@arthurzakharov/ui-kit 1.3.8 → 1.4.0

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.
Files changed (279) hide show
  1. package/dist/_commonjsHelpers-CqEciG1_.js +31 -0
  2. package/dist/animations/animation-fade-grow/animation-fade-grow.component.d.ts +2 -0
  3. package/dist/animations/animation-fade-grow/animation-fade-grow.component.js +34 -0
  4. package/dist/animations/animation-fade-grow/index.d.ts +1 -0
  5. package/dist/animations/animation-fade-grow/index.js +4 -0
  6. package/dist/animations/animation-fade-scale/animation-fade-scale.component.d.ts +2 -0
  7. package/dist/animations/animation-fade-scale/animation-fade-scale.component.js +33 -0
  8. package/dist/animations/animation-fade-scale/index.d.ts +1 -0
  9. package/dist/animations/animation-fade-scale/index.js +4 -0
  10. package/dist/animations/animation-fade-slide/animation-fade-slide.component.d.ts +6 -0
  11. package/dist/animations/animation-fade-slide/animation-fade-slide.component.js +33 -0
  12. package/dist/animations/animation-fade-slide/index.d.ts +1 -0
  13. package/dist/animations/animation-fade-slide/index.js +4 -0
  14. package/dist/animations/animation-rotate/animation-rotate.component.d.ts +8 -0
  15. package/dist/animations/animation-rotate/animation-rotate.component.js +38 -0
  16. package/dist/animations/animation-rotate/index.d.ts +1 -0
  17. package/dist/animations/animation-rotate/index.js +4 -0
  18. package/dist/animations/hook/index.d.ts +1 -0
  19. package/dist/animations/hook/index.js +4 -0
  20. package/dist/animations/hook/use-animation-lifecycle/index.d.ts +1 -0
  21. package/dist/animations/hook/use-animation-lifecycle/index.js +4 -0
  22. package/dist/animations/hook/use-animation-lifecycle/use-animation-lifecycle.hook.d.ts +12 -0
  23. package/dist/animations/hook/use-animation-lifecycle/use-animation-lifecycle.hook.js +31 -0
  24. package/dist/animations/utils/default-props.d.ts +5 -0
  25. package/dist/animations/utils/default-props.js +17 -0
  26. package/dist/animations/utils/index.d.ts +2 -0
  27. package/dist/animations/utils/index.js +4 -0
  28. package/dist/animations/utils/types.d.ts +15 -0
  29. package/dist/animations/utils/types.js +1 -0
  30. package/dist/assets/control-box-Dx-QKPgf.css +1 -0
  31. package/dist/assets/control-button-Tzg6F5Dp.css +1 -0
  32. package/dist/assets/control-button-card-Cb8_vJbQ.css +1 -0
  33. package/dist/assets/control-button-radio-BodzD0rU.css +1 -0
  34. package/dist/assets/control-button-text-BbE_5ebO.css +1 -0
  35. package/dist/assets/control-card-image-BYT3bzTE.css +1 -0
  36. package/dist/assets/control-card-text-Cvv3bL2p.css +1 -0
  37. package/dist/assets/control-checkbox-uLtXjmYN.css +1 -0
  38. package/dist/assets/control-choice-BAHN-VTm.css +1 -0
  39. package/dist/assets/control-dropdown-DaS5KsvG.css +1 -0
  40. package/dist/assets/control-error-message-CKgqmo1U.css +1 -0
  41. package/dist/assets/control-hidden-input-BhMdNmnP.css +1 -0
  42. package/dist/assets/control-input-nR0XQHHp.css +1 -0
  43. package/dist/assets/control-label-C8pjaWEU.css +1 -0
  44. package/dist/assets/control-radio-Bo1rvcg2.css +1 -0
  45. package/dist/assets/control-radio-label-CgZ-FNj0.css +1 -0
  46. package/dist/assets/control-radio-text-S7MEO4a2.css +1 -0
  47. package/dist/assets/control-status-DPNvkGlM.css +1 -0
  48. package/dist/assets/control-text-n-qi7e2Y.css +1 -0
  49. package/dist/assets/control-textarea-B6gWlJs3.css +1 -0
  50. package/dist/assets/data-protected-label-BN19_NZF.css +1 -0
  51. package/dist/assets/dialog-article-WnyHZI47.css +1 -0
  52. package/dist/assets/expenses-AU5q4idk.css +1 -0
  53. package/dist/assets/loader-DadlBlOF.css +1 -0
  54. package/dist/assets/main-DlyWXITA.css +1 -0
  55. package/dist/assets/message-block-DG1cePyB.css +1 -0
  56. package/dist/components/accordion-table/accordion-table.component.d.ts +9 -7
  57. package/dist/components/accordion-table/accordion-table.component.js +44 -41
  58. package/dist/components/bottom-bar/bottom-bar.component.js +2 -2
  59. package/dist/components/certifications/certifications.component.d.ts +6 -3
  60. package/dist/components/certifications/certifications.component.js +54 -46
  61. package/dist/components/data-protected-label/data-protected-label.component.d.ts +8 -3
  62. package/dist/components/data-protected-label/data-protected-label.component.js +31 -28
  63. package/dist/components/data-protected-label/index.d.ts +1 -0
  64. package/dist/components/data-protected-label/index.js +4 -0
  65. package/dist/components/dialog-article/dialog-article.component.d.ts +9 -3
  66. package/dist/components/dialog-article/dialog-article.component.js +51 -21
  67. package/dist/components/dialog-article/index.d.ts +1 -0
  68. package/dist/components/dialog-article/index.js +4 -0
  69. package/dist/components/expenses/expenses.component.d.ts +12 -7
  70. package/dist/components/expenses/expenses.component.js +26 -20
  71. package/dist/components/expenses/index.d.ts +1 -0
  72. package/dist/components/expenses/index.js +4 -0
  73. package/dist/components/flex/flex.component.d.ts +158 -158
  74. package/dist/components/footer/footer.component.d.ts +6 -3
  75. package/dist/components/footer/footer.component.js +39 -31
  76. package/dist/components/footer/index.d.ts +1 -1
  77. package/dist/components/info-panel/info-panel.component.d.ts +6 -3
  78. package/dist/components/info-panel/info-panel.component.js +20 -12
  79. package/dist/components/information/index.d.ts +1 -1
  80. package/dist/components/information/information.component.d.ts +5 -4
  81. package/dist/components/information/information.component.js +21 -12
  82. package/dist/components/loader/index.d.ts +1 -1
  83. package/dist/components/loader/loader.component.d.ts +9 -5
  84. package/dist/components/loader/loader.component.js +42 -55
  85. package/dist/components/loader/loader.utils.d.ts +2 -0
  86. package/dist/components/loader/loader.utils.js +13 -0
  87. package/dist/components/main-attachment/main-attachment.component.js +2 -2
  88. package/dist/components/message/index.d.ts +1 -1
  89. package/dist/components/message/message.component.d.ts +6 -3
  90. package/dist/components/message/message.component.js +23 -22
  91. package/dist/components/message-block/index.d.ts +1 -0
  92. package/dist/components/message-block/index.js +4 -0
  93. package/dist/components/message-block/message-block.component.d.ts +7 -2
  94. package/dist/components/message-block/message-block.component.js +36 -18
  95. package/dist/components/not-found/not-found.component.d.ts +6 -3
  96. package/dist/components/not-found/not-found.component.js +35 -27
  97. package/dist/components/payment/components/glass/glass.component.js +1 -1
  98. package/dist/components/sidebar/components/step/step.component.d.ts +1 -1
  99. package/dist/components/sidebar/components/step/step.component.js +6 -6
  100. package/dist/components/sidebar/sidebar.component.d.ts +1 -1
  101. package/dist/components/sidebar/sidebar.component.js +9 -9
  102. package/dist/components/signature/index.d.ts +1 -1
  103. package/dist/components/signature/signature.component.d.ts +4 -4
  104. package/dist/components/signature/signature.component.js +255 -263
  105. package/dist/components/text/components/tag/tag.component.d.ts +316 -316
  106. package/dist/components/text/text.component.d.ts +316 -316
  107. package/dist/components/user-panel/user-panel.component.d.ts +6 -3
  108. package/dist/components/user-panel/user-panel.component.js +35 -27
  109. package/dist/components/warranty/warranty.component.d.ts +6 -3
  110. package/dist/components/warranty/warranty.component.js +26 -19
  111. package/dist/controls/control-box/control-box.component.d.ts +15 -0
  112. package/dist/controls/control-box/control-box.component.js +33 -0
  113. package/dist/controls/control-box/index.d.ts +2 -0
  114. package/dist/controls/control-box/index.js +4 -0
  115. package/dist/controls/control-button/control-button.component.d.ts +18 -0
  116. package/dist/controls/control-button/control-button.component.js +84 -0
  117. package/dist/controls/control-button/index.d.ts +2 -0
  118. package/dist/controls/control-button/index.js +4 -0
  119. package/dist/{components/control/components/button-card/button-card.component.d.ts → controls/control-button-card/control-button-card.component.d.ts} +4 -3
  120. package/dist/controls/control-button-card/control-button-card.component.js +65 -0
  121. package/dist/controls/control-button-card/index.d.ts +2 -0
  122. package/dist/controls/control-button-card/index.js +4 -0
  123. package/dist/controls/control-button-radio/control-button-radio.component.d.ts +19 -0
  124. package/dist/controls/control-button-radio/control-button-radio.component.js +69 -0
  125. package/dist/controls/control-button-radio/index.d.ts +2 -0
  126. package/dist/controls/control-button-radio/index.js +4 -0
  127. package/dist/controls/control-button-text/control-button-text.component.d.ts +20 -0
  128. package/dist/controls/control-button-text/control-button-text.component.js +87 -0
  129. package/dist/controls/control-button-text/index.d.ts +2 -0
  130. package/dist/controls/control-button-text/index.js +4 -0
  131. package/dist/controls/control-card-image/control-card-image.component.d.ts +8 -0
  132. package/dist/controls/control-card-image/control-card-image.component.js +53 -0
  133. package/dist/controls/control-card-image/index.d.ts +2 -0
  134. package/dist/controls/control-card-image/index.js +4 -0
  135. package/dist/controls/control-card-text/control-card-text.component.d.ts +7 -0
  136. package/dist/controls/control-card-text/control-card-text.component.js +48 -0
  137. package/dist/controls/control-card-text/index.d.ts +2 -0
  138. package/dist/controls/control-card-text/index.js +4 -0
  139. package/dist/controls/control-checkbox/control-checkbox.component.d.ts +11 -0
  140. package/dist/controls/control-checkbox/control-checkbox.component.js +96 -0
  141. package/dist/controls/control-checkbox/index.d.ts +2 -0
  142. package/dist/controls/control-checkbox/index.js +4 -0
  143. package/dist/controls/control-choice/control-choice.component.d.ts +12 -0
  144. package/dist/controls/control-choice/control-choice.component.js +64 -0
  145. package/dist/controls/control-choice/index.d.ts +2 -0
  146. package/dist/controls/control-choice/index.js +4 -0
  147. package/dist/{components/control/components/dropdown/dropdown.component.d.ts → controls/control-dropdown/control-dropdown.component.d.ts} +4 -3
  148. package/dist/controls/control-dropdown/control-dropdown.component.js +106 -0
  149. package/dist/controls/control-dropdown/index.d.ts +2 -0
  150. package/dist/controls/control-dropdown/index.js +4 -0
  151. package/dist/controls/control-error-message/control-error-message.component.d.ts +7 -0
  152. package/dist/controls/control-error-message/control-error-message.component.js +16 -0
  153. package/dist/controls/control-error-message/index.d.ts +1 -0
  154. package/dist/controls/control-error-message/index.js +4 -0
  155. package/dist/controls/control-hidden-input/control-hidden-input.component.d.ts +15 -0
  156. package/dist/controls/control-hidden-input/control-hidden-input.component.js +41 -0
  157. package/dist/controls/control-hidden-input/index.d.ts +2 -0
  158. package/dist/controls/control-hidden-input/index.js +4 -0
  159. package/dist/controls/control-input/control-input.component.d.ts +11 -0
  160. package/dist/controls/control-input/control-input.component.js +973 -0
  161. package/dist/controls/control-input/index.d.ts +2 -0
  162. package/dist/controls/control-input/index.js +4 -0
  163. package/dist/controls/control-label/control-label.component.d.ts +13 -0
  164. package/dist/controls/control-label/control-label.component.js +30 -0
  165. package/dist/controls/control-label/index.d.ts +1 -0
  166. package/dist/controls/control-label/index.js +4 -0
  167. package/dist/controls/control-radio/control-radio.component.d.ts +14 -0
  168. package/dist/controls/control-radio/control-radio.component.js +79 -0
  169. package/dist/controls/control-radio/index.d.ts +2 -0
  170. package/dist/controls/control-radio/index.js +4 -0
  171. package/dist/controls/control-radio-label/control-radio-label.component.d.ts +22 -0
  172. package/dist/controls/control-radio-label/control-radio-label.component.js +39 -0
  173. package/dist/controls/control-radio-label/index.d.ts +1 -0
  174. package/dist/controls/control-radio-label/index.js +4 -0
  175. package/dist/controls/control-radio-text/control-radio-text.component.d.ts +10 -0
  176. package/dist/controls/control-radio-text/control-radio-text.component.js +45 -0
  177. package/dist/controls/control-radio-text/index.d.ts +2 -0
  178. package/dist/controls/control-radio-text/index.js +4 -0
  179. package/dist/controls/control-status/control-status.component.d.ts +11 -0
  180. package/dist/controls/control-status/control-status.component.js +42 -0
  181. package/dist/controls/control-status/index.d.ts +1 -0
  182. package/dist/controls/control-status/index.js +4 -0
  183. package/dist/controls/control-text/control-text.component.d.ts +11 -0
  184. package/dist/controls/control-text/control-text.component.js +70 -0
  185. package/dist/controls/control-text/index.d.ts +2 -0
  186. package/dist/controls/control-text/index.js +4 -0
  187. package/dist/controls/control-textarea/control-textarea.component.d.ts +15 -0
  188. package/dist/controls/control-textarea/control-textarea.component.js +63 -0
  189. package/dist/controls/control-textarea/index.d.ts +1 -0
  190. package/dist/controls/control-textarea/index.js +4 -0
  191. package/dist/controls/hooks/index.d.ts +1 -0
  192. package/dist/controls/hooks/index.js +4 -0
  193. package/dist/controls/hooks/use-choice/index.d.ts +1 -0
  194. package/dist/controls/hooks/use-choice/index.js +4 -0
  195. package/dist/{components/control/hooks/useChoice/useChoice.hook.d.ts → controls/hooks/use-choice/use-choice.hook.d.ts} +2 -2
  196. package/dist/controls/utils/functions/index.d.ts +1 -0
  197. package/dist/controls/utils/functions/index.js +7 -0
  198. package/dist/controls/utils/index.d.ts +2 -0
  199. package/dist/controls/utils/index.js +7 -0
  200. package/dist/{components/control/control.types.d.ts → controls/utils/types.d.ts} +11 -3
  201. package/dist/main.d.ts +35 -13
  202. package/dist/main.js +101 -59
  203. package/dist/utils/functions/functions.util.d.ts +12 -2
  204. package/dist/utils/functions/functions.util.js +7 -3
  205. package/dist/utils/functions/index.js +5 -4
  206. package/dist/utils/svg/svg.component.d.ts +2 -2
  207. package/dist/utils/types.d.ts +6 -1
  208. package/package.json +6 -1
  209. package/dist/animations/animation.component.d.ts +0 -10
  210. package/dist/animations/animation.component.js +0 -13
  211. package/dist/animations/fade-grow/fade-grow.component.d.ts +0 -14
  212. package/dist/animations/fade-grow/fade-grow.component.js +0 -40
  213. package/dist/animations/fade-scale/fade-scale.component.d.ts +0 -14
  214. package/dist/animations/fade-scale/fade-scale.component.js +0 -40
  215. package/dist/animations/fade-slide/fade-slide.component.d.ts +0 -15
  216. package/dist/animations/fade-slide/fade-slide.component.js +0 -41
  217. package/dist/animations/rotate/rotate.component.d.ts +0 -18
  218. package/dist/animations/rotate/rotate.component.js +0 -43
  219. package/dist/assets/box-b_yPaNPs.css +0 -1
  220. package/dist/assets/button-4MJZ7yPE.css +0 -1
  221. package/dist/assets/button-text-CNXFsTky.css +0 -1
  222. package/dist/assets/choice-pCBafXqx.css +0 -1
  223. package/dist/assets/control-Dk23qyF8.css +0 -1
  224. package/dist/assets/data-protected-label-zRn9upL6.css +0 -1
  225. package/dist/assets/dialog-article-lpJC_c40.css +0 -1
  226. package/dist/assets/expenses-8eaHjdlH.css +0 -1
  227. package/dist/assets/fade-grow-B23oZuuD.css +0 -1
  228. package/dist/assets/hidden-input-DHJQHUKd.css +0 -1
  229. package/dist/assets/input-Cckwgcro.css +0 -1
  230. package/dist/assets/label-bo2ALC-X.css +0 -1
  231. package/dist/assets/loader-C0f3AvRU.css +0 -1
  232. package/dist/assets/main-BK_1RcKG.css +0 -1
  233. package/dist/assets/message-block-BVk5u9rO.css +0 -1
  234. package/dist/assets/radio-label-Bd5UiESO.css +0 -1
  235. package/dist/assets/radio-text-BI17l0wD.css +0 -1
  236. package/dist/assets/status-6MH80dkz.css +0 -1
  237. package/dist/components/control/components/box/box.component.d.ts +0 -10
  238. package/dist/components/control/components/box/box.component.js +0 -32
  239. package/dist/components/control/components/button/button.component.d.ts +0 -16
  240. package/dist/components/control/components/button/button.component.js +0 -82
  241. package/dist/components/control/components/button-card/button-card.component.js +0 -9
  242. package/dist/components/control/components/button-radio/button-radio.component.d.ts +0 -17
  243. package/dist/components/control/components/button-radio/button-radio.component.js +0 -7
  244. package/dist/components/control/components/button-text/button-text.component.d.ts +0 -18
  245. package/dist/components/control/components/button-text/button-text.component.js +0 -86
  246. package/dist/components/control/components/card-image/card-image.component.d.ts +0 -7
  247. package/dist/components/control/components/card-image/card-image.component.js +0 -7
  248. package/dist/components/control/components/card-text/card-text.component.d.ts +0 -6
  249. package/dist/components/control/components/card-text/card-text.component.js +0 -7
  250. package/dist/components/control/components/checkbox/checkbox.component.d.ts +0 -9
  251. package/dist/components/control/components/checkbox/checkbox.component.js +0 -8
  252. package/dist/components/control/components/choice/choice.component.d.ts +0 -10
  253. package/dist/components/control/components/choice/choice.component.js +0 -52
  254. package/dist/components/control/components/dropdown/dropdown.component.js +0 -11
  255. package/dist/components/control/components/hidden-input/hidden-input.component.d.ts +0 -12
  256. package/dist/components/control/components/hidden-input/hidden-input.component.js +0 -25
  257. package/dist/components/control/components/input/input.component.d.ts +0 -10
  258. package/dist/components/control/components/input/input.component.js +0 -7
  259. package/dist/components/control/components/label/label.component.d.ts +0 -7
  260. package/dist/components/control/components/label/label.component.js +0 -28
  261. package/dist/components/control/components/radio/radio.component.d.ts +0 -9
  262. package/dist/components/control/components/radio/radio.component.js +0 -7
  263. package/dist/components/control/components/radio-label/radio-label.component.d.ts +0 -17
  264. package/dist/components/control/components/radio-label/radio-label.component.js +0 -37
  265. package/dist/components/control/components/radio-text/radio-text.component.d.ts +0 -9
  266. package/dist/components/control/components/radio-text/radio-text.component.js +0 -29
  267. package/dist/components/control/components/status/status.component.d.ts +0 -6
  268. package/dist/components/control/components/status/status.component.js +0 -37
  269. package/dist/components/control/components/text/text.component.d.ts +0 -9
  270. package/dist/components/control/components/text/text.component.js +0 -8
  271. package/dist/components/control/components/textarea/textarea.component.d.ts +0 -9
  272. package/dist/components/control/components/textarea/textarea.component.js +0 -6
  273. package/dist/components/control/control.component.d.ts +0 -41
  274. package/dist/components/control/control.component.js +0 -14
  275. package/dist/control.component-B9Ao9mfl.js +0 -557
  276. package/dist/input.component-C5xcmnfu.js +0 -999
  277. /package/dist/{components/control/hooks/useChoice/useChoice.hook.js → controls/hooks/use-choice/use-choice.hook.js} +0 -0
  278. /package/dist/{components/control → controls}/utils/functions/functions.util.d.ts +0 -0
  279. /package/dist/{components/control → controls}/utils/functions/functions.util.js +0 -0
