@tolki/str 1.0.1 → 1.0.3

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.
package/dist/str.js CHANGED
@@ -1,60 +1,60 @@
1
- import { substr as x, ltrim as q, rtrim as G, randomInt as M, randomString as K, title as P, trim as Z, upper as D } from "@tolki/str";
2
- import { isArray as S, toLower as O, isString as N, isFunction as Q } from "@tolki/utils";
3
- const R = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
4
- let b = null;
1
+ import { substr as x, ltrim as I, rtrim as q, randomInt as O, title as G, trim as K, upper as Z, randomString as D } from "@tolki/str";
2
+ import { isArray as S, toLower as W, isString as _, isFunction as Q, isNumber as V } from "@tolki/utils";
3
+ const E = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map(), F = /* @__PURE__ */ new Map();
4
+ let R = null;
5
5
  function T(t, e) {
6
6
  if (e === "")
7
7
  return t;
8
8
  const n = String(e), r = t.indexOf(n);
9
9
  return r === -1 ? t : t.slice(r + n.length);
10
10
  }
11
- function ft(t, e) {
11
+ function at(t, e) {
12
12
  if (e === "")
13
13
  return t;
14
14
  const n = t.lastIndexOf(String(e));
15
15
  return n === -1 ? t : t.slice(n + String(e).length);
16
16
  }
17
- function V(t, e) {
17
+ function X(t, e) {
18
18
  if (e === "")
19
19
  return t;
20
20
  const n = t.indexOf(String(e));
21
21
  return n === -1 ? t : t.slice(0, n);
22
22
  }
23
- function X(t, e) {
23
+ function Y(t, e) {
24
24
  if (e === "")
25
25
  return t;
26
26
  const n = t.lastIndexOf(String(e));
27
27
  return n === -1 ? t : x(t, 0, n);
28
28
  }
29
- function at(t, e, n) {
30
- return e === "" || n === "" ? t : X(T(t, e), n);
31
- }
32
29
  function ut(t, e, n) {
33
- return e === "" || n === "" ? t : V(T(t, e), n);
30
+ return e === "" || n === "" ? t : Y(T(t, e), n);
34
31
  }
35
- function pt(t) {
36
- if (E.has(t))
37
- return E.get(t);
38
- const e = rt(H(t));
39
- return E.set(t, e), e;
32
+ function pt(t, e, n) {
33
+ return e === "" || n === "" ? t : X(T(t, e), n);
34
+ }
35
+ function gt(t) {
36
+ if (C.has(t))
37
+ return C.get(t);
38
+ const e = st(H(t));
39
+ return C.set(t, e), e;
40
40
  }
41
- function gt(t, e) {
41
+ function mt(t, e) {
42
42
  const n = t.length;
43
43
  return (e < 0 ? e < -n : e > n - 1) ? !1 : (e < 0 && (e += n), t.charAt(e));
44
44
  }
45
- function mt(t, e) {
45
+ function ht(t, e) {
46
46
  for (const n of S(e) ? e : [e])
47
47
  if (n !== "" && t.startsWith(n)) {
48
- const r = [...t], o = [...n];
49
- return r.slice(o.length).join("");
48
+ const r = [...t], s = [...n];
49
+ return r.slice(s.length).join("");
50
50
  }
51
51
  return t;
52
52
  }
53
- function ht(t, e) {
53
+ function dt(t, e) {
54
54
  for (const n of S(e) ? e : [e])
55
55
  if (n !== "" && t.endsWith(n)) {
56
- const r = [...t], o = [...n];
57
- return r.slice(0, -o.length).join("");
56
+ const r = [...t], s = [...n];
57
+ return r.slice(0, -s.length).join("");
58
58
  }
59
59
  return t;
60
60
  }
@@ -62,39 +62,37 @@ function B(t, e, n = !1) {
62
62
  n && (t = t.toLowerCase());
63
63
  let r;
64
64
  typeof e == "string" ? r = [e] : r = Array.from(e);
65
- for (let o of r)
66
- if (n && (o = o.toLowerCase()), o !== "" && t.includes(o))
65
+ for (let s of r)
66
+ if (n && (s = s.toLowerCase()), s !== "" && t.includes(s))
67
67
  return !0;
68
68
  return !1;
69
69
  }
70
- function dt(t, e = "", n = {}) {
71
- const { radius: r = 100, omission: o = "..." } = n, s = String(t ?? ""), c = e ?? "", i = (y) => y.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${i(c)})(.*)$`, "iu").exec(s);
70
+ function yt(t, e = "", n = {}) {
71
+ const { radius: r = 100, omission: s = "..." } = n, o = String(t ?? ""), c = e ?? "", i = ($) => $.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${i(c)})(.*)$`, "iu").exec(o);
72
72
  if (!l)
73
73
  return null;
74
- const g = q(l[1] ?? ""), u = Array.from(g).length, m = x(g, Math.max(u - r, 0), r);
75
- let a = q(m);
76
- a !== g && (a = o + a);
77
- const p = G(l[3] ?? ""), h = x(p, 0, r);
78
- let w = G(h);
79
- w !== p && (w = w + o);
80
- const d = l[2] ?? "";
81
- return a + d + w;
82
- }
83
- function yt(t, e, n = !1) {
74
+ const m = String(l[1]), a = String(l[2]), p = String(l[3]), u = I(m), g = Array.from(u).length, y = x(u, Math.max(g - r, 0), r);
75
+ let w = I(y);
76
+ w !== u && (w = s + w);
77
+ const h = q(p), d = x(h, 0, r);
78
+ let k = q(d);
79
+ return k !== h && (k = k + s), w + a + k;
80
+ }
81
+ function wt(t, e, n = !1) {
84
82
  for (const r of e)
85
83
  if (!B(t, r, n))
86
84
  return !1;
87
85
  return !0;
88
86
  }
89
- function wt(t, e, n = !1) {
87
+ function xt(t, e, n = !1) {
90
88
  return !B(t, e, n);
91
89
  }
92
- function xt(t, e = " ") {
90
+ function St(t, e = " ") {
93
91
  return S(e) ? (e.forEach((n) => {
94
92
  t = t.replace(new RegExp(`${n}+`, "g"), n);
95
93
  }), t) : t.replace(new RegExp(`${e}+`, "g"), e);
96
94
  }
97
- function W(t, e) {
95
+ function M(t, e) {
98
96
  if (t === null)
99
97
  return !1;
100
98
  t = String(t), S(e) ? e = Array.from(e) : e = [String(e)];
@@ -103,41 +101,41 @@ function W(t, e) {
103
101
  return !0;
104
102
  return !1;
105
103
  }
106
- function St(t, e) {
107
- return !W(t, e);
108
- }
109
104
  function $t(t, e) {
105
+ return !M(t, e);
106
+ }
107
+ function kt(t, e) {
110
108
  const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
111
109
  return t.replace(new RegExp(`(?:${n})+$`, "u"), "") + e;
112
110
  }
113
- function kt(t, e, n = null) {
111
+ function At(t, e, n = null) {
114
112
  return e + t + (n ?? e);
115
113
  }
116
- function At(t, e, n = null) {
117
- return U(t, e) && (t = x(t, F(e))), W(t, n ??= e) && (t = x(t, 0, -F(n))), t;
114
+ function bt(t, e, n = null) {
115
+ return P(t, e) && (t = x(t, N(e))), M(t, n ??= e) && (t = x(t, 0, -N(n))), t;
118
116
  }
119
- function bt(t, e, n = !1) {
117
+ function Lt(t, e, n = !1) {
120
118
  e = String(e);
121
119
  let r;
122
120
  typeof t == "string" ? r = [t] : r = Array.from(t);
123
- for (let o of r) {
124
- if (o = String(o), o === e || n && O(o) === O(e))
121
+ for (let s of r) {
122
+ if (s = String(s), s === e || n && W(s) === W(e))
125
123
  return !0;
126
- o = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = o.replace(/\\\*/g, ".*");
127
- const s = n ? "iu" : "u";
128
- if (new RegExp(`^${o}$`, s).test(e))
124
+ s = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = s.replace(/\\\*/g, ".*");
125
+ const o = n ? "iu" : "u";
126
+ if (new RegExp(`^${s}$`, o).test(e))
129
127
  return !0;
130
128
  }
131
129
  return !1;
132
130
  }
133
- function Lt(t) {
131
+ function Rt(t) {
134
132
  for (let e = 0; e < t.length; e++)
135
133
  if (t.charCodeAt(e) > 127)
136
134
  return !1;
137
135
  return !0;
138
136
  }
139
- function Rt(t) {
140
- if (!N(t))
137
+ function Et(t) {
138
+ if (!_(t))
141
139
  return !1;
142
140
  try {
143
141
  JSON.parse(t);
@@ -146,17 +144,17 @@ function Rt(t) {
146
144
  }
147
145
  return !0;
148
146
  }
149
- function Et(t, e = []) {
150
- if (!N(t))
147
+ function Ct(t, e = []) {
148
+ if (!_(t))
151
149
  return !1;
152
- const r = (e.length === 0 ? "aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap+tcp|coap+ws|coaps|coaps+tcp|coaps+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris.beep|iris.lwz|iris.xpc|iris.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap.beep|soap.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|tg|things|thismessage|tip|tn3270|tool|ts3server|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc.beep|xmlrpc.beeps|xmpp|xri|ymsgr|z39.50|z39.50r|z39.50s" : e.join("|")).split("|").map((s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
150
+ const r = (e.length === 0 ? "aaa|aaas|about|acap|acct|acd|acr|adiumxtra|adt|afp|afs|aim|amss|android|appdata|apt|ark|attachment|aw|barion|beshare|bitcoin|bitcoincash|blob|bolo|browserext|calculator|callto|cap|cast|casts|chrome|chrome-extension|cid|coap|coap+tcp|coap+ws|coaps|coaps+tcp|coaps+ws|com-eventbrite-attendee|content|conti|crid|cvs|dab|data|dav|diaspora|dict|did|dis|dlna-playcontainer|dlna-playsingle|dns|dntp|dpp|drm|drop|dtn|dvb|ed2k|elsi|example|facetime|fax|feed|feedready|file|filesystem|finger|first-run-pen-experience|fish|fm|ftp|fuchsia-pkg|geo|gg|git|gizmoproject|go|gopher|graph|gtalk|h323|ham|hcap|hcp|http|https|hxxp|hxxps|hydrazone|iax|icap|icon|im|imap|info|iotdisco|ipn|ipp|ipps|irc|irc6|ircs|iris|iris.beep|iris.lwz|iris.xpc|iris.xpcs|isostore|itms|jabber|jar|jms|keyparc|lastfm|ldap|ldaps|leaptofrogans|lorawan|lvlt|magnet|mailserver|mailto|maps|market|message|mid|mms|modem|mongodb|moz|ms-access|ms-browser-extension|ms-calculator|ms-drive-to|ms-enrollment|ms-excel|ms-eyecontrolspeech|ms-gamebarservices|ms-gamingoverlay|ms-getoffice|ms-help|ms-infopath|ms-inputapp|ms-lockscreencomponent-config|ms-media-stream-id|ms-mixedrealitycapture|ms-mobileplans|ms-officeapp|ms-people|ms-project|ms-powerpoint|ms-publisher|ms-restoretabcompanion|ms-screenclip|ms-screensketch|ms-search|ms-search-repair|ms-secondary-screen-controller|ms-secondary-screen-setup|ms-settings|ms-settings-airplanemode|ms-settings-bluetooth|ms-settings-camera|ms-settings-cellular|ms-settings-cloudstorage|ms-settings-connectabledevices|ms-settings-displays-topology|ms-settings-emailandaccounts|ms-settings-language|ms-settings-location|ms-settings-lock|ms-settings-nfctransactions|ms-settings-notifications|ms-settings-power|ms-settings-privacy|ms-settings-proximity|ms-settings-screenrotation|ms-settings-wifi|ms-settings-workplace|ms-spd|ms-sttoverlay|ms-transit-to|ms-useractivityset|ms-virtualtouchpad|ms-visio|ms-walk-to|ms-whiteboard|ms-whiteboard-cmd|ms-word|msnim|msrp|msrps|mss|mtqp|mumble|mupdate|mvn|news|nfs|ni|nih|nntp|notes|ocf|oid|onenote|onenote-cmd|opaquelocktoken|openpgp4fpr|pack|palm|paparazzi|payto|pkcs11|platform|pop|pres|prospero|proxy|pwid|psyc|pttp|qb|query|redis|rediss|reload|res|resource|rmi|rsync|rtmfp|rtmp|rtsp|rtsps|rtspu|s3|secondlife|service|session|sftp|sgn|shttp|sieve|simpleledger|sip|sips|skype|smb|sms|smtp|snews|snmp|soap.beep|soap.beeps|soldat|spiffe|spotify|ssh|steam|stun|stuns|submit|svn|tag|teamspeak|tel|teliaeid|telnet|tftp|tg|things|thismessage|tip|tn3270|tool|ts3server|turn|turns|tv|udp|unreal|urn|ut2004|v-event|vemmi|ventrilo|videotex|vnc|view-source|wais|webcal|wpid|ws|wss|wtai|wyciwyg|xcon|xcon-userid|xfire|xmlrpc.beep|xmlrpc.beeps|xmpp|xri|ymsgr|z39.50|z39.50r|z39.50s" : e.join("|")).split("|").map((o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
153
151
  try {
154
152
  const c = new URL(t).protocol.replace(":", "");
155
153
  if (r.split("|").includes(c))
156
154
  return !0;
157
155
  } catch {
158
156
  }
159
- const o = [
157
+ const s = [
160
158
  "^(",
161
159
  r,
162
160
  "):\\/\\/",
@@ -175,85 +173,85 @@ function Et(t, e = []) {
175
173
  "$"
176
174
  ].join("");
177
175
  try {
178
- return new RegExp(o, "iu").test(t);
176
+ return new RegExp(s, "iu").test(t);
179
177
  } catch {
180
178
  return !1;
181
179
  }
182
180
  }
183
- function Ct(t) {
184
- return nt(t, "-");
181
+ function Ft(t) {
182
+ return rt(t, "-");
185
183
  }
186
- function F(t) {
184
+ function N(t) {
187
185
  return t.length;
188
186
  }
189
- function Ft(t, e = 100, n = "...", r = !1) {
187
+ function Nt(t, e = 100, n = "...", r = !1) {
190
188
  if (t.length <= e)
191
189
  return t;
192
190
  if (!r)
193
191
  return t.slice(0, e).replace(/\s+$/, "") + n;
194
- t = et(t).replace(/[\n\r]+/g, " ").trim();
195
- const o = t.slice(0, e).replace(/\s+$/, "");
196
- return t.substring(e, e + 1) === " " ? o + n : o.replace(/(.*)\s.*/, "$1") + n;
192
+ t = nt(t).replace(/[\n\r]+/g, " ").trim();
193
+ const s = t.slice(0, e).replace(/\s+$/, "");
194
+ return t.substring(e, e + 1) === " " ? s + n : s.replace(/(.*)\s.*/, "$1") + n;
197
195
  }
198
196
  function J(t) {
199
- return O(t);
197
+ return W(t);
200
198
  }
201
199
  function zt(t, e = 100, n = "...") {
202
200
  if (e <= 0)
203
201
  return t;
204
- const r = e, o = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), s = t.match(o);
205
- return !s || F(t) === F(s[0]) ? t : s[0].replace(/\s+$/, "") + n;
202
+ const r = e, s = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), o = t.match(s);
203
+ return !o || N(t) === N(o[0]) ? t : o[0].replace(/\s+$/, "") + n;
206
204
  }
207
205
  function _t(t, e, n, r = null) {
208
206
  if (e === "")
209
207
  return t;
210
- const o = t.length;
211
- let s = n;
212
- n < 0 && (s = n < -o ? 0 : o + n);
208
+ const s = t.length;
209
+ let o = n;
210
+ n < 0 && (o = n < -s ? 0 : s + n);
213
211
  const c = t.slice(
214
- s,
215
- r !== null ? s + r : void 0
212
+ o,
213
+ r !== null ? o + r : void 0
216
214
  );
217
215
  if (c === "")
218
216
  return t;
219
- const i = t.slice(0, s), f = c.length, l = t.slice(s + f);
217
+ const i = t.slice(0, o), f = c.length, l = t.slice(o + f);
220
218
  return i + e.slice(0, 1).repeat(f) + l;
221
219
  }
222
- function Mt(t, e) {
220
+ function Ot(t, e) {
223
221
  let n = "u", r = t;
224
222
  if (t.length >= 2 && t[0] === "/") {
225
- let o = -1;
226
- for (let s = t.length - 1; s > 0; s--)
227
- if (t[s] === "/") {
223
+ let s = -1;
224
+ for (let o = t.length - 1; o > 0; o--)
225
+ if (t[o] === "/") {
228
226
  let c = 0;
229
- for (let i = s - 1; i >= 0 && t[i] === "\\"; i--)
227
+ for (let i = o - 1; i >= 0 && t[i] === "\\"; i--)
230
228
  c++;
231
229
  if (c % 2 === 0) {
232
- o = s;
230
+ s = o;
233
231
  break;
234
232
  }
235
233
  }
236
- if (o > 0) {
237
- r = t.slice(1, o);
238
- const s = t.slice(o + 1);
239
- if (s)
240
- for (const c of s)
234
+ if (s > 0) {
235
+ r = t.slice(1, s);
236
+ const o = t.slice(s + 1);
237
+ if (o)
238
+ for (const c of o)
241
239
  /[imsuy]/.test(c) && !n.includes(c) && (n += c);
242
240
  }
243
241
  }
244
242
  try {
245
- const s = new RegExp(r, n).exec(e);
246
- return s ? s[1] !== void 0 ? s[1] : s[0] : "";
243
+ const o = new RegExp(r, n).exec(e);
244
+ return o ? o[1] !== void 0 ? o[1] : o[0] : "";
247
245
  } catch {
248
246
  return "";
249
247
  }
250
248
  }
251
- function Ot(t, e) {
249
+ function Wt(t, e) {
252
250
  e = String(e);
253
251
  const n = typeof t == "string" ? [t] : Array.from(t);
254
252
  for (const r of n) {
255
253
  if (typeof r != "string" || r === "") continue;
256
- let o = "u", s = r;
254
+ let s = "u", o = r;
257
255
  if (r.length >= 2 && r[0] === "/") {
258
256
  let c = -1;
259
257
  for (let i = r.length - 1; i > 0; i--)
@@ -267,85 +265,86 @@ function Ot(t, e) {
267
265
  }
268
266
  }
269
267
  if (c > 0) {
270
- s = r.slice(1, c);
268
+ o = r.slice(1, c);
271
269
  const i = r.slice(c + 1);
272
270
  if (i)
273
271
  for (const f of i)
274
- /[imsuy]/.test(f) && !o.includes(f) && (o += f);
272
+ /[imsuy]/.test(f) && !s.includes(f) && (s += f);
275
273
  }
276
274
  }
277
275
  try {
278
- if (new RegExp(s, o).test(e))
276
+ if (new RegExp(o, s).test(e))
279
277
  return !0;
280
278
  } catch {
281
279
  }
282
280
  }
283
281
  return !1;
284
282
  }
285
- function Nt(t, e) {
283
+ function Mt(t, e) {
286
284
  let n = "u", r = t;
287
285
  if (t.length >= 2 && t[0] === "/") {
288
- let s = -1;
286
+ let o = -1;
289
287
  for (let c = t.length - 1; c > 0; c--)
290
288
  if (t[c] === "/") {
291
289
  let i = 0;
292
290
  for (let f = c - 1; f >= 0 && t[f] === "\\"; f--)
293
291
  i++;
294
292
  if (i % 2 === 0) {
295
- s = c;
293
+ o = c;
296
294
  break;
297
295
  }
298
296
  }
299
- if (s > 0) {
300
- r = t.slice(1, s);
301
- const c = t.slice(s + 1);
297
+ if (o > 0) {
298
+ r = t.slice(1, o);
299
+ const c = t.slice(o + 1);
302
300
  if (c)
303
301
  for (const i of c)
304
- /[imsuy]/.test(i) && !n.includes(i) && (n += i);
302
+ /[gimsuy]/.test(i) && !n.includes(i) && (n += i);
305
303
  }
306
304
  }
307
305
  n.includes("g") || (n += "g");
308
- let o = [];
306
+ let s = [];
309
307
  try {
310
- const s = new RegExp(r, n);
308
+ const o = new RegExp(r, n);
311
309
  let c;
312
- for (; (c = s.exec(e)) !== null; )
313
- o.push(c[1] !== void 0 ? c[1] : c[0]), c[0] === "" && s.lastIndex++;
310
+ for (; (c = o.exec(e)) !== null; )
311
+ s.push(c[1] !== void 0 ? c[1] : c[0]), c[0] === "" && o.lastIndex++;
314
312
  } catch {
315
- o = [];
313
+ s = [];
316
314
  }
317
- return o;
315
+ return s;
318
316
  }
319
- function Wt(t) {
317
+ function Pt(t) {
320
318
  return S(t) ? t.map((e) => e.replace(/[^0-9]/g, "")) : t.replace(/[^0-9]/g, "");
321
319
  }
322
320
  function Ut(t, e, n = " ") {
323
321
  const r = t.length;
324
322
  if (e <= r || n === "")
325
323
  return t;
326
- const o = e - r, s = Math.floor(o / 2), c = o - s;
327
- return z(n, s) + t + z(n, c);
324
+ const s = e - r, o = Math.floor(s / 2), c = s - o;
325
+ return z(n, o) + t + z(n, c);
328
326
  }
329
327
  function It(t, e, n = " ") {
330
328
  const r = t.length;
331
329
  if (e <= r || n === "")
332
330
  return t;
333
- const s = e - r;
334
- return z(n, s) + t;
331
+ const o = e - r;
332
+ return z(n, o) + t;
335
333
  }
336
334
  function qt(t, e, n = " ") {
337
335
  const r = t.length;
338
336
  if (e <= r || n === "")
339
337
  return t;
340
- const s = e - r;
341
- return t + z(n, s);
338
+ const o = e - r;
339
+ return t + z(n, o);
342
340
  }
343
341
  function z(t, e) {
344
- if (e <= 0) return "";
342
+ if (e <= 0 || t.length === 0)
343
+ return "";
345
344
  const n = Math.ceil(e / t.length);
346
345
  return t.repeat(n).slice(0, e);
347
346
  }
348
- function Gt(t = 32, e = !0, n = !0, r = !0, o = !1) {
347
+ function Gt(t = 32, e = !0, n = !0, r = !0, s = !1) {
349
348
  const l = [
350
349
  e ? [
351
350
  "a",
@@ -430,38 +429,38 @@ function Gt(t = 32, e = !0, n = !0, r = !0, o = !1) {
430
429
  ":",
431
430
  ";"
432
431
  ] : null,
433
- o ? [" "] : null
434
- ].filter((a) => S(a));
432
+ s ? [" "] : null
433
+ ].filter((u) => S(u));
435
434
  if (l.length === 0 || t <= 0)
436
435
  return "";
437
- const g = [];
438
- for (const a of l) {
439
- const p = M(0, a.length - 1);
440
- g.push(a[p]);
436
+ const m = [];
437
+ for (const u of l) {
438
+ const g = O(0, u.length - 1);
439
+ m.push(u[g]);
441
440
  }
442
- const u = Math.max(0, t - g.length), m = l.flat();
443
- for (let a = 0; a < u; a++) {
444
- const p = M(0, m.length - 1);
445
- g.push(m[p]);
441
+ const a = Math.max(0, t - m.length), p = l.flat();
442
+ for (let u = 0; u < a; u++) {
443
+ const g = O(0, p.length - 1);
444
+ m.push(p[g]);
446
445
  }
447
- for (let a = g.length - 1; a > 0; a--) {
448
- const p = M(0, a), h = g[a];
449
- g[a] = g[p], g[p] = h;
446
+ for (let u = m.length - 1; u > 0; u--) {
447
+ const g = O(0, u), y = m[u];
448
+ m[u] = m[g], m[g] = y;
450
449
  }
451
- return g.join("");
450
+ return m.join("");
452
451
  }
453
- function Pt(t, e, n = 0) {
452
+ function Tt(t, e, n = 0) {
454
453
  if (e === "")
455
454
  return !1;
456
- const r = Array.from(t), o = Array.from(e);
457
- let s = n >= 0 ? n : r.length + n;
458
- if (s < 0 && (s = 0), s >= r.length)
455
+ const r = Array.from(t), s = Array.from(e);
456
+ let o = n >= 0 ? n : r.length + n;
457
+ if (o < 0 && (o = 0), o >= r.length)
459
458
  return !1;
460
- const c = r.length - o.length;
461
- for (let i = s; i <= c; i++) {
459
+ const c = r.length - s.length;
460
+ for (let i = o; i <= c; i++) {
462
461
  let f = !0;
463
- for (let l = 0; l < o.length; l++)
464
- if (r[i + l] !== o[l]) {
462
+ for (let l = 0; l < s.length; l++)
463
+ if (r[i + l] !== s[l]) {
465
464
  f = !1;
466
465
  break;
467
466
  }
@@ -470,42 +469,42 @@ function Pt(t, e, n = 0) {
470
469
  }
471
470
  return !1;
472
471
  }
473
- function Y(t = 16) {
474
- return (b ?? ((n) => K(n)))(t);
472
+ function j(t = 16) {
473
+ return (R ?? ((n) => D(n)))(t);
475
474
  }
476
- function j(t) {
477
- b = t;
475
+ function v(t) {
476
+ R = t;
478
477
  }
479
- function Tt(t, e) {
478
+ function Bt(t, e) {
480
479
  let n = 0;
481
- const r = e ?? function(o) {
482
- const s = b;
483
- b = null;
484
- const c = Y(o);
485
- return b = s, n++, c;
480
+ const r = e ?? function(s) {
481
+ const o = R;
482
+ R = null;
483
+ const c = j(s);
484
+ return R = o, n++, c;
486
485
  };
487
- j((o) => n < t.length ? String(t[n++]) : r(o));
486
+ v((s) => n < t.length ? String(t[n++]) : r(s));
488
487
  }
489
- function Bt() {
490
- b = null;
488
+ function Jt() {
489
+ R = null;
491
490
  }
492
- function Jt(t, e) {
491
+ function Ht(t, e) {
493
492
  return e <= 0 ? "" : t.repeat(e);
494
493
  }
495
- function Ht(t, e, n) {
494
+ function Kt(t, e, n) {
496
495
  let r;
497
496
  typeof e == "object" && !S(e) ? r = Object.values(e) : r = S(e) ? [...e] : Array.from(e);
498
- const o = n.split(t);
499
- if (o.length === 1)
497
+ const s = n.split(t);
498
+ if (s.length === 1)
500
499
  return n;
501
- let s = o[0];
502
- for (let c = 1; c < o.length; c++) {
500
+ let o = s[0];
501
+ for (let c = 1; c < s.length; c++) {
503
502
  const i = r.length ? r.shift() : t;
504
- s += i + o[c];
503
+ o += i + s[c];
505
504
  }
506
- return String(s);
505
+ return String(o);
507
506
  }
508
- function Kt(t, e) {
507
+ function Zt(t, e) {
509
508
  try {
510
509
  const n = String(t);
511
510
  if (n.length)
@@ -515,159 +514,158 @@ function Kt(t, e) {
515
514
  return e;
516
515
  }
517
516
  }
518
- function Zt(t, e, n, r = !0) {
519
- const o = (l) => typeof l == "string" ? [l] : Array.from(l), s = o(t), c = o(e), i = (l) => l.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), f = (l) => s.reduce((g, u, m) => {
520
- if (u === "") return g;
521
- const a = c[m] ?? "";
517
+ function Dt(t, e, n, r = !0) {
518
+ const s = (l) => typeof l == "string" ? [l] : Array.from(l), o = s(t), c = s(e), i = (l) => l.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), f = (l) => o.reduce((m, a, p) => {
519
+ if (a === "") return m;
520
+ const u = c[p] ?? "";
522
521
  if (!r)
523
- return g.split(u).join(a);
524
- const p = new RegExp(i(u), "gi");
525
- return g.replace(p, () => a);
522
+ return m.split(a).join(u);
523
+ const g = new RegExp(i(a), "gi");
524
+ return m.replace(g, () => u);
526
525
  }, l);
527
- return N(n) ? f(n) : Array.from(n).map(f);
526
+ return _(n) ? f(n) : Array.from(n).map(f);
528
527
  }
529
- function v(t, e, n) {
528
+ function tt(t, e, n) {
530
529
  if (t = String(t), t === "")
531
530
  return n;
532
531
  const r = n.indexOf(t);
533
532
  return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
534
533
  }
535
- function Dt(t, e, n) {
536
- return t = String(t), t === "" ? n : U(n, t) ? v(t, e, n) : n;
534
+ function Qt(t, e, n) {
535
+ return t = String(t), t === "" ? n : P(n, t) ? tt(t, e, n) : n;
537
536
  }
538
- function tt(t, e, n) {
537
+ function et(t, e, n) {
539
538
  if (t = String(t), t === "")
540
539
  return n;
541
540
  const r = n.lastIndexOf(t);
542
541
  return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
543
542
  }
544
- function Qt(t, e, n) {
545
- return t = String(t), t === "" ? n : W(n, t) ? tt(t, e, n) : n;
543
+ function Vt(t, e, n) {
544
+ return t = String(t), t === "" ? n : M(n, t) ? et(t, e, n) : n;
546
545
  }
547
- function Vt(t, e, n, r = -1) {
548
- const o = (u) => S(u) ? u : [u], s = o(t);
549
- function c(u) {
546
+ function Xt(t, e, n, r = -1) {
547
+ const s = (a) => S(a) ? a : [a], o = s(t);
548
+ function c(a) {
550
549
  try {
551
- if (u instanceof RegExp) {
552
- let p = u.flags;
553
- return p.includes("g") || (p += "g"), p.includes("u") || (p += "u"), new RegExp(u.source, p);
550
+ if (a instanceof RegExp) {
551
+ let g = a.flags;
552
+ return g.includes("g") || (g += "g"), g.includes("u") || (g += "u"), new RegExp(a.source, g);
554
553
  }
555
- let m = u, a = "gu";
556
- if (u.length >= 2 && u[0] === "/") {
557
- let p = -1;
558
- for (let h = u.length - 1; h > 0; h--)
559
- if (u[h] === "/") {
554
+ let p = a, u = "gu";
555
+ if (a.length >= 2 && a[0] === "/") {
556
+ let g = -1;
557
+ for (let y = a.length - 1; y > 0; y--)
558
+ if (a[y] === "/") {
560
559
  let w = 0;
561
- for (let d = h - 1; d >= 0 && u[d] === "\\"; d--)
560
+ for (let h = y - 1; h >= 0 && a[h] === "\\"; h--)
562
561
  w++;
563
562
  if (w % 2 === 0) {
564
- p = h;
563
+ g = y;
565
564
  break;
566
565
  }
567
566
  }
568
- if (p > 1) {
569
- m = u.slice(1, p);
570
- const h = u.slice(p + 1);
571
- if (h)
572
- for (const w of h)
573
- /[imsuy]/.test(w) && !a.includes(w) && (a += w);
574
- a.includes("g") || (a += "g"), a.includes("u") || (a += "u");
567
+ if (g > 1) {
568
+ p = a.slice(1, g);
569
+ const y = a.slice(g + 1);
570
+ if (y)
571
+ for (const w of y)
572
+ /[imsuy]/.test(w) && !u.includes(w) && (u += w);
575
573
  }
576
574
  }
577
575
  return new RegExp(
578
- m,
579
- Array.from(new Set(a.split(""))).join("")
576
+ p,
577
+ Array.from(new Set(u.split(""))).join("")
580
578
  );
581
579
  } catch {
582
580
  return null;
583
581
  }
584
582
  }
585
583
  const i = [];
586
- for (const u of s) {
587
- const m = c(u);
588
- if (!m) return null;
589
- i.push(m);
584
+ for (const a of o) {
585
+ const p = c(a);
586
+ if (!p) return null;
587
+ i.push(p);
590
588
  }
591
- const f = Q(e), l = f ? [] : o(e), g = (u) => {
592
- let m = u;
593
- for (let a = 0; a < i.length; a++) {
594
- const p = i[a];
589
+ const f = Q(e), l = f ? [] : s(e), m = (a) => {
590
+ let p = a;
591
+ for (let u = 0; u < i.length; u++) {
592
+ const g = i[u];
595
593
  if (f) {
596
- let h = 0;
594
+ let y = 0;
597
595
  const w = e;
598
- m = m.replace(
599
- p,
600
- (d, ...y) => {
601
- if (r >= 0 && h >= r) return d;
602
- h++;
603
- const L = typeof y[y.length - 1] == "object" && typeof y[y.length - 2] == "number" ? y.length - 3 : y.length - 2, $ = [];
604
- for (let k = 0; k < L; k++)
605
- $.push(y[k]);
606
- const A = [d, ...$];
607
- return w(A);
596
+ p = p.replace(
597
+ g,
598
+ (h, ...d) => {
599
+ if (r >= 0 && y >= r) return h;
600
+ y++;
601
+ const b = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, $ = [];
602
+ for (let A = 0; A < b; A++)
603
+ $.push(d[A]);
604
+ const L = [h, ...$];
605
+ return w(L);
608
606
  }
609
607
  );
610
608
  } else {
611
- const h = l[a] ?? (l.length === 1 ? l[0] : "");
609
+ const y = l[u] ?? (l.length === 1 ? l[0] : "");
612
610
  if (r < 0)
613
- m = m.replace(p, (w, ...d) => {
614
- const _ = typeof d[d.length - 1] == "object" && typeof d[d.length - 2] == "number" ? d.length - 3 : d.length - 2, L = d.slice(0, _).map(($) => String($));
615
- return h.replace(/\$(\d{1,2})/g, ($, A) => {
616
- const k = parseInt(A, 10);
617
- return (L[k - 1] ?? "").toUpperCase();
611
+ p = p.replace(g, (w, ...h) => {
612
+ const k = h.length > 0 && h[h.length - 1] !== null && typeof h[h.length - 1] == "object" ? h.length - 3 : h.length - 2, b = h.slice(0, k).map(($) => String($));
613
+ return y.replace(/\$(\d{1,2})/g, ($, L) => {
614
+ const A = parseInt(L, 10);
615
+ return (b[A - 1] ?? "").toUpperCase();
618
616
  });
619
617
  });
620
618
  else {
621
619
  let w = 0;
622
- m = m.replace(p, (d, ...y) => {
623
- if (w >= r) return d;
620
+ p = p.replace(g, (h, ...d) => {
621
+ if (w >= r) return h;
624
622
  w++;
625
- const L = typeof y[y.length - 1] == "object" && typeof y[y.length - 2] == "number" ? y.length - 3 : y.length - 2, $ = y.slice(0, L).map((A) => String(A));
626
- return h.replace(/\$(\d{1,2})/g, (A, k) => {
627
- const I = parseInt(k, 10);
628
- return ($[I - 1] ?? "").toUpperCase();
623
+ const b = d.length > 0 && d[d.length - 1] !== null && typeof d[d.length - 1] == "object" ? d.length - 3 : d.length - 2, $ = d.slice(0, b).map((L) => String(L));
624
+ return y.replace(/\$(\d{1,2})/g, (L, A) => {
625
+ const U = parseInt(A, 10);
626
+ return ($[U - 1] ?? "").toUpperCase();
629
627
  });
630
628
  });
631
629
  }
632
630
  }
633
631
  }
634
- return m;
632
+ return p;
635
633
  };
636
- return S(n) ? n.map(g) : g(n);
634
+ return S(n) ? n.map(m) : m(n);
637
635
  }
638
- function et(t) {
636
+ function nt(t) {
639
637
  return t.replace(/<\/?[^>]+(>|$)/g, "");
640
638
  }
641
- function Xt(t, e, n = !0) {
642
- const r = typeof t == "string" ? [t] : Array.from(t), o = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = (c) => {
639
+ function Yt(t, e, n = !0) {
640
+ const r = typeof t == "string" ? [t] : Array.from(t), s = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = (c) => {
643
641
  let i = c;
644
642
  for (const f of r)
645
643
  if (f !== "")
646
644
  if (n)
647
645
  i = i.split(f).join("");
648
646
  else {
649
- const l = new RegExp(o(f), "gi");
647
+ const l = new RegExp(s(f), "gi");
650
648
  i = i.replace(l, "");
651
649
  }
652
650
  return i;
653
651
  };
654
- return typeof e == "string" ? s(e) : Array.from(e, (c) => s(String(c)));
652
+ return typeof e == "string" ? o(e) : Array.from(e, (c) => o(String(c)));
655
653
  }
656
- function Yt(t) {
654
+ function jt(t) {
657
655
  return Array.from(t).reverse().join("");
658
656
  }
659
- function jt(t, e) {
657
+ function vt(t, e) {
660
658
  const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
661
659
  return e + t.replace(new RegExp(`^(?:${n})+`, "u"), "");
662
660
  }
663
- function vt(t) {
661
+ function te(t) {
664
662
  const e = String(t).trim();
665
663
  if (e === "")
666
664
  return "";
667
665
  let n = e.split(/\s+/u);
668
- return n.length > 1 ? n = n.map((o) => P(o)) : n = st(n.join("_")).map((o) => P(o)), n.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((o) => o.length > 0).join(" ");
666
+ return n.length > 1 ? n = n.map((s) => G(s)) : n = ot(n.join("_")).map((s) => G(s)), n.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
669
667
  }
670
- function te(t) {
668
+ function ee(t) {
671
669
  if (t.trim() === "")
672
670
  return t;
673
671
  const e = /* @__PURE__ */ new Set([
@@ -706,117 +704,115 @@ function te(t) {
706
704
  "des",
707
705
  "par",
708
706
  "à"
709
- ]), n = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), o = (s) => {
710
- if (!s) return s;
711
- const c = Array.from(s), i = c[0].toLocaleUpperCase(), f = c.slice(1).join("");
707
+ ]), n = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (o) => {
708
+ if (!o) return o;
709
+ const c = Array.from(o), i = c[0].toLocaleUpperCase(), f = c.slice(1).join("");
712
710
  return i + f;
713
711
  };
714
- for (let s = 0; s < r.length; s++) {
715
- const c = r[s].toLocaleLowerCase();
712
+ for (let o = 0; o < r.length; o++) {
713
+ const c = r[o].toLocaleLowerCase();
716
714
  if (c.includes("-")) {
717
- const f = c.split("-").map((l) => e.has(l) && l.length <= 3 ? l : o(l));
718
- r[s] = f.join("-");
715
+ const f = c.split("-").map((l) => e.has(l) && l.length <= 3 ? l : s(l));
716
+ r[o] = f.join("-");
719
717
  } else {
720
- const i = s > 0 ? r[s - 1] : "", f = i ? Array.from(i).slice(-1)[0] : void 0, l = s === 0 || f !== void 0 && n.has(f);
721
- e.has(c) && c.length <= 3 && !l ? r[s] = c : r[s] = o(c);
718
+ const i = o > 0 ? r[o - 1] : "", f = i ? Array.from(i).slice(-1)[0] : void 0, l = o === 0 || f !== void 0 && n.has(f);
719
+ e.has(c) && c.length <= 3 && !l ? r[o] = c : r[o] = s(c);
722
720
  }
723
721
  }
724
722
  return r.join(" ");
725
723
  }
726
- function nt(t, e = "_") {
724
+ function rt(t, e = "_") {
727
725
  const r = `${t}|${e}`;
728
- if (R.has(r))
729
- return R.get(r);
730
- let o = t;
731
- return /^[a-z]+$/.test(t) || (o = ot(t).replace(/\s+/gu, ""), o = o.replace(/(.)(?=[A-Z])/g, `$1${e}`), o = J(o)), R.set(r, o), o;
726
+ if (E.has(r))
727
+ return E.get(r);
728
+ let s = t;
729
+ return /^[a-z]+$/.test(t) || (s = it(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${e}`), s = J(s)), E.set(r, s), s;
732
730
  }
733
- function ee(t) {
734
- return Z(t).replace(/[\s\u3164\u1160]+/gu, " ");
731
+ function ne(t) {
732
+ return K(t).replace(/[\s\u3164\u1160]+/gu, " ");
735
733
  }
736
- function U(t, e) {
734
+ function P(t, e) {
737
735
  if (t == null || e == null)
738
736
  return !1;
739
- let n = [
740
- e
741
- ];
742
- typeof e == "string" || typeof e == "number" ? n = [e] : Symbol.iterator in Object(e) && (n = Array.from(e));
737
+ let n;
738
+ _(e) || V(e) ? n = [e] : Symbol.iterator in Object(e) ? n = Array.from(e) : n = [e];
743
739
  const r = String(t);
744
- for (const o of n) {
745
- if (o == null)
740
+ for (const s of n) {
741
+ if (s == null)
746
742
  continue;
747
- const s = String(o);
748
- if (s !== "" && r.startsWith(s))
743
+ const o = String(s);
744
+ if (o !== "" && r.startsWith(o))
749
745
  return !0;
750
746
  }
751
747
  return !1;
752
748
  }
753
- function ne(t, e) {
754
- return !U(t, e);
749
+ function re(t, e) {
750
+ return !P(t, e);
755
751
  }
756
752
  function H(t) {
757
753
  const e = t;
758
- if (C.has(e))
759
- return C.get(e);
760
- const n = String(t).replace(/[-_]+/g, " "), r = n.trim() === "" ? [] : n.split(/\s+/u), o = (c) => {
754
+ if (F.has(e))
755
+ return F.get(e);
756
+ const n = String(t).replace(/[-_]+/g, " "), r = n.trim() === "" ? [] : n.split(/\s+/u), s = (c) => {
761
757
  if (!c) return c;
762
758
  const i = Array.from(c), f = i[0].toUpperCase(), l = i.slice(1).join("");
763
759
  return f + l;
764
- }, s = r.map(o).join("");
765
- return C.set(e, s), s;
760
+ }, o = r.map(s).join("");
761
+ return F.set(e, o), o;
766
762
  }
767
- function re(t) {
763
+ function se(t) {
768
764
  return H(t);
769
765
  }
770
- function se(t, e) {
766
+ function oe(t, e) {
771
767
  if (!t || Object.keys(t).length === 0)
772
768
  return e;
773
- const n = Object.keys(t).filter((s) => s !== "");
769
+ const n = Object.keys(t).filter((o) => o !== "");
774
770
  if (n.length === 0)
775
771
  return e;
776
- n.sort((s, c) => c.length - s.length);
777
- const r = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(n.map(r).join("|"), "gu");
778
- return e.replace(o, (s) => t[s] ?? s);
772
+ n.sort((o, c) => c.length - o.length);
773
+ const r = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(n.map(r).join("|"), "gu");
774
+ return e.replace(s, (o) => t[o]);
779
775
  }
780
- function oe(t, e) {
776
+ function ie(t, e) {
781
777
  return e < 0 ? x(t, e) : x(t, 0, e);
782
778
  }
783
- function rt(t) {
779
+ function st(t) {
784
780
  return J(x(t, 0, 1)) + x(t, 1);
785
781
  }
786
- function ie(t) {
787
- return D(x(t, 0, 1)) + x(t, 1);
782
+ function ce(t) {
783
+ return Z(x(t, 0, 1)) + x(t, 1);
788
784
  }
789
- function st(t) {
785
+ function ot(t) {
790
786
  return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
791
787
  }
792
- function ot(t, e = ` \r
788
+ function it(t, e = ` \r
793
789
  \f\v`) {
794
- const n = S(e) ? e.join("") : e, r = (i) => i.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), o = n.length ? r(n) : "", s = o.length ? `(?:\\s|[${o}])` : "\\s", c = new RegExp(`(^|${s})(\\p{Ll})`, "gu");
790
+ const n = S(e) ? e.join("") : e, r = (i) => i.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), s = n.length ? r(n) : "", o = s.length ? `(?:\\s|[${s}])` : "\\s", c = new RegExp(`(^|${o})(\\p{Ll})`, "gu");
795
791
  return t.replace(c, (i, f, l) => f + l.toUpperCase());
796
792
  }
797
- function ce(t, e = null) {
798
- const n = e && e.length > 0 ? e.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&") : "", r = n.length > 0 ? new RegExp(`[\\p{L}\\p{N}${n}]+`, "gu") : /[\p{L}\p{N}]+/gu, o = t.match(r);
799
- return o ? o.length : 0;
793
+ function le(t, e = null) {
794
+ const n = e && e.length > 0 ? e.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&") : "", r = n.length > 0 ? new RegExp(`[\\p{L}\\p{N}${n}]+`, "gu") : /[\p{L}\p{N}]+/gu, s = t.match(r);
795
+ return s ? s.length : 0;
800
796
  }
801
- function le(t, e = 75, n = `
797
+ function fe(t, e = 75, n = `
802
798
  `, r = !1) {
803
799
  if (t.length === 0 || e < 1 || n === "")
804
800
  return t;
805
- const o = t.split(/\r\n|\n|\r/), s = [];
806
- for (const c of o) {
801
+ const s = t.split(/\r\n|\n|\r/), o = [];
802
+ for (const c of s) {
807
803
  let i = c;
808
804
  if (i.length === 0) {
809
- s.push("");
805
+ o.push("");
810
806
  continue;
811
807
  }
812
808
  if (r) {
813
809
  for (; i.length > 0 && !(/^\s/u.test(i) && (i = i.replace(/^\s+/u, ""), i.length === 0)); ) {
814
810
  if (i.length <= e) {
815
- s.push(i), i = "";
811
+ o.push(i), i = "";
816
812
  break;
817
813
  }
818
814
  let f = i.slice(0, e);
819
- f = f.replace(/\s+$/u, ""), s.push(f), i = i.slice(e).replace(/^\s+/u, "");
815
+ f = f.replace(/\s+$/u, ""), o.push(f), i = i.slice(e).replace(/^\s+/u, "");
820
816
  }
821
817
  continue;
822
818
  }
@@ -825,30 +821,27 @@ function le(t, e = 75, n = `
825
821
  if (f.length !== i.length && (i = f, i.length <= e))
826
822
  break;
827
823
  const l = i.slice(0, e + 1);
828
- let g = -1;
829
- for (let m = l.length - 1; m >= 0; m--)
830
- if (/\s/u.test(l[m])) {
831
- g = m;
824
+ let m = -1;
825
+ for (let p = l.length - 1; p >= 0; p--)
826
+ if (/\s/u.test(l[p])) {
827
+ m = p;
832
828
  break;
833
829
  }
834
- if (g > 0) {
835
- s.push(i.slice(0, g)), i = i.slice(g + 1);
830
+ if (m > 0) {
831
+ o.push(i.slice(0, m)), i = i.slice(m + 1);
836
832
  continue;
837
833
  }
838
- const u = i.search(/\s/u);
839
- if (u >= 0) {
840
- s.push(i.slice(0, u)), i = i.slice(u + 1);
834
+ const a = i.search(/\s/u);
835
+ if (a >= 0) {
836
+ o.push(i.slice(0, a)), i = i.slice(a + 1);
841
837
  continue;
842
838
  }
843
- s.push(i), i = "";
839
+ o.push(i), i = "";
844
840
  break;
845
841
  }
846
- i.length > 0 && s.push(i);
842
+ i.length > 0 && o.push(i);
847
843
  }
848
- return s.join(n);
849
- }
850
- function fe() {
851
- return R.size;
844
+ return o.join(n);
852
845
  }
853
846
  function ae() {
854
847
  return E.size;
@@ -857,84 +850,87 @@ function ue() {
857
850
  return C.size;
858
851
  }
859
852
  function pe() {
860
- R.clear(), E.clear(), C.clear();
853
+ return F.size;
854
+ }
855
+ function ge() {
856
+ E.clear(), C.clear(), F.clear();
861
857
  }
862
858
  export {
863
859
  T as after,
864
- ft as afterLast,
865
- te as apa,
866
- V as before,
867
- X as beforeLast,
868
- at as between,
869
- ut as betweenFirst,
870
- pt as camel,
871
- ae as camelCacheSize,
872
- gt as charAt,
873
- ht as chopEnd,
874
- mt as chopStart,
860
+ at as afterLast,
861
+ ee as apa,
862
+ X as before,
863
+ Y as beforeLast,
864
+ ut as between,
865
+ pt as betweenFirst,
866
+ gt as camel,
867
+ ue as camelCacheSize,
868
+ mt as charAt,
869
+ dt as chopEnd,
870
+ ht as chopStart,
875
871
  B as contains,
876
- yt as containsAll,
877
- Bt as createRandomStringsNormally,
878
- j as createRandomStringsUsing,
879
- Tt as createRandomStringsUsingSequence,
880
- xt as deduplicate,
881
- wt as doesntContain,
882
- St as doesntEndWith,
883
- ne as doesntStartWith,
884
- W as endsWith,
885
- dt as excerpt,
886
- $t as finish,
887
- pe as flushCache,
888
- vt as headline,
889
- bt as is,
890
- Lt as isAscii,
891
- Rt as isJson,
892
- Ot as isMatch,
893
- Et as isUrl,
894
- Ct as kebab,
895
- rt as lcfirst,
896
- F as length,
897
- Ft as limit,
872
+ wt as containsAll,
873
+ Jt as createRandomStringsNormally,
874
+ v as createRandomStringsUsing,
875
+ Bt as createRandomStringsUsingSequence,
876
+ St as deduplicate,
877
+ xt as doesntContain,
878
+ $t as doesntEndWith,
879
+ re as doesntStartWith,
880
+ M as endsWith,
881
+ yt as excerpt,
882
+ kt as finish,
883
+ ge as flushCache,
884
+ te as headline,
885
+ Lt as is,
886
+ Rt as isAscii,
887
+ Et as isJson,
888
+ Wt as isMatch,
889
+ Ct as isUrl,
890
+ Ft as kebab,
891
+ st as lcfirst,
892
+ N as length,
893
+ Nt as limit,
898
894
  J as lower,
899
895
  z as makePad,
900
896
  _t as mask,
901
- Mt as match,
902
- Nt as matchAll,
903
- Wt as numbers,
897
+ Ot as match,
898
+ Mt as matchAll,
899
+ Pt as numbers,
904
900
  Ut as padBoth,
905
901
  It as padLeft,
906
902
  qt as padRight,
907
- re as pascal,
903
+ se as pascal,
908
904
  Gt as password,
909
- Pt as position,
910
- Y as random,
911
- Xt as remove,
912
- Jt as repeat,
913
- Zt as replace,
914
- Ht as replaceArray,
915
- Qt as replaceEnd,
916
- v as replaceFirst,
917
- tt as replaceLast,
918
- Vt as replaceMatches,
919
- Dt as replaceStart,
920
- Yt as reverse,
921
- nt as snake,
922
- fe as snakeCacheSize,
923
- ee as squish,
924
- jt as start,
925
- U as startsWith,
926
- et as stripTags,
905
+ Tt as position,
906
+ j as random,
907
+ Yt as remove,
908
+ Ht as repeat,
909
+ Dt as replace,
910
+ Kt as replaceArray,
911
+ Vt as replaceEnd,
912
+ tt as replaceFirst,
913
+ et as replaceLast,
914
+ Xt as replaceMatches,
915
+ Qt as replaceStart,
916
+ jt as reverse,
917
+ rt as snake,
918
+ ae as snakeCacheSize,
919
+ ne as squish,
920
+ vt as start,
921
+ P as startsWith,
922
+ nt as stripTags,
927
923
  H as studly,
928
- ue as studlyCacheSize,
929
- se as swap,
930
- oe as take,
931
- Kt as toStringOr,
932
- ie as ucfirst,
933
- st as ucsplit,
934
- ot as ucwords,
935
- At as unwrap,
936
- ce as wordCount,
937
- le as wordWrap,
924
+ pe as studlyCacheSize,
925
+ oe as swap,
926
+ ie as take,
927
+ Zt as toStringOr,
928
+ ce as ucfirst,
929
+ ot as ucsplit,
930
+ it as ucwords,
931
+ bt as unwrap,
932
+ le as wordCount,
933
+ fe as wordWrap,
938
934
  zt as words,
939
- kt as wrap
935
+ At as wrap
940
936
  };