bitboss-ui 0.2.39 → 0.2.40

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 (319) hide show
  1. package/dist/index10.js +1 -4
  2. package/dist/index10.js.map +1 -1
  3. package/dist/index100.js +1 -4
  4. package/dist/index100.js.map +1 -1
  5. package/dist/index101.js +3 -3
  6. package/dist/index101.js.map +1 -1
  7. package/dist/index102.js +1 -4
  8. package/dist/index102.js.map +1 -1
  9. package/dist/index103.js +2 -2
  10. package/dist/index103.js.map +1 -1
  11. package/dist/index104.js +1 -4
  12. package/dist/index104.js.map +1 -1
  13. package/dist/index105.js.map +1 -1
  14. package/dist/index106.js +1 -4
  15. package/dist/index106.js.map +1 -1
  16. package/dist/index107.js.map +1 -1
  17. package/dist/index108.js +1 -4
  18. package/dist/index108.js.map +1 -1
  19. package/dist/index109.js +1 -1
  20. package/dist/index109.js.map +1 -1
  21. package/dist/index11.js +2 -2
  22. package/dist/index11.js.map +1 -1
  23. package/dist/index110.js +1 -4
  24. package/dist/index110.js.map +1 -1
  25. package/dist/index111.js +4 -4
  26. package/dist/index111.js.map +1 -1
  27. package/dist/index112.js +1 -4
  28. package/dist/index112.js.map +1 -1
  29. package/dist/index113.js +1 -1
  30. package/dist/index113.js.map +1 -1
  31. package/dist/index114.js +1 -4
  32. package/dist/index114.js.map +1 -1
  33. package/dist/index115.js.map +1 -1
  34. package/dist/index116.js +1 -1
  35. package/dist/index116.js.map +1 -1
  36. package/dist/index117.js +1 -1
  37. package/dist/index117.js.map +1 -1
  38. package/dist/index118.js +1 -1
  39. package/dist/index118.js.map +1 -1
  40. package/dist/index119.js +1 -1
  41. package/dist/index119.js.map +1 -1
  42. package/dist/index12.js +1 -4
  43. package/dist/index12.js.map +1 -1
  44. package/dist/index121.js +1 -1
  45. package/dist/index125.js +1 -1
  46. package/dist/index126.js +1 -1
  47. package/dist/index127.js +1 -1
  48. package/dist/index13.js.map +1 -1
  49. package/dist/index131.js +2 -2
  50. package/dist/index14.js +1 -4
  51. package/dist/index14.js.map +1 -1
  52. package/dist/index15.js +8 -8
  53. package/dist/index15.js.map +1 -1
  54. package/dist/index158.js +1 -4
  55. package/dist/index158.js.map +1 -1
  56. package/dist/index16.js +1 -4
  57. package/dist/index16.js.map +1 -1
  58. package/dist/index160.js +1 -4
  59. package/dist/index160.js.map +1 -1
  60. package/dist/index169.js +1 -4
  61. package/dist/index169.js.map +1 -1
  62. package/dist/index17.js +9 -9
  63. package/dist/index17.js.map +1 -1
  64. package/dist/index18.js +1 -4
  65. package/dist/index18.js.map +1 -1
  66. package/dist/index183.js +1 -4
  67. package/dist/index183.js.map +1 -1
  68. package/dist/index185.js +1 -4
  69. package/dist/index185.js.map +1 -1
  70. package/dist/index19.js +3 -3
  71. package/dist/index19.js.map +1 -1
  72. package/dist/index196.js +2 -2
  73. package/dist/index196.js.map +1 -1
  74. package/dist/index197.js +10 -4
  75. package/dist/index197.js.map +1 -1
  76. package/dist/index198.js +5 -2
  77. package/dist/index198.js.map +1 -1
  78. package/dist/index199.js +16 -3
  79. package/dist/index199.js.map +1 -1
  80. package/dist/index20.js +1 -4
  81. package/dist/index20.js.map +1 -1
  82. package/dist/index200.js +16 -35
  83. package/dist/index200.js.map +1 -1
  84. package/dist/index201.js +19 -6
  85. package/dist/index201.js.map +1 -1
  86. package/dist/index202.js +20 -2
  87. package/dist/index202.js.map +1 -1
  88. package/dist/index203.js +29 -2
  89. package/dist/index203.js.map +1 -1
  90. package/dist/index204.js +8 -5
  91. package/dist/index204.js.map +1 -1
  92. package/dist/index205.js +2 -16
  93. package/dist/index205.js.map +1 -1
  94. package/dist/index206.js +235 -16
  95. package/dist/index206.js.map +1 -1
  96. package/dist/index207.js +3 -19
  97. package/dist/index207.js.map +1 -1
  98. package/dist/index208.js +35 -20
  99. package/dist/index208.js.map +1 -1
  100. package/dist/index209.js +6 -29
  101. package/dist/index209.js.map +1 -1
  102. package/dist/index21.js +2 -2
  103. package/dist/index21.js.map +1 -1
  104. package/dist/index210.js +2 -8
  105. package/dist/index210.js.map +1 -1
  106. package/dist/index211.js +4 -2
  107. package/dist/index211.js.map +1 -1
  108. package/dist/index212.js +346 -213
  109. package/dist/index212.js.map +1 -1
  110. package/dist/index213.js +134 -3
  111. package/dist/index213.js.map +1 -1
  112. package/dist/index214.js +2 -3
  113. package/dist/index214.js.map +1 -1
  114. package/dist/index215.js +157 -361
  115. package/dist/index215.js.map +1 -1
  116. package/dist/index216.js +23 -134
  117. package/dist/index216.js.map +1 -1
  118. package/dist/index217.js +363 -164
  119. package/dist/index217.js.map +1 -1
  120. package/dist/index218.js +2 -23
  121. package/dist/index218.js.map +1 -1
  122. package/dist/index219.js +3 -373
  123. package/dist/index219.js.map +1 -1
  124. package/dist/index22.js +1 -4
  125. package/dist/index22.js.map +1 -1
  126. package/dist/index220.js +3 -2
  127. package/dist/index220.js.map +1 -1
  128. package/dist/index221.js +2 -10
  129. package/dist/index221.js.map +1 -1
  130. package/dist/index222.js +8 -27
  131. package/dist/index222.js.map +1 -1
  132. package/dist/index223.js +120 -16
  133. package/dist/index223.js.map +1 -1
  134. package/dist/index224.js +6 -9
  135. package/dist/index224.js.map +1 -1
  136. package/dist/index225.js +16 -120
  137. package/dist/index225.js.map +1 -1
  138. package/dist/index226.js +2 -2
  139. package/dist/index226.js.map +1 -1
  140. package/dist/index227.js +2 -4
  141. package/dist/index227.js.map +1 -1
  142. package/dist/index228.js +151 -426
  143. package/dist/index228.js.map +1 -1
  144. package/dist/index229.js +1 -91
  145. package/dist/index229.js.map +1 -1
  146. package/dist/index23.js +1 -1
  147. package/dist/index23.js.map +1 -1
  148. package/dist/index230.js +68 -199
  149. package/dist/index230.js.map +1 -1
  150. package/dist/index231.js +5 -295
  151. package/dist/index231.js.map +1 -1
  152. package/dist/index232.js +294 -5
  153. package/dist/index232.js.map +1 -1
  154. package/dist/index233.js +6 -2
  155. package/dist/index233.js.map +1 -1
  156. package/dist/index234.js +2 -2
  157. package/dist/index239.js +2 -2
  158. package/dist/index239.js.map +1 -1
  159. package/dist/index24.js +1 -4
  160. package/dist/index24.js.map +1 -1
  161. package/dist/index240.js +4 -160
  162. package/dist/index240.js.map +1 -1
  163. package/dist/index241.js +15 -2
  164. package/dist/index241.js.map +1 -1
  165. package/dist/index242.js +433 -67
  166. package/dist/index242.js.map +1 -1
  167. package/dist/index243.js +89 -5
  168. package/dist/index243.js.map +1 -1
  169. package/dist/index244.js +200 -224
  170. package/dist/index244.js.map +1 -1
  171. package/dist/index245.js +2 -258
  172. package/dist/index245.js.map +1 -1
  173. package/dist/index246.js +117 -2
  174. package/dist/index246.js.map +1 -1
  175. package/dist/index247.js +100 -111
  176. package/dist/index247.js.map +1 -1
  177. package/dist/index248.js +218 -100
  178. package/dist/index248.js.map +1 -1
  179. package/dist/index249.js +258 -2
  180. package/dist/index249.js.map +1 -1
  181. package/dist/index25.js +2 -2
  182. package/dist/index25.js.map +1 -1
  183. package/dist/index250.js +2 -38
  184. package/dist/index250.js.map +1 -1
  185. package/dist/index251.js +4 -2
  186. package/dist/index251.js.map +1 -1
  187. package/dist/index252.js +4 -2
  188. package/dist/index252.js.map +1 -1
  189. package/dist/index253.js +60 -14
  190. package/dist/index253.js.map +1 -1
  191. package/dist/index254.js +3 -2
  192. package/dist/index254.js.map +1 -1
  193. package/dist/index255.js +2 -3
  194. package/dist/index255.js.map +1 -1
  195. package/dist/index26.js +1 -4
  196. package/dist/index26.js.map +1 -1
  197. package/dist/index27.js.map +1 -1
  198. package/dist/index28.js +1 -4
  199. package/dist/index28.js.map +1 -1
  200. package/dist/index29.js +3 -3
  201. package/dist/index29.js.map +1 -1
  202. package/dist/index30.js +1 -4
  203. package/dist/index30.js.map +1 -1
  204. package/dist/index31.js +6 -6
  205. package/dist/index31.js.map +1 -1
  206. package/dist/index32.js +1 -4
  207. package/dist/index32.js.map +1 -1
  208. package/dist/index33.js +2 -2
  209. package/dist/index33.js.map +1 -1
  210. package/dist/index34.js +1 -4
  211. package/dist/index34.js.map +1 -1
  212. package/dist/index35.js +2 -2
  213. package/dist/index35.js.map +1 -1
  214. package/dist/index36.js +1 -4
  215. package/dist/index36.js.map +1 -1
  216. package/dist/index37.js.map +1 -1
  217. package/dist/index38.js +1 -4
  218. package/dist/index38.js.map +1 -1
  219. package/dist/index39.js.map +1 -1
  220. package/dist/index40.js +1 -4
  221. package/dist/index40.js.map +1 -1
  222. package/dist/index41.js.map +1 -1
  223. package/dist/index42.js +1 -4
  224. package/dist/index42.js.map +1 -1
  225. package/dist/index43.js.map +1 -1
  226. package/dist/index44.js +1 -4
  227. package/dist/index44.js.map +1 -1
  228. package/dist/index45.js.map +1 -1
  229. package/dist/index46.js +1 -4
  230. package/dist/index46.js.map +1 -1
  231. package/dist/index47.js +1 -1
  232. package/dist/index47.js.map +1 -1
  233. package/dist/index48.js +1 -4
  234. package/dist/index48.js.map +1 -1
  235. package/dist/index49.js +1 -1
  236. package/dist/index49.js.map +1 -1
  237. package/dist/index50.js +1 -4
  238. package/dist/index50.js.map +1 -1
  239. package/dist/index51.js.map +1 -1
  240. package/dist/index52.js +1 -4
  241. package/dist/index52.js.map +1 -1
  242. package/dist/index53.js.map +1 -1
  243. package/dist/index54.js +1 -4
  244. package/dist/index54.js.map +1 -1
  245. package/dist/index55.js.map +1 -1
  246. package/dist/index56.js +1 -4
  247. package/dist/index56.js.map +1 -1
  248. package/dist/index57.js.map +1 -1
  249. package/dist/index58.js +1 -4
  250. package/dist/index58.js.map +1 -1
  251. package/dist/index59.js.map +1 -1
  252. package/dist/index60.js +1 -4
  253. package/dist/index60.js.map +1 -1
  254. package/dist/index61.js.map +1 -1
  255. package/dist/index62.js +1 -4
  256. package/dist/index62.js.map +1 -1
  257. package/dist/index63.js.map +1 -1
  258. package/dist/index64.js +1 -4
  259. package/dist/index64.js.map +1 -1
  260. package/dist/index65.js +5 -5
  261. package/dist/index65.js.map +1 -1
  262. package/dist/index66.js +1 -4
  263. package/dist/index66.js.map +1 -1
  264. package/dist/index67.js.map +1 -1
  265. package/dist/index68.js +1 -4
  266. package/dist/index68.js.map +1 -1
  267. package/dist/index69.js +13 -13
  268. package/dist/index69.js.map +1 -1
  269. package/dist/index70.js +1 -4
  270. package/dist/index70.js.map +1 -1
  271. package/dist/index71.js.map +1 -1
  272. package/dist/index72.js +1 -1
  273. package/dist/index72.js.map +1 -1
  274. package/dist/index73.js.map +1 -1
  275. package/dist/index74.js +1 -4
  276. package/dist/index74.js.map +1 -1
  277. package/dist/index75.js +1 -1
  278. package/dist/index75.js.map +1 -1
  279. package/dist/index76.js +1 -4
  280. package/dist/index76.js.map +1 -1
  281. package/dist/index77.js.map +1 -1
  282. package/dist/index78.js +1 -4
  283. package/dist/index78.js.map +1 -1
  284. package/dist/index79.js +4 -4
  285. package/dist/index79.js.map +1 -1
  286. package/dist/index80.js +1 -4
  287. package/dist/index80.js.map +1 -1
  288. package/dist/index81.js +1 -1
  289. package/dist/index81.js.map +1 -1
  290. package/dist/index82.js +1 -4
  291. package/dist/index82.js.map +1 -1
  292. package/dist/index83.js.map +1 -1
  293. package/dist/index84.js +1 -4
  294. package/dist/index84.js.map +1 -1
  295. package/dist/index85.js.map +1 -1
  296. package/dist/index86.js +1 -4
  297. package/dist/index86.js.map +1 -1
  298. package/dist/index87.js.map +1 -1
  299. package/dist/index88.js +1 -4
  300. package/dist/index88.js.map +1 -1
  301. package/dist/index89.js.map +1 -1
  302. package/dist/index9.js.map +1 -1
  303. package/dist/index90.js +1 -4
  304. package/dist/index90.js.map +1 -1
  305. package/dist/index91.js.map +1 -1
  306. package/dist/index92.js +1 -4
  307. package/dist/index92.js.map +1 -1
  308. package/dist/index93.js.map +1 -1
  309. package/dist/index94.js +1 -4
  310. package/dist/index94.js.map +1 -1
  311. package/dist/index95.js.map +1 -1
  312. package/dist/index96.js +1 -4
  313. package/dist/index96.js.map +1 -1
  314. package/dist/index97.js.map +1 -1
  315. package/dist/index98.js +1 -4
  316. package/dist/index98.js.map +1 -1
  317. package/dist/index99.js.map +1 -1
  318. package/dist/style.css +1 -1
  319. package/package.json +33 -35