@@ -1,999 +0,0 @@
1
- import { jsx as ve } from "react/jsx-runtime";
2
- import Me, { useRef as De } from "react";
3
- import { r as Ie } from "./index-D3EuHLHH.js";
4
- import { findEndIndex as be } from "./components/control/utils/functions/functions.util.js";
5
- import './assets/input-Cckwgcro.css';function Ee(S) {
6
- return S && S.__esModule && Object.prototype.hasOwnProperty.call(S, "default") ? S.default : S;
7
- }
8
- function Te(S) {
9
- if (Object.prototype.hasOwnProperty.call(S, "__esModule")) return S;
10
- var I = S.default;
11
- if (typeof I == "function") {
12
- var L = function V() {
13
- var O = !1;
14
- try {
15
- O = this instanceof V;
16
- } catch {
17
- }
18
- return O ? Reflect.construct(I, arguments, this.constructor) : I.apply(this, arguments);
19
- };
20
- L.prototype = I.prototype;
21
- } else L = {};
22
- return Object.defineProperty(L, "__esModule", { value: !0 }), Object.keys(S).forEach(function(V) {
23
- var O = Object.getOwnPropertyDescriptor(S, V);
24
- Object.defineProperty(L, V, O.get ? O : {
25
- enumerable: !0,
26
- get: function() {
27
- return S[V];
28
- }
29
- });
30
- }), L;
31
- }
32
- var ne = { exports: {} }, ce, ge;
33
- function ye() {
34
- if (ge) return ce;
35
- ge = 1;
36
- function S(t) {
37
- return t && typeof t == "object" && "default" in t ? t.default : t;
38
- }
39
- var I = S(Me), L = Ie();
40
- function V(t, r) {
41
- for (var a = Object.getOwnPropertyNames(r), n = 0; n < a.length; n++) {
42
- var e = a[n], o = Object.getOwnPropertyDescriptor(r, e);
43
- o && o.configurable && t[e] === void 0 && Object.defineProperty(t, e, o);
44
- }
45
- return t;
46
- }
47
- function O() {
48
- return (O = Object.assign || function(t) {
49
- for (var r = 1; r < arguments.length; r++) {
50
- var a = arguments[r];
51
- for (var n in a) Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
52
- }
53
- return t;
54
- }).apply(this, arguments);
55
- }
56
- function N(t, r) {
57
- t.prototype = Object.create(r.prototype), V(t.prototype.constructor = t, r);
58
- }
59
- function R(t, r) {
60
- if (t == null) return {};
61
- var a, n, e = {}, o = Object.keys(t);
62
- for (n = 0; n < o.length; n++) a = o[n], 0 <= r.indexOf(a) || (e[a] = t[a]);
63
- return e;
64
- }
65
- function y(t) {
66
- if (t === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
67
- return t;
68
- }
69
- var z = function(t, r, a, n, e, o, d, k) {
70
- if (!t) {
71
- var i;
72
- if (r === void 0) i = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
73
- else {
74
- var c = [a, n, e, o, d, k], p = 0;
75
- (i = new Error(r.replace(/%s/g, function() {
76
- return c[p++];
77
- }))).name = "Invariant Violation";
78
- }
79
- throw i.framesToPop = 1, i;
80
- }
81
- }, _ = z;
82
- function j(t, r, a) {
83
- if ("selectionStart" in t && "selectionEnd" in t) t.selectionStart = r, t.selectionEnd = a;
84
- else {
85
- var n = t.createTextRange();
86
- n.collapse(!0), n.moveStart("character", r), n.moveEnd("character", a - r), n.select();
87
- }
88
- }
89
- function A(t) {
90
- var r = 0, a = 0;
91
- if ("selectionStart" in t && "selectionEnd" in t) r = t.selectionStart, a = t.selectionEnd;
92
- else {
93
- var n = document.selection.createRange();
94
- n.parentElement() === t && (r = -n.moveStart("character", -t.value.length), a = -n.moveEnd("character", -t.value.length));
95
- }
96
- return { start: r, end: a, length: a - r };
97
- }
98
- var G = { 9: "[0-9]", a: "[A-Za-z]", "*": "[A-Za-z0-9]" }, J = "_";
99
- function D(t, r, a) {
100
- var n = "", e = "", o = null, d = [];
101
- if (r === void 0 && (r = J), a == null && (a = G), !t || typeof t != "string") return { maskChar: r, formatChars: a, mask: null, prefix: null, lastEditablePosition: null, permanents: [] };
102
- var k = !1;
103
- return t.split("").forEach(function(i) {
104
- k = !k && i === "\\" || (k || !a[i] ? (d.push(n.length), n.length === d.length - 1 && (e += i)) : o = n.length + 1, n += i, !1);
105
- }), { maskChar: r, formatChars: a, prefix: e, mask: n, lastEditablePosition: o, permanents: d };
106
- }
107
- function g(t, r) {
108
- return t.permanents.indexOf(r) !== -1;
109
- }
110
- function T(t, r, a) {
111
- var n = t.mask, e = t.formatChars;
112
- if (!a) return !1;
113
- if (g(t, r)) return n[r] === a;
114
- var o = e[n[r]];
115
- return new RegExp(o).test(a);
116
- }
117
- function q(t, r) {
118
- return r.split("").every(function(a, n) {
119
- return g(t, n) || !T(t, n, a);
120
- });
121
- }
122
- function U(t, r) {
123
- var a = t.maskChar, n = t.prefix;
124
- if (!a) {
125
- for (; r.length > n.length && g(t, r.length - 1); ) r = r.slice(0, r.length - 1);
126
- return r.length;
127
- }
128
- for (var e = n.length, o = r.length; o >= n.length; o--) {
129
- var d = r[o];
130
- if (!g(t, o) && T(t, o, d)) {
131
- e = o + 1;
132
- break;
133
- }
134
- }
135
- return e;
136
- }
137
- function Q(t, r) {
138
- return U(t, r) === t.mask.length;
139
- }
140
- function F(t, r) {
141
- var a = t.maskChar, n = t.mask, e = t.prefix;
142
- if (!a) {
143
- for ((r = $(t, "", r, 0)).length < e.length && (r = e); r.length < n.length && g(t, r.length); ) r += n[r.length];
144
- return r;
145
- }
146
- if (r) return $(t, F(t, ""), r, 0);
147
- for (var o = 0; o < n.length; o++) g(t, o) ? r += n[o] : r += a;
148
- return r;
149
- }
150
- function re(t, r, a, n) {
151
- var e = a + n, o = t.maskChar, d = t.mask, k = t.prefix, i = r.split("");
152
- if (o) return i.map(function(p, h) {
153
- return h < a || e <= h ? p : g(t, h) ? d[h] : o;
154
- }).join("");
155
- for (var c = e; c < i.length; c++) g(t, c) && (i[c] = "");
156
- return a = Math.max(k.length, a), i.splice(a, e - a), r = i.join(""), F(t, r);
157
- }
158
- function $(t, r, a, n) {
159
- var e = t.mask, o = t.maskChar, d = t.prefix, k = a.split(""), i = Q(t, r);
160
- return !o && n > r.length && (r += e.slice(r.length, n)), k.every(function(c) {
161
- for (; C = c, g(t, u = n) && C !== e[u]; ) {
162
- if (n >= r.length && (r += e[n]), p = c, h = n, o && g(t, h) && p === o) return !0;
163
- if (++n >= e.length) return !1;
164
- }
165
- var p, h, u, C;
166
- return !T(t, n, c) && c !== o || (n < r.length ? r = o || i || n < d.length ? r.slice(0, n) + c + r.slice(n + 1) : (r = r.slice(0, n) + c + r.slice(n), F(t, r)) : o || (r += c), ++n < e.length);
167
- }), r;
168
- }
169
- function ae(t, r, a, n) {
170
- var e = t.mask, o = t.maskChar, d = a.split(""), k = n;
171
- return d.every(function(i) {
172
- for (; p = i, g(t, c = n) && p !== e[c]; ) if (++n >= e.length) return !1;
173
- var c, p;
174
- return (T(t, n, i) || i === o) && n++, n < e.length;
175
- }), n - k;
176
- }
177
- function oe(t, r) {
178
- for (var a = r; 0 <= a; --a) if (!g(t, a)) return a;
179
- return null;
180
- }
181
- function W(t, r) {
182
- for (var a = t.mask, n = r; n < a.length; ++n) if (!g(t, n)) return n;
183
- return null;
184
- }
185
- function Z(t) {
186
- return t || t === 0 ? t + "" : "";
187
- }
188
- function se(t, r, a, n, e) {
189
- var o = t.mask, d = t.prefix, k = t.lastEditablePosition, i = r, c = "", p = 0, h = 0, u = Math.min(e.start, a.start);
190
- return a.end > e.start ? h = (p = ae(t, n, c = i.slice(e.start, a.end), u)) ? e.length : 0 : i.length < n.length && (h = n.length - i.length), i = n, h && (h === 1 && !e.length && (u = e.start === a.start ? W(t, a.start) : oe(t, a.start)), i = re(t, i, u, h)), i = $(t, i, c, u), (u += p) >= o.length ? u = o.length : u < d.length && !p ? u = d.length : u >= d.length && u < k && p && (u = W(t, u)), c || (c = null), { value: i = F(t, i), enteredString: c, selection: { start: u, end: u } };
191
- }
192
- function ie() {
193
- var t = new RegExp("windows", "i"), r = new RegExp("phone", "i"), a = navigator.userAgent;
194
- return t.test(a) && r.test(a);
195
- }
196
- function b(t) {
197
- return typeof t == "function";
198
- }
199
- function le() {
200
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
201
- }
202
- function ee() {
203
- return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame;
204
- }
205
- function te(t) {
206
- return (ee() ? le() : function() {
207
- return setTimeout(t, 1e3 / 60);
208
- })(t);
209
- }
210
- function K(t) {
211
- (ee() || clearTimeout)(t);
212
- }
213
- var ue = (function(t) {
214
- function r(n) {
215
- var e = t.call(this, n) || this;
216
- e.focused = !1, e.mounted = !1, e.previousSelection = null, e.selectionDeferId = null, e.saveSelectionLoopDeferId = null, e.saveSelectionLoop = function() {
217
- e.previousSelection = e.getSelection(), e.saveSelectionLoopDeferId = te(e.saveSelectionLoop);
218
- }, e.runSaveSelectionLoop = function() {
219
- e.saveSelectionLoopDeferId === null && e.saveSelectionLoop();
220
- }, e.stopSaveSelectionLoop = function() {
221
- e.saveSelectionLoopDeferId !== null && (K(e.saveSelectionLoopDeferId), e.saveSelectionLoopDeferId = null, e.previousSelection = null);
222
- }, e.getInputDOMNode = function() {
223
- if (!e.mounted) return null;
224
- var l = L.findDOMNode(y(y(e))), s = typeof window < "u" && l instanceof window.Element;
225
- if (l && !s) return null;
226
- if (l.nodeName !== "INPUT" && (l = l.querySelector("input")), !l) throw new Error("react-input-mask: inputComponent doesn't contain input node");
227
- return l;
228
- }, e.getInputValue = function() {
229
- var l = e.getInputDOMNode();
230
- return l ? l.value : null;
231
- }, e.setInputValue = function(l) {
232
- var s = e.getInputDOMNode();
233
- s && (e.value = l, s.value = l);
234
- }, e.setCursorToEnd = function() {
235
- var l = U(e.maskOptions, e.value), s = W(e.maskOptions, l);
236
- s !== null && e.setCursorPosition(s);
237
- }, e.setSelection = function(l, s, f) {
238
- f === void 0 && (f = {});
239
- var m = e.getInputDOMNode(), v = e.isFocused();
240
- m && v && (f.deferred || j(m, l, s), e.selectionDeferId !== null && K(e.selectionDeferId), e.selectionDeferId = te(function() {
241
- e.selectionDeferId = null, j(m, l, s);
242
- }), e.previousSelection = { start: l, end: s, length: Math.abs(s - l) });
243
- }, e.getSelection = function() {
244
- return A(e.getInputDOMNode());
245
- }, e.getCursorPosition = function() {
246
- return e.getSelection().start;
247
- }, e.setCursorPosition = function(l) {
248
- e.setSelection(l, l);
249
- }, e.isFocused = function() {
250
- return e.focused;
251
- }, e.getBeforeMaskedValueChangeConfig = function() {
252
- var l = e.maskOptions, s = l.mask, f = l.maskChar, m = l.permanents, v = l.formatChars;
253
- return { mask: s, maskChar: f, permanents: m, alwaysShowMask: !!e.props.alwaysShowMask, formatChars: v };
254
- }, e.isInputAutofilled = function(l, s, f, m) {
255
- var v = e.getInputDOMNode();
256
- try {
257
- if (v.matches(":-webkit-autofill")) return !0;
258
- } catch {
259
- }
260
- return !e.focused || m.end < f.length && s.end === l.length;
261
- }, e.onChange = function(l) {
262
- var s = y(y(e)).beforePasteState, f = y(y(e)).previousSelection, m = e.props.beforeMaskedValueChange, v = e.getInputValue(), w = e.value, M = e.getSelection();
263
- e.isInputAutofilled(v, M, w, f) && (w = F(e.maskOptions, ""), f = { start: 0, end: 0, length: 0 }), s && (f = s.selection, w = s.value, M = { start: f.start + v.length, end: f.start + v.length, length: 0 }, v = w.slice(0, f.start) + v + w.slice(f.end), e.beforePasteState = null);
264
- var E = se(e.maskOptions, v, M, w, f), P = E.enteredString, x = E.selection, B = E.value;
265
- if (b(m)) {
266
- var X = m({ value: B, selection: x }, { value: w, selection: f }, P, e.getBeforeMaskedValueChangeConfig());
267
- B = X.value, x = X.selection;
268
- }
269
- e.setInputValue(B), b(e.props.onChange) && e.props.onChange(l), e.isWindowsPhoneBrowser ? e.setSelection(x.start, x.end, { deferred: !0 }) : e.setSelection(x.start, x.end);
270
- }, e.onFocus = function(l) {
271
- var s = e.props.beforeMaskedValueChange, f = e.maskOptions, m = f.mask, v = f.prefix;
272
- if (e.focused = !0, e.mounted = !0, m) {
273
- if (e.value) U(e.maskOptions, e.value) < e.maskOptions.mask.length && e.setCursorToEnd();
274
- else {
275
- var w = F(e.maskOptions, v), M = F(e.maskOptions, w), E = U(e.maskOptions, M), P = W(e.maskOptions, E), x = { start: P, end: P };
276
- if (b(s)) {
277
- var B = s({ value: M, selection: x }, { value: e.value, selection: null }, null, e.getBeforeMaskedValueChangeConfig());
278
- M = B.value, x = B.selection;
279
- }
280
- var X = M !== e.getInputValue();
281
- X && e.setInputValue(M), X && b(e.props.onChange) && e.props.onChange(l), e.setSelection(x.start, x.end);
282
- }
283
- e.runSaveSelectionLoop();
284
- }
285
- b(e.props.onFocus) && e.props.onFocus(l);
286
- }, e.onBlur = function(l) {
287
- var s = e.props.beforeMaskedValueChange, f = e.maskOptions.mask;
288
- if (e.stopSaveSelectionLoop(), e.focused = !1, f && !e.props.alwaysShowMask && q(e.maskOptions, e.value)) {
289
- var m = "";
290
- b(s) && (m = s({ value: m, selection: null }, { value: e.value, selection: e.previousSelection }, null, e.getBeforeMaskedValueChangeConfig()).value);
291
- var v = m !== e.getInputValue();
292
- v && e.setInputValue(m), v && b(e.props.onChange) && e.props.onChange(l);
293
- }
294
- b(e.props.onBlur) && e.props.onBlur(l);
295
- }, e.onMouseDown = function(l) {
296
- if (!e.focused && document.addEventListener) {
297
- e.mouseDownX = l.clientX, e.mouseDownY = l.clientY, e.mouseDownTime = (/* @__PURE__ */ new Date()).getTime();
298
- var s = function f(m) {
299
- if (document.removeEventListener("mouseup", f), e.focused) {
300
- var v = Math.abs(m.clientX - e.mouseDownX), w = Math.abs(m.clientY - e.mouseDownY), M = Math.max(v, w), E = (/* @__PURE__ */ new Date()).getTime() - e.mouseDownTime;
301
- (M <= 10 && E <= 200 || M <= 5 && E <= 300) && e.setCursorToEnd();
302
- }
303
- };
304
- document.addEventListener("mouseup", s);
305
- }
306
- b(e.props.onMouseDown) && e.props.onMouseDown(l);
307
- }, e.onPaste = function(l) {
308
- b(e.props.onPaste) && e.props.onPaste(l), l.defaultPrevented || (e.beforePasteState = { value: e.getInputValue(), selection: e.getSelection() }, e.setInputValue(""));
309
- }, e.handleRef = function(l) {
310
- e.props.children == null && b(e.props.inputRef) && e.props.inputRef(l);
311
- };
312
- var o = n.mask, d = n.maskChar, k = n.formatChars, i = n.alwaysShowMask, c = n.beforeMaskedValueChange, p = n.defaultValue, h = n.value;
313
- e.maskOptions = D(o, d, k), p == null && (p = ""), h == null && (h = p);
314
- var u = Z(h);
315
- if (e.maskOptions.mask && (i || u) && (u = F(e.maskOptions, u), b(c))) {
316
- var C = n.value;
317
- n.value == null && (C = p), u = c({ value: u, selection: null }, { value: C = Z(C), selection: null }, null, e.getBeforeMaskedValueChangeConfig()).value;
318
- }
319
- return e.value = u, e;
320
- }
321
- N(r, t);
322
- var a = r.prototype;
323
- return a.componentDidMount = function() {
324
- this.mounted = !0, this.getInputDOMNode() && (this.isWindowsPhoneBrowser = ie(), this.maskOptions.mask && this.getInputValue() !== this.value && this.setInputValue(this.value));
325
- }, a.componentDidUpdate = function() {
326
- var n = this.previousSelection, e = this.props, o = e.beforeMaskedValueChange, d = e.alwaysShowMask, k = e.mask, i = e.maskChar, c = e.formatChars, p = this.maskOptions, h = d || this.isFocused(), u = this.props.value != null, C = u ? Z(this.props.value) : this.value, l = n ? n.start : null;
327
- if (this.maskOptions = D(k, i, c), this.maskOptions.mask) {
328
- !p.mask && this.isFocused() && this.runSaveSelectionLoop();
329
- var s = this.maskOptions.mask && this.maskOptions.mask !== p.mask;
330
- if (p.mask || u || (C = this.getInputValue()), (s || this.maskOptions.mask && (C || h)) && (C = F(this.maskOptions, C)), s) {
331
- var f = U(this.maskOptions, C);
332
- (l === null || f < l) && (l = Q(this.maskOptions, C) ? f : W(this.maskOptions, f));
333
- }
334
- !this.maskOptions.mask || !q(this.maskOptions, C) || h || u && this.props.value || (C = "");
335
- var m = { start: l, end: l };
336
- if (b(o)) {
337
- var v = o({ value: C, selection: m }, { value: this.value, selection: this.previousSelection }, null, this.getBeforeMaskedValueChangeConfig());
338
- C = v.value, m = v.selection;
339
- }
340
- this.value = C;
341
- var w = this.getInputValue() !== this.value;
342
- w ? (this.setInputValue(this.value), this.forceUpdate()) : s && this.forceUpdate();
343
- var M = !1;
344
- m.start != null && m.end != null && (M = !n || n.start !== m.start || n.end !== m.end), (M || w) && this.setSelection(m.start, m.end);
345
- } else p.mask && (this.stopSaveSelectionLoop(), this.forceUpdate());
346
- }, a.componentWillUnmount = function() {
347
- this.mounted = !1, this.selectionDeferId !== null && K(this.selectionDeferId), this.stopSaveSelectionLoop();
348
- }, a.render = function() {
349
- var n, e = this.props, o = (e.mask, e.alwaysShowMask, e.maskChar, e.formatChars, e.inputRef, e.beforeMaskedValueChange, e.children), d = R(e, ["mask", "alwaysShowMask", "maskChar", "formatChars", "inputRef", "beforeMaskedValueChange", "children"]);
350
- if (o) {
351
- b(o) || _(!1);
352
- var k = ["onChange", "onPaste", "onMouseDown", "onFocus", "onBlur", "value", "disabled", "readOnly"], i = O({}, d);
353
- k.forEach(function(p) {
354
- return delete i[p];
355
- }), n = o(i), k.filter(function(p) {
356
- return n.props[p] != null && n.props[p] !== d[p];
357
- }).length && _(!1);
358
- } else n = I.createElement("input", O({ ref: this.handleRef }, d));
359
- var c = { onFocus: this.onFocus, onBlur: this.onBlur };
360
- return this.maskOptions.mask && (d.disabled || d.readOnly || (c.onChange = this.onChange, c.onPaste = this.onPaste, c.onMouseDown = this.onMouseDown), d.value != null && (c.value = this.value)), n = I.cloneElement(n, c);
361
- }, r;
362
- })(I.Component);
363
- return ce = ue, ce;
364
- }
365
- var he, ke;
366
- function Oe() {
367
- if (ke) return he;
368
- ke = 1;
369
- var S = function(I, L, V, O, N, R, y, z) {
370
- if (process.env.NODE_ENV !== "production" && L === void 0)
371
- throw new Error("invariant requires an error message argument");
372
- if (!I) {
373
- var _;
374
- if (L === void 0)
375
- _ = new Error(
376
- "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
377
- );
378
- else {
379
- var j = [V, O, N, R, y, z], A = 0;
380
- _ = new Error(
381
- L.replace(/%s/g, function() {
382
- return j[A++];
383
- })
384
- ), _.name = "Invariant Violation";
385
- }
386
- throw _.framesToPop = 1, _;
387
- }
388
- };
389
- return he = S, he;
390
- }
391
- var pe, we;
392
- function _e() {
393
- if (we) return pe;
394
- we = 1;
395
- var S = process.env.NODE_ENV !== "production", I = function() {
396
- };
397
- if (S) {
398
- var L = function(O, N) {
399
- var R = arguments.length;
400
- N = new Array(R > 1 ? R - 1 : 0);
401
- for (var y = 1; y < R; y++)
402
- N[y - 1] = arguments[y];
403
- var z = 0, _ = "Warning: " + O.replace(/%s/g, function() {
404
- return N[z++];
405
- });
406
- typeof console < "u" && console.error(_);
407
- try {
408
- throw new Error(_);
409
- } catch {
410
- }
411
- };
412
- I = function(V, O, N) {
413
- var R = arguments.length;
414
- N = new Array(R > 2 ? R - 2 : 0);
415
- for (var y = 2; y < R; y++)
416
- N[y - 2] = arguments[y];
417
- if (O === void 0)
418
- throw new Error(
419
- "`warning(condition, format, ...args)` requires a warning message argument"
420
- );
421
- V || L.apply(null, [O].concat(N));
422
- };
423
- }
424
- return pe = I, pe;
425
- }
426
- var de, Se;
427
- function Ve() {
428
- if (Se) return de;
429
- Se = 1;
430
- function S(t) {
431
- return t && typeof t == "object" && "default" in t ? t.default : t;
432
- }
433
- var I = S(Me), L = Ie(), V = S(Oe()), O = S(_e());
434
- function N(t, r) {
435
- for (var a = Object.getOwnPropertyNames(r), n = 0; n < a.length; n++) {
436
- var e = a[n], o = Object.getOwnPropertyDescriptor(r, e);
437
- o && o.configurable && t[e] === void 0 && Object.defineProperty(t, e, o);
438
- }
439
- return t;
440
- }
441
- function R() {
442
- return R = Object.assign || function(t) {
443
- for (var r = 1; r < arguments.length; r++) {
444
- var a = arguments[r];
445
- for (var n in a)
446
- Object.prototype.hasOwnProperty.call(a, n) && (t[n] = a[n]);
447
- }
448
- return t;
449
- }, R.apply(this, arguments);
450
- }
451
- function y(t, r) {
452
- t.prototype = Object.create(r.prototype), t.prototype.constructor = t, N(t, r);
453
- }
454
- function z(t, r) {
455
- if (t == null) return {};
456
- var a = {}, n = Object.keys(t), e, o;
457
- for (o = 0; o < n.length; o++)
458
- e = n[o], !(r.indexOf(e) >= 0) && (a[e] = t[e]);
459
- return a;
460
- }
461
- function _(t) {
462
- if (t === void 0)
463
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
464
- return t;
465
- }
466
- function j(t, r, a) {
467
- if ("selectionStart" in t && "selectionEnd" in t)
468
- t.selectionStart = r, t.selectionEnd = a;
469
- else {
470
- var n = t.createTextRange();
471
- n.collapse(!0), n.moveStart("character", r), n.moveEnd("character", a - r), n.select();
472
- }
473
- }
474
- function A(t) {
475
- var r = 0, a = 0;
476
- if ("selectionStart" in t && "selectionEnd" in t)
477
- r = t.selectionStart, a = t.selectionEnd;
478
- else {
479
- var n = document.selection.createRange();
480
- n.parentElement() === t && (r = -n.moveStart("character", -t.value.length), a = -n.moveEnd("character", -t.value.length));
481
- }
482
- return {
483
- start: r,
484
- end: a,
485
- length: a - r
486
- };
487
- }
488
- var G = {
489
- 9: "[0-9]",
490
- a: "[A-Za-z]",
491
- "*": "[A-Za-z0-9]"
492
- }, J = "_";
493
- function D(t, r, a) {
494
- var n = "", e = "", o = null, d = [];
495
- if (r === void 0 && (r = J), a == null && (a = G), !t || typeof t != "string")
496
- return {
497
- maskChar: r,
498
- formatChars: a,
499
- mask: null,
500
- prefix: null,
501
- lastEditablePosition: null,
502
- permanents: []
503
- };
504
- var k = !1;
505
- return t.split("").forEach(function(i) {
506
- !k && i === "\\" ? k = !0 : (k || !a[i] ? (d.push(n.length), n.length === d.length - 1 && (e += i)) : o = n.length + 1, n += i, k = !1);
507
- }), {
508
- maskChar: r,
509
- formatChars: a,
510
- prefix: e,
511
- mask: n,
512
- lastEditablePosition: o,
513
- permanents: d
514
- };
515
- }
516
- function g(t, r) {
517
- return t.permanents.indexOf(r) !== -1;
518
- }
519
- function T(t, r, a) {
520
- var n = t.mask, e = t.formatChars;
521
- if (!a)
522
- return !1;
523
- if (g(t, r))
524
- return n[r] === a;
525
- var o = n[r], d = e[o];
526
- return new RegExp(d).test(a);
527
- }
528
- function q(t, r) {
529
- return r.split("").every(function(a, n) {
530
- return g(t, n) || !T(t, n, a);
531
- });
532
- }
533
- function U(t, r) {
534
- var a = t.maskChar, n = t.prefix;
535
- if (!a) {
536
- for (; r.length > n.length && g(t, r.length - 1); )
537
- r = r.slice(0, r.length - 1);
538
- return r.length;
539
- }
540
- for (var e = n.length, o = r.length; o >= n.length; o--) {
541
- var d = r[o], k = !g(t, o) && T(t, o, d);
542
- if (k) {
543
- e = o + 1;
544
- break;
545
- }
546
- }
547
- return e;
548
- }
549
- function Q(t, r) {
550
- return U(t, r) === t.mask.length;
551
- }
552
- function F(t, r) {
553
- var a = t.maskChar, n = t.mask, e = t.prefix;
554
- if (!a) {
555
- for (r = $(t, "", r, 0), r.length < e.length && (r = e); r.length < n.length && g(t, r.length); )
556
- r += n[r.length];
557
- return r;
558
- }
559
- if (r) {
560
- var o = F(t, "");
561
- return $(t, o, r, 0);
562
- }
563
- for (var d = 0; d < n.length; d++)
564
- g(t, d) ? r += n[d] : r += a;
565
- return r;
566
- }
567
- function re(t, r, a, n) {
568
- var e = a + n, o = t.maskChar, d = t.mask, k = t.prefix, i = r.split("");
569
- if (!o) {
570
- for (var c = e; c < i.length; c++)
571
- g(t, c) && (i[c] = "");
572
- return a = Math.max(k.length, a), i.splice(a, e - a), r = i.join(""), F(t, r);
573
- }
574
- return i.map(function(p, h) {
575
- return h < a || h >= e ? p : g(t, h) ? d[h] : o;
576
- }).join("");
577
- }
578
- function $(t, r, a, n) {
579
- var e = t.mask, o = t.maskChar, d = t.prefix, k = a.split(""), i = Q(t, r), c = function(u, C) {
580
- return !g(t, u) || C === e[u];
581
- }, p = function(u, C) {
582
- return !o || !g(t, C) || u !== o;
583
- };
584
- return !o && n > r.length && (r += e.slice(r.length, n)), k.every(function(h) {
585
- for (; !c(n, h); ) {
586
- if (n >= r.length && (r += e[n]), !p(h, n))
587
- return !0;
588
- if (n++, n >= e.length)
589
- return !1;
590
- }
591
- var u = T(t, n, h) || h === o;
592
- return u ? (n < r.length ? o || i || n < d.length ? r = r.slice(0, n) + h + r.slice(n + 1) : (r = r.slice(0, n) + h + r.slice(n), r = F(t, r)) : o || (r += h), n++, n < e.length) : !0;
593
- }), r;
594
- }
595
- function ae(t, r, a, n) {
596
- var e = t.mask, o = t.maskChar, d = a.split(""), k = n, i = function(p, h) {
597
- return !g(t, p) || h === e[p];
598
- };
599
- return d.every(function(c) {
600
- for (; !i(n, c); )
601
- if (n++, n >= e.length)
602
- return !1;
603
- var p = T(t, n, c) || c === o;
604
- return p && n++, n < e.length;
605
- }), n - k;
606
- }
607
- function oe(t, r) {
608
- for (var a = r; a >= 0; --a)
609
- if (!g(t, a))
610
- return a;
611
- return null;
612
- }
613
- function W(t, r) {
614
- for (var a = t.mask, n = r; n < a.length; ++n)
615
- if (!g(t, n))
616
- return n;
617
- return null;
618
- }
619
- function Z(t) {
620
- return !t && t !== 0 ? "" : t + "";
621
- }
622
- function se(t, r, a, n, e) {
623
- var o = t.mask, d = t.prefix, k = t.lastEditablePosition, i = r, c = "", p = 0, h = 0, u = Math.min(e.start, a.start);
624
- if (a.end > e.start ? (c = i.slice(e.start, a.end), p = ae(t, n, c, u), p ? h = e.length : h = 0) : i.length < n.length && (h = n.length - i.length), i = n, h) {
625
- if (h === 1 && !e.length) {
626
- var C = e.start === a.start;
627
- u = C ? W(t, a.start) : oe(t, a.start);
628
- }
629
- i = re(t, i, u, h);
630
- }
631
- return i = $(t, i, c, u), u = u + p, u >= o.length ? u = o.length : u < d.length && !p ? u = d.length : u >= d.length && u < k && p && (u = W(t, u)), i = F(t, i), c || (c = null), {
632
- value: i,
633
- enteredString: c,
634
- selection: {
635
- start: u,
636
- end: u
637
- }
638
- };
639
- }
640
- function ie() {
641
- var t = new RegExp("windows", "i"), r = new RegExp("phone", "i"), a = navigator.userAgent;
642
- return t.test(a) && r.test(a);
643
- }
644
- function b(t) {
645
- return typeof t == "function";
646
- }
647
- function le() {
648
- return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame;
649
- }
650
- function ee() {
651
- return window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame;
652
- }
653
- function te(t) {
654
- var r = !!ee(), a;
655
- return r ? a = le() : a = function() {
656
- return setTimeout(t, 1e3 / 60);
657
- }, a(t);
658
- }
659
- function K(t) {
660
- var r = ee() || clearTimeout;
661
- r(t);
662
- }
663
- var ue = /* @__PURE__ */ (function(t) {
664
- y(r, t);
665
- function r(n) {
666
- var e;
667
- e = t.call(this, n) || this, e.focused = !1, e.mounted = !1, e.previousSelection = null, e.selectionDeferId = null, e.saveSelectionLoopDeferId = null, e.saveSelectionLoop = function() {
668
- e.previousSelection = e.getSelection(), e.saveSelectionLoopDeferId = te(e.saveSelectionLoop);
669
- }, e.runSaveSelectionLoop = function() {
670
- e.saveSelectionLoopDeferId === null && e.saveSelectionLoop();
671
- }, e.stopSaveSelectionLoop = function() {
672
- e.saveSelectionLoopDeferId !== null && (K(e.saveSelectionLoopDeferId), e.saveSelectionLoopDeferId = null, e.previousSelection = null);
673
- }, e.getInputDOMNode = function() {
674
- if (!e.mounted)
675
- return null;
676
- var s = L.findDOMNode(_(_(e))), f = typeof window < "u" && s instanceof window.Element;
677
- if (s && !f)
678
- return null;
679
- if (s.nodeName !== "INPUT" && (s = s.querySelector("input")), !s)
680
- throw new Error("react-input-mask: inputComponent doesn't contain input node");
681
- return s;
682
- }, e.getInputValue = function() {
683
- var s = e.getInputDOMNode();
684
- return s ? s.value : null;
685
- }, e.setInputValue = function(s) {
686
- var f = e.getInputDOMNode();
687
- f && (e.value = s, f.value = s);
688
- }, e.setCursorToEnd = function() {
689
- var s = U(e.maskOptions, e.value), f = W(e.maskOptions, s);
690
- f !== null && e.setCursorPosition(f);
691
- }, e.setSelection = function(s, f, m) {
692
- m === void 0 && (m = {});
693
- var v = e.getInputDOMNode(), w = e.isFocused();
694
- if (!(!v || !w)) {
695
- var M = m, E = M.deferred;
696
- E || j(v, s, f), e.selectionDeferId !== null && K(e.selectionDeferId), e.selectionDeferId = te(function() {
697
- e.selectionDeferId = null, j(v, s, f);
698
- }), e.previousSelection = {
699
- start: s,
700
- end: f,
701
- length: Math.abs(f - s)
702
- };
703
- }
704
- }, e.getSelection = function() {
705
- var s = e.getInputDOMNode();
706
- return A(s);
707
- }, e.getCursorPosition = function() {
708
- return e.getSelection().start;
709
- }, e.setCursorPosition = function(s) {
710
- e.setSelection(s, s);
711
- }, e.isFocused = function() {
712
- return e.focused;
713
- }, e.getBeforeMaskedValueChangeConfig = function() {
714
- var s = e.maskOptions, f = s.mask, m = s.maskChar, v = s.permanents, w = s.formatChars, M = e.props.alwaysShowMask;
715
- return {
716
- mask: f,
717
- maskChar: m,
718
- permanents: v,
719
- alwaysShowMask: !!M,
720
- formatChars: w
721
- };
722
- }, e.isInputAutofilled = function(s, f, m, v) {
723
- var w = e.getInputDOMNode();
724
- try {
725
- if (w.matches(":-webkit-autofill"))
726
- return !0;
727
- } catch {
728
- }
729
- return e.focused ? v.end < m.length && f.end === s.length : !0;
730
- }, e.onChange = function(s) {
731
- var f = _(_(e)), m = f.beforePasteState, v = _(_(e)), w = v.previousSelection, M = e.props.beforeMaskedValueChange, E = e.getInputValue(), P = e.value, x = e.getSelection();
732
- e.isInputAutofilled(E, x, P, w) && (P = F(e.maskOptions, ""), w = {
733
- start: 0,
734
- end: 0,
735
- length: 0
736
- }), m && (w = m.selection, P = m.value, x = {
737
- start: w.start + E.length,
738
- end: w.start + E.length,
739
- length: 0
740
- }, E = P.slice(0, w.start) + E + P.slice(w.end), e.beforePasteState = null);
741
- var B = se(e.maskOptions, E, x, P, w), X = B.enteredString, Y = B.selection, fe = B.value;
742
- if (b(M)) {
743
- var me = M({
744
- value: fe,
745
- selection: Y
746
- }, {
747
- value: P,
748
- selection: w
749
- }, X, e.getBeforeMaskedValueChangeConfig());
750
- fe = me.value, Y = me.selection;
751
- }
752
- e.setInputValue(fe), b(e.props.onChange) && e.props.onChange(s), e.isWindowsPhoneBrowser ? e.setSelection(Y.start, Y.end, {
753
- deferred: !0
754
- }) : e.setSelection(Y.start, Y.end);
755
- }, e.onFocus = function(s) {
756
- var f = e.props.beforeMaskedValueChange, m = e.maskOptions, v = m.mask, w = m.prefix;
757
- if (e.focused = !0, e.mounted = !0, v) {
758
- if (e.value)
759
- U(e.maskOptions, e.value) < e.maskOptions.mask.length && e.setCursorToEnd();
760
- else {
761
- var M = F(e.maskOptions, w), E = F(e.maskOptions, M), P = U(e.maskOptions, E), x = W(e.maskOptions, P), B = {
762
- start: x,
763
- end: x
764
- };
765
- if (b(f)) {
766
- var X = f({
767
- value: E,
768
- selection: B
769
- }, {
770
- value: e.value,
771
- selection: null
772
- }, null, e.getBeforeMaskedValueChangeConfig());
773
- E = X.value, B = X.selection;
774
- }
775
- var Y = E !== e.getInputValue();
776
- Y && e.setInputValue(E), Y && b(e.props.onChange) && e.props.onChange(s), e.setSelection(B.start, B.end);
777
- }
778
- e.runSaveSelectionLoop();
779
- }
780
- b(e.props.onFocus) && e.props.onFocus(s);
781
- }, e.onBlur = function(s) {
782
- var f = e.props.beforeMaskedValueChange, m = e.maskOptions.mask;
783
- if (e.stopSaveSelectionLoop(), e.focused = !1, m && !e.props.alwaysShowMask && q(e.maskOptions, e.value)) {
784
- var v = "";
785
- if (b(f)) {
786
- var w = f({
787
- value: v,
788
- selection: null
789
- }, {
790
- value: e.value,
791
- selection: e.previousSelection
792
- }, null, e.getBeforeMaskedValueChangeConfig());
793
- v = w.value;
794
- }
795
- var M = v !== e.getInputValue();
796
- M && e.setInputValue(v), M && b(e.props.onChange) && e.props.onChange(s);
797
- }
798
- b(e.props.onBlur) && e.props.onBlur(s);
799
- }, e.onMouseDown = function(s) {
800
- if (!e.focused && document.addEventListener) {
801
- e.mouseDownX = s.clientX, e.mouseDownY = s.clientY, e.mouseDownTime = (/* @__PURE__ */ new Date()).getTime();
802
- var f = function m(v) {
803
- if (document.removeEventListener("mouseup", m), !!e.focused) {
804
- var w = Math.abs(v.clientX - e.mouseDownX), M = Math.abs(v.clientY - e.mouseDownY), E = Math.max(w, M), P = (/* @__PURE__ */ new Date()).getTime() - e.mouseDownTime;
805
- (E <= 10 && P <= 200 || E <= 5 && P <= 300) && e.setCursorToEnd();
806
- }
807
- };
808
- document.addEventListener("mouseup", f);
809
- }
810
- b(e.props.onMouseDown) && e.props.onMouseDown(s);
811
- }, e.onPaste = function(s) {
812
- b(e.props.onPaste) && e.props.onPaste(s), s.defaultPrevented || (e.beforePasteState = {
813
- value: e.getInputValue(),
814
- selection: e.getSelection()
815
- }, e.setInputValue(""));
816
- }, e.handleRef = function(s) {
817
- e.props.children == null && b(e.props.inputRef) && e.props.inputRef(s);
818
- };
819
- var o = n.mask, d = n.maskChar, k = n.formatChars, i = n.alwaysShowMask, c = n.beforeMaskedValueChange, p = n.defaultValue, h = n.value;
820
- e.maskOptions = D(o, d, k), p == null && (p = ""), h == null && (h = p);
821
- var u = Z(h);
822
- if (e.maskOptions.mask && (i || u) && (u = F(e.maskOptions, u), b(c))) {
823
- var C = n.value;
824
- n.value == null && (C = p), C = Z(C);
825
- var l = c({
826
- value: u,
827
- selection: null
828
- }, {
829
- value: C,
830
- selection: null
831
- }, null, e.getBeforeMaskedValueChangeConfig());
832
- u = l.value;
833
- }
834
- return e.value = u, e;
835
- }
836
- var a = r.prototype;
837
- return a.componentDidMount = function() {
838
- this.mounted = !0, this.getInputDOMNode() && (this.isWindowsPhoneBrowser = ie(), this.maskOptions.mask && this.getInputValue() !== this.value && this.setInputValue(this.value));
839
- }, a.componentDidUpdate = function() {
840
- var e = this.previousSelection, o = this.props, d = o.beforeMaskedValueChange, k = o.alwaysShowMask, i = o.mask, c = o.maskChar, p = o.formatChars, h = this.maskOptions, u = k || this.isFocused(), C = this.props.value != null, l = C ? Z(this.props.value) : this.value, s = e ? e.start : null;
841
- if (this.maskOptions = D(i, c, p), this.maskOptions.mask)
842
- !h.mask && this.isFocused() && this.runSaveSelectionLoop();
843
- else {
844
- h.mask && (this.stopSaveSelectionLoop(), this.forceUpdate());
845
- return;
846
- }
847
- var f = this.maskOptions.mask && this.maskOptions.mask !== h.mask;
848
- if (!h.mask && !C && (l = this.getInputValue()), (f || this.maskOptions.mask && (l || u)) && (l = F(this.maskOptions, l)), f) {
849
- var m = U(this.maskOptions, l);
850
- (s === null || m < s) && (Q(this.maskOptions, l) ? s = m : s = W(this.maskOptions, m));
851
- }
852
- this.maskOptions.mask && q(this.maskOptions, l) && !u && (!C || !this.props.value) && (l = "");
853
- var v = {
854
- start: s,
855
- end: s
856
- };
857
- if (b(d)) {
858
- var w = d({
859
- value: l,
860
- selection: v
861
- }, {
862
- value: this.value,
863
- selection: this.previousSelection
864
- }, null, this.getBeforeMaskedValueChangeConfig());
865
- l = w.value, v = w.selection;
866
- }
867
- this.value = l;
868
- var M = this.getInputValue() !== this.value;
869
- M ? (this.setInputValue(this.value), this.forceUpdate()) : f && this.forceUpdate();
870
- var E = !1;
871
- v.start != null && v.end != null && (E = !e || e.start !== v.start || e.end !== v.end), (E || M) && this.setSelection(v.start, v.end);
872
- }, a.componentWillUnmount = function() {
873
- this.mounted = !1, this.selectionDeferId !== null && K(this.selectionDeferId), this.stopSaveSelectionLoop();
874
- }, a.render = function() {
875
- var e = this.props, o = e.mask;
876
- e.alwaysShowMask;
877
- var d = e.maskChar, k = e.formatChars, i = e.inputRef;
878
- e.beforeMaskedValueChange;
879
- var c = e.children, p = z(e, ["mask", "alwaysShowMask", "maskChar", "formatChars", "inputRef", "beforeMaskedValueChange", "children"]), h;
880
- if (process.env.NODE_ENV !== "production" && O(
881
- // parse mask to test against actual mask prop as this.maskOptions
882
- // will be updated later in componentDidUpdate
883
- !p.maxLength || !D(o, d, k).mask,
884
- "react-input-mask: maxLength property shouldn't be passed to the masked input. It breaks masking and unnecessary because length is limited by the mask length."
885
- ), c) {
886
- b(c) || (process.env.NODE_ENV !== "production" ? V(!1, "react-input-mask: children must be a function") : V(!1));
887
- var u = ["onChange", "onPaste", "onMouseDown", "onFocus", "onBlur", "value", "disabled", "readOnly"], C = R({}, p);
888
- u.forEach(function(f) {
889
- return delete C[f];
890
- }), h = c(C);
891
- var l = u.filter(function(f) {
892
- return h.props[f] != null && h.props[f] !== p[f];
893
- });
894
- l.length && (process.env.NODE_ENV !== "production" ? V(!1, "react-input-mask: the following props should be passed to the react-input-mask's component and should not be altered in children's function: " + l.join(", ")) : V(!1)), process.env.NODE_ENV !== "production" && O(!i, "react-input-mask: inputRef is ignored when children is passed, attach ref to the children instead");
895
- } else
896
- h = I.createElement("input", R({
897
- ref: this.handleRef
898
- }, p));
899
- var s = {
900
- onFocus: this.onFocus,
901
- onBlur: this.onBlur
902
- };
903
- return this.maskOptions.mask && (!p.disabled && !p.readOnly && (s.onChange = this.onChange, s.onPaste = this.onPaste, s.onMouseDown = this.onMouseDown), p.value != null && (s.value = this.value)), h = I.cloneElement(h, s), h;
904
- }, r;
905
- })(I.Component);
906
- return de = ue, de;
907
- }
908
- var Ce;
909
- function Re() {
910
- return Ce || (Ce = 1, process.env.NODE_ENV === "production" ? ne.exports = ye() : ne.exports = Ve()), ne.exports;
911
- }
912
- var Fe = Re();
913
- const Le = /* @__PURE__ */ Ee(Fe), xe = "_Input_1df40_1", H = {
914
- Input: xe,
915
- "autofill-start": "_autofill-start_1df40_1",
916
- "autofill-cancel": "_autofill-cancel_1df40_1"
917
- }, je = ({
918
- id: S,
919
- value: I,
920
- disabled: L = !1,
921
- dateMask: V = !1,
922
- maxLength: O,
923
- type: N = "text",
924
- onAutofill: R,
925
- onAutofillCancel: y,
926
- onChange: z,
927
- onFocus: _,
928
- onBlur: j
929
- }) => {
930
- const A = De(null), G = (D) => {
931
- const g = be(I);
932
- g < I.length - 1 && A.current && (D.preventDefault(), A.current.setSelectionRange(g + 1, g + 1, "none"));
933
- }, J = (D) => {
934
- if ((D.code === "ArrowUp" || D.code === "ArrowDown") && D.preventDefault(), D.code === "ArrowRight" && A.current) {
935
- const g = A.current.selectionStart || 0, T = I[g + 1] === "/" ? I[g + 2] : I[g + 1];
936
- if (!/^\d+$/.test(T))
937
- D.preventDefault();
938
- else {
939
- const q = I[g + 1] === "/" ? 1 : 0;
940
- A.current.setSelectionRange(g + q, g + q, "none");
941
- }
942
- }
943
- if (D.code === "ArrowLeft" && A.current) {
944
- D.preventDefault();
945
- const g = A.current.selectionStart || 0, T = I[g - 1] === "/" ? I[g - 2] : I[g - 1];
946
- if (!/^\d+$/.test(T))
947
- D.preventDefault();
948
- else {
949
- const q = I[g - 1] === "/" ? 2 : 1;
950
- A.current.setSelectionRange(g - q, g - q, "none");
951
- }
952
- }
953
- };
954
- return V ? /* @__PURE__ */ ve(
955
- Le,
956
- {
957
- "data-testid": "input-masked",
958
- ref: A,
959
- value: I,
960
- id: S,
961
- className: H.Input,
962
- disabled: L,
963
- mask: "99/99/9999",
964
- maskChar: "_",
965
- alwaysShowMask: !1,
966
- onClick: G,
967
- onKeyDown: J,
968
- onChange: (D) => z(D.target.value, S, "keyboard"),
969
- onAnimationStart: (D) => {
970
- D.animationName === H["autofill-start"] && R?.call(null, S), D.animationName === H["autofill-cancel"] && (D.currentTarget.blur(), y?.call(null, S));
971
- },
972
- onFocus: () => _?.call(null, S),
973
- onBlur: () => j?.call(null, S)
974
- }
975
- ) : /* @__PURE__ */ ve(
976
- "input",
977
- {
978
- "data-testid": "input",
979
- disabled: L,
980
- maxLength: O,
981
- type: N,
982
- id: S,
983
- name: S,
984
- value: I,
985
- className: H.Input,
986
- onChange: (D) => z(D.target.value, S, "keyboard"),
987
- onAnimationStart: (D) => {
988
- D.animationName === H["autofill-start"] && R?.call(null, S), D.animationName === H["autofill-cancel"] && (D.currentTarget.blur(), y?.call(null, S));
989
- },
990
- onFocus: () => _?.call(null, S),
991
- onBlur: () => j?.call(null, S)
992
- }
993
- );
994
- };
995
- export {
996
- je as I,
997
- Ee as a,
998
- Te as g
999
- };