numora 2.0.5 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,52 +1,21 @@
1
1
  import type { SeparatorOptions, Separators, FormattingOptions } from '@/types';
2
2
  /**
3
3
  * Normalizes separator configuration with defaults.
4
- *
5
- * @param options - Separator configuration options
6
- * @returns Normalized separator configuration
7
4
  */
8
5
  export declare function getSeparators(options: SeparatorOptions | FormattingOptions | undefined): Separators;
9
6
  /**
10
- * Converts comma or dot to the configured decimal separator when thousandStyle is None/undefined.
11
- * This makes it easier for users to type decimal separators without knowing the exact separator character.
12
- *
13
- * @param e - The keyboard event
14
- * @param inputElement - The input element
15
- * @param formattingOptions - Optional formatting options
16
- * @param separators - The separator configuration
17
- * @returns True if the conversion was handled (event should be prevented), false otherwise
7
+ * Handles keyboard events for decimal separators, converting comma/dot and preventing duplicates.
18
8
  */
19
- export declare function convertCommaOrDotToDecimalSeparatorAndPreventMultimpleDecimalSeparators(e: KeyboardEvent, inputElement: HTMLInputElement, formattingOptions: FormattingOptions | undefined, decimalSeparator: string): boolean;
9
+ export declare function handleDecimalSeparatorKey(e: KeyboardEvent, inputElement: HTMLInputElement, decimalSeparator: string): boolean;
20
10
  /**
21
- * Trims a string representation of a number to a maximum number of decimal places.
22
- *
23
- * @param value - The string to trim.
24
- * @param decimalMaxLength - The maximum number of decimal places to allow.
25
- * @param decimalSeparator - The decimal separator character to use.
26
- * @returns The trimmed string.
11
+ * Trims decimals to a maximum length.
27
12
  */
28
13
  export declare const trimToDecimalMaxLength: (value: string, decimalMaxLength: number, decimalSeparator?: string) => string;
29
14
  /**
30
15
  * Removes extra decimal separators, keeping only the first one.
31
- *
32
- * @param value - The string value
33
- * @param decimalSeparator - The decimal separator character
34
- * @returns The string with only the first decimal separator
35
16
  */
36
17
  export declare const removeExtraDecimalSeparators: (value: string, decimalSeparator?: string) => string;
37
18
  /**
38
19
  * Ensures a numeric string has at least the specified minimum number of decimal places.
39
- * Pads with zeros if needed, but does not truncate if more decimals exist.
40
- *
41
- * @param value - The string value to ensure minimum decimals for
42
- * @param minDecimals - The minimum number of decimal places (default: 0, meaning no minimum)
43
- * @param decimalSeparator - The decimal separator character (default: '.')
44
- * @returns The string with at least minDecimals decimal places
45
- *
46
- * @example
47
- * ensureMinDecimals("1", 2, ".") // "1.00"
48
- * ensureMinDecimals("1.5", 2, ".") // "1.50"
49
- * ensureMinDecimals("1.123", 2, ".") // "1.123" (doesn't truncate)
50
- * ensureMinDecimals("1", 0, ".") // "1" (no minimum)
51
20
  */
52
21
  export declare const ensureMinDecimals: (value: string, minDecimals?: number, decimalSeparator?: string) => string;
@@ -17,7 +17,7 @@
17
17
  * countMeaningfulDigitsBeforePosition("1,234.56", 8, ",") // Returns: 6
18
18
  * countMeaningfulDigitsBeforePosition("1.234,56", 8, ".", ",") // Returns: 6
19
19
  */
20
- export declare function countMeaningfulDigitsBeforePosition(value: string, position: number, separator: string, decimalSeparator?: string): number;
20
+ export declare function countMeaningfulDigitsBeforePosition(value: string, position: number, separator: string, _decimalSeparator?: string): number;
21
21
  /**
22
22
  * Finds the position in the string for a specific digit index.
23
23
  * Returns the position AFTER the digit at targetDigitIndex.
@@ -31,7 +31,7 @@ export declare function countMeaningfulDigitsBeforePosition(value: string, posit
31
31
  * @example
32
32
  * findPositionForDigitIndex("1,234", 2, ",") // Returns: 4 (after digit "3")
33
33
  */
34
- export declare function findPositionForDigitIndex(value: string, targetDigitIndex: number, separator: string, decimalSeparator?: string): number;
34
+ export declare function findPositionForDigitIndex(value: string, targetDigitIndex: number, separator: string, _decimalSeparator?: string): number;
35
35
  /**
36
36
  * Finds the position in the string where the digit count equals targetDigitCount.
37
37
  * Returns the position after reaching the target count.
@@ -45,7 +45,7 @@ export declare function findPositionForDigitIndex(value: string, targetDigitInde
45
45
  * @example
46
46
  * findPositionWithMeaningfulDigitCount("1,234", 3, ",") // Returns: 5 (after "2,3")
47
47
  */
48
- export declare function findPositionWithMeaningfulDigitCount(value: string, targetDigitCount: number, separator: string, decimalSeparator?: string): number;
48
+ export declare function findPositionWithMeaningfulDigitCount(value: string, targetDigitCount: number, separator: string, _decimalSeparator?: string): number;
49
49
  /**
50
50
  * Checks if a position in the string is on a separator character.
51
51
  *
@@ -17,3 +17,4 @@ export { countMeaningfulDigitsBeforePosition, findPositionForDigitIndex, findPos
17
17
  export { formatPercent, formatLargePercent } from './percent';
18
18
  export { condenseDecimalZeros } from './subscript-notation';
19
19
  export { formatLargeNumber, type FormatLargeNumberOptions } from './large-number';
20
+ export { applyDecimalPrecision, applyScaleNotation, compareStrings, isVeryLarge } from './numeric-formatting-utils';
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Common utilities for numeric formatting.
3
+ */
4
+ /**
5
+ * Checks if a numeric string represents a very large number.
6
+ */
7
+ export declare function isVeryLarge(value: string): boolean;
8
+ /**
9
+ * Compares two numeric strings using string comparison.
10
+ * Returns negative if a < b, positive if a > b, 0 if equal.
11
+ * Uses string-based comparison to avoid precision issues.
12
+ */
13
+ export declare function compareStrings(a: string, b: string): number;
14
+ /**
15
+ * Applies scale notation to a numeric string.
16
+ */
17
+ export declare function applyScaleNotation(value: string, decimalSeparator: string, minScale?: number): {
18
+ scaledValue: string;
19
+ scaleSuffix: string;
20
+ };
21
+ /**
22
+ * Helper for applying decimal precision and handling trailing zeros.
23
+ */
24
+ export declare function applyDecimalPrecision(value: string, decimals: number, decimalsMin: number, decimalSeparator: string, decimalsMinAppliesToZero?: boolean, isZeroValue?: boolean): string;
@@ -21,7 +21,7 @@ import { ThousandStyle } from '@/types';
21
21
  * formatWithSeparators("1234.56", ",", "thousand", false, '.') // "1,234.56"
22
22
  * formatWithSeparators("1234,56", ",", "thousand", false, ',') // "1,234,56"
23
23
  */
