@7pmlabs/design-system 0.2.7 → 0.2.8

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 (443) hide show
  1. package/dist/design-system.js +1 -1
  2. package/dist/design-system.mjs +71 -67
  3. package/dist/design-system.mjs.map +1 -1
  4. package/dist/design-system10.js +1 -1
  5. package/dist/design-system10.js.map +1 -1
  6. package/dist/design-system10.mjs +77 -288
  7. package/dist/design-system10.mjs.map +1 -1
  8. package/dist/design-system102.js +1 -1
  9. package/dist/design-system102.mjs +13 -13
  10. package/dist/design-system11.js +1 -1
  11. package/dist/design-system11.js.map +1 -1
  12. package/dist/design-system11.mjs +76 -250
  13. package/dist/design-system11.mjs.map +1 -1
  14. package/dist/design-system12.js +1 -1
  15. package/dist/design-system12.js.map +1 -1
  16. package/dist/design-system12.mjs +279 -96
  17. package/dist/design-system12.mjs.map +1 -1
  18. package/dist/design-system13.js +1 -1
  19. package/dist/design-system13.js.map +1 -1
  20. package/dist/design-system13.mjs +253 -13
  21. package/dist/design-system13.mjs.map +1 -1
  22. package/dist/design-system132.js +1 -1
  23. package/dist/design-system132.js.map +1 -1
  24. package/dist/design-system132.mjs +8 -2
  25. package/dist/design-system132.mjs.map +1 -1
  26. package/dist/design-system133.js +1 -1
  27. package/dist/design-system133.js.map +1 -1
  28. package/dist/design-system133.mjs +10 -2
  29. package/dist/design-system133.mjs.map +1 -1
  30. package/dist/design-system134.js +1 -1
  31. package/dist/design-system134.mjs +2 -2
  32. package/dist/design-system135.js +1 -1
  33. package/dist/design-system135.js.map +1 -1
  34. package/dist/design-system135.mjs +2 -8
  35. package/dist/design-system135.mjs.map +1 -1
  36. package/dist/design-system136.js +1 -1
  37. package/dist/design-system136.js.map +1 -1
  38. package/dist/design-system136.mjs +15 -9
  39. package/dist/design-system136.mjs.map +1 -1
  40. package/dist/design-system138.js +1 -1
  41. package/dist/design-system138.js.map +1 -1
  42. package/dist/design-system138.mjs +6 -10
  43. package/dist/design-system138.mjs.map +1 -1
  44. package/dist/design-system139.js +1 -1
  45. package/dist/design-system139.js.map +1 -1
  46. package/dist/design-system139.mjs +5 -15
  47. package/dist/design-system139.mjs.map +1 -1
  48. package/dist/design-system14.js +1 -1
  49. package/dist/design-system14.js.map +1 -1
  50. package/dist/design-system14.mjs +102 -54
  51. package/dist/design-system14.mjs.map +1 -1
  52. package/dist/design-system140.js +1 -1
  53. package/dist/design-system140.js.map +1 -1
  54. package/dist/design-system140.mjs +8 -5
  55. package/dist/design-system140.mjs.map +1 -1
  56. package/dist/design-system141.js +1 -1
  57. package/dist/design-system141.js.map +1 -1
  58. package/dist/design-system141.mjs +6 -5
  59. package/dist/design-system141.mjs.map +1 -1
  60. package/dist/design-system142.js +1 -1
  61. package/dist/design-system142.js.map +1 -1
  62. package/dist/design-system142.mjs +5 -8
  63. package/dist/design-system142.mjs.map +1 -1
  64. package/dist/design-system143.js +1 -1
  65. package/dist/design-system143.js.map +1 -1
  66. package/dist/design-system143.mjs +5 -6
  67. package/dist/design-system143.mjs.map +1 -1
  68. package/dist/design-system144.js +1 -1
  69. package/dist/design-system144.js.map +1 -1
  70. package/dist/design-system144.mjs +5 -4
  71. package/dist/design-system144.mjs.map +1 -1
  72. package/dist/design-system145.js +1 -1
  73. package/dist/design-system145.js.map +1 -1
  74. package/dist/design-system145.mjs +6 -5
  75. package/dist/design-system145.mjs.map +1 -1
  76. package/dist/design-system146.js +1 -1
  77. package/dist/design-system146.js.map +1 -1
  78. package/dist/design-system146.mjs +5 -6
  79. package/dist/design-system146.mjs.map +1 -1
  80. package/dist/design-system147.js +1 -1
  81. package/dist/design-system147.js.map +1 -1
  82. package/dist/design-system147.mjs +39 -6
  83. package/dist/design-system147.mjs.map +1 -1
  84. package/dist/design-system148.js +1 -1
  85. package/dist/design-system148.js.map +1 -1
  86. package/dist/design-system148.mjs +4 -3
  87. package/dist/design-system148.mjs.map +1 -1
  88. package/dist/design-system149.js +1 -1
  89. package/dist/design-system149.js.map +1 -1
  90. package/dist/design-system149.mjs +9 -39
  91. package/dist/design-system149.mjs.map +1 -1
  92. package/dist/design-system15.js +1 -1
  93. package/dist/design-system15.js.map +1 -1
  94. package/dist/design-system15.mjs +14 -245
  95. package/dist/design-system15.mjs.map +1 -1
  96. package/dist/design-system150.js +1 -1
  97. package/dist/design-system150.js.map +1 -1
  98. package/dist/design-system150.mjs +5 -6
  99. package/dist/design-system150.mjs.map +1 -1
  100. package/dist/design-system151.js +1 -1
  101. package/dist/design-system151.js.map +1 -1
  102. package/dist/design-system151.mjs +2 -6
  103. package/dist/design-system151.mjs.map +1 -1
  104. package/dist/design-system16.js +1 -1
  105. package/dist/design-system16.js.map +1 -1
  106. package/dist/design-system16.mjs +54 -119
  107. package/dist/design-system16.mjs.map +1 -1
  108. package/dist/design-system17.js +1 -3
  109. package/dist/design-system17.js.map +1 -1
  110. package/dist/design-system17.mjs +240 -102
  111. package/dist/design-system17.mjs.map +1 -1
  112. package/dist/design-system178.js +1 -1
  113. package/dist/design-system178.mjs +1 -1
  114. package/dist/design-system179.js +1 -1
  115. package/dist/design-system179.mjs +1 -1
  116. package/dist/design-system18.js +1 -1
  117. package/dist/design-system18.js.map +1 -1
  118. package/dist/design-system18.mjs +111 -52
  119. package/dist/design-system18.mjs.map +1 -1
  120. package/dist/design-system180.js +1 -1
  121. package/dist/design-system180.mjs +1 -1
  122. package/dist/design-system181.js +1 -1
  123. package/dist/design-system181.mjs +5 -5
  124. package/dist/design-system19.js +3 -1
  125. package/dist/design-system19.js.map +1 -1
  126. package/dist/design-system19.mjs +102 -186
  127. package/dist/design-system19.mjs.map +1 -1
  128. package/dist/design-system194.js +1 -1
  129. package/dist/design-system194.mjs +5 -5
  130. package/dist/design-system195.js +1 -1
  131. package/dist/design-system195.mjs +1 -1
  132. package/dist/design-system196.js +1 -1
  133. package/dist/design-system196.js.map +1 -1
  134. package/dist/design-system196.mjs +3 -3
  135. package/dist/design-system196.mjs.map +1 -1
  136. package/dist/design-system197.js +1 -1
  137. package/dist/design-system197.js.map +1 -1
  138. package/dist/design-system197.mjs +3 -9
  139. package/dist/design-system197.mjs.map +1 -1
  140. package/dist/design-system198.js +1 -1
  141. package/dist/design-system198.js.map +1 -1
  142. package/dist/design-system198.mjs +9 -5
  143. package/dist/design-system198.mjs.map +1 -1
  144. package/dist/design-system199.js +1 -1
  145. package/dist/design-system199.js.map +1 -1
  146. package/dist/design-system199.mjs +5 -4
  147. package/dist/design-system199.mjs.map +1 -1
  148. package/dist/design-system2.js +1 -1
  149. package/dist/design-system2.mjs +2 -2
  150. package/dist/design-system20.js +1 -1
  151. package/dist/design-system20.js.map +1 -1
  152. package/dist/design-system20.mjs +53 -61
  153. package/dist/design-system20.mjs.map +1 -1
  154. package/dist/design-system200.js +1 -1
  155. package/dist/design-system200.js.map +1 -1
  156. package/dist/design-system200.mjs +4 -5
  157. package/dist/design-system200.mjs.map +1 -1
  158. package/dist/design-system201.js +1 -1
  159. package/dist/design-system201.js.map +1 -1
  160. package/dist/design-system201.mjs +5 -3
  161. package/dist/design-system201.mjs.map +1 -1
  162. package/dist/design-system203.js +1 -1
  163. package/dist/design-system203.js.map +1 -1
  164. package/dist/design-system203.mjs +3 -3
  165. package/dist/design-system203.mjs.map +1 -1
  166. package/dist/design-system204.js +1 -1
  167. package/dist/design-system204.js.map +1 -1
  168. package/dist/design-system204.mjs +4 -4
  169. package/dist/design-system204.mjs.map +1 -1
  170. package/dist/design-system205.js +1 -1
  171. package/dist/design-system205.js.map +1 -1
  172. package/dist/design-system205.mjs +4 -10
  173. package/dist/design-system205.mjs.map +1 -1
  174. package/dist/design-system206.js +1 -1
  175. package/dist/design-system206.js.map +1 -1
  176. package/dist/design-system206.mjs +10 -6
  177. package/dist/design-system206.mjs.map +1 -1
  178. package/dist/design-system207.js +1 -1
  179. package/dist/design-system207.js.map +1 -1
  180. package/dist/design-system207.mjs +6 -6
  181. package/dist/design-system207.mjs.map +1 -1
  182. package/dist/design-system208.js +1 -1
  183. package/dist/design-system208.js.map +1 -1
  184. package/dist/design-system208.mjs +6 -4
  185. package/dist/design-system208.mjs.map +1 -1
  186. package/dist/design-system21.js +1 -1
  187. package/dist/design-system21.js.map +1 -1
  188. package/dist/design-system21.mjs +187 -37
  189. package/dist/design-system21.mjs.map +1 -1
  190. package/dist/design-system22.js +1 -1
  191. package/dist/design-system22.js.map +1 -1
  192. package/dist/design-system22.mjs +78 -5
  193. package/dist/design-system22.mjs.map +1 -1
  194. package/dist/design-system23.js +1 -1
  195. package/dist/design-system23.js.map +1 -1
  196. package/dist/design-system23.mjs +46 -12
  197. package/dist/design-system23.mjs.map +1 -1
  198. package/dist/design-system24.js +1 -1
  199. package/dist/design-system24.mjs +4 -4
  200. package/dist/design-system25.js +1 -1
  201. package/dist/design-system25.mjs +11 -5
  202. package/dist/design-system25.mjs.map +1 -1
  203. package/dist/design-system26.js +1 -1
  204. package/dist/design-system26.mjs +5 -10
  205. package/dist/design-system26.mjs.map +1 -1
  206. package/dist/design-system27.js +1 -1
  207. package/dist/design-system27.js.map +1 -1
  208. package/dist/design-system27.mjs +6 -19
  209. package/dist/design-system27.mjs.map +1 -1
  210. package/dist/design-system28.js +1 -1
  211. package/dist/design-system28.js.map +1 -1
  212. package/dist/design-system28.mjs +10 -29
  213. package/dist/design-system28.mjs.map +1 -1
  214. package/dist/design-system29.js +1 -1
  215. package/dist/design-system29.js.map +1 -1
  216. package/dist/design-system29.mjs +19 -5
  217. package/dist/design-system29.mjs.map +1 -1
  218. package/dist/design-system30.js +1 -1
  219. package/dist/design-system30.js.map +1 -1
  220. package/dist/design-system30.mjs +29 -5
  221. package/dist/design-system30.mjs.map +1 -1
  222. package/dist/design-system31.js +1 -1
  223. package/dist/design-system31.mjs +5 -10
  224. package/dist/design-system31.mjs.map +1 -1
  225. package/dist/design-system32.js +1 -1
  226. package/dist/design-system32.mjs +5 -10
  227. package/dist/design-system32.mjs.map +1 -1
  228. package/dist/design-system33.js +1 -1
  229. package/dist/design-system33.mjs +8 -8
  230. package/dist/design-system34.js +1 -1
  231. package/dist/design-system34.mjs +8 -8
  232. package/dist/design-system35.js +1 -1
  233. package/dist/design-system35.mjs +8 -9
  234. package/dist/design-system35.mjs.map +1 -1
  235. package/dist/design-system36.js +1 -1
  236. package/dist/design-system36.mjs +10 -5
  237. package/dist/design-system36.mjs.map +1 -1
  238. package/dist/design-system37.js +1 -1
  239. package/dist/design-system37.js.map +1 -1
  240. package/dist/design-system37.mjs +11 -148
  241. package/dist/design-system37.mjs.map +1 -1
  242. package/dist/design-system38.js +1 -1
  243. package/dist/design-system38.js.map +1 -1
  244. package/dist/design-system38.mjs +5 -57
  245. package/dist/design-system38.mjs.map +1 -1
  246. package/dist/design-system39.js +1 -1
  247. package/dist/design-system39.js.map +1 -1
  248. package/dist/design-system39.mjs +148 -5
  249. package/dist/design-system39.mjs.map +1 -1
  250. package/dist/design-system40.js +1 -1
  251. package/dist/design-system40.js.map +1 -1
  252. package/dist/design-system40.mjs +57 -10
  253. package/dist/design-system40.mjs.map +1 -1
  254. package/dist/design-system41.js +1 -1
  255. package/dist/design-system41.mjs +5 -15
  256. package/dist/design-system41.mjs.map +1 -1
  257. package/dist/design-system42.js +1 -1
  258. package/dist/design-system42.js.map +1 -1
  259. package/dist/design-system42.mjs +10 -9
  260. package/dist/design-system42.mjs.map +1 -1
  261. package/dist/design-system43.js +1 -5
  262. package/dist/design-system43.js.map +1 -1
  263. package/dist/design-system43.mjs +15 -821
  264. package/dist/design-system43.mjs.map +1 -1
  265. package/dist/design-system44.js +1 -1
  266. package/dist/design-system44.js.map +1 -1
  267. package/dist/design-system44.mjs +8 -83
  268. package/dist/design-system44.mjs.map +1 -1
  269. package/dist/design-system45.js +5 -1
  270. package/dist/design-system45.js.map +1 -1
  271. package/dist/design-system45.mjs +816 -79
  272. package/dist/design-system45.mjs.map +1 -1
  273. package/dist/design-system46.js +6 -1
  274. package/dist/design-system46.js.map +1 -1
  275. package/dist/design-system46.mjs +107 -2
  276. package/dist/design-system46.mjs.map +1 -1
  277. package/dist/design-system47.js +6 -1
  278. package/dist/design-system47.js.map +1 -1
  279. package/dist/design-system47.mjs +910 -114
  280. package/dist/design-system47.mjs.map +1 -1
  281. package/dist/design-system48.js +7 -1
  282. package/dist/design-system48.js.map +1 -1
  283. package/dist/design-system48.mjs +861 -2
  284. package/dist/design-system48.mjs.map +1 -1
  285. package/dist/design-system49.js +4 -1
  286. package/dist/design-system49.js.map +1 -1
  287. package/dist/design-system49.mjs +1364 -7
  288. package/dist/design-system49.mjs.map +1 -1
  289. package/dist/design-system50.js +1 -1
  290. package/dist/design-system50.mjs +2 -2
  291. package/dist/design-system51.js +1 -1
  292. package/dist/design-system51.js.map +1 -1
  293. package/dist/design-system51.mjs +116 -2
  294. package/dist/design-system51.mjs.map +1 -1
  295. package/dist/design-system52.js +1 -4
  296. package/dist/design-system52.js.map +1 -1
  297. package/dist/design-system52.mjs +2 -74
  298. package/dist/design-system52.mjs.map +1 -1
  299. package/dist/design-system53.js +1 -1
  300. package/dist/design-system53.mjs +7 -2
  301. package/dist/design-system53.mjs.map +1 -1
  302. package/dist/design-system54.js +1 -1
  303. package/dist/design-system54.js.map +1 -1
  304. package/dist/design-system54.mjs +2 -49
  305. package/dist/design-system54.mjs.map +1 -1
  306. package/dist/design-system56.js +4 -1
  307. package/dist/design-system56.js.map +1 -1
  308. package/dist/design-system56.mjs +74 -2
  309. package/dist/design-system56.mjs.map +1 -1
  310. package/dist/design-system57.js +1 -1
  311. package/dist/design-system57.mjs +2 -2
  312. package/dist/design-system58.js +1 -1
  313. package/dist/design-system58.js.map +1 -1
  314. package/dist/design-system58.mjs +49 -2
  315. package/dist/design-system58.mjs.map +1 -1
  316. package/dist/design-system59.js +1 -1
  317. package/dist/design-system59.mjs +2 -2
  318. package/dist/design-system60.js +1 -1
  319. package/dist/design-system60.mjs +2 -2
  320. package/dist/design-system61.js +1 -1
  321. package/dist/design-system61.mjs +1 -1
  322. package/dist/design-system62.js +1 -1
  323. package/dist/design-system62.mjs +1 -1
  324. package/dist/design-system63.js +1 -1
  325. package/dist/design-system63.js.map +1 -1
  326. package/dist/design-system63.mjs +2 -28
  327. package/dist/design-system63.mjs.map +1 -1
  328. package/dist/design-system64.js +1 -1
  329. package/dist/design-system64.mjs +2 -2
  330. package/dist/design-system65.js +1 -1
  331. package/dist/design-system65.js.map +1 -1
  332. package/dist/design-system65.mjs +2 -58
  333. package/dist/design-system65.mjs.map +1 -1
  334. package/dist/design-system66.js +1 -1
  335. package/dist/design-system66.mjs +2 -2
  336. package/dist/design-system67.js +1 -1
  337. package/dist/design-system67.js.map +1 -1
  338. package/dist/design-system67.mjs +28 -2
  339. package/dist/design-system67.mjs.map +1 -1
  340. package/dist/design-system68.js +1 -1
  341. package/dist/design-system68.mjs +2 -2
  342. package/dist/design-system69.js +1 -1
  343. package/dist/design-system69.js.map +1 -1
  344. package/dist/design-system69.mjs +58 -2
  345. package/dist/design-system69.mjs.map +1 -1
  346. package/dist/design-system7.js +1 -1
  347. package/dist/design-system7.js.map +1 -1
  348. package/dist/design-system7.mjs +2 -2
  349. package/dist/design-system70.js +1 -1
  350. package/dist/design-system70.mjs +2 -2
  351. package/dist/design-system71.js +1 -1
  352. package/dist/design-system71.mjs +1 -1
  353. package/dist/design-system72.js +1 -1
  354. package/dist/design-system72.mjs +1 -1
  355. package/dist/design-system73.js +1 -1
  356. package/dist/design-system73.mjs +2 -2
  357. package/dist/design-system74.js +1 -1
  358. package/dist/design-system74.js.map +1 -1
  359. package/dist/design-system74.mjs +2 -81
  360. package/dist/design-system74.mjs.map +1 -1
  361. package/dist/design-system75.js +1 -1
  362. package/dist/design-system75.mjs +2 -2
  363. package/dist/design-system76.js +1 -1
  364. package/dist/design-system76.mjs +1 -1
  365. package/dist/design-system77.js +1 -1
  366. package/dist/design-system77.mjs +2 -2
  367. package/dist/design-system78.js +1 -1
  368. package/dist/design-system78.js.map +1 -1
  369. package/dist/design-system78.mjs +81 -2
  370. package/dist/design-system78.mjs.map +1 -1
  371. package/dist/design-system79.js +1 -1
  372. package/dist/design-system79.mjs +2 -2
  373. package/dist/design-system80.js +1 -1
  374. package/dist/design-system80.js.map +1 -1
  375. package/dist/design-system80.mjs +2 -102
  376. package/dist/design-system80.mjs.map +1 -1
  377. package/dist/design-system81.js +1 -1
  378. package/dist/design-system81.mjs +2 -2
  379. package/dist/design-system82.js +1 -6
  380. package/dist/design-system82.js.map +1 -1
  381. package/dist/design-system82.mjs +2 -107
  382. package/dist/design-system82.mjs.map +1 -1
  383. package/dist/design-system83.js +1 -6
  384. package/dist/design-system83.js.map +1 -1
  385. package/dist/design-system83.mjs +2 -912
  386. package/dist/design-system83.mjs.map +1 -1
  387. package/dist/design-system84.js +1 -7
  388. package/dist/design-system84.js.map +1 -1
  389. package/dist/design-system84.mjs +95 -854
  390. package/dist/design-system84.mjs.map +1 -1
  391. package/dist/design-system85.js +1 -4
  392. package/dist/design-system85.js.map +1 -1
  393. package/dist/design-system85.mjs +2 -1364
  394. package/dist/design-system85.mjs.map +1 -1
  395. package/dist/design-system87.js +1 -1
  396. package/dist/design-system87.js.map +1 -1
  397. package/dist/design-system87.mjs +6 -2452
  398. package/dist/design-system87.mjs.map +1 -1
  399. package/dist/design-system88.js +1 -1
  400. package/dist/design-system88.js.map +1 -1
  401. package/dist/design-system88.mjs +4 -1103
  402. package/dist/design-system88.mjs.map +1 -1
  403. package/dist/design-system89.js +1 -1
  404. package/dist/design-system89.js.map +1 -1
  405. package/dist/design-system89.mjs +2 -17
  406. package/dist/design-system89.mjs.map +1 -1
  407. package/dist/design-system9.js +1 -1
  408. package/dist/design-system9.js.map +1 -1
  409. package/dist/design-system9.mjs +81 -82
  410. package/dist/design-system9.mjs.map +1 -1
  411. package/dist/design-system90.js +1 -1
  412. package/dist/design-system90.js.map +1 -1
  413. package/dist/design-system90.mjs +1103 -25
  414. package/dist/design-system90.mjs.map +1 -1
  415. package/dist/design-system91.js +1 -1
  416. package/dist/design-system91.js.map +1 -1
  417. package/dist/design-system91.mjs +16 -74
  418. package/dist/design-system91.mjs.map +1 -1
  419. package/dist/design-system92.js +1 -1
  420. package/dist/design-system92.js.map +1 -1
  421. package/dist/design-system92.mjs +24 -5
  422. package/dist/design-system92.mjs.map +1 -1
  423. package/dist/design-system93.js +1 -1
  424. package/dist/design-system93.js.map +1 -1
  425. package/dist/design-system93.mjs +2445 -60
  426. package/dist/design-system93.mjs.map +1 -1
  427. package/dist/design-system94.js +1 -1
  428. package/dist/design-system94.js.map +1 -1
  429. package/dist/design-system94.mjs +67 -6
  430. package/dist/design-system94.mjs.map +1 -1
  431. package/dist/design-system95.js +1 -1
  432. package/dist/design-system95.js.map +1 -1
  433. package/dist/design-system95.mjs +75 -4
  434. package/dist/design-system95.mjs.map +1 -1
  435. package/dist/design-system96.js +1 -1
  436. package/dist/design-system96.js.map +1 -1
  437. package/dist/design-system96.mjs +6 -2
  438. package/dist/design-system96.mjs.map +1 -1
  439. package/dist/design-system97.js +1 -1
  440. package/dist/design-system97.mjs +1 -1
  441. package/dist/style.css +1 -1
  442. package/dist/types/index.d.ts +2 -0
  443. package/package.json +1 -1