package/dist/index215.js CHANGED
@@ -1,381 +1,177 @@
1
- import { shift as tt, flip as et, computePosition as ot, arrow as nt } from "./index219.js";
2
- import { detectOverflow as At, offset as It } from "./index219.js";
3
- import { createCoords as v, rectToClientRect as q, round as A, max as O, min as D, floor as B } from "./index247.js";
4
- import { getOverflowAncestors as H, isElement as x, getWindow as T, getComputedStyle as w, getDocumentElement as L, isHTMLElement as b, isWebKit as U, getNodeName as W, isOverflowElement as z, getNodeScroll as I, isTableElement as it, isContainingBlock as X, getContainingBlock as K, getParentNode as V, isLastTraversableNode as Y } from "./index248.js";
5
- function j(t) {
6
- const e = w(t);
7
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
8
- const s = b(t), c = s ? t.offsetWidth : n, i = s ? t.offsetHeight : o, r = A(n) !== c || A(o) !== i;
9
- return r && (n = c, o = i), {
10
- width: n,
11
- height: o,
12
- $: r
13
- };
14
- }
15
- function S(t) {
16
- return x(t) ? t : t.contextElement;
17
- }
18
- function F(t) {
19
- const e = S(t);
20
- if (!b(e))
21
- return v(1);
22
- const n = e.getBoundingClientRect(), {
23
- width: o,
24
- height: s,
25
- $: c
26
- } = j(e);
27
- let i = (c ? A(n.width) : n.width) / o, r = (c ? A(n.height) : n.height) / s;
28
- return (!i || !Number.isFinite(i)) && (i = 1), (!r || !Number.isFinite(r)) && (r = 1), {
29
- x: i,
30
- y: r
31
- };
32
- }
33
- const st = /* @__PURE__ */ v(0);
34
- function G(t) {
35
- const e = T(t);
36
- return !U() || !e.visualViewport ? st : {
37
- x: e.visualViewport.offsetLeft,
38
- y: e.visualViewport.offsetTop
39
- };
40
- }
41
- function rt(t, e, n) {
42
- return e === void 0 && (e = !1), !n || e && n !== T(t) ? !1 : e;
43
- }
44
- function E(t, e, n, o) {
45
- e === void 0 && (e = !1), n === void 0 && (n = !1);
46
- const s = t.getBoundingClientRect(), c = S(t);
47
- let i = v(1);
48
- e && (o ? x(o) && (i = F(o)) : i = F(t));
49
- const r = rt(c, n, o) ? G(c) : v(0);
50
- let l = (s.left + r.x) / i.x, f = (s.top + r.y) / i.y, a = s.width / i.x, u = s.height / i.y;
51
- if (c) {
52
- const m = T(c), p = o && x(o) ? T(o) : o;
53
- let g = m.frameElement;
54
- for (; g && o && p !== m; ) {
55
- const h = F(g), R = g.getBoundingClientRect(), d = w(g), y = R.left + (g.clientLeft + parseFloat(d.paddingLeft)) * h.x, C = R.top + (g.clientTop + parseFloat(d.paddingTop)) * h.y;
56
- l *= h.x, f *= h.y, a *= h.x, u *= h.y, l += y, f += C, g = T(g).frameElement;
57
- }
1
+ /*! maska v2.1.11 | (c) Alexander Shabunevich | Released under the MIT license */
2
+ var V = Object.defineProperty, P = (a, t, e) => t in a ? V(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e, g = (a, t, e) => (P(a, typeof t != "symbol" ? t + "" : t, e), e);
3
+ const R = {
4
+ "#": { pattern: /[0-9]/ },
5
+ "@": { pattern: /[a-zA-Z]/ },
6
+ "*": { pattern: /[a-zA-Z0-9]/ }
7
+ };
8
+ class b {
9
+ constructor(t = {}) {
10
+ g(this, "opts", {}), g(this, "memo", /* @__PURE__ */ new Map());
11
+ const e = { ...t };
12
+ if (e.tokens != null) {
13
+ e.tokens = e.tokensReplace ? { ...e.tokens } : { ...R, ...e.tokens };
14
+ for (const s of Object.values(e.tokens))
15
+ typeof s.pattern == "string" && (s.pattern = new RegExp(s.pattern));
16
+ } else
17
+ e.tokens = R;
18
+ Array.isArray(e.mask) && (e.mask.length > 1 ? e.mask = [...e.mask].sort((s, n) => s.length - n.length) : e.mask = e.mask[0] ?? ""), e.mask === "" && (e.mask = null), this.opts = e;
58
19
  }
59
- return q({
60
- width: a,
61
- height: u,
62
- x: l,
63
- y: f
64
- });
65
- }
66
- const ct = [":popover-open", ":modal"];
67
- function J(t) {
68
- let e = !1, n = 0, o = 0;
69
- function s(i) {
70
- try {
71
- e = e || t.matches(i);
72
- } catch {
73
- }
20
+ masked(t) {
21
+ return this.process(t, this.findMask(t));
74
22
  }
75
- ct.forEach((i) => {
76
- s(i);
77
- });
78
- const c = K(t);
79
- if (e && c) {
80
- const i = c.getBoundingClientRect();
81
- n = i.x, o = i.y;
23
+ unmasked(t) {
24
+ return this.process(t, this.findMask(t), !1);
82
25
  }
83
- return [e, n, o];
84
- }
85
- function lt(t) {
86
- let {
87
- elements: e,
88
- rect: n,
89
- offsetParent: o,
90
- strategy: s
91
- } = t;
92
- const c = L(o), [i] = e ? J(e.floating) : [!1];
93
- if (o === c || i)
94
- return n;
95
- let r = {
96
- scrollLeft: 0,
97
- scrollTop: 0
98
- }, l = v(1);
99
- const f = v(0), a = b(o);
100
- if ((a || !a && s !== "fixed") && ((W(o) !== "body" || z(c)) && (r = I(o)), b(o))) {
101
- const u = E(o);
102
- l = F(o), f.x = u.x + o.clientLeft, f.y = u.y + o.clientTop;
26
+ isEager() {
27
+ return this.opts.eager === !0;
103
28
  }
104
- return {
105
- width: n.width * l.x,
106
- height: n.height * l.y,
107
- x: n.x * l.x - r.scrollLeft * l.x + f.x,
108
- y: n.y * l.y - r.scrollTop * l.y + f.y
109
- };
110
- }
111
- function ft(t) {
112
- return Array.from(t.getClientRects());
113
- }
114
- function Q(t) {
115
- return E(L(t)).left + I(t).scrollLeft;
116
- }
117
- function ut(t) {
118
- const e = L(t), n = I(t), o = t.ownerDocument.body, s = O(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), c = O(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
119
- let i = -n.scrollLeft + Q(t);
120
- const r = -n.scrollTop;
121
- return w(o).direction === "rtl" && (i += O(e.clientWidth, o.clientWidth) - s), {
122
- width: s,
123
- height: c,
124
- x: i,
125
- y: r
126
- };
127
- }
128
- function at(t, e) {
129
- const n = T(t), o = L(t), s = n.visualViewport;
130
- let c = o.clientWidth, i = o.clientHeight, r = 0, l = 0;
131
- if (s) {
132
- c = s.width, i = s.height;
133
- const f = U();
134
- (!f || f && e === "fixed") && (r = s.offsetLeft, l = s.offsetTop);
29
+ isReversed() {
30
+ return this.opts.reversed === !0;
135
31
  }
136
- return {
137
- width: c,
138
- height: i,
139
- x: r,
140
- y: l
141
- };
142
- }
143
- function ht(t, e) {
144
- const n = E(t, !0, e === "fixed"), o = n.top + t.clientTop, s = n.left + t.clientLeft, c = b(t) ? F(t) : v(1), i = t.clientWidth * c.x, r = t.clientHeight * c.y, l = s * c.x, f = o * c.y;
145
- return {
146
- width: i,
147
- height: r,
148
- x: l,
149
- y: f
150
- };
151
- }
152
- function _(t, e, n) {
153
- let o;
154
- if (e === "viewport")
155
- o = at(t, n);
156
- else if (e === "document")
157
- o = ut(L(t));
158
- else if (x(e))
159
- o = ht(e, n);
160
- else {
161
- const s = G(t);
162
- o = {
163
- ...e,
164
- x: e.x - s.x,
165
- y: e.y - s.y
166
- };
32
+ completed(t) {
33
+ const e = this.findMask(t);
34
+ if (this.opts.mask == null || e == null)
35
+ return !1;
36
+ const s = this.process(t, e).length;
37
+ return typeof this.opts.mask == "string" ? s >= this.opts.mask.length : typeof this.opts.mask == "function" ? s >= e.length : this.opts.mask.filter((n) => s >= n.length).length === this.opts.mask.length;
167
38
  }
168
- return q(o);
169
- }
170
- function Z(t, e) {
171
- const n = V(t);
172
- return n === e || !x(n) || Y(n) ? !1 : w(n).position === "fixed" || Z(n, e);
173
- }
174
- function dt(t, e) {
175
- const n = e.get(t);
176
- if (n)
177
- return n;
178
- let o = H(t, [], !1).filter((r) => x(r) && W(r) !== "body"), s = null;
179
- const c = w(t).position === "fixed";
180
- let i = c ? V(t) : t;
181
- for (; x(i) && !Y(i); ) {
182
- const r = w(i), l = X(i);
183
- !l && r.position === "fixed" && (s = null), (c ? !l && !s : !l && r.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || z(i) && !l && Z(t, i)) ? o = o.filter((a) => a !== i) : s = r, i = V(i);
39
+ findMask(t) {
40
+ const e = this.opts.mask;
41
+ if (e == null)
42
+ return null;
43
+ if (typeof e == "string")
44
+ return e;
45
+ if (typeof e == "function")
46
+ return e(t);
47
+ const s = this.process(t, e.slice(-1).pop() ?? "", !1);
48
+ return e.find((n) => this.process(t, n, !1).length >= s.length) ?? "";
184
49
  }
185
- return e.set(t, o), o;
186
- }
187
- function gt(t) {
188
- let {
189
- element: e,
190
- boundary: n,
191
- rootBoundary: o,
192
- strategy: s
193
- } = t;
194
- const i = [...n === "clippingAncestors" ? dt(e, this._c) : [].concat(n), o], r = i[0], l = i.reduce((f, a) => {
195
- const u = _(e, a, s);
196
- return f.top = O(u.top, f.top), f.right = D(u.right, f.right), f.bottom = D(u.bottom, f.bottom), f.left = O(u.left, f.left), f;
197
- }, _(e, r, s));
198
- return {
199
- width: l.right - l.left,
200
- height: l.bottom - l.top,
201
- x: l.left,
202
- y: l.top
203
- };
204
- }
205
- function pt(t) {
206
- const {
207
- width: e,
208
- height: n
209
- } = j(t);
210
- return {
211
- width: e,
212
- height: n
213
- };
214
- }
215
- function mt(t, e, n, o) {
216
- const s = b(e), c = L(e), i = n === "fixed", r = E(t, !0, i, e);
217
- let l = {
218
- scrollLeft: 0,
219
- scrollTop: 0
220
- };
221
- const f = v(0);
222
- if (s || !s && !i)
223
- if ((W(e) !== "body" || z(c)) && (l = I(e)), s) {
224
- const h = E(e, !0, i, e);
225
- f.x = h.x + e.clientLeft, f.y = h.y + e.clientTop;
226
- } else
227
- c && (f.x = Q(c));
228
- let a = r.left + l.scrollLeft - f.x, u = r.top + l.scrollTop - f.y;
229
- const [m, p, g] = J(o);
230
- return m && (a += p, u += g, s && (a += e.clientLeft, u += e.clientTop)), {
231
- x: a,
232
- y: u,
233
- width: r.width,
234
- height: r.height
235
- };
236
- }
237
- function k(t, e) {
238
- return !b(t) || w(t).position === "fixed" ? null : e ? e(t) : t.offsetParent;
239
- }
240
- function P(t, e) {
241
- const n = T(t);
242
- if (!b(t))
243
- return n;
244
- let o = k(t, e);
245
- for (; o && it(o) && w(o).position === "static"; )
246
- o = k(o, e);
247
- return o && (W(o) === "html" || W(o) === "body" && w(o).position === "static" && !X(o)) ? n : o || K(t) || n;
248
- }
249
- const yt = async function(t) {
250
- const e = this.getOffsetParent || P, n = this.getDimensions;
251
- return {
252
- reference: mt(t.reference, await e(t.floating), t.strategy, t.floating),
253
- floating: {
254
- x: 0,
255
- y: 0,
256
- ...await n(t.floating)
50
+ escapeMask(t) {
51
+ const e = [], s = [];
52
+ return t.split("").forEach((n, i) => {
53
+ n === "!" && t[i - 1] !== "!" ? s.push(i - s.length) : e.push(n);
54
+ }), { mask: e.join(""), escaped: s };
55
+ }
56
+ process(t, e, s = !0) {
57
+ if (e == null)
58
+ return t;
59
+ const n = `value=${t},mask=${e},masked=${s ? 1 : 0}`;
60
+ if (this.memo.has(n))
61
+ return this.memo.get(n);
62
+ const { mask: i, escaped: p } = this.escapeMask(e), o = [], k = this.opts.tokens != null ? this.opts.tokens : {}, l = this.isReversed() ? -1 : 1, m = this.isReversed() ? "unshift" : "push", c = this.isReversed() ? 0 : i.length - 1, T = this.isReversed() ? () => r > -1 && u > -1 : () => r < i.length && u < t.length, S = (d) => !this.isReversed() && d <= c || this.isReversed() && d >= c;
63
+ let E, f = -1, r = this.isReversed() ? i.length - 1 : 0, u = this.isReversed() ? t.length - 1 : 0, y = !1;
64
+ for (; T(); ) {
65
+ const d = i.charAt(r), h = k[d], v = (h == null ? void 0 : h.transform) != null ? h.transform(t.charAt(u)) : t.charAt(u);
66
+ if (!p.includes(r) && h != null ? (v.match(h.pattern) != null ? (o[m](v), h.repeated ? (f === -1 ? f = r : r === c && r !== f && (r = f - l), c === f && (r -= l)) : h.multiple && (y = !0, r -= l), r += l) : h.multiple ? y && (r += l, u -= l, y = !1) : v === E ? E = void 0 : h.optional && (r += l, u -= l), u += l) : (s && !this.isEager() && o[m](d), v === d && !this.isEager() ? u += l : E = d, this.isEager() || (r += l)), this.isEager())
67
+ for (; S(r) && (k[i.charAt(r)] == null || p.includes(r)); )
68
+ s ? o[m](i.charAt(r)) : i.charAt(r) === t.charAt(u) && (u += l), r += l;
257
69
  }
258
- };
259
- };
260
- function wt(t) {
261
- return w(t).direction === "rtl";
262
- }
263
- const vt = {
264
- convertOffsetParentRelativeRectToViewportRelativeRect: lt,
265
- getDocumentElement: L,
266
- getClippingRect: gt,
267
- getOffsetParent: P,
268
- getElementRects: yt,
269
- getClientRects: ft,
270
- getDimensions: pt,
271
- getScale: F,
272
- isElement: x,
273
- isRTL: wt
274
- };
275
- function xt(t, e) {
276
- let n = null, o;
277
- const s = L(t);
278
- function c() {
279
- var r;
280
- clearTimeout(o), (r = n) == null || r.disconnect(), n = null;
70
+ return this.memo.set(n, o.join("")), this.memo.get(n);
281
71
  }
282
- function i(r, l) {
283
- r === void 0 && (r = !1), l === void 0 && (l = 1), c();
284
- const {
285
- left: f,
286
- top: a,
287
- width: u,
288
- height: m
289
- } = t.getBoundingClientRect();
290
- if (r || e(), !u || !m)
291
- return;
292
- const p = B(a), g = B(s.clientWidth - (f + u)), h = B(s.clientHeight - (a + m)), R = B(f), y = {
293
- rootMargin: -p + "px " + -g + "px " + -h + "px " + -R + "px",
294
- threshold: O(0, D(1, l)) || 1
72
+ }
73
+ const O = (a) => JSON.parse(a.replaceAll("'", '"')), w = (a, t = {}) => {
74
+ const e = { ...t };
75
+ return a.dataset.maska != null && a.dataset.maska !== "" && (e.mask = W(a.dataset.maska)), a.dataset.maskaEager != null && (e.eager = M(a.dataset.maskaEager)), a.dataset.maskaReversed != null && (e.reversed = M(a.dataset.maskaReversed)), a.dataset.maskaTokensReplace != null && (e.tokensReplace = M(a.dataset.maskaTokensReplace)), a.dataset.maskaTokens != null && (e.tokens = j(a.dataset.maskaTokens)), e;
76
+ }, M = (a) => a !== "" ? !!JSON.parse(a) : !0, W = (a) => a.startsWith("[") && a.endsWith("]") ? O(a) : a, j = (a) => {
77
+ if (a.startsWith("{") && a.endsWith("}"))
78
+ return O(a);
79
+ const t = {};
80
+ return a.split("|").forEach((e) => {
81
+ const s = e.split(":");
82
+ t[s[0]] = {
83
+ pattern: new RegExp(s[1]),
84
+ optional: s[2] === "optional",
85
+ multiple: s[2] === "multiple",
86
+ repeated: s[2] === "repeated"
295
87
  };
296
- let C = !0;
297
- function $(M) {
298
- const N = M[0].intersectionRatio;
299
- if (N !== l) {
300
- if (!C)
301
- return i();
302
- N ? i(!1, N) : o = setTimeout(() => {
303
- i(!1, 1e-7);
304
- }, 100);
88
+ }), t;
89
+ };
90
+ class L {
91
+ constructor(t, e = {}) {
92
+ g(this, "items", /* @__PURE__ */ new Map()), g(this, "beforeinputEvent", (s) => {
93
+ const n = s.target, i = this.items.get(n);
94
+ i.isEager() && "inputType" in s && s.inputType.startsWith("delete") && i.unmasked(n.value).length <= 1 && this.setMaskedValue(n, "");
95
+ }), g(this, "inputEvent", (s) => {
96
+ if (s instanceof CustomEvent && s.type === "input" && s.detail != null && typeof s.detail == "object" && "masked" in s.detail)
97
+ return;
98
+ const n = s.target, i = this.items.get(n), p = n.value, o = n.selectionStart, k = n.selectionEnd;
99
+ let l = p;
100
+ if (i.isEager()) {
101
+ const m = i.masked(p), c = i.unmasked(p);
102
+ c === "" && "data" in s && s.data != null ? l = s.data : c !== i.unmasked(m) && (l = c);
305
103
  }
306
- C = !1;
307
- }
308
- try {
309
- n = new IntersectionObserver($, {
310
- ...y,
311
- // Handle <iframe>s
312
- root: s.ownerDocument
313
- });
314
- } catch {
315
- n = new IntersectionObserver($, y);
104
+ if (this.setMaskedValue(n, l), "inputType" in s && (s.inputType.startsWith("delete") || o != null && o < p.length))
105
+ try {
106
+ n.setSelectionRange(o, k);
107
+ } catch {
108
+ }
109
+ }), this.options = e, typeof t == "string" ? this.init(
110
+ Array.from(document.querySelectorAll(t)),
111
+ this.getMaskOpts(e)
112
+ ) : this.init(
113
+ "length" in t ? Array.from(t) : [t],
114
+ this.getMaskOpts(e)
115
+ );
116
+ }
117
+ destroy() {
118
+ for (const t of this.items.keys())
119
+ t.removeEventListener("input", this.inputEvent), t.removeEventListener("beforeinput", this.beforeinputEvent);
120
+ this.items.clear();
121
+ }
122
+ needUpdateOptions(t, e) {
123
+ const s = this.items.get(t), n = new b(w(t, this.getMaskOpts(e)));
124
+ return JSON.stringify(s.opts) !== JSON.stringify(n.opts);
125
+ }
126
+ needUpdateValue(t) {
127
+ const e = t.dataset.maskaValue;
128
+ return e == null && t.value !== "" || e != null && e !== t.value;
129
+ }
130
+ getMaskOpts(t) {
131
+ const { onMaska: e, preProcess: s, postProcess: n, ...i } = t;
132
+ return i;
133
+ }
134
+ init(t, e) {
135
+ for (const s of t) {
136
+ const n = new b(w(s, e));
137
+ this.items.set(s, n), s.value !== "" && this.setMaskedValue(s, s.value), s.addEventListener("input", this.inputEvent), s.addEventListener("beforeinput", this.beforeinputEvent);
316
138
  }
317
- n.observe(t);
318
139
  }
319
- return i(!0), c;
320
- }
321
- function Ct(t, e, n, o) {
322
- o === void 0 && (o = {});
323
- const {
324
- ancestorScroll: s = !0,
325
- ancestorResize: c = !0,
326
- elementResize: i = typeof ResizeObserver == "function",
327
- layoutShift: r = typeof IntersectionObserver == "function",
328
- animationFrame: l = !1
329
- } = o, f = S(t), a = s || c ? [...f ? H(f) : [], ...H(e)] : [];
330
- a.forEach((d) => {
331
- s && d.addEventListener("scroll", n, {
332
- passive: !0
333
- }), c && d.addEventListener("resize", n);
334
- });
335
- const u = f && r ? xt(f, n) : null;
336
- let m = -1, p = null;
337
- i && (p = new ResizeObserver((d) => {
338
- let [y] = d;
339
- y && y.target === f && p && (p.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
340
- var C;
341
- (C = p) == null || C.observe(e);
342
- })), n();
343
- }), f && !l && p.observe(f), p.observe(e));
344
- let g, h = l ? E(t) : null;
345
- l && R();
346
- function R() {
347
- const d = E(t);
348
- h && (d.x !== h.x || d.y !== h.y || d.width !== h.width || d.height !== h.height) && n(), h = d, g = requestAnimationFrame(R);
140
+ setMaskedValue(t, e) {
141
+ const s = this.items.get(t);
142
+ this.options.preProcess != null && (e = this.options.preProcess(e));
143
+ const n = s.masked(e), i = s.unmasked(s.isEager() ? n : e), p = s.completed(e), o = { masked: n, unmasked: i, completed: p };
144
+ e = n, this.options.postProcess != null && (e = this.options.postProcess(e)), t.value = e, t.dataset.maskaValue = e, this.options.onMaska != null && (Array.isArray(this.options.onMaska) ? this.options.onMaska.forEach((k) => k(o)) : this.options.onMaska(o)), t.dispatchEvent(new CustomEvent("maska", { detail: o })), t.dispatchEvent(new CustomEvent("input", { detail: o }));
349
145
  }
350
- return n(), () => {
351
- var d;
352
- a.forEach((y) => {
353
- s && y.removeEventListener("scroll", n), c && y.removeEventListener("resize", n);
354
- }), u == null || u(), (d = p) == null || d.disconnect(), p = null, l && cancelAnimationFrame(g);
355
- };
356
146
  }
357
- const Tt = tt, Et = et, Ot = nt, Ft = (t, e, n) => {
358
- const o = /* @__PURE__ */ new Map(), s = {
359
- platform: vt,
360
- ...n
361
- }, c = {
362
- ...s.platform,
363
- _c: o
364
- };
365
- return ot(t, e, {
366
- ...s,
367
- platform: c
147
+ const A = /* @__PURE__ */ new WeakMap(), C = (a) => {
148
+ setTimeout(() => {
149
+ var t;
150
+ ((t = A.get(a)) == null ? void 0 : t.needUpdateValue(a)) === !0 && a.dispatchEvent(new CustomEvent("input"));
368
151
  });
152
+ }, J = (a, t) => {
153
+ const e = a instanceof HTMLInputElement ? a : a.querySelector("input"), s = { ...t.arg };
154
+ if (e == null || (e == null ? void 0 : e.type) === "file")
155
+ return;
156
+ C(e);
157
+ const n = A.get(e);
158
+ if (n != null) {
159
+ if (!n.needUpdateOptions(e, s))
160
+ return;
161
+ n.destroy();
162
+ }
163
+ if (t.value != null) {
164
+ const i = t.value, p = (o) => {
165
+ i.masked = o.masked, i.unmasked = o.unmasked, i.completed = o.completed;
166
+ };
167
+ s.onMaska = s.onMaska == null ? p : Array.isArray(s.onMaska) ? [...s.onMaska, p] : [s.onMaska, p];
168
+ }
169
+ A.set(e, new L(e, s));
369
170
  };
370
171
  export {
371
- Ot as arrow,
372
- Ct as autoUpdate,
373
- Ft as computePosition,
374
- At as detectOverflow,
375
- Et as flip,
376
- H as getOverflowAncestors,
377
- It as offset,
378
- vt as platform,
379
- Tt as shift
172
+ b as Mask,
173
+ L as MaskInput,
174
+ R as tokens,
175
+ J as vMaska
380
176
  };
381
177
  //# sourceMappingURL=index215.js.map