24
- export declare function formatWithSeparators(value: string, separator: string, groupStyle: ThousandStyle, enableLeadingZeros?: boolean, decimalSeparator?: string): string;
24
+ export declare function formatWithSeparators(value: string, separator: string, groupStyle?: ThousandStyle, enableLeadingZeros?: boolean, decimalSeparator?: string): string;
25
25
  /**
26
26
  * Applies formatting to the input element if formatting is enabled.
27
27
  *
@@ -25,6 +25,9 @@ export interface SanitizationOptions {
25
25
  * 5. Removing extra decimal points
26
26
  * 6. (Optional) Removing leading zeros
27
27
  *
28
+ * Note: Decimal separator conversion (comma ↔ dot) is handled in the keydown event
29
+ * (handleDecimalSeparatorKey), not here, to avoid converting thousand separators.
30
+ *
28
31
  * @param value - The string value to sanitize
29
32
  * @param options - Optional sanitization configuration
30
33
  * @returns The sanitized numeric string
package/dist/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  export * from './NumoraInput';
2
2
  export { ThousandStyle, FormatOn } from './types';
3
3
  export { handleOnChangeNumoraInput, handleOnPasteNumoraInput, handleOnKeyDownNumoraInput, } from './utils/event-handlers';
4
- export { formatValue, processAndFormatValue, } from './utils/format-utils';
4
+ export { formatValueForDisplay, formatInputValue, } from './utils/format-utils';
5
5
  export type { FormattingOptions, CaretPositionInfo } from './types';
6
+ export { formatPercent, formatLargePercent } from './features/formatting/percent';
7
+ export { formatLargeNumber, type FormatLargeNumberOptions } from './features/formatting/large-number';
8
+ export { condenseDecimalZeros } from './features/formatting/subscript-notation';
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var Y=Object.defineProperty;var V=(e,t,n)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var L=(e,t,n)=>V(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var b=(e=>(e.Blur="blur",e.Change="change",e))(b||{}),S=(e=>(e.None="none",e.Thousand="thousand",e.Lakh="lakh",e.Wan="wan",e))(S||{});const x=2,O=0,R=b.Blur,_=",",P=S.None,E=".",F=!1,B=!1,W=!1,k=!1;function w(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function T(e){return{decimalSeparator:(e==null?void 0:e.decimalSeparator)??E,thousandSeparator:e==null?void 0:e.thousandSeparator}}function ee(e,t){const n=e.target;return n?n.value.includes(t):!1}function te(e,t,n,r){const{selectionStart:i,selectionEnd:a,value:s}=t,{key:o}=e,c=n==null?void 0:n.ThousandStyle;if(c!==S.None&&c!==void 0||o!==","&&o!==".")return!1;if(ee(e,r))return!0;if(o!==r){const l=i??0,h=a??l,d=s.slice(0,l)+r+s.slice(h);t.value=d;const u=l+1;return t.setSelectionRange(u,u),!0}return!1}const ne=(e,t,n=E)=>{const[r,i]=e.split(n);return i?`${r}${n}${i.slice(0,t)}`:e},re=(e,t=E)=>{const n=w(t),r=new RegExp(`(${n}.*?)${n}`,"g");return e.replace(r,`$1${t}`)},se=(e,t=0,n=E)=>{if(t===0)return e;if(!e||e==="0"||e===n||e==="-"||e===`-${n}`)return e==="-"||e===`-${n}`?`-${n}${"0".repeat(t)}`:e===n?`${n}${"0".repeat(t)}`:`${e}${n}${"0".repeat(t)}`;const r=e.includes(n),i=e.startsWith("-"),a=i?e.slice(1):e,[s,o=""]=a.split(n);if(!r){const c="0".repeat(t);return i?`-${s}${n}${c}`:`${s}${n}${c}`}if(o.length<t){const c=t-o.length,l=o+"0".repeat(c);return i?`-${s}${n}${l}`:`${s}${n}${l}`}return e},N={thousand:{size:3},lakh:{firstGroup:3,restGroup:2},wan:{size:4}};function G(e,t,n,r=!1,i="."){if(!e||e==="0"||e===i||e==="-"||e===`-${i}`)return e;const a=e.includes(i),s=e.startsWith("-"),o=s?e.slice(1):e,[c,l]=o.split(i);if(!c){const u=l?`${i}${l}`:o;return s?`-${u}`:u}if(r&&c.startsWith("0")&&c.length>1){const u=c.match(/^(0+)/);if(u){const g=u[1],f=c.slice(g.length);if(f){const p=Z(f,t,n),$=g+p,D=s?"-":"";return a?l?`${D}${$}${i}${l}`:`${D}${$}${i}`:`${D}${$}`}}}const h=Z(c,t,n),d=s?"-":"";return a?l?`${d}${h}${i}${l}`:`${d}${h}${i}`:`${d}${h}`}function Z(e,t,n){if(e==="0"||e==="")return e;switch(n){case S.None:return e;case S.Thousand:return ie(e,t);case S.Lakh:return ae(e,t);case S.Wan:return oe(e,t);default:return e}}function ie(e,t){return U(e,t,N.thousand.size)}function ae(e,t){if(e.length<=N.lakh.firstGroup)return e;const n=e.split("").reverse(),r=[],i=n.slice(0,N.lakh.firstGroup).reverse().join("");r.push(i);for(let a=N.lakh.firstGroup;a<n.length;a+=N.lakh.restGroup)r.push(n.slice(a,a+N.lakh.restGroup).reverse().join(""));return r.reverse().join(t)}function oe(e,t){return U(e,t,N.wan.size)}function U(e,t,n){const r=e.split("").reverse(),i=[];for(let a=0;a<r.length;a+=n)i.push(r.slice(a,a+n).reverse().join(""));return i.reverse().join(t)}function ce(e,t,n){return(t==null?void 0:t.formatOn)==="change"&&t.thousandSeparator?G(e,t.thousandSeparator,t.ThousandStyle??S.None,t.enableLeadingZeros,(n==null?void 0:n.decimalSeparator)??E):e}function v(e,t,n,r="."){let i=0;for(let a=0;a<t&&a<e.length;a++){const s=e[a];s!==n&&s!==r&&i++}return i}function le(e,t,n,r="."){if(t===0)return 0;let i=0;for(let a=0;a<e.length;a++){const s=e[a];if(s!==n&&s!==r){if(i===t-1)return a+1;i++}}return e.length}function A(e,t,n,r="."){if(t===0)return 0;let i=0;for(let a=0;a<e.length;a++){const s=e[a];if(s!==n&&s!==r){if(i++,i===t)return a+1;if(i>t)return a}}return e.length}function j(e,t,n){return t<0||t>=e.length?!1:e[t]===n}function he(e,t={}){const{thousandSeparator:n,decimalSeparator:r=".",prefix:i="",suffix:a=""}=t,s=Array.from({length:e.length+1}).map(()=>!0);if(i&&s.fill(!1,0,i.length),a){const o=e.length-a.length;s.fill(!1,o+1,e.length+1)}for(let o=0;o<e.length;o++){const c=e[o];(n&&c===n||c===r)&&(s[o]=!1,o+1<e.length&&!/\d/.test(e[o+1])&&(s[o+1]=!1))}return s.some(o=>o)||s.fill(!0),s}function I(e,t,n,r){const i=e.length;if(t=Math.max(0,Math.min(t,i)),!n[t]){let a=t;for(;a<=i&&!n[a];)a++;let s=t;for(;s>=0&&!n[s];)s--;a<=i&&s>=0?t=t-s<a-t?s:a:a<=i?t=a:s>=0&&(t=s)}return(t===-1||t>i)&&(t=i),t}const J=(e,t)=>e===t;function ue(e,t,n,r,i,a,s=".",o={}){if(n<0)return 0;if(n>e.length||e===""||t==="")return t.length;const c=/(\d+\.?\d*)\s*[kmbMTOQaqiSxsxSpOoNn]$/i;if(c.test(e)&&!c.test(t)&&t.length>e.length&&n>=e.length-1)return t.length;const l=t.length<e.length,h=j(e,n,r),d=e.indexOf(s),u=t.indexOf(s);if(o.isCharacterEquivalent&&e!==t){const p=de(e,t,n,o.isCharacterEquivalent||J,a,o);if(p!==void 0)return p}if(l)return fe(e,t,n,r,h,d,u,a,s,o);const f=be(e,t,n,r,h,s);return o.boundary?I(t,f,o.boundary):f}function de(e,t,n,r,i,a){const s=e.length,o=t.length,c={},l=new Array(s);for(let f=0;f<s;f++){l[f]=-1;for(let p=0;p<o;p++){if(c[p])continue;if(r(e[f],t[p],{oldValue:e,newValue:t,typedRange:i,oldIndex:f,newIndex:p})){l[f]=p,c[p]=!0;break}}}let h=n;for(;h<s&&(l[h]===-1||!/\d/.test(e[h]));)h++;const d=h===s||l[h]===-1?o:l[h];for(h=n-1;h>=0&&l[h]===-1;)h--;const u=h===-1||l[h]===-1?0:l[h]+1;if(u>d)return d;const g=n-u<d-n?u:d;return a.boundary?I(t,g,a.boundary):g}function fe(e,t,n,r,i,a,s,o,c,l={}){if(i)return ge(e,t,n,r,s,c);const h=v(e,n,r,c),d=v(e,e.length,r,c),u=v(t,t.length,r,c),g=d-u,f=pe(e,n,r,h,g,a,o,c),p=a===-1||n<=a,$=Se(t,f,r,g,o,c,p,s);return l.boundary?I(t,$,l.boundary):$}function ge(e,t,n,r,i,a){const s=n+1;if(s<e.length){const o=v(e,s,r,a),c=le(t,o,r,a);return c<t.length&&t[c]!==r?c+1:c}return n}function pe(e,t,n,r,i,a,s,o){if(s){const{start:l,isDelete:h}=s;return h?v(e,l,n,o):Math.max(0,v(e,l,n,o))}return t>0&&e[t-1]===n&&i>0?r+1:r}function Se(e,t,n,r,i,a,s,o){if(s&&o!==-1){const l=e.substring(0,o),h=v(l,l.length,n,a);if(t<=h){const d=A(l,t,n,a);if(d>0&&d<l.length&&v(l,d,n,a)===t){if(l[d]===n&&i&&r>0&&d<l.length-1)return d+1;if(!i&&r>0&&d<l.length-1)return Math.min(d+1,l.length)}return d}}const c=A(e,t,n,a);if(c>0&&c<e.length&&v(e,c,n,a)===t){if(e[c]===n&&i&&r>0&&c<e.length-1)return c+1;if(!i&&r>0&&c<e.length-1)return Math.min(c+1,e.length)}return c}function be(e,t,n,r,i,a){const s=n>=e.length,o=v(e,n,r,a),c=v(e,e.length,r,a),l=v(t,t.length,r,a);if(s||o===c)return t.length;const h=l-c;let d=o;h>0&&!s&&o<c&&(d=o+1);const u=A(t,d,r,a);return i&&!j(t,u,r)?Math.max(0,u-1):u}function ve(e,t,n){const{selectionStart:r,selectionEnd:i,endOffset:a=0}=e;if(r!==i){const h=i-r;return{start:r,end:i,deletedLength:h,isDelete:!1}}if(a>0){const h=a;return{start:r,end:r+h,deletedLength:h,isDelete:!0}}const o=t.length,c=n.length,l=o-c;if(!(l<=0))return{start:r,end:r+l,deletedLength:l,isDelete:!1}}function $e(e,t){if(e===t)return;let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;let r=e.length-1,i=t.length-1;for(;r>=n&&i>=n&&e[r]===t[i];)r--,i--;const a=r-n+1,s=i-n+1;if(!(a===0&&s===0))return{start:n,end:r+1,deletedLength:a,isDelete:a>s}}function z(e,t){if(e.value=e.value,e===null)return!1;if(e.createTextRange){const n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart!==null||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}function Ee(e,t,n){return e.selectionStart===0&&e.selectionEnd===e.value.length?null:(z(e,t),setTimeout(()=>{e.value===n&&e.selectionStart!==t&&z(e,t)},0))}function Ne(e){return Math.max(e.selectionStart,e.selectionEnd)}function Le(e,t,n){if((n==null?void 0:n.formatOn)!==b.Change||!n.thousandSeparator)return;const{selectionStart:r,selectionEnd:i,value:a}=t;if(r===null||i===null||r!==i)return;const{key:s}=e,o=n.thousandSeparator;s==="Backspace"&&r>0&&a[r-1]===o&&t.setSelectionRange(r-1,r-1),s==="Delete"&&a[r]===o&&t.setSelectionRange(r+1,r+1)}function me(e,t,n,r,i,a,s){if(!i)return;const{selectionStart:o=0,selectionEnd:c=0,endOffset:l=0}=i;let h=ve({selectionStart:o,selectionEnd:c,endOffset:l},t,n);if(h||(h=$e(t,n)),!h)return;const d=he(n,{thousandSeparator:(s==null?void 0:s.thousandSeparator)??a.thousandSeparator,decimalSeparator:a.decimalSeparator}),u={thousandSeparator:(s==null?void 0:s.thousandSeparator)??a.thousandSeparator,isCharacterEquivalent:J,boundary:d},g=(s==null?void 0:s.thousandSeparator)??a.thousandSeparator??",",f=(s==null?void 0:s.ThousandStyle)??S.None,p=ue(t,n,r,g,f,h,a.decimalSeparator,u);Ee(e,p,n)}const we=(e,t=!1,n=".")=>{const r=w(n),i=new RegExp(`[^0-9${r}]`,"g");if(!t)return e.replace(i,"");const a=e.startsWith("-"),s=e.replace(i,"");if(a){if(s.length>0)return"-"+s;if(e==="-")return"-"}return s};function De(e){const t=/([+-]?\d+\.?\d*)[eE]([+-]?\d+)/g;let n=e,r;const i=[];for(;(r=t.exec(e))!==null;){const a=r[0],s=r[1],o=parseInt(r[2],10);let c;if(o===0)c=s;else{const l=s.startsWith("-"),h=l?s.slice(1):s,[d,u=""]=h.split(".");o>0?c=Me(d,u,o):c=ye(d,u,Math.abs(o)),l&&(c="-"+c)}i.push({full:a,expanded:c})}for(const{full:a,expanded:s}of i)n=n.replace(a,s);return n}function Me(e,t,n){const r=e+t;if(r==="0"||r.match(/^0+$/))return"0";const i=t.length;if(n<=i){const s=r.slice(0,e.length+n),o=r.slice(e.length+n);return o?`${s}.${o}`:s}const a=n-i;return r+"0".repeat(a)}function ye(e,t,n){const r=e+t;if(r==="0"||r.match(/^0+$/))return"0";const s=e.length-n;if(s<=0){const o=Math.abs(s),c=`0.${"0".repeat(o)}${r}`;return C(c)}if(s<e.length){const o=r.slice(0,s),c=r.slice(s),l=`${o}.${c}`;return C(l)}return C(r)}function C(e){if(!e.includes("."))return e;if(e==="0"||e==="0.")return"0";if(e.startsWith("0.")){const t=e.replace(/\.?0+$/,"");return t==="0"?"0":t||"0"}if(e.startsWith("-0.")){const t=e.replace(/\.?0+$/,"");return t==="-0"||t==="0"?"0":t||"0"}return e.replace(/\.?0+$/,"")||e}function Ce(e){const t=/(\d+\.?\d*)\s*(Qa|Qi|Sx|Sp|[kmbMTO]|N)/gi;return e.replace(t,(n,r,i)=>{const a={k:3,K:3,m:6,M:6,b:9,B:9,T:12,t:12};let s;if(i.length>1){const g=i.charAt(0).toUpperCase()+i.slice(1).toLowerCase();s=a[i]||a[g]}else{const g=i.toLowerCase();s=a[i]||a[g]}if(!s)return n;const o=r.startsWith("-"),c=o?r.slice(1):r,[l,h=""]=c.split("."),d=l.replace(/^0+/,"")||"0";let u;if(h.length===0)u=d+"0".repeat(s);else if(h.length<=s){const g=s-h.length;u=d+h+"0".repeat(g)}else{const g=h.slice(0,s),f=h.slice(s);u=d+g+"."+f}return u=u.replace(/^(-?)0+([1-9])/,"$1$2"),u.match(/^-?0+$/)&&(u=o?"-0":"0"),u.includes(".")&&(u=u.replace(/\.?0+$/,"")),o&&!u.startsWith("-")?"-"+u:u})}function Ae(e){if(!e||e==="0"||e==="-0"||e==="-"||e===".")return e;const t=e.startsWith("-"),n=t?e.slice(1):e;if(!n||n==="0"||n===".")return e;if(n.includes(".")){const[i,a]=n.split(".");if(i&&i.length>0){const o=(i.replace(/^0+/,"")||"0")+"."+a;return t?"-"+o:o}return e}if(n.startsWith("0")&&n.length>1){const i=n.replace(/^0+/,"")||"0";return t?"-"+i:i}return e}function Te(e){return e.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000]/g," ").replace(/\s/g,"")}function m(e,t){const n=w(t);return e.replace(new RegExp(n,"g"),"")}const Ie=(e,t)=>{let n=Te(e);return t!=null&&t.thousandSeparator&&(n=m(n,t.thousandSeparator)),t!=null&&t.enableCompactNotation&&(n=Ce(n)),n=De(n),n=we(n,t==null?void 0:t.enableNegative,t==null?void 0:t.decimalSeparator),n=re(n,(t==null?void 0:t.decimalSeparator)||E),t!=null&&t.enableLeadingZeros||(n=Ae(n)),n};function xe(e,t,n){return{enableCompactNotation:e==null?void 0:e.enableCompactNotation,enableNegative:e==null?void 0:e.enableNegative,enableLeadingZeros:e==null?void 0:e.enableLeadingZeros,decimalSeparator:t.decimalSeparator,thousandSeparator:n?t.thousandSeparator:void 0}}function y(e,t,n,r){const i=T(n),a=r??(n==null?void 0:n.formatOn)===b.Change,s=Ie(e,xe(n,i,a)),o=ne(s,t,i.decimalSeparator),c=(n==null?void 0:n.decimalMinLength)??0,l=se(o,c,i.decimalSeparator),h=l;return{formatted:ce(l,n,i),raw:h}}function Oe(e,t,n){const r=!!(n!=null&&n.thousandSeparator);return y(e,t,n,r)}function Re(e,t,n){if(e==="Backspace"||e==="Delete")return e==="Delete"&&t===n?{endOffset:1}:{endOffset:0}}function K(e,t){const{decimalSeparator:n}=T(t),r=e.target;if(te(e,r,t,n)){e.preventDefault();return}return Le(e,r,t),Re(e.key,r.selectionStart,r.selectionEnd)}function q(e,t,n,r){const i=e.target,a=i.value,s=Ne(i),o=T(r),c=(r==null?void 0:r.formatOn)===b.Change,{formatted:l,raw:h}=y(a,t,r,c);return i.value=l,a!==l&&me(i,a,l,s,n,o,r),{formatted:l,raw:h}}function _e(e,t,n,r){const i=r-n;return e+t+i}function H(e,t,n){var u;e.preventDefault();const r=e.target,{value:i,selectionStart:a,selectionEnd:s}=r,o=((u=e.clipboardData)==null?void 0:u.getData("text/plain"))||"",c=i.slice(0,a||0)+o+i.slice(s||0),{formatted:l,raw:h}=y(c,t,n,!0);r.value=l;const d=_e(a||0,o.length,c.length,l.length);return r.setSelectionRange(d,d),{formatted:l,raw:h}}function Pe(e,t){const n=w(e);return t?`^-?[0-9]*[${n}]?[0-9]*$`:`^[0-9]*[${n}]?[0-9]*$`}function Be(e){We(e.decimalMaxLength),ke(e.decimalMinLength),Ze(e.decimalMinLength,e.decimalMaxLength),ze(e.formatOn),Ge(e.thousandSeparator),Ue(e.thousandStyle),je(e.decimalSeparator),Je(e.thousandSeparator,e.decimalSeparator),M("enableCompactNotation",e.enableCompactNotation),M("enableNegative",e.enableNegative),M("enableLeadingZeros",e.enableLeadingZeros),M("rawValueMode",e.rawValueMode),Ke(e.onChange)}function We(e){if(e!==void 0){if(typeof e!="number")throw new Error(`decimalMaxLength must be a number. Received: ${typeof e} (${JSON.stringify(e)})`);if(!Number.isInteger(e))throw new Error(`decimalMaxLength must be an integer. Received: ${e}`);if(e<0)throw new Error(`decimalMaxLength must be non-negative. Received: ${e}`)}}function ke(e){if(e!==void 0){if(typeof e!="number")throw new Error(`decimalMinLength must be a number. Received: ${typeof e} (${JSON.stringify(e)})`);if(!Number.isInteger(e))throw new Error(`decimalMinLength must be an integer. Received: ${e}`);if(e<0)throw new Error(`decimalMinLength must be non-negative. Received: ${e}`)}}function Ze(e,t){if(!(e===void 0||t===void 0)&&e>t)throw new Error(`decimalMinLength (${e}) cannot be greater than decimalMaxLength (${t}).`)}function ze(e){if(e!==void 0&&e!==b.Blur&&e!==b.Change)throw new Error(`formatOn must be either ${b.Blur} or ${b.Change}. Received: ${JSON.stringify(e)}`)}function Ge(e){if(e!==void 0){if(typeof e!="string")throw new Error(`thousandSeparator must be a string. Received: ${typeof e} (${JSON.stringify(e)})`);if(e.length===0)throw new Error(`thousandSeparator cannot be empty. Received: ${JSON.stringify(e)}`);if(e.length>1)throw new Error(`thousandSeparator must be a single character. Received: "${e}" (length: ${e.length})`)}}function Ue(e){if(e!==void 0&&!Object.values(S).includes(e))throw new Error(`ThousandStyle must be one of: ${Object.values(S).map(t=>`'${t}'`).join(", ")}. Received: ${JSON.stringify(e)}`)}function je(e){if(e!==void 0){if(typeof e!="string")throw new Error(`decimalSeparator must be a string. Received: ${typeof e} (${JSON.stringify(e)})`);if(e.length===0)throw new Error(`decimalSeparator cannot be empty. Received: ${JSON.stringify(e)}`);if(e.length>1)throw new Error(`decimalSeparator must be a single character. Received: "${e}" (length: ${e.length})`)}}function Je(e,t){if(!(e===void 0||t===void 0)&&e===t)throw new Error(`Decimal separator can't be same as thousand separator. thousandSeparator: ${e}, decimalSeparator: ${t}`)}function M(e,t){if(t!==void 0&&typeof t!="boolean")throw new Error(`${e} must be a boolean. Received: ${typeof t} (${JSON.stringify(t)})`)}function Ke(e){if(e!==void 0&&typeof e!="function")throw new Error(`onChange must be a function or undefined. Received: ${typeof e} (${JSON.stringify(e)})`)}class qe{constructor(t,{decimalMaxLength:n=x,decimalMinLength:r=O,formatOn:i=R,thousandSeparator:a=_,thousandStyle:s=P,decimalSeparator:o=E,enableCompactNotation:c=!0,enableNegative:l=B,enableLeadingZeros:h=W,rawValueMode:d=k,onChange:u,...g}){L(this,"element");L(this,"options");L(this,"resolvedOptions");L(this,"rawValue","");L(this,"caretPositionBeforeChange");if(Be({decimalMaxLength:n,decimalMinLength:r,formatOn:i,thousandSeparator:a,thousandStyle:s,decimalSeparator:o,enableCompactNotation:c,enableNegative:l,enableLeadingZeros:h,rawValueMode:d,onChange:u}),this.options={decimalMaxLength:n,decimalMinLength:r,onChange:u,formatOn:i,thousandSeparator:a,thousandStyle:s,decimalSeparator:o,enableCompactNotation:c,enableNegative:l,enableLeadingZeros:h,rawValueMode:d,...g},this.resolvedOptions=this.getResolvedOptions(),this.createInputElement(t),this.setupEventListeners(),this.resolvedOptions.rawValueMode&&this.element.value){const f=this.element.value,p=this.resolvedOptions.thousandSeparator?m(f,this.resolvedOptions.thousandSeparator):f;this.rawValue=p,this.element.value=this.formatValueForDisplay(p)}else if(this.element.value){const f=this.element.value;this.element.value=this.formatValueForDisplay(f)}}createInputElement(t){if(this.element=document.createElement("input"),this.element.setAttribute("type","text"),this.element.setAttribute("inputmode","decimal"),this.element.setAttribute("spellcheck","false"),this.element.setAttribute("autocomplete","off"),this.resolvedOptions.decimalSeparator!==void 0&&this.resolvedOptions.enableNegative!==void 0){const X=Pe(this.resolvedOptions.decimalSeparator,this.resolvedOptions.enableNegative);this.element.setAttribute("pattern",X)}const{decimalMaxLength:n,decimalMinLength:r,formatOn:i,thousandSeparator:a,thousandStyle:s,decimalSeparator:o,enableCompactNotation:c,enableNegative:l,enableLeadingZeros:h,rawValueMode:d,onChange:u,value:g,defaultValue:f,type:p,inputMode:$,spellcheck:D,autocomplete:He,...Q}=this.options;Object.assign(this.element,Q),g!==void 0?this.element.value=g:f!==void 0&&(this.element.defaultValue=f,this.element.value=f),t.appendChild(this.element)}setupEventListeners(){this.element.addEventListener("input",this.handleChange.bind(this)),this.element.addEventListener("keydown",this.handleKeyDown.bind(this)),this.element.addEventListener("paste",this.handlePaste.bind(this)),this.resolvedOptions.formatOn===b.Blur&&this.resolvedOptions.thousandSeparator&&(this.element.addEventListener("focus",this.handleFocus.bind(this)),this.element.addEventListener("blur",this.handleBlur.bind(this)))}getResolvedOptions(){return{decimalMaxLength:this.options.decimalMaxLength??x,decimalMinLength:this.options.decimalMinLength??O,formatOn:this.options.formatOn??R,thousandSeparator:this.options.thousandSeparator??_,thousandStyle:this.options.thousandStyle??P,decimalSeparator:this.options.decimalSeparator??E,enableCompactNotation:this.options.enableCompactNotation??F,enableNegative:this.options.enableNegative??B,enableLeadingZeros:this.options.enableLeadingZeros??W,rawValueMode:this.options.rawValueMode??k,onChange:this.options.onChange}}buildFormattingOptions(){return{formatOn:this.resolvedOptions.formatOn,thousandSeparator:this.resolvedOptions.thousandSeparator,ThousandStyle:this.resolvedOptions.thousandStyle,enableCompactNotation:this.resolvedOptions.enableCompactNotation,enableNegative:this.resolvedOptions.enableNegative,enableLeadingZeros:this.resolvedOptions.enableLeadingZeros,decimalSeparator:this.resolvedOptions.decimalSeparator,decimalMinLength:this.resolvedOptions.decimalMinLength,rawValueMode:this.resolvedOptions.rawValueMode}}handleValueChange(t,n){if(this.resolvedOptions.rawValueMode&&n!==void 0&&(this.rawValue=n),this.resolvedOptions.onChange){const r=this.resolvedOptions.rawValueMode?this.rawValue:t;this.resolvedOptions.onChange(r)}}formatValueForDisplay(t){if(!t)return t;const{thousandSeparator:n,thousandStyle:r,enableLeadingZeros:i,decimalSeparator:a}=this.resolvedOptions;return n&&r!==S.None?G(t,n,r,i,a):t}handleChange(t){const{formatted:n,raw:r}=q(t,this.resolvedOptions.decimalMaxLength,this.caretPositionBeforeChange,this.buildFormattingOptions());this.caretPositionBeforeChange=void 0,this.handleValueChange(n,r)}handleKeyDown(t){const n=t.target,{selectionStart:r,selectionEnd:i}=n,a=this.buildFormattingOptions(),s=K(t,{formatOn:a.formatOn,thousandSeparator:a.thousandSeparator,ThousandStyle:a.ThousandStyle,decimalSeparator:a.decimalSeparator});s?this.caretPositionBeforeChange={selectionStart:r??0,selectionEnd:i??0,endOffset:s.endOffset}:this.caretPositionBeforeChange={selectionStart:r??0,selectionEnd:i??0}}handlePaste(t){const{formatted:n,raw:r}=H(t,this.resolvedOptions.decimalMaxLength,this.buildFormattingOptions());this.handleValueChange(n,r);const i=new Event("input",{bubbles:!0,cancelable:!0});this.element.dispatchEvent(i)}handleFocus(t){if(this.resolvedOptions.formatOn===b.Blur&&this.resolvedOptions.thousandSeparator){const n=t.target;n.value=m(n.value,this.resolvedOptions.thousandSeparator)}}handleBlur(t){const n=t.target,{thousandSeparator:r,thousandStyle:i}=this.resolvedOptions;if(r&&i!==S.None&&n.value){const a=n.value,s=this.formatValueForDisplay(n.value);n.value=s;const o=this.resolvedOptions.rawValueMode?m(s,r):void 0;if(this.handleValueChange(s,o),a!==s){const c=new Event("input",{bubbles:!0,cancelable:!0});this.element.dispatchEvent(c);const l=new Event("change",{bubbles:!0,cancelable:!0});this.element.dispatchEvent(l)}}}getValue(){return this.resolvedOptions.rawValueMode?this.rawValue:this.element.value}setValue(t){if(this.resolvedOptions.rawValueMode){const n=this.resolvedOptions.thousandSeparator?m(t,this.resolvedOptions.thousandSeparator):t;this.rawValue=n,this.element.value=this.formatValueForDisplay(n)}else this.element.value=t}disable(){this.element.disabled=!0}enable(){this.element.disabled=!1}addEventListener(t,n){this.element.addEventListener(t,n)}removeEventListener(t,n){this.element.removeEventListener(t,n)}getElement(){return this.element}get value(){return this.getValue()}set value(t){this.setValue(t)}get valueAsNumber(){const t=this.getValue();if(!t)return NaN;const n=this.resolvedOptions.thousandSeparator?m(t,this.resolvedOptions.thousandSeparator):t,r=this.resolvedOptions.decimalSeparator&&this.resolvedOptions.decimalSeparator!=="."?n.replace(new RegExp(w(this.resolvedOptions.decimalSeparator),"g"),"."):n;return parseFloat(r)}set valueAsNumber(t){if(isNaN(t)){this.setValue("");return}const n=t.toString();this.setValue(n)}}exports.FormatOn=b;exports.NumoraInput=qe;exports.ThousandStyle=S;exports.formatValue=Oe;exports.handleOnChangeNumoraInput=q;exports.handleOnKeyDownNumoraInput=K;exports.handleOnPasteNumoraInput=H;exports.processAndFormatValue=y;
1
+ "use strict";var ae=Object.defineProperty;var ce=(e,t,n)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var v=(e,t,n)=>ce(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var $=(e=>(e.Blur="blur",e.Change="change",e))($||{}),m=(e=>(e.None="none",e.Thousand="thousand",e.Lakh="lakh",e.Wan="wan",e))(m||{});const _=2,z=0,Z=$.Blur,B=",",W=m.None,N=".",le=!1,k=!1,U=!1,G=!1;function I(e){return{decimalSeparator:(e==null?void 0:e.decimalSeparator)??N,thousandSeparator:e==null?void 0:e.thousandSeparator}}function K(e,t){const n=e.startsWith("-"),s=n?e.slice(1):e,[o="",r=""]=s.split(t);return{sign:n?"-":"",integer:o,decimal:r}}function he(e,t){if(!e.value.includes(t))return!1;const{selectionStart:n,selectionEnd:s,value:o}=e;return!o.slice(n??0,s??0).includes(t)}function ue(e,t,n){const{key:s}=e;if(s!==","&&s!==".")return!1;if(he(t,n))return!0;if(s!==n){const{selectionStart:o,selectionEnd:r,value:i}=t,a=o??0,c=r??a;t.value=i.slice(0,a)+n+i.slice(c);const l=a+1;return t.setSelectionRange(l,l),!0}return!1}const fe=(e,t,n=N)=>{const{sign:s,integer:o,decimal:r}=K(e,n);if(!e.includes(n))return e;const a=r.slice(0,t);return`${s}${o}${n}${a}`},de=(e,t=N)=>{const n=e.indexOf(t);if(n===-1)return e;const s=e.slice(0,n+1),r=e.slice(n+1).split(",").join("").split(".").join("").split(t).join("");return s+r},ge=(e,t=0,n=N)=>{if(t<=0)return e;const{sign:s,integer:o,decimal:r}=K(e,n);if(r.length>=t)return e.includes(n)?e:`${s}${o}${n}${r}`;const i=r.padEnd(t,"0");return`${s}${o}${n}${i}`},L={thousand:{size:3},lakh:{firstGroup:3,restGroup:2},wan:{size:4}};function y(e,t,n=m.Thousand,s=!1,o="."){if(!e||e==="0"||e===o||e==="-"||e===`-${o}`)return e;const r=e.includes(o),i=e.startsWith("-"),a=i?e.slice(1):e,[c,l]=a.split(o);if(!c){const f=l?`${o}${l}`:a;return i?`-${f}`:f}if(s&&c.startsWith("0")&&c.length>1){const f=c.match(/^(0+)/);if(f){const d=f[1],g=c.slice(d.length);if(g){const p=j(g,t,n),S=d+p,D=i?"-":"";return r?l?`${D}${S}${o}${l}`:`${D}${S}${o}`:`${D}${S}`}}}const h=j(c,t,n),u=i?"-":"";return r?l?`${u}${h}${o}${l}`:`${u}${h}${o}`:`${u}${h}`}function j(e,t,n){if(e==="0"||e==="")return e;switch(n){case m.None:return e;case m.Thousand:return pe(e,t);case m.Lakh:return me(e,t);case m.Wan:return Se(e,t);default:return e}}function pe(e,t){return q(e,t,L.thousand.size)}function me(e,t){if(e.length<=L.lakh.firstGroup)return e;const n=e.split("").reverse(),s=[],o=n.slice(0,L.lakh.firstGroup).reverse().join("");s.push(o);for(let r=L.lakh.firstGroup;r<n.length;r+=L.lakh.restGroup)s.push(n.slice(r,r+L.lakh.restGroup).reverse().join(""));return s.reverse().join(t)}function Se(e,t){return q(e,t,L.wan.size)}function q(e,t,n){const s=e.split("").reverse(),o=[];for(let r=0;r<s.length;r+=n)o.push(s.slice(r,r+n).reverse().join(""));return o.reverse().join(t)}function $e(e,t,n){return(t==null?void 0:t.formatOn)===$.Change&&t.thousandSeparator?y(e,t.thousandSeparator,t.ThousandStyle??m.None,t.enableLeadingZeros,(n==null?void 0:n.decimalSeparator)??N):e}function b(e,t,n,s="."){let o=0;for(let r=0;r<t&&r<e.length;r++)e[r]!==n&&o++;return o}function be(e,t,n,s="."){if(t===0)return 0;let o=0;for(let r=0;r<e.length;r++)if(e[r]!==n){if(o===t-1)return r+1;o++}return e.length}function T(e,t,n,s="."){if(t===0)return 0;let o=0;for(let r=0;r<e.length;r++)if(e[r]!==n){if(o++,o===t)return r+1;if(o>t)return r}return e.length}function Q(e,t,n){return t<0||t>=e.length?!1:e[t]===n}function Ne(e,t={}){const{thousandSeparator:n,decimalSeparator:s=".",prefix:o="",suffix:r=""}=t,i=Array.from({length:e.length+1}).map(()=>!0);if(o&&i.fill(!1,0,o.length),r){const a=e.length-r.length;i.fill(!1,a+1,e.length+1)}for(let a=0;a<e.length;a++){const c=e[a];(n&&c===n||c===s)&&(i[a]=!1,a+1<e.length&&!/\d/.test(e[a+1])&&(i[a+1]=!1))}return i.some(a=>a)||i.fill(!0),i}function P(e,t,n,s){const o=e.length;if(t=Math.max(0,Math.min(t,o)),!n[t]){let r=t;for(;r<=o&&!n[r];)r++;let i=t;for(;i>=0&&!n[i];)i--;r<=o&&i>=0?t=t-i<r-t?i:r:r<=o?t=r:i>=0&&(t=i)}return(t===-1||t>o)&&(t=o),t}const H=(e,t)=>e===t;function De(e,t,n,s,o,r,i=".",a={}){if(n<0)return 0;if(n>e.length||e===""||t==="")return t.length;const c=/(\d+\.?\d*)\s*[kmbMTOQaqiSxsxSpOoNn]$/i;if(c.test(e)&&!c.test(t)&&t.length>e.length&&n>=e.length-1)return t.length;const l=t.length<e.length,h=Q(e,n,s),u=e.indexOf(i),f=t.indexOf(i);if(a.isCharacterEquivalent&&e!==t){const p=Ee(e,t,n,a.isCharacterEquivalent||H,r,a);if(p!==void 0)return p}if(l)return Le(e,t,n,s,h,u,f,r,i,a);const g=Me(e,t,n,s,h,i);return a.boundary?P(t,g,a.boundary):g}function Ee(e,t,n,s,o,r){const i=e.length,a=t.length,c={},l=new Array(i);for(let g=0;g<i;g++){l[g]=-1;for(let p=0;p<a;p++){if(c[p])continue;if(s(e[g],t[p],{oldValue:e,newValue:t,typedRange:o,oldIndex:g,newIndex:p})){l[g]=p,c[p]=!0;break}}}let h=n;for(;h<i&&(l[h]===-1||!/\d/.test(e[h]));)h++;const u=h===i||l[h]===-1?a:l[h];for(h=n-1;h>=0&&l[h]===-1;)h--;const f=h===-1||l[h]===-1?0:l[h]+1;if(f>u)return u;const d=n-f<u-n?f:u;return r.boundary?P(t,d,r.boundary):d}function Le(e,t,n,s,o,r,i,a,c,l={}){if(o)return ve(e,t,n,s,i,c);const h=b(e,n,s,c),u=b(e,e.length,s,c),f=b(t,t.length,s,c),d=u-f,g=we(e,n,s,h,d,r,a,c),p=r===-1||n<=r,S=ye(t,g,s,d,a,c,p,i);return l.boundary?P(t,S,l.boundary):S}function ve(e,t,n,s,o,r){const i=n+1;if(i<e.length){const a=b(e,i,s,r),c=be(t,a,s,r);return c<t.length&&t[c]!==s?c+1:c}return n}function we(e,t,n,s,o,r,i,a){if(i){const{start:l,isDelete:h}=i;return h?b(e,l,n,a):Math.max(0,b(e,l,n,a))}return t>0&&e[t-1]===n&&o>0?s+1:s}function ye(e,t,n,s,o,r,i,a){if(i&&a!==-1){const l=e.substring(0,a),h=b(l,l.length,n,r);if(t<=h){const u=T(l,t,n,r);if(u>0&&u<l.length&&b(l,u,n,r)===t){if(l[u]===n&&o&&s>0&&u<l.length-1)return u+1;if(!o&&s>0&&u<l.length-1)return Math.min(u+1,l.length)}return u}}const c=T(e,t,n,r);if(c>0&&c<e.length&&b(e,c,n,r)===t){if(e[c]===n&&o&&s>0&&c<e.length-1)return c+1;if(!o&&s>0&&c<e.length-1)return Math.min(c+1,e.length)}return c}function Me(e,t,n,s,o,r){const i=n>=e.length,a=b(e,n,s,r),c=b(e,e.length,s,r),l=b(t,t.length,s,r);if(i||a===c)return t.length;const h=l-c;let u=a;h>0&&!i&&a<c&&(u=a+1);const f=T(t,u,s,r);return o&&!Q(t,f,s)?Math.max(0,f-1):f}function xe(e,t,n){const{selectionStart:s,selectionEnd:o,endOffset:r=0}=e;if(s!==o){const h=o-s;return{start:s,end:o,deletedLength:h,isDelete:!1}}if(r>0){const h=r;return{start:s,end:s+h,deletedLength:h,isDelete:!0}}const a=t.length,c=n.length,l=a-c;if(!(l<=0))return{start:s,end:s+l,deletedLength:l,isDelete:!1}}function Ce(e,t){if(e===t)return;let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];)n++;let s=e.length-1,o=t.length-1;for(;s>=n&&o>=n&&e[s]===t[o];)s--,o--;const r=s-n+1,i=o-n+1;if(!(r===0&&i===0))return{start:n,end:s+1,deletedLength:r,isDelete:r>i}}function J(e,t){if(e.value=e.value,e===null)return!1;if(e.createTextRange){const n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart!==null||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}function Ae(e,t,n){return e.selectionStart===0&&e.selectionEnd===e.value.length?null:(J(e,t),setTimeout(()=>{e.value===n&&e.selectionStart!==t&&J(e,t)},0))}function Te(e){return Math.max(e.selectionStart,e.selectionEnd)}function Ie(e,t,n){if((n==null?void 0:n.formatOn)!==$.Change||!n.thousandSeparator)return;const{selectionStart:s,selectionEnd:o,value:r}=t;if(s===null||o===null||s!==o)return;const{key:i}=e,a=n.thousandSeparator;i==="Backspace"&&s>0&&r[s-1]===a&&t.setSelectionRange(s-1,s-1),i==="Delete"&&r[s]===a&&t.setSelectionRange(s+1,s+1)}function Pe(e,t,n,s,o,r,i){if(!o)return;const{selectionStart:a=0,selectionEnd:c=0,endOffset:l=0}=o;let h=xe({selectionStart:a,selectionEnd:c,endOffset:l},t,n);if(h||(h=Ce(t,n)),!h)return;const u=Ne(n,{thousandSeparator:(i==null?void 0:i.thousandSeparator)??r.thousandSeparator,decimalSeparator:r.decimalSeparator}),f={thousandSeparator:(i==null?void 0:i.thousandSeparator)??r.thousandSeparator,isCharacterEquivalent:H,boundary:u},d=(i==null?void 0:i.thousandSeparator)??r.thousandSeparator??",",g=(i==null?void 0:i.ThousandStyle)??m.None,p=De(t,n,s,d,g,h,r.decimalSeparator,f);Ae(e,p,n)}function V(e){const[t,n=""]=e.split(".");return t.length+n.length>30}function X(e,t){const n=e.replace(".",""),s=t.replace(".",""),o=Math.max(n.length,s.length),r=n.padStart(o,"0"),i=s.padStart(o,"0");for(let a=0;a<o;a++){const c=parseInt(r[a],10),l=parseInt(i[a],10);if(c!==l)return c-l}return 0}const Oe=[{suffix:"N",zeros:30},{suffix:"O",zeros:27},{suffix:"Sp",zeros:24},{suffix:"Sx",zeros:21},{suffix:"Qi",zeros:18},{suffix:"Qa",zeros:15},{suffix:"T",zeros:12},{suffix:"B",zeros:9},{suffix:"M",zeros:6},{suffix:"k",zeros:3}];function Y(e,t,n=0){const[s,o=""]=e.split(t),r=s.replace(/^0+/,"")||"0";for(const i of Oe)if(i.zeros>=n&&(r.length>i.zeros||r.length===i.zeros&&o.length>0)){const a=i.zeros;if(r.length>a){const c=r.slice(0,-a),u=(r.slice(-a)+o).replace(/0+$/,"");return{scaledValue:u?`${c}${t}${u}`:c,scaleSuffix:i.suffix}}else{const c=a-r.length,l="0",u=("0".repeat(c)+r+o).replace(/0+$/,"");return{scaledValue:u?`${l}${t}${u}`:l,scaleSuffix:i.suffix}}}return{scaledValue:e,scaleSuffix:""}}function O(e,t,n,s,o=!1,r=!1){if(r&&o&&n>0)return`0${s}${"0".repeat(n)}`;const[i,a=""]=e.split(s);let c;if(t===0)c=i;else if(a.length===0){const l="0".repeat(Math.max(t,n));c=`${i}${s}${l}`}else if(a.length<t){const l=Math.max(t-a.length,n-a.length);c=`${i}${s}${a}${"0".repeat(l)}`}else c=`${i}${s}${a.slice(0,t)}`;if(n>0){const[l,h=""]=c.split(s);if(h.length<n){const u=n-h.length;c=`${l}${s}${h}${"0".repeat(u)}`}}if(n===0)c=c.replace(/(\.[0-9]*?)0+$/,"$1").replace(/\.$/,"");else{const[l,h=""]=c.split(s);if(h){const u=h.replace(/0+$/,""),f=u.length>=n?u:h.slice(0,n);c=f?`${l}${s}${f}`:l}}return c}function F(e,t){return!e||e==="0"||e===t||e==="-"||e===`-${t}`}function ee(e){const t=e.startsWith("-");return{isNegative:t,absoluteValue:t?e.slice(1):e}}function te(e,t){if(!e||e==="0")return"0";const n=e.includes(t),[s,o=""]=n?e.split(t):[e,""];let r;if(o.length<=2){const a=2-o.length;r=s+o+"0".repeat(a)}else r=s+o.slice(0,2)+t+o.slice(2);let i=r.replace(/^0+/,"")||"0";if(i.startsWith(t)&&(i="0"+i),i.includes(t)){const[a,c]=i.split(t);return a==="0"&&!c?"0":i}return i}function Re(e,t){const{decimals:n,decimalSeparator:s,thousandSeparator:o,thousandStyle:r,decimalsMin:i=0}=t;if(F(e,s))return"0";const{isNegative:a,absoluteValue:c}=ee(e),l=te(c,s);let h=l;o&&r!==m.None&&(h=y(l,o,r,!1,s));const u=O(h,n,i,s,!1,e==="0");return`${a?"-":""}${u}`}function _e(e,t=2,n=N,s,o=m.None){const r=Re(e,{decimals:t,decimalSeparator:n,thousandSeparator:s,thousandStyle:o,decimalsMin:t});return r==="0"?"0%":`${r}%`}function ze(e,t=2,n={}){const{missingPlaceholder:s="?",veryLargePlaceholder:o="🔥",decimalsUnder:r=1e3,decimalSeparator:i=N,thousandSeparator:a,thousandStyle:c=m.None}=n;if(e==null||e==="")return s;if(F(e,i))return"0%";const{isNegative:l,absoluteValue:h}=ee(e),u=te(h,i);if(V(u))return o;const{scaledValue:f,scaleSuffix:d}=Y(u,i),p=X(f,r.toString())<0?t:0;let S=f;a&&c!==m.None&&(S=y(f,a,c,!1,i));const D=O(S,p,p,i,!1,!1);return`${l?"-":""}${D}${d}%`}function Ze(e){const t="₀₁₂₃₄₅₆₇₈₉";return e.replace(/[0-9]/g,n=>t[+n])}function Be(e,t=8,n=N){if(!e||!e.includes(n))return e;const s=e.startsWith("-"),o=s?e.slice(1):e,[r,i]=o.split(n);if(!i||!i.length)return e;const a=i.match(/^(0{3,})/);if(!a)return e;const l=a[1].length,h=i.slice(l),u=r==="0"&&l>=5?l+1:l,f=Ze(u.toString());let d=`0${f}${h}`;const g=f.length,p=Math.max(0,t-g-1);h.length>p&&(d=`0${f}${h.slice(0,p)}`),d=d.replace(/0+$/,"");const S=r==="0"?d:`${r}${d}`;return s?`-${S}`:S}const E={minScale:0,decimalsUnder:1e3,decimals:2,decimalsMin:0,decimalsMinAppliesToZero:!1,veryLargePlaceholder:"🔥",decimalSeparator:N};function We(e,t={}){const{minScale:n=E.minScale,decimalsUnder:s=E.decimalsUnder,decimals:o=E.decimals,decimalsMin:r=E.decimalsMin,decimalsMinAppliesToZero:i=E.decimalsMinAppliesToZero,veryLargePlaceholder:a=E.veryLargePlaceholder,decimalSeparator:c=E.decimalSeparator,thousandSeparator:l,thousandStyle:h=m.None}=t;if(!e||e==="0"||e===c||e==="-"||e===`-${c}`)return i&&r>0?`0${c}${"0".repeat(r)}`:"0";const u=e.startsWith("-"),f=u?e.slice(1):e;if(V(f))return a;const{scaledValue:d,scaleSuffix:g}=Y(f,c,n),S=X(d,s.toString())<0?o:0;let D=d;l&&h!==m.None&&(D=y(d,l,h,!1,c));const R=O(D,S,r,c,i,e==="0");return`${u?"-":""}${R}${g}`}function x(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const ke=(e,t=!1,n=".")=>{const s=x(n),o=new RegExp(`[^0-9${s}]`,"g");if(!t)return e.replace(o,"");const r=e.startsWith("-"),i=e.replace(o,"");if(r){if(i.length>0)return"-"+i;if(e==="-")return"-"}return i};function Ue(e){const t=/([+-]?\d+\.?\d*)[eE]([+-]?\d+)/g;let n=e,s;const o=[];for(;(s=t.exec(e))!==null;){const r=s[0],i=s[1],a=parseInt(s[2],10);let c;if(a===0)c=i;else{const l=i.startsWith("-"),h=l?i.slice(1):i,[u,f=""]=h.split(".");a>0?c=Ge(u,f,a):c=je(u,f,Math.abs(a)),l&&(c="-"+c)}o.push({full:r,expanded:c})}for(const{full:r,expanded:i}of o)n=n.replace(r,i);return n}function Ge(e,t,n){const s=e+t;if(s==="0"||s.match(/^0+$/))return"0";const o=t.length;if(n<=o){const i=s.slice(0,e.length+n),a=s.slice(e.length+n);return a?`${i}.${a}`:i}const r=n-o;return s+"0".repeat(r)}function je(e,t,n){const s=e+t;if(s==="0"||s.match(/^0+$/))return"0";const i=e.length-n;if(i<=0){const a=Math.abs(i),c=`0.${"0".repeat(a)}${s}`;return A(c)}if(i<e.length){const a=s.slice(0,i),c=s.slice(i),l=`${a}.${c}`;return A(l)}return A(s)}function A(e){if(!e.includes("."))return e;if(e==="0"||e==="0.")return"0";if(e.startsWith("0.")){const t=e.replace(/\.?0+$/,"");return t==="0"?"0":t||"0"}if(e.startsWith("-0.")){const t=e.replace(/\.?0+$/,"");return t==="-0"||t==="0"?"0":t||"0"}return e.replace(/\.?0+$/,"")||e}function Je(e){const t=/(\d+\.?\d*)\s*(Qa|Qi|Sx|Sp|[kmbMTO]|N)/gi;return e.replace(t,(n,s,o)=>{const r={k:3,K:3,m:6,M:6,b:9,B:9,T:12,t:12};let i;if(o.length>1){const d=o.charAt(0).toUpperCase()+o.slice(1).toLowerCase();i=r[o]||r[d]}else{const d=o.toLowerCase();i=r[o]||r[d]}if(!i)return n;const a=s.startsWith("-"),c=a?s.slice(1):s,[l,h=""]=c.split("."),u=l.replace(/^0+/,"")||"0";let f;if(h.length===0)f=u+"0".repeat(i);else if(h.length<=i){const d=i-h.length;f=u+h+"0".repeat(d)}else{const d=h.slice(0,i),g=h.slice(i);f=u+d+"."+g}return f=f.replace(/^(-?)0+([1-9])/,"$1$2"),f.match(/^-?0+$/)&&(f=a?"-0":"0"),f.includes(".")&&(f=f.replace(/\.?0+$/,"")),a&&!f.startsWith("-")?"-"+f:f})}function Ke(e){if(!e||e==="0"||e==="-0"||e==="-"||e===".")return e;const t=e.startsWith("-"),n=t?e.slice(1):e;if(!n||n==="0"||n===".")return e;if(n.includes(".")){const[o,r]=n.split(".");if(o&&o.length>0){const a=(o.replace(/^0+/,"")||"0")+"."+r;return t?"-"+a:a}return e}if(n.startsWith("0")&&n.length>1){const o=n.replace(/^0+/,"")||"0";return t?"-"+o:o}return e}function qe(e){return e.replace(/[\u00A0\u2000-\u200B\u202F\u205F\u3000]/g," ").replace(/\s/g,"")}function w(e,t){const n=x(t);return e.replace(new RegExp(n,"g"),"")}const Qe=(e,t)=>{let n=qe(e);return t!=null&&t.thousandSeparator&&(n=w(n,t.thousandSeparator)),t!=null&&t.enableCompactNotation&&(n=Je(n)),n=Ue(n),n=ke(n,t==null?void 0:t.enableNegative,t==null?void 0:t.decimalSeparator),n=de(n,(t==null?void 0:t.decimalSeparator)||N),t!=null&&t.enableLeadingZeros||(n=Ke(n)),n};function He(e,t,n){return{enableCompactNotation:e==null?void 0:e.enableCompactNotation,enableNegative:e==null?void 0:e.enableNegative,enableLeadingZeros:e==null?void 0:e.enableLeadingZeros,decimalSeparator:t.decimalSeparator,thousandSeparator:n?t.thousandSeparator:void 0}}function C(e,t,n,s){const o=I(n),r=s??(n==null?void 0:n.formatOn)===$.Change,i=Qe(e,He(n,o,r)),a=fe(i,t,o.decimalSeparator),c=(n==null?void 0:n.decimalMinLength)??0,l=ge(a,c,o.decimalSeparator),h=l;return{formatted:$e(l,n,o),raw:h}}function Ve(e,t,n){const s=!!(n!=null&&n.thousandSeparator);return C(e,t,n,s)}function Xe(e,t,n){if(e==="Backspace"||e==="Delete")return e==="Delete"&&t===n?{endOffset:1}:{endOffset:0}}function ne(e,t){const{decimalSeparator:n}=I(t),s=e.target;if(ue(e,s,n)){e.preventDefault();return}return Ie(e,s,t),Xe(e.key,s.selectionStart,s.selectionEnd)}function se(e,t,n,s){const o=e.target,r=o.value,i=Te(o),a=I(s),c=(s==null?void 0:s.formatOn)===$.Change,{formatted:l,raw:h}=C(r,t,s,c);return o.value=l,r!==l&&Pe(o,r,l,i,n,a,s),{formatted:l,raw:h}}function Ye(e,t,n,s){const o=s-n;return e+t+o}function re(e,t,n){var f;e.preventDefault();const s=e.target,{value:o,selectionStart:r,selectionEnd:i}=s,a=((f=e.clipboardData)==null?void 0:f.getData("text/plain"))||"",c=o.slice(0,r||0)+a+o.slice(i||0),{formatted:l,raw:h}=C(c,t,n,!0);s.value=l;const u=Ye(r||0,a.length,c.length,l.length);return s.setSelectionRange(u,u),{formatted:l,raw:h}}function Fe(e,t){const n=x(e);return t?`^-?[0-9]*[${n}]?[0-9]*$`:`^[0-9]*[${n}]?[0-9]*$`}function et(e){tt(e.decimalMaxLength),nt(e.decimalMinLength),st(e.decimalMinLength,e.decimalMaxLength),rt(e.formatOn),it(e.thousandSeparator),ot(e.thousandStyle),at(e.decimalSeparator),ct(e.thousandSeparator,e.decimalSeparator),M("enableCompactNotation",e.enableCompactNotation),M("enableNegative",e.enableNegative),M("enableLeadingZeros",e.enableLeadingZeros),M("rawValueMode",e.rawValueMode),lt(e.onChange)}function tt(e){if(e!==void 0){if(typeof e!="number")throw new Error(`decimalMaxLength must be a number. Received: ${typeof e} (${JSON.stringify(e)})`);if(!Number.isInteger(e))throw new Error(`decimalMaxLength must be an integer. Received: ${e}`);if(e<0)throw new Error(`decimalMaxLength must be non-negative. Received: ${e}`)}}function nt(e){if(e!==void 0){if(typeof e!="number")throw new Error(`decimalMinLength must be a number. Received: ${typeof e} (${JSON.stringify(e)})`);if(!Number.isInteger(e))throw new Error(`decimalMinLength must be an integer. Received: ${e}`);if(e<0)throw new Error(`decimalMinLength must be non-negative. Received: ${e}`)}}function st(e,t){if(!(e===void 0||t===void 0)&&e>t)throw new Error(`decimalMinLength (${e}) cannot be greater than decimalMaxLength (${t}).`)}function rt(e){if(e!==void 0&&e!==$.Blur&&e!==$.Change)throw new Error(`formatOn must be either ${$.Blur} or ${$.Change}. Received: ${JSON.stringify(e)}`)}function it(e){if(e!==void 0){if(typeof e!="string")throw new Error(`thousandSeparator must be a string. Received: ${typeof e} (${JSON.stringify(e)})`);if(e.length===0)throw new Error(`thousandSeparator cannot be empty. Received: ${JSON.stringify(e)}`);if(e.length>1)throw new Error(`thousandSeparator must be a single character. Received: "${e}" (length: ${e.length})`)}}function ot(e){if(e!==void 0&&!Object.values(m).includes(e))throw new Error(`ThousandStyle must be one of: ${Object.values(m).map(t=>`'${t}'`).join(", ")}. Received: ${JSON.stringify(e)}`)}function at(e){if(e!==void 0){if(typeof e!="string")throw new Error(`decimalSeparator must be a string. Received: ${typeof e} (${JSON.stringify(e)})`);if(e.length===0)throw new Error(`decimalSeparator cannot be empty. Received: ${JSON.stringify(e)}`);if(e.length>1)throw new Error(`decimalSeparator must be a single character. Received: "${e}" (length: ${e.length})`)}}function ct(e,t){if(!(e===void 0||t===void 0)&&e===t)throw new Error(`Decimal separator can't be same as thousand separator. thousandSeparator: ${e}, decimalSeparator: ${t}`)}function M(e,t){if(t!==void 0&&typeof t!="boolean")throw new Error(`${e} must be a boolean. Received: ${typeof t} (${JSON.stringify(t)})`)}function lt(e){if(e!==void 0&&typeof e!="function")throw new Error(`onChange must be a function or undefined. Received: ${typeof e} (${JSON.stringify(e)})`)}class ht{constructor(t,{decimalMaxLength:n=_,decimalMinLength:s=z,formatOn:o=Z,thousandSeparator:r=B,thousandStyle:i=W,decimalSeparator:a=N,enableCompactNotation:c=!0,enableNegative:l=k,enableLeadingZeros:h=U,rawValueMode:u=G,onChange:f,...d}){v(this,"element");v(this,"options");v(this,"resolvedOptions");v(this,"rawValue","");v(this,"caretPositionBeforeChange");if(et({decimalMaxLength:n,decimalMinLength:s,formatOn:o,thousandSeparator:r,thousandStyle:i,decimalSeparator:a,enableCompactNotation:c,enableNegative:l,enableLeadingZeros:h,rawValueMode:u,onChange:f}),this.options={decimalMaxLength:n,decimalMinLength:s,onChange:f,formatOn:o,thousandSeparator:r,thousandStyle:i,decimalSeparator:a,enableCompactNotation:c,enableNegative:l,enableLeadingZeros:h,rawValueMode:u,...d},this.resolvedOptions=this.getResolvedOptions(),this.createInputElement(t),this.setupEventListeners(),this.resolvedOptions.rawValueMode&&this.element.value){const g=this.element.value,p=this.resolvedOptions.thousandSeparator?w(g,this.resolvedOptions.thousandSeparator):g;this.rawValue=p,this.element.value=this.formatValueForDisplay(p)}else if(this.element.value){const g=this.element.value;this.element.value=this.formatValueForDisplay(g)}}createInputElement(t){if(this.element=document.createElement("input"),this.element.setAttribute("type","text"),this.element.setAttribute("inputmode","decimal"),this.element.setAttribute("spellcheck","false"),this.element.setAttribute("autocomplete","off"),this.resolvedOptions.decimalSeparator!==void 0&&this.resolvedOptions.enableNegative!==void 0){const oe=Fe(this.resolvedOptions.decimalSeparator,this.resolvedOptions.enableNegative);this.element.setAttribute("pattern",oe)}const{decimalMaxLength:n,decimalMinLength:s,formatOn:o,thousandSeparator:r,thousandStyle:i,decimalSeparator:a,enableCompactNotation:c,enableNegative:l,enableLeadingZeros:h,rawValueMode:u,onChange:f,value:d,defaultValue:g,type:p,inputMode:S,spellcheck:D,autocomplete:R,...ie}=this.options;Object.assign(this.element,ie),d!==void 0?this.element.value=d:g!==void 0&&(this.element.defaultValue=g,this.element.value=g),t.appendChild(this.element)}setupEventListeners(){this.element.addEventListener("input",this.handleChange.bind(this)),this.element.addEventListener("keydown",this.handleKeyDown.bind(this)),this.element.addEventListener("paste",this.handlePaste.bind(this)),this.resolvedOptions.formatOn===$.Blur&&this.resolvedOptions.thousandSeparator&&(this.element.addEventListener("focus",this.handleFocus.bind(this)),this.element.addEventListener("blur",this.handleBlur.bind(this)))}getResolvedOptions(){return{decimalMaxLength:this.options.decimalMaxLength??_,decimalMinLength:this.options.decimalMinLength??z,formatOn:this.options.formatOn??Z,thousandSeparator:this.options.thousandSeparator??B,thousandStyle:this.options.thousandStyle??W,decimalSeparator:this.options.decimalSeparator??N,enableCompactNotation:this.options.enableCompactNotation??le,enableNegative:this.options.enableNegative??k,enableLeadingZeros:this.options.enableLeadingZeros??U,rawValueMode:this.options.rawValueMode??G,onChange:this.options.onChange}}buildFormattingOptions(){return{formatOn:this.resolvedOptions.formatOn,thousandSeparator:this.resolvedOptions.thousandSeparator,ThousandStyle:this.resolvedOptions.thousandStyle,enableCompactNotation:this.resolvedOptions.enableCompactNotation,enableNegative:this.resolvedOptions.enableNegative,enableLeadingZeros:this.resolvedOptions.enableLeadingZeros,decimalSeparator:this.resolvedOptions.decimalSeparator,decimalMinLength:this.resolvedOptions.decimalMinLength,rawValueMode:this.resolvedOptions.rawValueMode}}handleValueChange(t,n){if(this.resolvedOptions.rawValueMode&&n!==void 0&&(this.rawValue=n),this.resolvedOptions.onChange){const s=this.resolvedOptions.rawValueMode?this.rawValue:t;this.resolvedOptions.onChange(s)}}formatValueForDisplay(t){if(!t)return t;const{thousandSeparator:n,thousandStyle:s,enableLeadingZeros:o,decimalSeparator:r}=this.resolvedOptions;return n&&s!==m.None?y(t,n,s,o,r):t}handleChange(t){const{formatted:n,raw:s}=se(t,this.resolvedOptions.decimalMaxLength,this.caretPositionBeforeChange,this.buildFormattingOptions());this.caretPositionBeforeChange=void 0,this.handleValueChange(n,s)}handleKeyDown(t){const n=t.target,{selectionStart:s,selectionEnd:o}=n,r=this.buildFormattingOptions(),i=ne(t,{formatOn:r.formatOn,thousandSeparator:r.thousandSeparator,ThousandStyle:r.ThousandStyle,decimalSeparator:r.decimalSeparator});i?this.caretPositionBeforeChange={selectionStart:s??0,selectionEnd:o??0,endOffset:i.endOffset}:this.caretPositionBeforeChange={selectionStart:s??0,selectionEnd:o??0}}handlePaste(t){const{formatted:n,raw:s}=re(t,this.resolvedOptions.decimalMaxLength,this.buildFormattingOptions());this.handleValueChange(n,s);const o=new Event("input",{bubbles:!0,cancelable:!0});this.element.dispatchEvent(o)}handleFocus(t){if(this.resolvedOptions.formatOn===$.Blur&&this.resolvedOptions.thousandSeparator){const n=t.target;n.value=w(n.value,this.resolvedOptions.thousandSeparator)}}handleBlur(t){const n=t.target,{thousandSeparator:s,thousandStyle:o}=this.resolvedOptions;if(s&&o!==m.None&&n.value){const r=n.value,i=this.formatValueForDisplay(n.value);n.value=i;const a=this.resolvedOptions.rawValueMode?w(i,s):void 0;if(this.handleValueChange(i,a),r!==i){const c=new Event("input",{bubbles:!0,cancelable:!0});this.element.dispatchEvent(c);const l=new Event("change",{bubbles:!0,cancelable:!0});this.element.dispatchEvent(l)}}}getValue(){return this.resolvedOptions.rawValueMode?this.rawValue:this.element.value}setValue(t){if(this.resolvedOptions.rawValueMode){const n=this.resolvedOptions.thousandSeparator?w(t,this.resolvedOptions.thousandSeparator):t;this.rawValue=n,this.element.value=this.formatValueForDisplay(n)}else this.element.value=t}disable(){this.element.disabled=!0}enable(){this.element.disabled=!1}addEventListener(t,n){this.element.addEventListener(t,n)}removeEventListener(t,n){this.element.removeEventListener(t,n)}getElement(){return this.element}get value(){return this.getValue()}set value(t){this.setValue(t)}get valueAsNumber(){const t=this.getValue();if(!t)return NaN;const n=this.resolvedOptions.thousandSeparator?w(t,this.resolvedOptions.thousandSeparator):t,s=this.resolvedOptions.decimalSeparator&&this.resolvedOptions.decimalSeparator!=="."?n.replace(new RegExp(x(this.resolvedOptions.decimalSeparator),"g"),"."):n;return parseFloat(s)}set valueAsNumber(t){if(isNaN(t)){this.setValue("");return}const n=t.toString();this.setValue(n)}}exports.FormatOn=$;exports.NumoraInput=ht;exports.ThousandStyle=m;exports.condenseDecimalZeros=Be;exports.formatInputValue=C;exports.formatLargeNumber=We;exports.formatLargePercent=ze;exports.formatPercent=_e;exports.formatValueForDisplay=Ve;exports.handleOnChangeNumoraInput=se;exports.handleOnKeyDownNumoraInput=ne;exports.handleOnPasteNumoraInput=re;