@@ -1,70 +1,2455 @@
1
- import { defineComponent as k, ref as C, computed as d, onMounted as h, onBeforeUnmount as B, openBlock as E, createBlock as x, withCtx as y, createElementVNode as a, normalizeClass as c, renderSlot as L } from "vue";
2
- import { BModalSize as t } from "./design-system5.mjs";
3
- import _ from "./design-system34.mjs";
4
- const W = /* @__PURE__ */ k({
5
- __name: "BModalContainer",
6
- props: {
7
- size: { default: t.Medium },
8
- fullscreen: { type: Boolean, default: !1 },
9
- persistent: { type: Boolean, default: !1 }
10
- },
11
- emits: ["close"],
12
- setup(i, { emit: n }) {
13
- const s = i, o = C(null), u = d(() => {
14
- let e = "ds-relative ds-w-full ds-h-auto ds-m-auto ds-flex ds-items-center ";
15
- if (s.fullscreen)
16
- e += "ds-w-screen ds-h-screen ";
17
- else
18
- switch (e += "ds-p-4 ", s.size) {
19
- case t.Small:
20
- e += "ds-max-w-md ";
1
+ (function(g, k) {
2
+ typeof exports == "object" && typeof module < "u" ? k(exports) : typeof define == "function" && define.amd ? define(["exports"], k) : (g = typeof globalThis < "u" ? globalThis : g || self, k(g.IMask = {}));
3
+ })(globalThis, function(g) {
4
+ function k(a, t) {
5
+ if (a == null)
6
+ return {};
7
+ var e = {}, s = Object.keys(a), n, u;
8
+ for (u = 0; u < s.length; u++)
9
+ n = s[u], !(t.indexOf(n) >= 0) && (e[n] = a[n]);
10
+ return e;
11
+ }
12
+ function h(a) {
13
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
14
+ return new h.InputMask(a, t);
15
+ }
16
+ class c {
17
+ /** Inserted symbols */
18
+ /** Can skip chars */
19
+ /** Additional offset if any changes occurred before tail */
20
+ /** Raw inserted is used by dynamic mask */
21
+ constructor(t) {
22
+ Object.assign(
23
+ this,
24
+ {
25
+ inserted: "",
26
+ rawInserted: "",
27
+ skip: !1,
28
+ tailShift: 0
29
+ },
30
+ t
31
+ );
32
+ }
33
+ /**
34
+ Aggregate changes
35
+ @returns {ChangeDetails} `this`
36
+ */
37
+ aggregate(t) {
38
+ return this.rawInserted += t.rawInserted, this.skip = this.skip || t.skip, this.inserted += t.inserted, this.tailShift += t.tailShift, this;
39
+ }
40
+ /** Total offset considering all changes */
41
+ get offset() {
42
+ return this.tailShift + this.inserted.length;
43
+ }
44
+ }
45
+ h.ChangeDetails = c;
46
+ function B(a) {
47
+ return typeof a == "string" || a instanceof String;
48
+ }
49
+ const o = {
50
+ NONE: "NONE",
51
+ LEFT: "LEFT",
52
+ FORCE_LEFT: "FORCE_LEFT",
53
+ RIGHT: "RIGHT",
54
+ FORCE_RIGHT: "FORCE_RIGHT"
55
+ };
56
+ function $(a) {
57
+ switch (a) {
58
+ case o.LEFT:
59
+ return o.FORCE_LEFT;
60
+ case o.RIGHT:
61
+ return o.FORCE_RIGHT;
62
+ default:
63
+ return a;
64
+ }
65
+ }
66
+ function R(a) {
67
+ return a.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1");
68
+ }
69
+ function M(a) {
70
+ return Array.isArray(a) ? a : [a, new c()];
71
+ }
72
+ function I(a, t) {
73
+ if (t === a)
74
+ return !0;
75
+ var e = Array.isArray(t), s = Array.isArray(a), n;
76
+ if (e && s) {
77
+ if (t.length != a.length)
78
+ return !1;
79
+ for (n = 0; n < t.length; n++)
80
+ if (!I(t[n], a[n]))
81
+ return !1;
82
+ return !0;
83
+ }
84
+ if (e != s)
85
+ return !1;
86
+ if (t && a && typeof t == "object" && typeof a == "object") {
87
+ var u = t instanceof Date, i = a instanceof Date;
88
+ if (u && i)
89
+ return t.getTime() == a.getTime();
90
+ if (u != i)
91
+ return !1;
92
+ var r = t instanceof RegExp, l = a instanceof RegExp;
93
+ if (r && l)
94
+ return t.toString() == a.toString();
95
+ if (r != l)
96
+ return !1;
97
+ var d = Object.keys(t);
98
+ for (n = 0; n < d.length; n++)
99
+ if (!Object.prototype.hasOwnProperty.call(a, d[n]))
100
+ return !1;
101
+ for (n = 0; n < d.length; n++)
102
+ if (!I(a[d[n]], t[d[n]]))
103
+ return !1;
104
+ return !0;
105
+ } else if (t && a && typeof t == "function" && typeof a == "function")
106
+ return t.toString() === a.toString();
107
+ return !1;
108
+ }
109
+ class K {
110
+ /** Current input value */
111
+ /** Current cursor position */
112
+ /** Old input value */
113
+ /** Old selection */
114
+ constructor(t, e, s, n) {
115
+ for (this.value = t, this.cursorPos = e, this.oldValue = s, this.oldSelection = n; this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos); )
116
+ --this.oldSelection.start;
117
+ }
118
+ /**
119
+ Start changing position
120
+ @readonly
121
+ */
122
+ get startChangePos() {
123
+ return Math.min(this.cursorPos, this.oldSelection.start);
124
+ }
125
+ /**
126
+ Inserted symbols count
127
+ @readonly
128
+ */
129
+ get insertedCount() {
130
+ return this.cursorPos - this.startChangePos;
131
+ }
132
+ /**
133
+ Inserted symbols
134
+ @readonly
135
+ */
136
+ get inserted() {
137
+ return this.value.substr(this.startChangePos, this.insertedCount);
138
+ }
139
+ /**
140
+ Removed symbols count
141
+ @readonly
142
+ */
143
+ get removedCount() {
144
+ return Math.max(
145
+ this.oldSelection.end - this.startChangePos || // for Delete
146
+ this.oldValue.length - this.value.length,
147
+ 0
148
+ );
149
+ }
150
+ /**
151
+ Removed symbols
152
+ @readonly
153
+ */
154
+ get removed() {
155
+ return this.oldValue.substr(this.startChangePos, this.removedCount);
156
+ }
157
+ /**
158
+ Unchanged head symbols
159
+ @readonly
160
+ */
161
+ get head() {
162
+ return this.value.substring(0, this.startChangePos);
163
+ }
164
+ /**
165
+ Unchanged tail symbols
166
+ @readonly
167
+ */
168
+ get tail() {
169
+ return this.value.substring(this.startChangePos + this.insertedCount);
170
+ }
171
+ /**
172
+ Remove direction
173
+ @readonly
174
+ */
175
+ get removeDirection() {
176
+ return !this.removedCount || this.insertedCount ? o.NONE : (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace)
177
+ this.oldSelection.end === this.oldSelection.start ? o.RIGHT : o.LEFT;
178
+ }
179
+ }
180
+ class _ {
181
+ /** Tail value as string */
182
+ /** Tail start position */
183
+ /** Start position */
184
+ constructor() {
185
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, s = arguments.length > 2 ? arguments[2] : void 0;
186
+ this.value = t, this.from = e, this.stop = s;
187
+ }
188
+ toString() {
189
+ return this.value;
190
+ }
191
+ extend(t) {
192
+ this.value += String(t);
193
+ }
194
+ appendTo(t) {
195
+ return t.append(this.toString(), {
196
+ tail: !0
197
+ }).aggregate(t._appendPlaceholder());
198
+ }
199
+ get state() {
200
+ return {
201
+ value: this.value,
202
+ from: this.from,
203
+ stop: this.stop
204
+ };
205
+ }
206
+ set state(t) {
207
+ Object.assign(this, t);
208
+ }
209
+ unshift(t) {
210
+ if (!this.value.length || t != null && this.from >= t)
211
+ return "";
212
+ const e = this.value[0];
213
+ return this.value = this.value.slice(1), e;
214
+ }
215
+ shift() {
216
+ if (!this.value.length)
217
+ return "";
218
+ const t = this.value[this.value.length - 1];
219
+ return this.value = this.value.slice(0, -1), t;
220
+ }
221
+ }
222
+ class p {
223
+ // $Shape<MaskedOptions>; TODO after fix https://github.com/facebook/flow/issues/4773
224
+ /** @type {Mask} */
225
+ /** */
226
+ // $FlowFixMe no ideas
227
+ /** Transforms value before mask processing */
228
+ /** Validates if value is acceptable */
229
+ /** Does additional processing in the end of editing */
230
+ /** Format typed value to string */
231
+ /** Parse strgin to get typed value */
232
+ /** Enable characters overwriting */
233
+ /** */
234
+ /** */
235
+ /** */
236
+ constructor(t) {
237
+ this._value = "", this._update(Object.assign({}, p.DEFAULTS, t)), this.isInitialized = !0;
238
+ }
239
+ /** Sets and applies new options */
240
+ updateOptions(t) {
241
+ Object.keys(t).length && this.withValueRefresh(this._update.bind(this, t));
242
+ }
243
+ /**
244
+ Sets new options
245
+ @protected
246
+ */
247
+ _update(t) {
248
+ Object.assign(this, t);
249
+ }
250
+ /** Mask state */
251
+ get state() {
252
+ return {
253
+ _value: this.value
254
+ };
255
+ }
256
+ set state(t) {
257
+ this._value = t._value;
258
+ }
259
+ /** Resets value */
260
+ reset() {
261
+ this._value = "";
262
+ }
263
+ /** */
264
+ get value() {
265
+ return this._value;
266
+ }
267
+ set value(t) {
268
+ this.resolve(t);
269
+ }
270
+ /** Resolve new value */
271
+ resolve(t) {
272
+ return this.reset(), this.append(
273
+ t,
274
+ {
275
+ input: !0
276
+ },
277
+ ""
278
+ ), this.doCommit(), this.value;
279
+ }
280
+ /** */
281
+ get unmaskedValue() {
282
+ return this.value;
283
+ }
284
+ set unmaskedValue(t) {
285
+ this.reset(), this.append(t, {}, ""), this.doCommit();
286
+ }
287
+ /** */
288
+ get typedValue() {
289
+ return this.doParse(this.value);
290
+ }
291
+ set typedValue(t) {
292
+ this.value = this.doFormat(t);
293
+ }
294
+ /** Value that includes raw user input */
295
+ get rawInputValue() {
296
+ return this.extractInput(0, this.value.length, {
297
+ raw: !0
298
+ });
299
+ }
300
+ set rawInputValue(t) {
301
+ this.reset(), this.append(
302
+ t,
303
+ {
304
+ raw: !0
305
+ },
306
+ ""
307
+ ), this.doCommit();
308
+ }
309
+ get displayValue() {
310
+ return this.value;
311
+ }
312
+ /** */
313
+ get isComplete() {
314
+ return !0;
315
+ }
316
+ /** */
317
+ get isFilled() {
318
+ return this.isComplete;
319
+ }
320
+ /** Finds nearest input position in direction */
321
+ nearestInputPos(t, e) {
322
+ return t;
323
+ }
324
+ totalInputPositions() {
325
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length;
326
+ return Math.min(this.value.length, e - t);
327
+ }
328
+ /** Extracts value in range considering flags */
329
+ extractInput() {
330
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length;
331
+ return this.value.slice(t, e);
332
+ }
333
+ /** Extracts tail in range */
334
+ extractTail() {
335
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length;
336
+ return new _(
337
+ this.extractInput(t, e),
338
+ t
339
+ );
340
+ }
341
+ /** Appends tail */
342
+ // $FlowFixMe no ideas
343
+ appendTail(t) {
344
+ return B(t) && (t = new _(String(t))), t.appendTo(this);
345
+ }
346
+ /** Appends char */
347
+ _appendCharRaw(t) {
348
+ return t ? (this._value += t, new c({
349
+ inserted: t,
350
+ rawInserted: t
351
+ })) : new c();
352
+ }
353
+ /** Appends char */
354
+ _appendChar(t) {
355
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 ? arguments[2] : void 0;
356
+ const n = this.state;
357
+ let u;
358
+ if ([t, u] = M(this.doPrepare(t, e)), u = u.aggregate(this._appendCharRaw(t, e)), u.inserted) {
359
+ let i, r = this.doValidate(e) !== !1;
360
+ if (r && s != null) {
361
+ const l = this.state;
362
+ this.overwrite === !0 && (i = s.state, s.unshift(this.value.length - u.tailShift));
363
+ let d = this.appendTail(s);
364
+ r = d.rawInserted === s.toString(), !(r && d.inserted) && this.overwrite === "shift" && (this.state = l, i = s.state, s.shift(), d = this.appendTail(s), r = d.rawInserted === s.toString()), r && d.inserted && (this.state = l);
365
+ }
366
+ r || (u = new c(), this.state = n, s && i && (s.state = i));
367
+ }
368
+ return u;
369
+ }
370
+ /** Appends optional placeholder at end */
371
+ _appendPlaceholder() {
372
+ return new c();
373
+ }
374
+ /** Appends optional eager placeholder at end */
375
+ _appendEager() {
376
+ return new c();
377
+ }
378
+ /** Appends symbols considering flags */
379
+ // $FlowFixMe no ideas
380
+ append(t, e, s) {
381
+ if (!B(t))
382
+ throw new Error("value should be string");
383
+ const n = new c(), u = B(s) ? new _(String(s)) : s;
384
+ e != null && e.tail && (e._beforeTailState = this.state);
385
+ for (let i = 0; i < t.length; ++i) {
386
+ const r = this._appendChar(t[i], e, u);
387
+ if (!r.rawInserted && !this.doSkipInvalid(t[i], e, u))
388
+ break;
389
+ n.aggregate(r);
390
+ }
391
+ return u != null && (n.tailShift += this.appendTail(u).tailShift), (this.eager === !0 || this.eager === "append") && e !== null && e !== void 0 && e.input && t && n.aggregate(this._appendEager()), n;
392
+ }
393
+ /** */
394
+ remove() {
395
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length;
396
+ return this._value = this.value.slice(0, t) + this.value.slice(e), new c();
397
+ }
398
+ /** Calls function and reapplies current value */
399
+ withValueRefresh(t) {
400
+ if (this._refreshing || !this.isInitialized)
401
+ return t();
402
+ this._refreshing = !0;
403
+ const e = this.rawInputValue, s = this.value, n = t();
404
+ return this.rawInputValue = e, this.value && this.value !== s && s.indexOf(this.value) === 0 && this.append(s.slice(this.value.length), {}, ""), delete this._refreshing, n;
405
+ }
406
+ /** */
407
+ runIsolated(t) {
408
+ if (this._isolated || !this.isInitialized)
409
+ return t(this);
410
+ this._isolated = !0;
411
+ const e = this.state, s = t(this);
412
+ return this.state = e, delete this._isolated, s;
413
+ }
414
+ /** */
415
+ doSkipInvalid(t) {
416
+ return this.skipInvalid;
417
+ }
418
+ /**
419
+ Prepares string before mask processing
420
+ @protected
421
+ */
422
+ doPrepare(t) {
423
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
424
+ return this.prepare ? this.prepare(t, this, e) : t;
425
+ }
426
+ /**
427
+ Validates if value is acceptable
428
+ @protected
429
+ */
430
+ doValidate(t) {
431
+ return (!this.validate || this.validate(this.value, this, t)) && (!this.parent || this.parent.doValidate(t));
432
+ }
433
+ /**
434
+ Does additional processing in the end of editing
435
+ @protected
436
+ */
437
+ doCommit() {
438
+ this.commit && this.commit(this.value, this);
439
+ }
440
+ /** */
441
+ doFormat(t) {
442
+ return this.format ? this.format(t, this) : t;
443
+ }
444
+ /** */
445
+ doParse(t) {
446
+ return this.parse ? this.parse(t, this) : t;
447
+ }
448
+ /** */
449
+ splice(t, e, s, n) {
450
+ let u = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
451
+ input: !0
452
+ };
453
+ const i = t + e, r = this.extractTail(i), l = this.eager === !0 || this.eager === "remove";
454
+ let d;
455
+ l && (n = $(n), d = this.extractInput(0, i, {
456
+ raw: !0
457
+ }));
458
+ let E = t;
459
+ const A = new c();
460
+ if (n !== o.NONE && (E = this.nearestInputPos(
461
+ t,
462
+ e > 1 && t !== 0 && !l ? o.NONE : n
463
+ ), A.tailShift = E - t), A.aggregate(this.remove(E)), l && n !== o.NONE && d === this.rawInputValue)
464
+ if (n === o.FORCE_LEFT) {
465
+ let V;
466
+ for (; d === this.rawInputValue && (V = this.value.length); )
467
+ A.aggregate(
468
+ new c({
469
+ tailShift: -1
470
+ })
471
+ ).aggregate(this.remove(V - 1));
472
+ } else
473
+ n === o.FORCE_RIGHT && r.unshift();
474
+ return A.aggregate(this.append(s, u, r));
475
+ }
476
+ maskEquals(t) {
477
+ return this.mask === t;
478
+ }
479
+ typedValueEquals(t) {
480
+ const e = this.typedValue;
481
+ return t === e || p.EMPTY_VALUES.includes(t) && p.EMPTY_VALUES.includes(e) || this.doFormat(t) === this.doFormat(this.typedValue);
482
+ }
483
+ }
484
+ p.DEFAULTS = {
485
+ format: String,
486
+ parse: (a) => a,
487
+ skipInvalid: !0
488
+ }, p.EMPTY_VALUES = [void 0, null, ""], h.Masked = p;
489
+ function L(a) {
490
+ if (a == null)
491
+ throw new Error("mask property should be defined");
492
+ return a instanceof RegExp ? h.MaskedRegExp : B(a) ? h.MaskedPattern : a instanceof Date || a === Date ? h.MaskedDate : a instanceof Number || typeof a == "number" || a === Number ? h.MaskedNumber : Array.isArray(a) || a === Array ? h.MaskedDynamic : h.Masked && a.prototype instanceof h.Masked ? a : a instanceof h.Masked ? a.constructor : a instanceof Function ? h.MaskedFunction : (console.warn("Mask not found for mask", a), h.Masked);
493
+ }
494
+ function v(a) {
495
+ if (h.Masked && a instanceof h.Masked)
496
+ return a;
497
+ a = Object.assign({}, a);
498
+ const t = a.mask;
499
+ if (h.Masked && t instanceof h.Masked)
500
+ return t;
501
+ const e = L(t);
502
+ if (!e)
503
+ throw new Error(
504
+ "Masked class is not found for provided mask, appropriate module needs to be import manually before creating mask."
505
+ );
506
+ return new e(a);
507
+ }
508
+ h.createMask = v;
509
+ const Z = [
510
+ "parent",
511
+ "isOptional",
512
+ "placeholderChar",
513
+ "displayChar",
514
+ "lazy",
515
+ "eager"
516
+ ], X = {
517
+ 0: /\d/,
518
+ a: /[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,
519
+ // http://stackoverflow.com/a/22075070
520
+ "*": /./
521
+ };
522
+ class N {
523
+ /** */
524
+ /** */
525
+ /** */
526
+ /** */
527
+ /** */
528
+ /** */
529
+ /** */
530
+ /** */
531
+ constructor(t) {
532
+ const { parent: e, isOptional: s, placeholderChar: n, displayChar: u, lazy: i, eager: r } = t, l = k(t, Z);
533
+ this.masked = v(l), Object.assign(this, {
534
+ parent: e,
535
+ isOptional: s,
536
+ placeholderChar: n,
537
+ displayChar: u,
538
+ lazy: i,
539
+ eager: r
540
+ });
541
+ }
542
+ reset() {
543
+ this.isFilled = !1, this.masked.reset();
544
+ }
545
+ remove() {
546
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length;
547
+ return t === 0 && e >= 1 ? (this.isFilled = !1, this.masked.remove(t, e)) : new c();
548
+ }
549
+ get value() {
550
+ return this.masked.value || (this.isFilled && !this.isOptional ? this.placeholderChar : "");
551
+ }
552
+ get unmaskedValue() {
553
+ return this.masked.unmaskedValue;
554
+ }
555
+ get displayValue() {
556
+ return this.masked.value && this.displayChar || this.value;
557
+ }
558
+ get isComplete() {
559
+ return !!this.masked.value || this.isOptional;
560
+ }
561
+ _appendChar(t) {
562
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
563
+ if (this.isFilled)
564
+ return new c();
565
+ const s = this.masked.state, n = this.masked._appendChar(t, e);
566
+ return n.inserted && this.doValidate(e) === !1 && (n.inserted = n.rawInserted = "", this.masked.state = s), !n.inserted && !this.isOptional && !this.lazy && !e.input && (n.inserted = this.placeholderChar), n.skip = !n.inserted && !this.isOptional, this.isFilled = !!n.inserted, n;
567
+ }
568
+ append() {
569
+ return this.masked.append(...arguments);
570
+ }
571
+ _appendPlaceholder() {
572
+ const t = new c();
573
+ return this.isFilled || this.isOptional || (this.isFilled = !0, t.inserted = this.placeholderChar), t;
574
+ }
575
+ _appendEager() {
576
+ return new c();
577
+ }
578
+ extractTail() {
579
+ return this.masked.extractTail(...arguments);
580
+ }
581
+ appendTail() {
582
+ return this.masked.appendTail(...arguments);
583
+ }
584
+ extractInput() {
585
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length, s = arguments.length > 2 ? arguments[2] : void 0;
586
+ return this.masked.extractInput(t, e, s);
587
+ }
588
+ nearestInputPos(t) {
589
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o.NONE;
590
+ const s = 0, n = this.value.length, u = Math.min(Math.max(t, s), n);
591
+ switch (e) {
592
+ case o.LEFT:
593
+ case o.FORCE_LEFT:
594
+ return this.isComplete ? u : s;
595
+ case o.RIGHT:
596
+ case o.FORCE_RIGHT:
597
+ return this.isComplete ? u : n;
598
+ case o.NONE:
599
+ default:
600
+ return u;
601
+ }
602
+ }
603
+ totalInputPositions() {
604
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length;
605
+ return this.value.slice(t, e).length;
606
+ }
607
+ doValidate() {
608
+ return this.masked.doValidate(...arguments) && (!this.parent || this.parent.doValidate(...arguments));
609
+ }
610
+ doCommit() {
611
+ this.masked.doCommit();
612
+ }
613
+ get state() {
614
+ return {
615
+ masked: this.masked.state,
616
+ isFilled: this.isFilled
617
+ };
618
+ }
619
+ set state(t) {
620
+ this.masked.state = t.masked, this.isFilled = t.isFilled;
621
+ }
622
+ }
623
+ class j {
624
+ /** */
625
+ /** */
626
+ /** */
627
+ /** */
628
+ /** */
629
+ /** */
630
+ constructor(t) {
631
+ Object.assign(this, t), this._value = "", this.isFixed = !0;
632
+ }
633
+ get value() {
634
+ return this._value;
635
+ }
636
+ get unmaskedValue() {
637
+ return this.isUnmasking ? this.value : "";
638
+ }
639
+ get displayValue() {
640
+ return this.value;
641
+ }
642
+ reset() {
643
+ this._isRawInput = !1, this._value = "";
644
+ }
645
+ remove() {
646
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this._value.length;
647
+ return this._value = this._value.slice(0, t) + this._value.slice(e), this._value || (this._isRawInput = !1), new c();
648
+ }
649
+ nearestInputPos(t) {
650
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o.NONE;
651
+ const s = 0, n = this._value.length;
652
+ switch (e) {
653
+ case o.LEFT:
654
+ case o.FORCE_LEFT:
655
+ return s;
656
+ case o.NONE:
657
+ case o.RIGHT:
658
+ case o.FORCE_RIGHT:
659
+ default:
660
+ return n;
661
+ }
662
+ }
663
+ totalInputPositions() {
664
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this._value.length;
665
+ return this._isRawInput ? e - t : 0;
666
+ }
667
+ extractInput() {
668
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this._value.length;
669
+ return (arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}).raw && this._isRawInput && this._value.slice(t, e) || "";
670
+ }
671
+ get isComplete() {
672
+ return !0;
673
+ }
674
+ get isFilled() {
675
+ return !!this._value;
676
+ }
677
+ _appendChar(t) {
678
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
679
+ const s = new c();
680
+ if (this.isFilled)
681
+ return s;
682
+ const n = this.eager === !0 || this.eager === "append", i = this.char === t && (this.isUnmasking || e.input || e.raw) && (!e.raw || !n) && !e.tail;
683
+ return i && (s.rawInserted = this.char), this._value = s.inserted = this.char, this._isRawInput = i && (e.raw || e.input), s;
684
+ }
685
+ _appendEager() {
686
+ return this._appendChar(this.char, {
687
+ tail: !0
688
+ });
689
+ }
690
+ _appendPlaceholder() {
691
+ const t = new c();
692
+ return this.isFilled || (this._value = t.inserted = this.char), t;
693
+ }
694
+ extractTail() {
695
+ return arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length, new _("");
696
+ }
697
+ // $FlowFixMe no ideas
698
+ appendTail(t) {
699
+ return B(t) && (t = new _(String(t))), t.appendTo(this);
700
+ }
701
+ append(t, e, s) {
702
+ const n = this._appendChar(t[0], e);
703
+ return s != null && (n.tailShift += this.appendTail(s).tailShift), n;
704
+ }
705
+ doCommit() {
706
+ }
707
+ get state() {
708
+ return {
709
+ _value: this._value,
710
+ _isRawInput: this._isRawInput
711
+ };
712
+ }
713
+ set state(t) {
714
+ Object.assign(this, t);
715
+ }
716
+ }
717
+ const W = ["chunks"];
718
+ class F {
719
+ /** */
720
+ constructor() {
721
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
722
+ this.chunks = t, this.from = e;
723
+ }
724
+ toString() {
725
+ return this.chunks.map(String).join("");
726
+ }
727
+ // $FlowFixMe no ideas
728
+ extend(t) {
729
+ if (!String(t))
730
+ return;
731
+ B(t) && (t = new _(String(t)));
732
+ const e = this.chunks[this.chunks.length - 1], s = e && // if stops are same or tail has no stop
733
+ (e.stop === t.stop || t.stop == null) && // if tail chunk goes just after last chunk
734
+ t.from === e.from + e.toString().length;
735
+ if (t instanceof _)
736
+ s ? e.extend(t.toString()) : this.chunks.push(t);
737
+ else if (t instanceof F) {
738
+ if (t.stop == null) {
739
+ let n;
740
+ for (; t.chunks.length && t.chunks[0].stop == null; )
741
+ n = t.chunks.shift(), n.from += t.from, this.extend(n);
742
+ }
743
+ t.toString() && (t.stop = t.blockIndex, this.chunks.push(t));
744
+ }
745
+ }
746
+ appendTo(t) {
747
+ if (!(t instanceof h.MaskedPattern))
748
+ return new _(this.toString()).appendTo(t);
749
+ const e = new c();
750
+ for (let s = 0; s < this.chunks.length && !e.skip; ++s) {
751
+ const n = this.chunks[s], u = t._mapPosToBlock(t.value.length), i = n.stop;
752
+ let r;
753
+ if (i != null && // if block not found or stop is behind lastBlock
754
+ (!u || u.index <= i)) {
755
+ if (n instanceof F || // for continuous block also check if stop is exist
756
+ t._stops.indexOf(i) >= 0) {
757
+ const l = t._appendPlaceholder(i);
758
+ e.aggregate(l);
759
+ }
760
+ r = n instanceof F && t._blocks[i];
761
+ }
762
+ if (r) {
763
+ const l = r.appendTail(n);
764
+ l.skip = !1, e.aggregate(l), t._value += l.inserted;
765
+ const d = n.toString().slice(l.rawInserted.length);
766
+ d && e.aggregate(
767
+ t.append(d, {
768
+ tail: !0
769
+ })
770
+ );
771
+ } else
772
+ e.aggregate(
773
+ t.append(n.toString(), {
774
+ tail: !0
775
+ })
776
+ );
777
+ }
778
+ return e;
779
+ }
780
+ get state() {
781
+ return {
782
+ chunks: this.chunks.map((t) => t.state),
783
+ from: this.from,
784
+ stop: this.stop,
785
+ blockIndex: this.blockIndex
786
+ };
787
+ }
788
+ set state(t) {
789
+ const { chunks: e } = t, s = k(t, W);
790
+ Object.assign(this, s), this.chunks = e.map((n) => {
791
+ const u = "chunks" in n ? new F() : new _();
792
+ return u.state = n, u;
793
+ });
794
+ }
795
+ unshift(t) {
796
+ if (!this.chunks.length || t != null && this.from >= t)
797
+ return "";
798
+ const e = t != null ? t - this.from : t;
799
+ let s = 0;
800
+ for (; s < this.chunks.length; ) {
801
+ const n = this.chunks[s], u = n.unshift(e);
802
+ if (n.toString()) {
803
+ if (!u)
21
804
  break;
22
- case t.Large:
23
- e += "ds-max-w-4xl ";
805
+ ++s;
806
+ } else
807
+ this.chunks.splice(s, 1);
808
+ if (u)
809
+ return u;
810
+ }
811
+ return "";
812
+ }
813
+ shift() {
814
+ if (!this.chunks.length)
815
+ return "";
816
+ let t = this.chunks.length - 1;
817
+ for (; 0 <= t; ) {
818
+ const e = this.chunks[t], s = e.shift();
819
+ if (e.toString()) {
820
+ if (!s)
24
821
  break;
25
- case t.Medium:
26
- default:
27
- e += "ds-max-w-2xl ";
822
+ --t;
823
+ } else
824
+ this.chunks.splice(t, 1);
825
+ if (s)
826
+ return s;
827
+ }
828
+ return "";
829
+ }
830
+ }
831
+ class J {
832
+ constructor(t, e) {
833
+ this.masked = t, this._log = [];
834
+ const { offset: s, index: n } = t._mapPosToBlock(e) || (e < 0 ? (
835
+ // first
836
+ {
837
+ index: 0,
838
+ offset: 0
839
+ }
840
+ ) : (
841
+ // last
842
+ {
843
+ index: this.masked._blocks.length,
844
+ offset: 0
845
+ }
846
+ ));
847
+ this.offset = s, this.index = n, this.ok = !1;
848
+ }
849
+ get block() {
850
+ return this.masked._blocks[this.index];
851
+ }
852
+ get pos() {
853
+ return this.masked._blockStartPos(this.index) + this.offset;
854
+ }
855
+ get state() {
856
+ return {
857
+ index: this.index,
858
+ offset: this.offset,
859
+ ok: this.ok
860
+ };
861
+ }
862
+ set state(t) {
863
+ Object.assign(this, t);
864
+ }
865
+ pushState() {
866
+ this._log.push(this.state);
867
+ }
868
+ popState() {
869
+ const t = this._log.pop();
870
+ return this.state = t, t;
871
+ }
872
+ bindBlock() {
873
+ this.block || (this.index < 0 && (this.index = 0, this.offset = 0), this.index >= this.masked._blocks.length && (this.index = this.masked._blocks.length - 1, this.offset = this.block.value.length));
874
+ }
875
+ _pushLeft(t) {
876
+ for (this.pushState(), this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((e = this.block) === null || e === void 0 ? void 0 : e.value.length) || 0) {
877
+ var e;
878
+ if (t())
879
+ return this.ok = !0;
880
+ }
881
+ return this.ok = !1;
882
+ }
883
+ _pushRight(t) {
884
+ for (this.pushState(), this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0)
885
+ if (t())
886
+ return this.ok = !0;
887
+ return this.ok = !1;
888
+ }
889
+ pushLeftBeforeFilled() {
890
+ return this._pushLeft(() => {
891
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(
892
+ this.offset,
893
+ o.FORCE_LEFT
894
+ ), this.offset !== 0))
895
+ return !0;
896
+ });
897
+ }
898
+ pushLeftBeforeInput() {
899
+ return this._pushLeft(() => {
900
+ if (!this.block.isFixed)
901
+ return this.offset = this.block.nearestInputPos(this.offset, o.LEFT), !0;
902
+ });
903
+ }
904
+ pushLeftBeforeRequired() {
905
+ return this._pushLeft(() => {
906
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
907
+ return this.offset = this.block.nearestInputPos(this.offset, o.LEFT), !0;
908
+ });
909
+ }
910
+ pushRightBeforeFilled() {
911
+ return this._pushRight(() => {
912
+ if (!(this.block.isFixed || !this.block.value) && (this.offset = this.block.nearestInputPos(
913
+ this.offset,
914
+ o.FORCE_RIGHT
915
+ ), this.offset !== this.block.value.length))
916
+ return !0;
917
+ });
918
+ }
919
+ pushRightBeforeInput() {
920
+ return this._pushRight(() => {
921
+ if (!this.block.isFixed)
922
+ return this.offset = this.block.nearestInputPos(this.offset, o.NONE), !0;
923
+ });
924
+ }
925
+ pushRightBeforeRequired() {
926
+ return this._pushRight(() => {
927
+ if (!(this.block.isFixed || this.block.isOptional && !this.block.value))
928
+ return this.offset = this.block.nearestInputPos(this.offset, o.NONE), !0;
929
+ });
930
+ }
931
+ }
932
+ class U extends p {
933
+ /**
934
+ @override
935
+ @param {Object} opts
936
+ */
937
+ _update(t) {
938
+ t.mask && (t.validate = (e) => e.search(t.mask) >= 0), super._update(t);
939
+ }
940
+ }
941
+ h.MaskedRegExp = U;
942
+ const Q = ["_blocks"];
943
+ class f extends p {
944
+ /** */
945
+ /** */
946
+ /** Single char for empty input */
947
+ /** Single char for filled input */
948
+ /** Show placeholder only when needed */
949
+ constructor() {
950
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
951
+ t.definitions = Object.assign(
952
+ {},
953
+ X,
954
+ t.definitions
955
+ ), super(Object.assign({}, f.DEFAULTS, t));
956
+ }
957
+ /**
958
+ @override
959
+ @param {Object} opts
960
+ */
961
+ _update() {
962
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
963
+ t.definitions = Object.assign({}, this.definitions, t.definitions), super._update(t), this._rebuildMask();
964
+ }
965
+ /** */
966
+ _rebuildMask() {
967
+ const t = this.definitions;
968
+ this._blocks = [], this._stops = [], this._maskedBlocks = {};
969
+ let e = this.mask;
970
+ if (!e || !t)
971
+ return;
972
+ let s = !1, n = !1;
973
+ for (let r = 0; r < e.length; ++r) {
974
+ var u, i;
975
+ if (this.blocks) {
976
+ const V = e.slice(r), Y = Object.keys(this.blocks).filter(
977
+ (D) => V.indexOf(D) === 0
978
+ );
979
+ Y.sort((D, nt) => nt.length - D.length);
980
+ const b = Y[0];
981
+ if (b) {
982
+ const D = v(
983
+ Object.assign(
984
+ {
985
+ parent: this,
986
+ lazy: this.lazy,
987
+ eager: this.eager,
988
+ placeholderChar: this.placeholderChar,
989
+ displayChar: this.displayChar,
990
+ overwrite: this.overwrite
991
+ },
992
+ this.blocks[b]
993
+ )
994
+ );
995
+ D && (this._blocks.push(D), this._maskedBlocks[b] || (this._maskedBlocks[b] = []), this._maskedBlocks[b].push(this._blocks.length - 1)), r += b.length - 1;
996
+ continue;
997
+ }
998
+ }
999
+ let l = e[r], d = l in t;
1000
+ if (l === f.STOP_CHAR) {
1001
+ this._stops.push(this._blocks.length);
1002
+ continue;
1003
+ }
1004
+ if (l === "{" || l === "}") {
1005
+ s = !s;
1006
+ continue;
1007
+ }
1008
+ if (l === "[" || l === "]") {
1009
+ n = !n;
1010
+ continue;
1011
+ }
1012
+ if (l === f.ESCAPE_CHAR) {
1013
+ if (++r, l = e[r], !l)
28
1014
  break;
1015
+ d = !1;
29
1016
  }
1017
+ const E = (u = t[l]) !== null && u !== void 0 && u.mask && !(((i = t[l]) === null || i === void 0 ? void 0 : i.mask.prototype) instanceof h.Masked) ? t[l] : {
1018
+ mask: t[l]
1019
+ }, A = d ? new N(
1020
+ Object.assign(
1021
+ {
1022
+ parent: this,
1023
+ isOptional: n,
1024
+ lazy: this.lazy,
1025
+ eager: this.eager,
1026
+ placeholderChar: this.placeholderChar,
1027
+ displayChar: this.displayChar
1028
+ },
1029
+ E
1030
+ )
1031
+ ) : new j({
1032
+ char: l,
1033
+ eager: this.eager,
1034
+ isUnmasking: s
1035
+ });
1036
+ this._blocks.push(A);
1037
+ }
1038
+ }
1039
+ /**
1040
+ @override
1041
+ */
1042
+ get state() {
1043
+ return Object.assign({}, super.state, {
1044
+ _blocks: this._blocks.map((t) => t.state)
1045
+ });
1046
+ }
1047
+ set state(t) {
1048
+ const { _blocks: e } = t, s = k(t, Q);
1049
+ this._blocks.forEach((n, u) => n.state = e[u]), super.state = s;
1050
+ }
1051
+ /**
1052
+ @override
1053
+ */
1054
+ reset() {
1055
+ super.reset(), this._blocks.forEach((t) => t.reset());
1056
+ }
1057
+ /**
1058
+ @override
1059
+ */
1060
+ get isComplete() {
1061
+ return this._blocks.every((t) => t.isComplete);
1062
+ }
1063
+ /**
1064
+ @override
1065
+ */
1066
+ get isFilled() {
1067
+ return this._blocks.every((t) => t.isFilled);
1068
+ }
1069
+ get isFixed() {
1070
+ return this._blocks.every((t) => t.isFixed);
1071
+ }
1072
+ get isOptional() {
1073
+ return this._blocks.every((t) => t.isOptional);
1074
+ }
1075
+ /**
1076
+ @override
1077
+ */
1078
+ doCommit() {
1079
+ this._blocks.forEach((t) => t.doCommit()), super.doCommit();
1080
+ }
1081
+ /**
1082
+ @override
1083
+ */
1084
+ get unmaskedValue() {
1085
+ return this._blocks.reduce((t, e) => t += e.unmaskedValue, "");
1086
+ }
1087
+ set unmaskedValue(t) {
1088
+ super.unmaskedValue = t;
1089
+ }
1090
+ /**
1091
+ @override
1092
+ */
1093
+ get value() {
1094
+ return this._blocks.reduce((t, e) => t += e.value, "");
1095
+ }
1096
+ set value(t) {
1097
+ super.value = t;
1098
+ }
1099
+ get displayValue() {
1100
+ return this._blocks.reduce((t, e) => t += e.displayValue, "");
1101
+ }
1102
+ /**
1103
+ @override
1104
+ */
1105
+ appendTail(t) {
1106
+ return super.appendTail(t).aggregate(this._appendPlaceholder());
1107
+ }
1108
+ /**
1109
+ @override
1110
+ */
1111
+ _appendEager() {
1112
+ var t;
1113
+ const e = new c();
1114
+ let s = (t = this._mapPosToBlock(this.value.length)) === null || t === void 0 ? void 0 : t.index;
1115
+ if (s == null)
1116
+ return e;
1117
+ this._blocks[s].isFilled && ++s;
1118
+ for (let n = s; n < this._blocks.length; ++n) {
1119
+ const u = this._blocks[n]._appendEager();
1120
+ if (!u.inserted)
1121
+ break;
1122
+ e.aggregate(u);
1123
+ }
1124
+ return e;
1125
+ }
1126
+ /**
1127
+ @override
1128
+ */
1129
+ _appendCharRaw(t) {
1130
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1131
+ const s = this._mapPosToBlock(this.value.length), n = new c();
1132
+ if (!s)
1133
+ return n;
1134
+ for (let r = s.index; ; ++r) {
1135
+ var u, i;
1136
+ const l = this._blocks[r];
1137
+ if (!l)
1138
+ break;
1139
+ const d = l._appendChar(
1140
+ t,
1141
+ Object.assign({}, e, {
1142
+ _beforeTailState: (u = e._beforeTailState) === null || u === void 0 || (i = u._blocks) === null || i === void 0 ? void 0 : i[r]
1143
+ })
1144
+ ), E = d.skip;
1145
+ if (n.aggregate(d), E || d.rawInserted)
1146
+ break;
1147
+ }
1148
+ return n;
1149
+ }
1150
+ /**
1151
+ @override
1152
+ */
1153
+ extractTail() {
1154
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length;
1155
+ const s = new F();
1156
+ return t === e || this._forEachBlocksInRange(t, e, (n, u, i, r) => {
1157
+ const l = n.extractTail(i, r);
1158
+ l.stop = this._findStopBefore(u), l.from = this._blockStartPos(u), l instanceof F && (l.blockIndex = u), s.extend(l);
1159
+ }), s;
1160
+ }
1161
+ /**
1162
+ @override
1163
+ */
1164
+ extractInput() {
1165
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1166
+ if (t === e)
1167
+ return "";
1168
+ let n = "";
1169
+ return this._forEachBlocksInRange(t, e, (u, i, r, l) => {
1170
+ n += u.extractInput(r, l, s);
1171
+ }), n;
1172
+ }
1173
+ _findStopBefore(t) {
1174
+ let e;
1175
+ for (let s = 0; s < this._stops.length; ++s) {
1176
+ const n = this._stops[s];
1177
+ if (n <= t)
1178
+ e = n;
1179
+ else
1180
+ break;
1181
+ }
30
1182
  return e;
31
- }), m = d(() => {
32
- let e = "ds-relative ds-bg-white ds-rounded-lg ds-shadow ";
33
- return e += s.fullscreen ? "ds-w-screen ds-h-screen ds-rounded-none " : "", e;
34
- }), p = () => {
35
- document.addEventListener("keydown", r);
36
- }, r = (e) => {
37
- e.key === "Escape" && n("close");
38
- }, f = () => {
39
- document.addEventListener("click", l);
40
- }, l = (e) => {
41
- [o.value].some((v) => e.composedPath().includes(v)) || n("close");
42
- };
43
- return h(() => {
44
- s.persistent || setTimeout(() => {
45
- p(), f();
46
- }, 200);
47
- }), B(() => {
48
- s.persistent || (document.removeEventListener("keydown", r), document.removeEventListener("click", l));
49
- }), (e, w) => (E(), x(_, null, {
50
- default: y(() => [
51
- a("div", {
52
- class: c(["modal-wrapper", u.value])
53
- }, [
54
- a("div", {
55
- ref_key: "modalWrapperContentRef",
56
- ref: o,
57
- class: c(["modal-wrapper-content ds-w-full", m.value])
58
- }, [
59
- L(e.$slots, "default")
60
- ], 2)
61
- ], 2)
62
- ]),
63
- _: 3
64
- }));
1183
+ }
1184
+ /** Appends placeholder depending on laziness */
1185
+ _appendPlaceholder(t) {
1186
+ const e = new c();
1187
+ if (this.lazy && t == null)
1188
+ return e;
1189
+ const s = this._mapPosToBlock(this.value.length);
1190
+ if (!s)
1191
+ return e;
1192
+ const n = s.index, u = t ?? this._blocks.length;
1193
+ return this._blocks.slice(n, u).forEach((i) => {
1194
+ if (!i.lazy || t != null) {
1195
+ const r = i._blocks != null ? [i._blocks.length] : [], l = i._appendPlaceholder(...r);
1196
+ this._value += l.inserted, e.aggregate(l);
1197
+ }
1198
+ }), e;
1199
+ }
1200
+ /** Finds block in pos */
1201
+ _mapPosToBlock(t) {
1202
+ let e = "";
1203
+ for (let s = 0; s < this._blocks.length; ++s) {
1204
+ const n = this._blocks[s], u = e.length;
1205
+ if (e += n.value, t <= e.length)
1206
+ return {
1207
+ index: s,
1208
+ offset: t - u
1209
+ };
1210
+ }
1211
+ }
1212
+ /** */
1213
+ _blockStartPos(t) {
1214
+ return this._blocks.slice(0, t).reduce((e, s) => e += s.value.length, 0);
1215
+ }
1216
+ /** */
1217
+ _forEachBlocksInRange(t) {
1218
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length, s = arguments.length > 2 ? arguments[2] : void 0;
1219
+ const n = this._mapPosToBlock(t);
1220
+ if (n) {
1221
+ const u = this._mapPosToBlock(e), i = u && n.index === u.index, r = n.offset, l = u && i ? u.offset : this._blocks[n.index].value.length;
1222
+ if (s(
1223
+ this._blocks[n.index],
1224
+ n.index,
1225
+ r,
1226
+ l
1227
+ ), u && !i) {
1228
+ for (let d = n.index + 1; d < u.index; ++d)
1229
+ s(this._blocks[d], d, 0, this._blocks[d].value.length);
1230
+ s(
1231
+ this._blocks[u.index],
1232
+ u.index,
1233
+ 0,
1234
+ u.offset
1235
+ );
1236
+ }
1237
+ }
1238
+ }
1239
+ /**
1240
+ @override
1241
+ */
1242
+ remove() {
1243
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length;
1244
+ const s = super.remove(t, e);
1245
+ return this._forEachBlocksInRange(t, e, (n, u, i, r) => {
1246
+ s.aggregate(n.remove(i, r));
1247
+ }), s;
1248
+ }
1249
+ /**
1250
+ @override
1251
+ */
1252
+ nearestInputPos(t) {
1253
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : o.NONE;
1254
+ if (!this._blocks.length)
1255
+ return 0;
1256
+ const s = new J(this, t);
1257
+ if (e === o.NONE)
1258
+ return s.pushRightBeforeInput() || (s.popState(), s.pushLeftBeforeInput()) ? s.pos : this.value.length;
1259
+ if (e === o.LEFT || e === o.FORCE_LEFT) {
1260
+ if (e === o.LEFT) {
1261
+ if (s.pushRightBeforeFilled(), s.ok && s.pos === t)
1262
+ return t;
1263
+ s.popState();
1264
+ }
1265
+ if (s.pushLeftBeforeInput(), s.pushLeftBeforeRequired(), s.pushLeftBeforeFilled(), e === o.LEFT) {
1266
+ if (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.ok && s.pos <= t || (s.popState(), s.ok && s.pos <= t))
1267
+ return s.pos;
1268
+ s.popState();
1269
+ }
1270
+ return s.ok ? s.pos : e === o.FORCE_LEFT ? 0 : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : 0);
1271
+ }
1272
+ return e === o.RIGHT || e === o.FORCE_RIGHT ? (s.pushRightBeforeInput(), s.pushRightBeforeRequired(), s.pushRightBeforeFilled() ? s.pos : e === o.FORCE_RIGHT ? this.value.length : (s.popState(), s.ok || (s.popState(), s.ok) ? s.pos : this.nearestInputPos(t, o.LEFT))) : t;
1273
+ }
1274
+ /**
1275
+ @override
1276
+ */
1277
+ totalInputPositions() {
1278
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length, s = 0;
1279
+ return this._forEachBlocksInRange(t, e, (n, u, i, r) => {
1280
+ s += n.totalInputPositions(i, r);
1281
+ }), s;
1282
+ }
1283
+ /** Get block by name */
1284
+ maskedBlock(t) {
1285
+ return this.maskedBlocks(t)[0];
1286
+ }
1287
+ /** Get all blocks by name */
1288
+ maskedBlocks(t) {
1289
+ const e = this._maskedBlocks[t];
1290
+ return e ? e.map((s) => this._blocks[s]) : [];
1291
+ }
1292
+ }
1293
+ f.DEFAULTS = {
1294
+ lazy: !0,
1295
+ placeholderChar: "_"
1296
+ }, f.STOP_CHAR = "`", f.ESCAPE_CHAR = "\\", f.InputDefinition = N, f.FixedDefinition = j, h.MaskedPattern = f;
1297
+ class T extends f {
1298
+ /**
1299
+ Optionally sets max length of pattern.
1300
+ Used when pattern length is longer then `to` param length. Pads zeros at start in this case.
1301
+ */
1302
+ /** Min bound */
1303
+ /** Max bound */
1304
+ /** */
1305
+ get _matchFrom() {
1306
+ return this.maxLength - String(this.from).length;
1307
+ }
1308
+ /**
1309
+ @override
1310
+ */
1311
+ _update(t) {
1312
+ t = Object.assign(
1313
+ {
1314
+ to: this.to || 0,
1315
+ from: this.from || 0,
1316
+ maxLength: this.maxLength || 0
1317
+ },
1318
+ t
1319
+ );
1320
+ let e = String(t.to).length;
1321
+ t.maxLength != null && (e = Math.max(e, t.maxLength)), t.maxLength = e;
1322
+ const s = String(t.from).padStart(e, "0"), n = String(t.to).padStart(e, "0");
1323
+ let u = 0;
1324
+ for (; u < n.length && n[u] === s[u]; )
1325
+ ++u;
1326
+ t.mask = n.slice(0, u).replace(/0/g, "\\0") + "0".repeat(e - u), super._update(t);
1327
+ }
1328
+ /**
1329
+ @override
1330
+ */
1331
+ get isComplete() {
1332
+ return super.isComplete && !!this.value;
1333
+ }
1334
+ boundaries(t) {
1335
+ let e = "", s = "";
1336
+ const [, n, u] = t.match(/^(\D*)(\d*)(\D*)/) || [];
1337
+ return u && (e = "0".repeat(n.length) + u, s = "9".repeat(n.length) + u), e = e.padEnd(this.maxLength, "0"), s = s.padEnd(this.maxLength, "9"), [e, s];
1338
+ }
1339
+ // TODO str is a single char everytime
1340
+ /**
1341
+ @override
1342
+ */
1343
+ doPrepare(t) {
1344
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s;
1345
+ if ([t, s] = M(
1346
+ super.doPrepare(t.replace(/\D/g, ""), e)
1347
+ ), !this.autofix || !t)
1348
+ return t;
1349
+ const n = String(this.from).padStart(this.maxLength, "0"), u = String(this.to).padStart(this.maxLength, "0");
1350
+ let i = this.value + t;
1351
+ if (i.length > this.maxLength)
1352
+ return "";
1353
+ const [r, l] = this.boundaries(i);
1354
+ return Number(l) < this.from ? n[i.length - 1] : Number(r) > this.to ? this.autofix === "pad" && i.length < this.maxLength ? [
1355
+ "",
1356
+ s.aggregate(
1357
+ this.append(n[i.length - 1] + t, e)
1358
+ )
1359
+ ] : u[i.length - 1] : t;
1360
+ }
1361
+ /**
1362
+ @override
1363
+ */
1364
+ doValidate() {
1365
+ const t = this.value;
1366
+ if (t.search(/[^0]/) === -1 && t.length <= this._matchFrom)
1367
+ return !0;
1368
+ const [s, n] = this.boundaries(t);
1369
+ return this.from <= Number(n) && Number(s) <= this.to && super.doValidate(...arguments);
1370
+ }
1371
+ }
1372
+ h.MaskedRange = T;
1373
+ class C extends f {
1374
+ /** Pattern mask for date according to {@link MaskedDate#format} */
1375
+ /** Start date */
1376
+ /** End date */
1377
+ /** */
1378
+ /**
1379
+ @param {Object} opts
1380
+ */
1381
+ constructor(t) {
1382
+ super(Object.assign({}, C.DEFAULTS, t));
1383
+ }
1384
+ /**
1385
+ @override
1386
+ */
1387
+ _update(t) {
1388
+ t.mask === Date && delete t.mask, t.pattern && (t.mask = t.pattern);
1389
+ const e = t.blocks;
1390
+ t.blocks = Object.assign({}, C.GET_DEFAULT_BLOCKS()), t.min && (t.blocks.Y.from = t.min.getFullYear()), t.max && (t.blocks.Y.to = t.max.getFullYear()), t.min && t.max && t.blocks.Y.from === t.blocks.Y.to && (t.blocks.m.from = t.min.getMonth() + 1, t.blocks.m.to = t.max.getMonth() + 1, t.blocks.m.from === t.blocks.m.to && (t.blocks.d.from = t.min.getDate(), t.blocks.d.to = t.max.getDate())), Object.assign(t.blocks, this.blocks, e), Object.keys(t.blocks).forEach((s) => {
1391
+ const n = t.blocks[s];
1392
+ !("autofix" in n) && "autofix" in t && (n.autofix = t.autofix);
1393
+ }), super._update(t);
1394
+ }
1395
+ /**
1396
+ @override
1397
+ */
1398
+ doValidate() {
1399
+ const t = this.date;
1400
+ return super.doValidate(...arguments) && (!this.isComplete || this.isDateExist(this.value) && t != null && (this.min == null || this.min <= t) && (this.max == null || t <= this.max));
1401
+ }
1402
+ /** Checks if date is exists */
1403
+ isDateExist(t) {
1404
+ return this.format(this.parse(t, this), this).indexOf(t) >= 0;
1405
+ }
1406
+ /** Parsed Date */
1407
+ get date() {
1408
+ return this.typedValue;
1409
+ }
1410
+ set date(t) {
1411
+ this.typedValue = t;
1412
+ }
1413
+ /**
1414
+ @override
1415
+ */
1416
+ get typedValue() {
1417
+ return this.isComplete ? super.typedValue : null;
1418
+ }
1419
+ set typedValue(t) {
1420
+ super.typedValue = t;
1421
+ }
1422
+ /**
1423
+ @override
1424
+ */
1425
+ maskEquals(t) {
1426
+ return t === Date || super.maskEquals(t);
1427
+ }
1428
+ }
1429
+ C.DEFAULTS = {
1430
+ pattern: "d{.}`m{.}`Y",
1431
+ format: (a) => {
1432
+ if (!a)
1433
+ return "";
1434
+ const t = String(a.getDate()).padStart(2, "0"), e = String(a.getMonth() + 1).padStart(2, "0"), s = a.getFullYear();
1435
+ return [t, e, s].join(".");
1436
+ },
1437
+ parse: (a) => {
1438
+ const [t, e, s] = a.split(".");
1439
+ return new Date(s, e - 1, t);
1440
+ }
1441
+ }, C.GET_DEFAULT_BLOCKS = () => ({
1442
+ d: {
1443
+ mask: T,
1444
+ from: 1,
1445
+ to: 31,
1446
+ maxLength: 2
1447
+ },
1448
+ m: {
1449
+ mask: T,
1450
+ from: 1,
1451
+ to: 12,
1452
+ maxLength: 2
1453
+ },
1454
+ Y: {
1455
+ mask: T,
1456
+ from: 1900,
1457
+ to: 9999
1458
+ }
1459
+ }), h.MaskedDate = C;
1460
+ class P {
1461
+ /** */
1462
+ /** */
1463
+ /** */
1464
+ /** Safely returns selection start */
1465
+ get selectionStart() {
1466
+ let t;
1467
+ try {
1468
+ t = this._unsafeSelectionStart;
1469
+ } catch {
1470
+ }
1471
+ return t ?? this.value.length;
1472
+ }
1473
+ /** Safely returns selection end */
1474
+ get selectionEnd() {
1475
+ let t;
1476
+ try {
1477
+ t = this._unsafeSelectionEnd;
1478
+ } catch {
1479
+ }
1480
+ return t ?? this.value.length;
1481
+ }
1482
+ /** Safely sets element selection */
1483
+ select(t, e) {
1484
+ if (!(t == null || e == null || t === this.selectionStart && e === this.selectionEnd))
1485
+ try {
1486
+ this._unsafeSelect(t, e);
1487
+ } catch {
1488
+ }
1489
+ }
1490
+ /** Should be overriden in subclasses */
1491
+ _unsafeSelect(t, e) {
1492
+ }
1493
+ /** Should be overriden in subclasses */
1494
+ get isActive() {
1495
+ return !1;
1496
+ }
1497
+ /** Should be overriden in subclasses */
1498
+ bindEvents(t) {
1499
+ }
1500
+ /** Should be overriden in subclasses */
1501
+ unbindEvents() {
1502
+ }
1503
+ }
1504
+ h.MaskElement = P;
1505
+ class S extends P {
1506
+ /** Mapping between HTMLElement events and mask internal events */
1507
+ /** HTMLElement to use mask on */
1508
+ /**
1509
+ @param {HTMLInputElement|HTMLTextAreaElement} input
1510
+ */
1511
+ constructor(t) {
1512
+ super(), this.input = t, this._handlers = {};
1513
+ }
1514
+ /** */
1515
+ // $FlowFixMe https://github.com/facebook/flow/issues/2839
1516
+ get rootElement() {
1517
+ var t, e, s;
1518
+ return (t = (e = (s = this.input).getRootNode) === null || e === void 0 ? void 0 : e.call(s)) !== null && t !== void 0 ? t : document;
1519
+ }
1520
+ /**
1521
+ Is element in focus
1522
+ @readonly
1523
+ */
1524
+ get isActive() {
1525
+ return this.input === this.rootElement.activeElement;
1526
+ }
1527
+ /**
1528
+ Returns HTMLElement selection start
1529
+ @override
1530
+ */
1531
+ get _unsafeSelectionStart() {
1532
+ return this.input.selectionStart;
1533
+ }
1534
+ /**
1535
+ Returns HTMLElement selection end
1536
+ @override
1537
+ */
1538
+ get _unsafeSelectionEnd() {
1539
+ return this.input.selectionEnd;
1540
+ }
1541
+ /**
1542
+ Sets HTMLElement selection
1543
+ @override
1544
+ */
1545
+ _unsafeSelect(t, e) {
1546
+ this.input.setSelectionRange(t, e);
1547
+ }
1548
+ /**
1549
+ HTMLElement value
1550
+ @override
1551
+ */
1552
+ get value() {
1553
+ return this.input.value;
1554
+ }
1555
+ set value(t) {
1556
+ this.input.value = t;
1557
+ }
1558
+ /**
1559
+ Binds HTMLElement events to mask internal events
1560
+ @override
1561
+ */
1562
+ bindEvents(t) {
1563
+ Object.keys(t).forEach(
1564
+ (e) => this._toggleEventHandler(
1565
+ S.EVENTS_MAP[e],
1566
+ t[e]
1567
+ )
1568
+ );
1569
+ }
1570
+ /**
1571
+ Unbinds HTMLElement events to mask internal events
1572
+ @override
1573
+ */
1574
+ unbindEvents() {
1575
+ Object.keys(this._handlers).forEach(
1576
+ (t) => this._toggleEventHandler(t)
1577
+ );
1578
+ }
1579
+ /** */
1580
+ _toggleEventHandler(t, e) {
1581
+ this._handlers[t] && (this.input.removeEventListener(t, this._handlers[t]), delete this._handlers[t]), e && (this.input.addEventListener(t, e), this._handlers[t] = e);
1582
+ }
1583
+ }
1584
+ S.EVENTS_MAP = {
1585
+ selectionChange: "keydown",
1586
+ input: "input",
1587
+ drop: "drop",
1588
+ click: "click",
1589
+ focus: "focus",
1590
+ commit: "blur"
1591
+ }, h.HTMLMaskElement = S;
1592
+ class y extends S {
1593
+ /**
1594
+ Returns HTMLElement selection start
1595
+ @override
1596
+ */
1597
+ get _unsafeSelectionStart() {
1598
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, n = e && e.focusOffset;
1599
+ return n == null || s == null || s < n ? s : n;
1600
+ }
1601
+ /**
1602
+ Returns HTMLElement selection end
1603
+ @override
1604
+ */
1605
+ get _unsafeSelectionEnd() {
1606
+ const t = this.rootElement, e = t.getSelection && t.getSelection(), s = e && e.anchorOffset, n = e && e.focusOffset;
1607
+ return n == null || s == null || s > n ? s : n;
1608
+ }
1609
+ /**
1610
+ Sets HTMLElement selection
1611
+ @override
1612
+ */
1613
+ _unsafeSelect(t, e) {
1614
+ if (!this.rootElement.createRange)
1615
+ return;
1616
+ const s = this.rootElement.createRange();
1617
+ s.setStart(this.input.firstChild || this.input, t), s.setEnd(this.input.lastChild || this.input, e);
1618
+ const n = this.rootElement, u = n.getSelection && n.getSelection();
1619
+ u && (u.removeAllRanges(), u.addRange(s));
1620
+ }
1621
+ /**
1622
+ HTMLElement value
1623
+ @override
1624
+ */
1625
+ get value() {
1626
+ return this.input.textContent;
1627
+ }
1628
+ set value(t) {
1629
+ this.input.textContent = t;
1630
+ }
1631
+ }
1632
+ h.HTMLContenteditableMaskElement = y;
1633
+ const tt = ["mask"];
1634
+ class H {
1635
+ /**
1636
+ View element
1637
+ @readonly
1638
+ */
1639
+ /**
1640
+ Internal {@link Masked} model
1641
+ @readonly
1642
+ */
1643
+ /**
1644
+ @param {MaskElement|HTMLInputElement|HTMLTextAreaElement} el
1645
+ @param {Object} opts
1646
+ */
1647
+ constructor(t, e) {
1648
+ this.el = t instanceof P ? t : t.isContentEditable && t.tagName !== "INPUT" && t.tagName !== "TEXTAREA" ? new y(t) : new S(t), this.masked = v(e), this._listeners = {}, this._value = "", this._unmaskedValue = "", this._saveSelection = this._saveSelection.bind(this), this._onInput = this._onInput.bind(this), this._onChange = this._onChange.bind(this), this._onDrop = this._onDrop.bind(this), this._onFocus = this._onFocus.bind(this), this._onClick = this._onClick.bind(this), this.alignCursor = this.alignCursor.bind(this), this.alignCursorFriendly = this.alignCursorFriendly.bind(this), this._bindEvents(), this.updateValue(), this._onChange();
1649
+ }
1650
+ /** Read or update mask */
1651
+ get mask() {
1652
+ return this.masked.mask;
1653
+ }
1654
+ maskEquals(t) {
1655
+ var e;
1656
+ return t == null || ((e = this.masked) === null || e === void 0 ? void 0 : e.maskEquals(t));
1657
+ }
1658
+ set mask(t) {
1659
+ if (this.maskEquals(t))
1660
+ return;
1661
+ if (!(t instanceof h.Masked) && this.masked.constructor === L(t)) {
1662
+ this.masked.updateOptions({
1663
+ mask: t
1664
+ });
1665
+ return;
1666
+ }
1667
+ const e = v({
1668
+ mask: t
1669
+ });
1670
+ e.unmaskedValue = this.masked.unmaskedValue, this.masked = e;
1671
+ }
1672
+ /** Raw value */
1673
+ get value() {
1674
+ return this._value;
1675
+ }
1676
+ set value(t) {
1677
+ this.value !== t && (this.masked.value = t, this.updateControl(), this.alignCursor());
1678
+ }
1679
+ /** Unmasked value */
1680
+ get unmaskedValue() {
1681
+ return this._unmaskedValue;
1682
+ }
1683
+ set unmaskedValue(t) {
1684
+ this.unmaskedValue !== t && (this.masked.unmaskedValue = t, this.updateControl(), this.alignCursor());
1685
+ }
1686
+ /** Typed unmasked value */
1687
+ get typedValue() {
1688
+ return this.masked.typedValue;
1689
+ }
1690
+ set typedValue(t) {
1691
+ this.masked.typedValueEquals(t) || (this.masked.typedValue = t, this.updateControl(), this.alignCursor());
1692
+ }
1693
+ /** Display value */
1694
+ get displayValue() {
1695
+ return this.masked.displayValue;
1696
+ }
1697
+ /**
1698
+ Starts listening to element events
1699
+ @protected
1700
+ */
1701
+ _bindEvents() {
1702
+ this.el.bindEvents({
1703
+ selectionChange: this._saveSelection,
1704
+ input: this._onInput,
1705
+ drop: this._onDrop,
1706
+ click: this._onClick,
1707
+ focus: this._onFocus,
1708
+ commit: this._onChange
1709
+ });
1710
+ }
1711
+ /**
1712
+ Stops listening to element events
1713
+ @protected
1714
+ */
1715
+ _unbindEvents() {
1716
+ this.el && this.el.unbindEvents();
1717
+ }
1718
+ /**
1719
+ Fires custom event
1720
+ @protected
1721
+ */
1722
+ _fireEvent(t) {
1723
+ for (var e = arguments.length, s = new Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++)
1724
+ s[n - 1] = arguments[n];
1725
+ const u = this._listeners[t];
1726
+ u && u.forEach((i) => i(...s));
1727
+ }
1728
+ /**
1729
+ Current selection start
1730
+ @readonly
1731
+ */
1732
+ get selectionStart() {
1733
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionStart;
1734
+ }
1735
+ /** Current cursor position */
1736
+ get cursorPos() {
1737
+ return this._cursorChanging ? this._changingCursorPos : this.el.selectionEnd;
1738
+ }
1739
+ set cursorPos(t) {
1740
+ !this.el || !this.el.isActive || (this.el.select(t, t), this._saveSelection());
1741
+ }
1742
+ /**
1743
+ Stores current selection
1744
+ @protected
1745
+ */
1746
+ _saveSelection() {
1747
+ this.displayValue !== this.el.value && console.warn(
1748
+ "Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."
1749
+ ), this._selection = {
1750
+ start: this.selectionStart,
1751
+ end: this.cursorPos
1752
+ };
1753
+ }
1754
+ /** Syncronizes model value from view */
1755
+ updateValue() {
1756
+ this.masked.value = this.el.value, this._value = this.masked.value;
1757
+ }
1758
+ /** Syncronizes view from model value, fires change events */
1759
+ updateControl() {
1760
+ const t = this.masked.unmaskedValue, e = this.masked.value, s = this.displayValue, n = this.unmaskedValue !== t || this.value !== e;
1761
+ this._unmaskedValue = t, this._value = e, this.el.value !== s && (this.el.value = s), n && this._fireChangeEvents();
1762
+ }
1763
+ /** Updates options with deep equal check, recreates @{link Masked} model if mask type changes */
1764
+ updateOptions(t) {
1765
+ const { mask: e } = t, s = k(t, tt), n = !this.maskEquals(e), u = !I(this.masked, s);
1766
+ n && (this.mask = e), u && this.masked.updateOptions(s), (n || u) && this.updateControl();
1767
+ }
1768
+ /** Updates cursor */
1769
+ updateCursor(t) {
1770
+ t != null && (this.cursorPos = t, this._delayUpdateCursor(t));
1771
+ }
1772
+ /**
1773
+ Delays cursor update to support mobile browsers
1774
+ @private
1775
+ */
1776
+ _delayUpdateCursor(t) {
1777
+ this._abortUpdateCursor(), this._changingCursorPos = t, this._cursorChanging = setTimeout(() => {
1778
+ this.el && (this.cursorPos = this._changingCursorPos, this._abortUpdateCursor());
1779
+ }, 10);
1780
+ }
1781
+ /**
1782
+ Fires custom events
1783
+ @protected
1784
+ */
1785
+ _fireChangeEvents() {
1786
+ this._fireEvent("accept", this._inputEvent), this.masked.isComplete && this._fireEvent("complete", this._inputEvent);
1787
+ }
1788
+ /**
1789
+ Aborts delayed cursor update
1790
+ @private
1791
+ */
1792
+ _abortUpdateCursor() {
1793
+ this._cursorChanging && (clearTimeout(this._cursorChanging), delete this._cursorChanging);
1794
+ }
1795
+ /** Aligns cursor to nearest available position */
1796
+ alignCursor() {
1797
+ this.cursorPos = this.masked.nearestInputPos(
1798
+ this.masked.nearestInputPos(this.cursorPos, o.LEFT)
1799
+ );
1800
+ }
1801
+ /** Aligns cursor only if selection is empty */
1802
+ alignCursorFriendly() {
1803
+ this.selectionStart === this.cursorPos && this.alignCursor();
1804
+ }
1805
+ /** Adds listener on custom event */
1806
+ on(t, e) {
1807
+ return this._listeners[t] || (this._listeners[t] = []), this._listeners[t].push(e), this;
1808
+ }
1809
+ /** Removes custom event listener */
1810
+ off(t, e) {
1811
+ if (!this._listeners[t])
1812
+ return this;
1813
+ if (!e)
1814
+ return delete this._listeners[t], this;
1815
+ const s = this._listeners[t].indexOf(e);
1816
+ return s >= 0 && this._listeners[t].splice(s, 1), this;
1817
+ }
1818
+ /** Handles view input event */
1819
+ _onInput(t) {
1820
+ if (this._inputEvent = t, this._abortUpdateCursor(), !this._selection)
1821
+ return this.updateValue();
1822
+ const e = new K(
1823
+ // new state
1824
+ this.el.value,
1825
+ this.cursorPos,
1826
+ // old state
1827
+ this.displayValue,
1828
+ this._selection
1829
+ ), s = this.masked.rawInputValue, n = this.masked.splice(
1830
+ e.startChangePos,
1831
+ e.removed.length,
1832
+ e.inserted,
1833
+ e.removeDirection,
1834
+ {
1835
+ input: !0,
1836
+ raw: !0
1837
+ }
1838
+ ).offset, u = s === this.masked.rawInputValue ? e.removeDirection : o.NONE;
1839
+ let i = this.masked.nearestInputPos(
1840
+ e.startChangePos + n,
1841
+ u
1842
+ );
1843
+ u !== o.NONE && (i = this.masked.nearestInputPos(i, o.NONE)), this.updateControl(), this.updateCursor(i), delete this._inputEvent;
1844
+ }
1845
+ /** Handles view change event and commits model value */
1846
+ _onChange() {
1847
+ this.displayValue !== this.el.value && this.updateValue(), this.masked.doCommit(), this.updateControl(), this._saveSelection();
1848
+ }
1849
+ /** Handles view drop event, prevents by default */
1850
+ _onDrop(t) {
1851
+ t.preventDefault(), t.stopPropagation();
1852
+ }
1853
+ /** Restore last selection on focus */
1854
+ _onFocus(t) {
1855
+ this.alignCursorFriendly();
1856
+ }
1857
+ /** Restore last selection on focus */
1858
+ _onClick(t) {
1859
+ this.alignCursorFriendly();
1860
+ }
1861
+ /** Unbind view events and removes element reference */
1862
+ destroy() {
1863
+ this._unbindEvents(), this._listeners.length = 0, delete this.el;
1864
+ }
1865
+ }
1866
+ h.InputMask = H;
1867
+ class z extends f {
1868
+ /**
1869
+ @override
1870
+ @param {Object} opts
1871
+ */
1872
+ _update(t) {
1873
+ t.enum && (t.mask = "*".repeat(t.enum[0].length)), super._update(t);
1874
+ }
1875
+ /**
1876
+ @override
1877
+ */
1878
+ doValidate() {
1879
+ return this.enum.some((t) => t.indexOf(this.unmaskedValue) >= 0) && super.doValidate(...arguments);
1880
+ }
1881
+ }
1882
+ h.MaskedEnum = z;
1883
+ class m extends p {
1884
+ /** Single char */
1885
+ /** Single char */
1886
+ /** Array of single chars */
1887
+ /** */
1888
+ /** */
1889
+ /** Digits after point */
1890
+ /** */
1891
+ /** Flag to remove leading and trailing zeros in the end of editing */
1892
+ /** Flag to pad trailing zeros after point in the end of editing */
1893
+ constructor(t) {
1894
+ super(Object.assign({}, m.DEFAULTS, t));
1895
+ }
1896
+ /**
1897
+ @override
1898
+ */
1899
+ _update(t) {
1900
+ super._update(t), this._updateRegExps();
1901
+ }
1902
+ /** */
1903
+ _updateRegExps() {
1904
+ let t = "^" + (this.allowNegative ? "[+|\\-]?" : ""), e = "\\d*", s = (this.scale ? "(".concat(R(this.radix), "\\d{0,").concat(this.scale, "})?") : "") + "$";
1905
+ this._numberRegExp = new RegExp(t + e + s), this._mapToRadixRegExp = new RegExp(
1906
+ "[".concat(this.mapToRadix.map(R).join(""), "]"),
1907
+ "g"
1908
+ ), this._thousandsSeparatorRegExp = new RegExp(
1909
+ R(this.thousandsSeparator),
1910
+ "g"
1911
+ );
1912
+ }
1913
+ /** */
1914
+ _removeThousandsSeparators(t) {
1915
+ return t.replace(this._thousandsSeparatorRegExp, "");
1916
+ }
1917
+ /** */
1918
+ _insertThousandsSeparators(t) {
1919
+ const e = t.split(this.radix);
1920
+ return e[0] = e[0].replace(
1921
+ /\B(?=(\d{3})+(?!\d))/g,
1922
+ this.thousandsSeparator
1923
+ ), e.join(this.radix);
1924
+ }
1925
+ /**
1926
+ @override
1927
+ */
1928
+ doPrepare(t) {
1929
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1930
+ t = this._removeThousandsSeparators(
1931
+ this.scale && this.mapToRadix.length && /*
1932
+ radix should be mapped when
1933
+ 1) input is done from keyboard = flags.input && flags.raw
1934
+ 2) unmasked value is set = !flags.input && !flags.raw
1935
+ and should not be mapped when
1936
+ 1) value is set = flags.input && !flags.raw
1937
+ 2) raw value is set = !flags.input && flags.raw
1938
+ */
1939
+ (e.input && e.raw || !e.input && !e.raw) ? t.replace(this._mapToRadixRegExp, this.radix) : t
1940
+ );
1941
+ const [s, n] = M(super.doPrepare(t, e));
1942
+ return t && !s && (n.skip = !0), [s, n];
1943
+ }
1944
+ /** */
1945
+ _separatorsCount(t) {
1946
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, s = 0;
1947
+ for (let n = 0; n < t; ++n)
1948
+ this._value.indexOf(this.thousandsSeparator, n) === n && (++s, e && (t += this.thousandsSeparator.length));
1949
+ return s;
1950
+ }
1951
+ /** */
1952
+ _separatorsCountFromSlice() {
1953
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this._value;
1954
+ return this._separatorsCount(
1955
+ this._removeThousandsSeparators(t).length,
1956
+ !0
1957
+ );
1958
+ }
1959
+ /**
1960
+ @override
1961
+ */
1962
+ extractInput() {
1963
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length, s = arguments.length > 2 ? arguments[2] : void 0;
1964
+ return [t, e] = this._adjustRangeWithSeparators(t, e), this._removeThousandsSeparators(
1965
+ super.extractInput(t, e, s)
1966
+ );
1967
+ }
1968
+ /**
1969
+ @override
1970
+ */
1971
+ _appendCharRaw(t) {
1972
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1973
+ if (!this.thousandsSeparator)
1974
+ return super._appendCharRaw(t, e);
1975
+ const s = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, n = this._separatorsCountFromSlice(s);
1976
+ this._value = this._removeThousandsSeparators(this.value);
1977
+ const u = super._appendCharRaw(t, e);
1978
+ this._value = this._insertThousandsSeparators(this._value);
1979
+ const i = e.tail && e._beforeTailState ? e._beforeTailState._value : this._value, r = this._separatorsCountFromSlice(i);
1980
+ return u.tailShift += (r - n) * this.thousandsSeparator.length, u.skip = !u.rawInserted && t === this.thousandsSeparator, u;
1981
+ }
1982
+ /** */
1983
+ _findSeparatorAround(t) {
1984
+ if (this.thousandsSeparator) {
1985
+ const e = t - this.thousandsSeparator.length + 1, s = this.value.indexOf(
1986
+ this.thousandsSeparator,
1987
+ e
1988
+ );
1989
+ if (s <= t)
1990
+ return s;
1991
+ }
1992
+ return -1;
1993
+ }
1994
+ _adjustRangeWithSeparators(t, e) {
1995
+ const s = this._findSeparatorAround(t);
1996
+ s >= 0 && (t = s);
1997
+ const n = this._findSeparatorAround(e);
1998
+ return n >= 0 && (e = n + this.thousandsSeparator.length), [t, e];
1999
+ }
2000
+ /**
2001
+ @override
2002
+ */
2003
+ remove() {
2004
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.value.length;
2005
+ [t, e] = this._adjustRangeWithSeparators(t, e);
2006
+ const s = this.value.slice(0, t), n = this.value.slice(e), u = this._separatorsCount(
2007
+ s.length
2008
+ );
2009
+ this._value = this._insertThousandsSeparators(
2010
+ this._removeThousandsSeparators(s + n)
2011
+ );
2012
+ const i = this._separatorsCountFromSlice(s);
2013
+ return new c({
2014
+ tailShift: (i - u) * this.thousandsSeparator.length
2015
+ });
2016
+ }
2017
+ /**
2018
+ @override
2019
+ */
2020
+ nearestInputPos(t, e) {
2021
+ if (!this.thousandsSeparator)
2022
+ return t;
2023
+ switch (e) {
2024
+ case o.NONE:
2025
+ case o.LEFT:
2026
+ case o.FORCE_LEFT: {
2027
+ const s = this._findSeparatorAround(t - 1);
2028
+ if (s >= 0) {
2029
+ const n = s + this.thousandsSeparator.length;
2030
+ if (t < n || this.value.length <= n || e === o.FORCE_LEFT)
2031
+ return s;
2032
+ }
2033
+ break;
2034
+ }
2035
+ case o.RIGHT:
2036
+ case o.FORCE_RIGHT: {
2037
+ const s = this._findSeparatorAround(t);
2038
+ if (s >= 0)
2039
+ return s + this.thousandsSeparator.length;
2040
+ }
2041
+ }
2042
+ return t;
2043
+ }
2044
+ /**
2045
+ @override
2046
+ */
2047
+ doValidate(t) {
2048
+ let e = !!this._removeThousandsSeparators(this.value).match(this._numberRegExp);
2049
+ if (e) {
2050
+ const s = this.number;
2051
+ e = e && !isNaN(s) && // check min bound for negative values
2052
+ (this.min == null || this.min >= 0 || this.min <= this.number) && // check max bound for positive values
2053
+ (this.max == null || this.max <= 0 || this.number <= this.max);
2054
+ }
2055
+ return e && super.doValidate(t);
2056
+ }
2057
+ /**
2058
+ @override
2059
+ */
2060
+ doCommit() {
2061
+ if (this.value) {
2062
+ const t = this.number;
2063
+ let e = t;
2064
+ this.min != null && (e = Math.max(e, this.min)), this.max != null && (e = Math.min(e, this.max)), e !== t && (this.unmaskedValue = this.doFormat(e));
2065
+ let s = this.value;
2066
+ this.normalizeZeros && (s = this._normalizeZeros(s)), this.padFractionalZeros && this.scale > 0 && (s = this._padFractionalZeros(s)), this._value = s;
2067
+ }
2068
+ super.doCommit();
2069
+ }
2070
+ /** */
2071
+ _normalizeZeros(t) {
2072
+ const e = this._removeThousandsSeparators(t).split(this.radix);
2073
+ return e[0] = e[0].replace(
2074
+ /^(\D*)(0*)(\d*)/,
2075
+ (s, n, u, i) => n + i
2076
+ ), t.length && !/\d$/.test(e[0]) && (e[0] = e[0] + "0"), e.length > 1 && (e[1] = e[1].replace(/0*$/, ""), e[1].length || (e.length = 1)), this._insertThousandsSeparators(e.join(this.radix));
2077
+ }
2078
+ /** */
2079
+ _padFractionalZeros(t) {
2080
+ if (!t)
2081
+ return t;
2082
+ const e = t.split(this.radix);
2083
+ return e.length < 2 && e.push(""), e[1] = e[1].padEnd(this.scale, "0"), e.join(this.radix);
2084
+ }
2085
+ /** */
2086
+ doSkipInvalid(t) {
2087
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 ? arguments[2] : void 0;
2088
+ const n = this.scale === 0 && t !== this.thousandsSeparator && (t === this.radix || t === m.UNMASKED_RADIX || this.mapToRadix.includes(t));
2089
+ return super.doSkipInvalid(t, e, s) && !n;
2090
+ }
2091
+ /**
2092
+ @override
2093
+ */
2094
+ get unmaskedValue() {
2095
+ return this._removeThousandsSeparators(
2096
+ this._normalizeZeros(this.value)
2097
+ ).replace(this.radix, m.UNMASKED_RADIX);
2098
+ }
2099
+ set unmaskedValue(t) {
2100
+ super.unmaskedValue = t;
2101
+ }
2102
+ /**
2103
+ @override
2104
+ */
2105
+ get typedValue() {
2106
+ return this.doParse(this.unmaskedValue);
2107
+ }
2108
+ set typedValue(t) {
2109
+ this.rawInputValue = this.doFormat(t).replace(
2110
+ m.UNMASKED_RADIX,
2111
+ this.radix
2112
+ );
2113
+ }
2114
+ /** Parsed Number */
2115
+ get number() {
2116
+ return this.typedValue;
2117
+ }
2118
+ set number(t) {
2119
+ this.typedValue = t;
2120
+ }
2121
+ /**
2122
+ Is negative allowed
2123
+ @readonly
2124
+ */
2125
+ get allowNegative() {
2126
+ return this.signed || this.min != null && this.min < 0 || this.max != null && this.max < 0;
2127
+ }
2128
+ /**
2129
+ @override
2130
+ */
2131
+ typedValueEquals(t) {
2132
+ return (super.typedValueEquals(t) || m.EMPTY_VALUES.includes(t) && m.EMPTY_VALUES.includes(this.typedValue)) && !(t === 0 && this.value === "");
2133
+ }
2134
+ }
2135
+ m.UNMASKED_RADIX = ".", m.DEFAULTS = {
2136
+ radix: ",",
2137
+ thousandsSeparator: "",
2138
+ mapToRadix: [m.UNMASKED_RADIX],
2139
+ scale: 2,
2140
+ signed: !1,
2141
+ normalizeZeros: !0,
2142
+ padFractionalZeros: !1,
2143
+ parse: Number,
2144
+ format: (a) => a.toLocaleString("en-US", {
2145
+ useGrouping: !1,
2146
+ maximumFractionDigits: 20
2147
+ })
2148
+ }, m.EMPTY_VALUES = [...p.EMPTY_VALUES, 0], h.MaskedNumber = m;
2149
+ class G extends p {
2150
+ /**
2151
+ @override
2152
+ @param {Object} opts
2153
+ */
2154
+ _update(t) {
2155
+ t.mask && (t.validate = t.mask), super._update(t);
2156
+ }
2157
+ }
2158
+ h.MaskedFunction = G;
2159
+ const et = ["compiledMasks", "currentMaskRef", "currentMask"], st = ["mask"];
2160
+ class x extends p {
2161
+ /** Currently chosen mask */
2162
+ /** Compliled {@link Masked} options */
2163
+ /** Chooses {@link Masked} depending on input value */
2164
+ /**
2165
+ @param {Object} opts
2166
+ */
2167
+ constructor(t) {
2168
+ super(Object.assign({}, x.DEFAULTS, t)), this.currentMask = null;
2169
+ }
2170
+ /**
2171
+ @override
2172
+ */
2173
+ _update(t) {
2174
+ super._update(t), "mask" in t && (this.compiledMasks = Array.isArray(t.mask) ? t.mask.map((e) => v(e)) : []);
2175
+ }
2176
+ /**
2177
+ @override
2178
+ */
2179
+ _appendCharRaw(t) {
2180
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2181
+ const s = this._applyDispatch(t, e);
2182
+ return this.currentMask && s.aggregate(
2183
+ this.currentMask._appendChar(t, this.currentMaskFlags(e))
2184
+ ), s;
2185
+ }
2186
+ _applyDispatch() {
2187
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
2188
+ const n = e.tail && e._beforeTailState != null ? e._beforeTailState._value : this.value, u = this.rawInputValue, i = e.tail && e._beforeTailState != null ? (
2189
+ // $FlowFixMe - tired to fight with type system
2190
+ e._beforeTailState._rawInputValue
2191
+ ) : u, r = u.slice(i.length), l = this.currentMask, d = new c(), E = l == null ? void 0 : l.state;
2192
+ if (this.currentMask = this.doDispatch(
2193
+ t,
2194
+ Object.assign({}, e),
2195
+ s
2196
+ ), this.currentMask)
2197
+ if (this.currentMask !== l) {
2198
+ if (this.currentMask.reset(), i) {
2199
+ const A = this.currentMask.append(i, {
2200
+ raw: !0
2201
+ });
2202
+ d.tailShift = A.inserted.length - n.length;
2203
+ }
2204
+ r && (d.tailShift += this.currentMask.append(r, {
2205
+ raw: !0,
2206
+ tail: !0
2207
+ }).tailShift);
2208
+ } else
2209
+ this.currentMask.state = E;
2210
+ return d;
2211
+ }
2212
+ _appendPlaceholder() {
2213
+ const t = this._applyDispatch(...arguments);
2214
+ return this.currentMask && t.aggregate(this.currentMask._appendPlaceholder()), t;
2215
+ }
2216
+ /**
2217
+ @override
2218
+ */
2219
+ _appendEager() {
2220
+ const t = this._applyDispatch(...arguments);
2221
+ return this.currentMask && t.aggregate(this.currentMask._appendEager()), t;
2222
+ }
2223
+ appendTail(t) {
2224
+ const e = new c();
2225
+ return t && e.aggregate(this._applyDispatch("", {}, t)), e.aggregate(
2226
+ this.currentMask ? this.currentMask.appendTail(t) : super.appendTail(t)
2227
+ );
2228
+ }
2229
+ currentMaskFlags(t) {
2230
+ var e, s;
2231
+ return Object.assign({}, t, {
2232
+ _beforeTailState: ((e = t._beforeTailState) === null || e === void 0 ? void 0 : e.currentMaskRef) === this.currentMask && ((s = t._beforeTailState) === null || s === void 0 ? void 0 : s.currentMask) || t._beforeTailState
2233
+ });
2234
+ }
2235
+ /**
2236
+ @override
2237
+ */
2238
+ doDispatch(t) {
2239
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
2240
+ return this.dispatch(t, this, e, s);
2241
+ }
2242
+ /**
2243
+ @override
2244
+ */
2245
+ doValidate(t) {
2246
+ return super.doValidate(t) && (!this.currentMask || this.currentMask.doValidate(this.currentMaskFlags(t)));
2247
+ }
2248
+ /**
2249
+ @override
2250
+ */
2251
+ doPrepare(t) {
2252
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, [s, n] = M(super.doPrepare(t, e));
2253
+ if (this.currentMask) {
2254
+ let u;
2255
+ [s, u] = M(
2256
+ super.doPrepare(s, this.currentMaskFlags(e))
2257
+ ), n = n.aggregate(u);
2258
+ }
2259
+ return [s, n];
2260
+ }
2261
+ /**
2262
+ @override
2263
+ */
2264
+ reset() {
2265
+ var t;
2266
+ (t = this.currentMask) === null || t === void 0 || t.reset(), this.compiledMasks.forEach((e) => e.reset());
2267
+ }
2268
+ /**
2269
+ @override
2270
+ */
2271
+ get value() {
2272
+ return this.currentMask ? this.currentMask.value : "";
2273
+ }
2274
+ set value(t) {
2275
+ super.value = t;
2276
+ }
2277
+ /**
2278
+ @override
2279
+ */
2280
+ get unmaskedValue() {
2281
+ return this.currentMask ? this.currentMask.unmaskedValue : "";
2282
+ }
2283
+ set unmaskedValue(t) {
2284
+ super.unmaskedValue = t;
2285
+ }
2286
+ /**
2287
+ @override
2288
+ */
2289
+ get typedValue() {
2290
+ return this.currentMask ? this.currentMask.typedValue : "";
2291
+ }
2292
+ // probably typedValue should not be used with dynamic
2293
+ set typedValue(t) {
2294
+ let e = String(t);
2295
+ this.currentMask && (this.currentMask.typedValue = t, e = this.currentMask.unmaskedValue), this.unmaskedValue = e;
2296
+ }
2297
+ get displayValue() {
2298
+ return this.currentMask ? this.currentMask.displayValue : "";
2299
+ }
2300
+ /**
2301
+ @override
2302
+ */
2303
+ get isComplete() {
2304
+ var t;
2305
+ return !!(!((t = this.currentMask) === null || t === void 0) && t.isComplete);
2306
+ }
2307
+ /**
2308
+ @override
2309
+ */
2310
+ get isFilled() {
2311
+ var t;
2312
+ return !!(!((t = this.currentMask) === null || t === void 0) && t.isFilled);
2313
+ }
2314
+ /**
2315
+ @override
2316
+ */
2317
+ remove() {
2318
+ const t = new c();
2319
+ return this.currentMask && t.aggregate(this.currentMask.remove(...arguments)).aggregate(this._applyDispatch()), t;
2320
+ }
2321
+ /**
2322
+ @override
2323
+ */
2324
+ get state() {
2325
+ var t;
2326
+ return Object.assign({}, super.state, {
2327
+ _rawInputValue: this.rawInputValue,
2328
+ compiledMasks: this.compiledMasks.map((e) => e.state),
2329
+ currentMaskRef: this.currentMask,
2330
+ currentMask: (t = this.currentMask) === null || t === void 0 ? void 0 : t.state
2331
+ });
2332
+ }
2333
+ set state(t) {
2334
+ const { compiledMasks: e, currentMaskRef: s, currentMask: n } = t, u = k(t, et);
2335
+ this.compiledMasks.forEach((i, r) => i.state = e[r]), s != null && (this.currentMask = s, this.currentMask.state = n), super.state = u;
2336
+ }
2337
+ /**
2338
+ @override
2339
+ */
2340
+ extractInput() {
2341
+ return this.currentMask ? this.currentMask.extractInput(...arguments) : "";
2342
+ }
2343
+ /**
2344
+ @override
2345
+ */
2346
+ extractTail() {
2347
+ return this.currentMask ? this.currentMask.extractTail(...arguments) : super.extractTail(...arguments);
2348
+ }
2349
+ /**
2350
+ @override
2351
+ */
2352
+ doCommit() {
2353
+ this.currentMask && this.currentMask.doCommit(), super.doCommit();
2354
+ }
2355
+ /**
2356
+ @override
2357
+ */
2358
+ nearestInputPos() {
2359
+ return this.currentMask ? this.currentMask.nearestInputPos(...arguments) : super.nearestInputPos(...arguments);
2360
+ }
2361
+ get overwrite() {
2362
+ return this.currentMask ? this.currentMask.overwrite : super.overwrite;
2363
+ }
2364
+ set overwrite(t) {
2365
+ console.warn(
2366
+ '"overwrite" option is not available in dynamic mask, use this option in siblings'
2367
+ );
2368
+ }
2369
+ get eager() {
2370
+ return this.currentMask ? this.currentMask.eager : super.eager;
2371
+ }
2372
+ set eager(t) {
2373
+ console.warn(
2374
+ '"eager" option is not available in dynamic mask, use this option in siblings'
2375
+ );
2376
+ }
2377
+ get skipInvalid() {
2378
+ return this.currentMask ? this.currentMask.skipInvalid : super.skipInvalid;
2379
+ }
2380
+ set skipInvalid(t) {
2381
+ (this.isInitialized || t !== p.DEFAULTS.skipInvalid) && console.warn(
2382
+ '"skipInvalid" option is not available in dynamic mask, use this option in siblings'
2383
+ );
2384
+ }
2385
+ /**
2386
+ @override
2387
+ */
2388
+ maskEquals(t) {
2389
+ return Array.isArray(t) && this.compiledMasks.every((e, s) => {
2390
+ if (!t[s])
2391
+ return;
2392
+ const n = t[s], { mask: u } = n, i = k(n, st);
2393
+ return I(e, i) && e.maskEquals(u);
2394
+ });
2395
+ }
2396
+ /**
2397
+ @override
2398
+ */
2399
+ typedValueEquals(t) {
2400
+ var e;
2401
+ return !!(!((e = this.currentMask) === null || e === void 0) && e.typedValueEquals(t));
2402
+ }
2403
+ }
2404
+ x.DEFAULTS = {
2405
+ dispatch: (a, t, e, s) => {
2406
+ if (!t.compiledMasks.length)
2407
+ return;
2408
+ const n = t.rawInputValue, u = t.compiledMasks.map((i, r) => {
2409
+ const l = t.currentMask === i, d = l ? i.value.length : i.nearestInputPos(i.value.length, o.FORCE_LEFT);
2410
+ return i.rawInputValue !== n ? (i.reset(), i.append(n, {
2411
+ raw: !0
2412
+ })) : l || i.remove(d), i.append(a, t.currentMaskFlags(e)), i.appendTail(s), {
2413
+ index: r,
2414
+ weight: i.rawInputValue.length,
2415
+ totalInputPositions: i.totalInputPositions(
2416
+ 0,
2417
+ Math.max(
2418
+ d,
2419
+ i.nearestInputPos(i.value.length, o.FORCE_LEFT)
2420
+ )
2421
+ )
2422
+ };
2423
+ });
2424
+ return u.sort(
2425
+ (i, r) => r.weight - i.weight || r.totalInputPositions - i.totalInputPositions
2426
+ ), t.compiledMasks[u[0].index];
2427
+ }
2428
+ }, h.MaskedDynamic = x;
2429
+ const w = {
2430
+ MASKED: "value",
2431
+ UNMASKED: "unmaskedValue",
2432
+ TYPED: "typedValue"
2433
+ };
2434
+ function O(a) {
2435
+ let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : w.MASKED, e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : w.MASKED;
2436
+ const s = v(a);
2437
+ return (n) => s.runIsolated((u) => (u[t] = n, u[e]));
2438
+ }
2439
+ function q(a) {
2440
+ for (var t = arguments.length, e = new Array(t > 1 ? t - 1 : 0), s = 1; s < t; s++)
2441
+ e[s - 1] = arguments[s];
2442
+ return O(...e)(a);
2443
+ }
2444
+ h.PIPE_TYPE = w, h.createPipe = O, h.pipe = q;
2445
+ try {
2446
+ globalThis.IMask = h;
2447
+ } catch {
65
2448
  }
2449
+ g.ChangeDetails = c, g.HTMLContenteditableMaskElement = y, g.HTMLMaskElement = S, g.InputMask = H, g.MaskElement = P, g.Masked = p, g.MaskedDate = C, g.MaskedDynamic = x, g.MaskedEnum = z, g.MaskedFunction = G, g.MaskedNumber = m, g.MaskedPattern = f, g.MaskedRange = T, g.MaskedRegExp = U, g.PIPE_TYPE = w, g.createMask = v, g.createPipe = O, g.default = h, g.pipe = q, Object.defineProperty(g, "__esModule", { value: !0 });
66
2450
  });
2451
+ const ut = IMask;
67
2452
  export {
68
- W as default
2453
+ ut as default
69
2454
  };
70
2455
  //# sourceMappingURL=design-system93.mjs.map