@zinaid/str 0.0.7 → 0.0.9

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,20 +1,20 @@
1
- import { substr as x, ltrim as G, rtrim as P, randomInt as O, randomString as J, title as j, ascii as Z, trim as H, upper as V } from "@zinaid/str";
2
- import { isArray as S, toLower as N, isString as M, isFunction as D } from "@zinaid/utils";
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 "@zinaid/str";
2
+ import { isArray as S, toLower as O, isString as N, isFunction as Q } from "@zinaid/utils";
3
3
  const R = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
4
4
  let b = null;
5
- function K(t, e) {
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 at(t, e) {
11
+ function ft(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 Q(t, e) {
17
+ function V(t, e) {
18
18
  if (e === "")
19
19
  return t;
20
20
  const n = t.indexOf(String(e));
@@ -26,70 +26,70 @@ function X(t, e) {
26
26
  const n = t.lastIndexOf(String(e));
27
27
  return n === -1 ? t : x(t, 0, n);
28
28
  }
29
- function ut(t, e, n) {
30
- return e === "" || n === "" ? t : X(K(t, e), n);
29
+ function at(t, e, n) {
30
+ return e === "" || n === "" ? t : X(T(t, e), n);
31
31
  }
32
- function pt(t, e, n) {
33
- return e === "" || n === "" ? t : Q(K(t, e), n);
32
+ function ut(t, e, n) {
33
+ return e === "" || n === "" ? t : V(T(t, e), n);
34
34
  }
35
- function gt(t) {
35
+ function pt(t) {
36
36
  if (E.has(t))
37
37
  return E.get(t);
38
- const e = st(B(t));
38
+ const e = rt(H(t));
39
39
  return E.set(t, e), e;
40
40
  }
41
- function mt(t, e) {
41
+ function gt(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 ht(t, e) {
45
+ function mt(t, e) {
46
46
  for (const n of S(e) ? e : [e])
47
47
  if (n !== "" && t.startsWith(n)) {
48
- const r = [...t], s = [...n];
49
- return r.slice(s.length).join("");
48
+ const r = [...t], o = [...n];
49
+ return r.slice(o.length).join("");
50
50
  }
51
51
  return t;
52
52
  }
53
- function dt(t, e) {
53
+ function ht(t, e) {
54
54
  for (const n of S(e) ? e : [e])
55
55
  if (n !== "" && t.endsWith(n)) {
56
- const r = [...t], s = [...n];
57
- return r.slice(0, -s.length).join("");
56
+ const r = [...t], o = [...n];
57
+ return r.slice(0, -o.length).join("");
58
58
  }
59
59
  return t;
60
60
  }
61
- function T(t, e, n = !1) {
61
+ 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 s of r)
66
- if (n && (s = s.toLowerCase()), s !== "" && t.includes(s))
65
+ for (let o of r)
66
+ if (n && (o = o.toLowerCase()), o !== "" && t.includes(o))
67
67
  return !0;
68
68
  return !1;
69
69
  }
70
- function yt(t, e = "", n = {}) {
71
- const r = n.radius ?? 100, s = n.omission ?? "...", o = String(t ?? ""), c = e ?? "", i = (w) => w.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), f = new RegExp(`^(.*?)(${i(c)})(.*)$`, "iu").exec(o);
72
- if (!f)
70
+ function dt(t, e = "", n = {}) {
71
+ const r = n.radius ?? 100, o = n.omission ?? "...", s = String(t ?? ""), c = e ?? "", i = (y) => y.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = new RegExp(`^(.*?)(${i(c)})(.*)$`, "iu").exec(s);
72
+ if (!l)
73
73
  return null;
74
- const m = G(f[1] ?? ""), u = Array.from(m).length, a = x(m, Math.max(u - r, 0), r);
75
- let p = G(a);
76
- p !== m && (p = s + p);
77
- const g = P(f[3] ?? ""), h = x(g, 0, r);
78
- let d = P(h);
79
- d !== g && (d = d + s);
80
- const y = f[2] ?? "";
81
- return p + y + d;
82
- }
83
- function wt(t, e, n = !1) {
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) {
84
84
  for (const r of e)
85
- if (!T(t, r, n))
85
+ if (!B(t, r, n))
86
86
  return !1;
87
87
  return !0;
88
88
  }
89
- function xt(t, e, n = !1) {
90
- return !T(t, e, n);
89
+ function wt(t, e, n = !1) {
90
+ return !B(t, e, n);
91
91
  }
92
- function St(t, e = " ") {
92
+ function xt(t, e = " ") {
93
93
  return S(e) ? (e.forEach((n) => {
94
94
  t = t.replace(new RegExp(`${n}+`, "g"), n);
95
95
  }), t) : t.replace(new RegExp(`${e}+`, "g"), e);
@@ -103,40 +103,40 @@ function W(t, e) {
103
103
  return !0;
104
104
  return !1;
105
105
  }
106
- function $t(t, e) {
106
+ function St(t, e) {
107
107
  return !W(t, e);
108
108
  }
109
- function kt(t, e) {
109
+ function $t(t, e) {
110
110
  const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
111
111
  return t.replace(new RegExp(`(?:${n})+$`, "u"), "") + e;
112
112
  }
113
- function At(t, e, n = null) {
113
+ function kt(t, e, n = null) {
114
114
  return e + t + (n ?? e);
115
115
  }
116
- function bt(t, e, n = null) {
117
- return I(t, e) && (t = x(t, F(e))), W(t, n ??= e) && (t = x(t, 0, -F(n))), t;
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;
118
118
  }
119
- function Lt(t, e, n = !1) {
119
+ function bt(t, e, n = !1) {
120
120
  e = String(e);
121
121
  let r;
122
122
  typeof t == "string" ? r = [t] : r = Array.from(t);
123
- for (let s of r) {
124
- if (s = String(s), s === e || n && N(s) === N(e))
123
+ for (let o of r) {
124
+ if (o = String(o), o === e || n && O(o) === O(e))
125
125
  return !0;
126
- s = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = s.replace(/\\\*/g, ".*");
127
- const o = n ? "iu" : "u";
128
- if (new RegExp(`^${s}$`, o).test(e))
126
+ o = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = o.replace(/\\\*/g, ".*");
127
+ const s = n ? "iu" : "u";
128
+ if (new RegExp(`^${o}$`, s).test(e))
129
129
  return !0;
130
130
  }
131
131
  return !1;
132
132
  }
133
- function Rt(t) {
133
+ function Lt(t) {
134
134
  for (let e = 0; e < t.length; e++)
135
135
  if (t.charCodeAt(e) > 127) return !1;
136
136
  return !0;
137
137
  }
138
- function Et(t) {
139
- if (!M(t))
138
+ function Rt(t) {
139
+ if (!N(t))
140
140
  return !1;
141
141
  try {
142
142
  JSON.parse(t);
@@ -145,17 +145,17 @@ function Et(t) {
145
145
  }
146
146
  return !0;
147
147
  }
148
- function Ct(t, e = []) {
149
- if (!M(t))
148
+ function Et(t, e = []) {
149
+ if (!N(t))
150
150
  return !1;
151
- 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("|");
151
+ 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("|");
152
152
  try {
153
153
  const c = new URL(t).protocol.replace(":", "");
154
154
  if (r.split("|").includes(c))
155
155
  return !0;
156
156
  } catch {
157
157
  }
158
- const s = [
158
+ const o = [
159
159
  "^(",
160
160
  r,
161
161
  "):\\/\\/",
@@ -174,178 +174,178 @@ function Ct(t, e = []) {
174
174
  "$"
175
175
  ].join("");
176
176
  try {
177
- return new RegExp(s, "iu").test(t);
177
+ return new RegExp(o, "iu").test(t);
178
178
  } catch {
179
179
  return !1;
180
180
  }
181
181
  }
182
- function Ft(t) {
183
- return rt(t, "-");
182
+ function Ct(t) {
183
+ return nt(t, "-");
184
184
  }
185
185
  function F(t) {
186
186
  return t.length;
187
187
  }
188
- function zt(t, e = 100, n = "...", r = !1) {
188
+ function Ft(t, e = 100, n = "...", r = !1) {
189
189
  if (t.length <= e)
190
190
  return t;
191
191
  if (!r)
192
192
  return t.slice(0, e).replace(/\s+$/, "") + n;
193
- t = nt(t).replace(/[\n\r]+/g, " ").trim();
194
- const s = t.slice(0, e).replace(/\s+$/, "");
195
- return t.substring(e, e + 1) === " " ? s + n : s.replace(/(.*)\s.*/, "$1") + n;
193
+ t = et(t).replace(/[\n\r]+/g, " ").trim();
194
+ const o = t.slice(0, e).replace(/\s+$/, "");
195
+ return t.substring(e, e + 1) === " " ? o + n : o.replace(/(.*)\s.*/, "$1") + n;
196
196
  }
197
- function U(t) {
198
- return N(t);
197
+ function J(t) {
198
+ return O(t);
199
199
  }
200
- function _t(t, e = 100, n = "...") {
200
+ function zt(t, e = 100, n = "...") {
201
201
  if (e <= 0)
202
202
  return t;
203
- const r = e, s = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), o = t.match(s);
204
- return !o || F(t) === F(o[0]) ? t : o[0].replace(/\s+$/, "") + n;
203
+ const r = e, o = new RegExp(`^\\s*(?:\\S+\\s*){1,${r}}`, "u"), s = t.match(o);
204
+ return !s || F(t) === F(s[0]) ? t : s[0].replace(/\s+$/, "") + n;
205
205
  }
206
- function Ot(t, e, n, r = null) {
206
+ function _t(t, e, n, r = null) {
207
207
  if (e === "")
208
208
  return t;
209
- const s = t.length;
210
- let o = n;
211
- n < 0 && (o = n < -s ? 0 : s + n);
209
+ const o = t.length;
210
+ let s = n;
211
+ n < 0 && (s = n < -o ? 0 : o + n);
212
212
  const c = t.slice(
213
- o,
214
- r !== null ? o + r : void 0
213
+ s,
214
+ r !== null ? s + r : void 0
215
215
  );
216
216
  if (c === "")
217
217
  return t;
218
- const i = t.slice(0, o), l = c.length, f = t.slice(o + l);
219
- return i + e.slice(0, 1).repeat(l) + f;
218
+ const i = t.slice(0, s), f = c.length, l = t.slice(s + f);
219
+ return i + e.slice(0, 1).repeat(f) + l;
220
220
  }
221
- function Nt(t, e) {
221
+ function Mt(t, e) {
222
222
  let n = "u", r = t;
223
223
  if (t.length >= 2 && t[0] === "/") {
224
- let s = -1;
225
- for (let o = t.length - 1; o > 0; o--)
226
- if (t[o] === "/") {
224
+ let o = -1;
225
+ for (let s = t.length - 1; s > 0; s--)
226
+ if (t[s] === "/") {
227
227
  let c = 0;
228
- for (let i = o - 1; i >= 0 && t[i] === "\\"; i--)
228
+ for (let i = s - 1; i >= 0 && t[i] === "\\"; i--)
229
229
  c++;
230
230
  if (c % 2 === 0) {
231
- s = o;
231
+ o = s;
232
232
  break;
233
233
  }
234
234
  }
235
- if (s > 0) {
236
- r = t.slice(1, s);
237
- const o = t.slice(s + 1);
238
- if (o)
239
- for (const c of o)
235
+ if (o > 0) {
236
+ r = t.slice(1, o);
237
+ const s = t.slice(o + 1);
238
+ if (s)
239
+ for (const c of s)
240
240
  /[imsuy]/.test(c) && !n.includes(c) && (n += c);
241
241
  }
242
242
  }
243
243
  try {
244
- const o = new RegExp(r, n).exec(e);
245
- return o ? o[1] !== void 0 ? o[1] : o[0] : "";
244
+ const s = new RegExp(r, n).exec(e);
245
+ return s ? s[1] !== void 0 ? s[1] : s[0] : "";
246
246
  } catch {
247
247
  return "";
248
248
  }
249
249
  }
250
- function Mt(t, e) {
250
+ function Ot(t, e) {
251
251
  e = String(e);
252
252
  const n = typeof t == "string" ? [t] : Array.from(t);
253
253
  for (const r of n) {
254
254
  if (typeof r != "string" || r === "") continue;
255
- let s = "u", o = r;
255
+ let o = "u", s = r;
256
256
  if (r.length >= 2 && r[0] === "/") {
257
257
  let c = -1;
258
258
  for (let i = r.length - 1; i > 0; i--)
259
259
  if (r[i] === "/") {
260
- let l = 0;
261
- for (let f = i - 1; f >= 0 && r[f] === "\\"; f--)
262
- l++;
263
- if (l % 2 === 0) {
260
+ let f = 0;
261
+ for (let l = i - 1; l >= 0 && r[l] === "\\"; l--)
262
+ f++;
263
+ if (f % 2 === 0) {
264
264
  c = i;
265
265
  break;
266
266
  }
267
267
  }
268
268
  if (c > 0) {
269
- o = r.slice(1, c);
269
+ s = r.slice(1, c);
270
270
  const i = r.slice(c + 1);
271
271
  if (i)
272
- for (const l of i)
273
- /[imsuy]/.test(l) && !s.includes(l) && (s += l);
272
+ for (const f of i)
273
+ /[imsuy]/.test(f) && !o.includes(f) && (o += f);
274
274
  }
275
275
  }
276
276
  try {
277
- if (new RegExp(o, s).test(e))
277
+ if (new RegExp(s, o).test(e))
278
278
  return !0;
279
279
  } catch {
280
280
  }
281
281
  }
282
282
  return !1;
283
283
  }
284
- function Wt(t, e) {
284
+ function Nt(t, e) {
285
285
  let n = "u", r = t;
286
286
  if (t.length >= 2 && t[0] === "/") {
287
- let o = -1;
287
+ let s = -1;
288
288
  for (let c = t.length - 1; c > 0; c--)
289
289
  if (t[c] === "/") {
290
290
  let i = 0;
291
- for (let l = c - 1; l >= 0 && t[l] === "\\"; l--)
291
+ for (let f = c - 1; f >= 0 && t[f] === "\\"; f--)
292
292
  i++;
293
293
  if (i % 2 === 0) {
294
- o = c;
294
+ s = c;
295
295
  break;
296
296
  }
297
297
  }
298
- if (o > 0) {
299
- r = t.slice(1, o);
300
- const c = t.slice(o + 1);
298
+ if (s > 0) {
299
+ r = t.slice(1, s);
300
+ const c = t.slice(s + 1);
301
301
  if (c)
302
302
  for (const i of c)
303
303
  /[imsuy]/.test(i) && !n.includes(i) && (n += i);
304
304
  }
305
305
  }
306
306
  n.includes("g") || (n += "g");
307
- let s = [];
307
+ let o = [];
308
308
  try {
309
- const o = new RegExp(r, n);
309
+ const s = new RegExp(r, n);
310
310
  let c;
311
- for (; (c = o.exec(e)) !== null; )
312
- s.push(c[1] !== void 0 ? c[1] : c[0]), c[0] === "" && o.lastIndex++;
311
+ for (; (c = s.exec(e)) !== null; )
312
+ o.push(c[1] !== void 0 ? c[1] : c[0]), c[0] === "" && s.lastIndex++;
313
313
  } catch {
314
- s = [];
314
+ o = [];
315
315
  }
316
- return s;
316
+ return o;
317
317
  }
318
- function Ut(t) {
318
+ function Wt(t) {
319
319
  return S(t) ? t.map((e) => e.replace(/[^0-9]/g, "")) : t.replace(/[^0-9]/g, "");
320
320
  }
321
- function It(t, e, n = " ") {
321
+ function Ut(t, e, n = " ") {
322
322
  const r = t.length;
323
323
  if (e <= r || n === "")
324
324
  return t;
325
- const s = e - r, o = Math.floor(s / 2), c = s - o;
326
- return z(n, o) + t + z(n, c);
325
+ const o = e - r, s = Math.floor(o / 2), c = o - s;
326
+ return z(n, s) + t + z(n, c);
327
327
  }
328
- function qt(t, e, n = " ") {
328
+ function It(t, e, n = " ") {
329
329
  const r = t.length;
330
330
  if (e <= r || n === "")
331
331
  return t;
332
- const o = e - r;
333
- return z(n, o) + t;
332
+ const s = e - r;
333
+ return z(n, s) + t;
334
334
  }
335
- function Gt(t, e, n = " ") {
335
+ function qt(t, e, n = " ") {
336
336
  const r = t.length;
337
337
  if (e <= r || n === "")
338
338
  return t;
339
- const o = e - r;
340
- return t + z(n, o);
339
+ const s = e - r;
340
+ return t + z(n, s);
341
341
  }
342
342
  function z(t, e) {
343
343
  if (e <= 0) return "";
344
344
  const n = Math.ceil(e / t.length);
345
345
  return t.repeat(n).slice(0, e);
346
346
  }
347
- function Pt(t = 32, e = !0, n = !0, r = !0, s = !1) {
348
- const f = [
347
+ function Gt(t = 32, e = !0, n = !0, r = !0, o = !1) {
348
+ const l = [
349
349
  e ? [
350
350
  "a",
351
351
  "b",
@@ -429,82 +429,82 @@ function Pt(t = 32, e = !0, n = !0, r = !0, s = !1) {
429
429
  ":",
430
430
  ";"
431
431
  ] : null,
432
- s ? [" "] : null
433
- ].filter((p) => S(p));
434
- if (f.length === 0 || t <= 0)
432
+ o ? [" "] : null
433
+ ].filter((a) => S(a));
434
+ if (l.length === 0 || t <= 0)
435
435
  return "";
436
- const m = [];
437
- for (const p of f) {
438
- const g = O(0, p.length - 1);
439
- m.push(p[g]);
436
+ const g = [];
437
+ for (const a of l) {
438
+ const p = M(0, a.length - 1);
439
+ g.push(a[p]);
440
440
  }
441
- const u = Math.max(0, t - m.length), a = f.flat();
442
- for (let p = 0; p < u; p++) {
443
- const g = O(0, a.length - 1);
444
- m.push(a[g]);
441
+ const u = Math.max(0, t - g.length), m = l.flat();
442
+ for (let a = 0; a < u; a++) {
443
+ const p = M(0, m.length - 1);
444
+ g.push(m[p]);
445
445
  }
446
- for (let p = m.length - 1; p > 0; p--) {
447
- const g = O(0, p), h = m[p];
448
- m[p] = m[g], m[g] = h;
446
+ for (let a = g.length - 1; a > 0; a--) {
447
+ const p = M(0, a), h = g[a];
448
+ g[a] = g[p], g[p] = h;
449
449
  }
450
- return m.join("");
450
+ return g.join("");
451
451
  }
452
- function jt(t, e, n = 0) {
452
+ function Pt(t, e, n = 0) {
453
453
  if (e === "")
454
454
  return !1;
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)
455
+ const r = Array.from(t), o = Array.from(e);
456
+ let s = n >= 0 ? n : r.length + n;
457
+ if (s < 0 && (s = 0), s >= r.length)
458
458
  return !1;
459
- const c = r.length - s.length;
460
- for (let i = o; i <= c; i++) {
461
- let l = !0;
462
- for (let f = 0; f < s.length; f++)
463
- if (r[i + f] !== s[f]) {
464
- l = !1;
459
+ const c = r.length - o.length;
460
+ for (let i = s; i <= c; i++) {
461
+ let f = !0;
462
+ for (let l = 0; l < o.length; l++)
463
+ if (r[i + l] !== o[l]) {
464
+ f = !1;
465
465
  break;
466
466
  }
467
- if (l)
467
+ if (f)
468
468
  return i;
469
469
  }
470
470
  return !1;
471
471
  }
472
472
  function Y(t = 16) {
473
- return (b ?? ((n) => J(n)))(t);
473
+ return (b ?? ((n) => K(n)))(t);
474
474
  }
475
- function v(t) {
475
+ function j(t) {
476
476
  b = t;
477
477
  }
478
- function Kt(t, e) {
478
+ function Tt(t, e) {
479
479
  let n = 0;
480
- const r = e ?? function(s) {
481
- const o = b;
480
+ const r = e ?? function(o) {
481
+ const s = b;
482
482
  b = null;
483
- const c = Y(s);
484
- return b = o, n++, c;
483
+ const c = Y(o);
484
+ return b = s, n++, c;
485
485
  };
486
- v((s) => n < t.length ? String(t[n++]) : r(s));
486
+ j((o) => n < t.length ? String(t[n++]) : r(o));
487
487
  }
488
- function Tt() {
488
+ function Bt() {
489
489
  b = null;
490
490
  }
491
- function Bt(t, e) {
491
+ function Jt(t, e) {
492
492
  return e <= 0 ? "" : t.repeat(e);
493
493
  }
494
- function Jt(t, e, n) {
494
+ function Ht(t, e, n) {
495
495
  let r;
496
496
  typeof e == "object" && !S(e) ? r = Object.values(e) : r = S(e) ? [...e] : Array.from(e);
497
- const s = n.split(t);
498
- if (s.length === 1)
497
+ const o = n.split(t);
498
+ if (o.length === 1)
499
499
  return n;
500
- let o = s[0];
501
- for (let c = 1; c < s.length; c++) {
500
+ let s = o[0];
501
+ for (let c = 1; c < o.length; c++) {
502
502
  const i = r.length ? r.shift() : t;
503
- o += i + s[c];
503
+ s += i + o[c];
504
504
  }
505
- return String(o);
505
+ return String(s);
506
506
  }
507
- function Zt(t, e) {
507
+ function Kt(t, e) {
508
508
  try {
509
509
  const n = String(t);
510
510
  if (n.length)
@@ -514,159 +514,159 @@ function Zt(t, e) {
514
514
  return e;
515
515
  }
516
516
  }
517
- function Ht(t, e, n, r = !0) {
518
- const s = (f) => typeof f == "string" ? [f] : Array.from(f), o = s(t), c = s(e), i = (f) => f.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), l = (f) => o.reduce((m, u, a) => {
519
- if (u === "") return m;
520
- const p = c[a] ?? "";
517
+ function Zt(t, e, n, r = !0) {
518
+ 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) => {
519
+ if (u === "") return g;
520
+ const a = c[m] ?? "";
521
521
  if (!r)
522
- return m.split(u).join(p);
523
- const g = new RegExp(i(u), "gi");
524
- return m.replace(g, () => p);
525
- }, f);
526
- return M(n) ? l(n) : Array.from(n).map(l);
522
+ return g.split(u).join(a);
523
+ const p = new RegExp(i(u), "gi");
524
+ return g.replace(p, () => a);
525
+ }, l);
526
+ return N(n) ? f(n) : Array.from(n).map(f);
527
527
  }
528
- function tt(t, e, n) {
528
+ function v(t, e, n) {
529
529
  if (t = String(t), t === "")
530
530
  return n;
531
531
  const r = n.indexOf(t);
532
532
  return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
533
533
  }
534
- function Vt(t, e, n) {
535
- return t = String(t), t === "" ? n : I(n, t) ? tt(t, e, n) : n;
534
+ function Dt(t, e, n) {
535
+ return t = String(t), t === "" ? n : U(n, t) ? v(t, e, n) : n;
536
536
  }
537
- function et(t, e, n) {
537
+ function tt(t, e, n) {
538
538
  if (t = String(t), t === "")
539
539
  return n;
540
540
  const r = n.lastIndexOf(t);
541
541
  return r !== -1 ? n.slice(0, r) + e + n.slice(r + t.length) : n;
542
542
  }
543
- function Dt(t, e, n) {
544
- return t = String(t), t === "" ? n : W(n, t) ? et(t, e, n) : n;
543
+ function Qt(t, e, n) {
544
+ return t = String(t), t === "" ? n : W(n, t) ? tt(t, e, n) : n;
545
545
  }
546
- function Qt(t, e, n, r = -1) {
547
- const s = (u) => S(u) ? u : [u], o = s(t);
546
+ function Vt(t, e, n, r = -1) {
547
+ const o = (u) => S(u) ? u : [u], s = o(t);
548
548
  function c(u) {
549
549
  try {
550
550
  if (u instanceof RegExp) {
551
- let g = u.flags;
552
- return g.includes("g") || (g += "g"), g.includes("u") || (g += "u"), new RegExp(u.source, g);
551
+ let p = u.flags;
552
+ return p.includes("g") || (p += "g"), p.includes("u") || (p += "u"), new RegExp(u.source, p);
553
553
  }
554
- let a = u, p = "gu";
554
+ let m = u, a = "gu";
555
555
  if (u.length >= 2 && u[0] === "/") {
556
- let g = -1;
556
+ let p = -1;
557
557
  for (let h = u.length - 1; h > 0; h--)
558
558
  if (u[h] === "/") {
559
- let d = 0;
560
- for (let y = h - 1; y >= 0 && u[y] === "\\"; y--)
561
- d++;
562
- if (d % 2 === 0) {
563
- g = h;
559
+ let w = 0;
560
+ for (let d = h - 1; d >= 0 && u[d] === "\\"; d--)
561
+ w++;
562
+ if (w % 2 === 0) {
563
+ p = h;
564
564
  break;
565
565
  }
566
566
  }
567
- if (g > 1) {
568
- a = u.slice(1, g);
569
- const h = u.slice(g + 1);
567
+ if (p > 1) {
568
+ m = u.slice(1, p);
569
+ const h = u.slice(p + 1);
570
570
  if (h)
571
- for (const d of h)
572
- /[imsuy]/.test(d) && !p.includes(d) && (p += d);
573
- p.includes("g") || (p += "g"), p.includes("u") || (p += "u");
571
+ for (const w of h)
572
+ /[imsuy]/.test(w) && !a.includes(w) && (a += w);
573
+ a.includes("g") || (a += "g"), a.includes("u") || (a += "u");
574
574
  }
575
575
  }
576
576
  return new RegExp(
577
- a,
578
- Array.from(new Set(p.split(""))).join("")
577
+ m,
578
+ Array.from(new Set(a.split(""))).join("")
579
579
  );
580
580
  } catch {
581
581
  return null;
582
582
  }
583
583
  }
584
584
  const i = [];
585
- for (const u of o) {
586
- const a = c(u);
587
- if (!a) return null;
588
- i.push(a);
585
+ for (const u of s) {
586
+ const m = c(u);
587
+ if (!m) return null;
588
+ i.push(m);
589
589
  }
590
- const l = D(e), f = l ? [] : s(e), m = (u) => {
591
- let a = u;
592
- for (let p = 0; p < i.length; p++) {
593
- const g = i[p];
594
- if (l) {
590
+ const f = Q(e), l = f ? [] : o(e), g = (u) => {
591
+ let m = u;
592
+ for (let a = 0; a < i.length; a++) {
593
+ const p = i[a];
594
+ if (f) {
595
595
  let h = 0;
596
- const d = e;
597
- a = a.replace(
598
- g,
599
- (y, ...w) => {
600
- if (r >= 0 && h >= r) return y;
596
+ const w = e;
597
+ m = m.replace(
598
+ p,
599
+ (d, ...y) => {
600
+ if (r >= 0 && h >= r) return d;
601
601
  h++;
602
- const L = typeof w[w.length - 1] == "object" && typeof w[w.length - 2] == "number" ? w.length - 3 : w.length - 2, $ = [];
602
+ const L = typeof y[y.length - 1] == "object" && typeof y[y.length - 2] == "number" ? y.length - 3 : y.length - 2, $ = [];
603
603
  for (let k = 0; k < L; k++)
604
- $.push(w[k]);
605
- const A = [y, ...$];
606
- return d(A);
604
+ $.push(y[k]);
605
+ const A = [d, ...$];
606
+ return w(A);
607
607
  }
608
608
  );
609
609
  } else {
610
- const h = f[p] ?? (f.length === 1 ? f[0] : "");
610
+ const h = l[a] ?? (l.length === 1 ? l[0] : "");
611
611
  if (r < 0)
612
- a = a.replace(g, (d, ...y) => {
613
- const _ = typeof y[y.length - 1] == "object" && typeof y[y.length - 2] == "number" ? y.length - 3 : y.length - 2, L = y.slice(0, _).map(($) => String($));
612
+ m = m.replace(p, (w, ...d) => {
613
+ 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($));
614
614
  return h.replace(/\$(\d{1,2})/g, ($, A) => {
615
615
  const k = parseInt(A, 10);
616
616
  return (L[k - 1] ?? "").toUpperCase();
617
617
  });
618
618
  });
619
619
  else {
620
- let d = 0;
621
- a = a.replace(g, (y, ...w) => {
622
- if (d >= r) return y;
623
- d++;
624
- const L = typeof w[w.length - 1] == "object" && typeof w[w.length - 2] == "number" ? w.length - 3 : w.length - 2, $ = w.slice(0, L).map((A) => String(A));
620
+ let w = 0;
621
+ m = m.replace(p, (d, ...y) => {
622
+ if (w >= r) return d;
623
+ w++;
624
+ 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));
625
625
  return h.replace(/\$(\d{1,2})/g, (A, k) => {
626
- const q = parseInt(k, 10);
627
- return ($[q - 1] ?? "").toUpperCase();
626
+ const I = parseInt(k, 10);
627
+ return ($[I - 1] ?? "").toUpperCase();
628
628
  });
629
629
  });
630
630
  }
631
631
  }
632
632
  }
633
- return a;
633
+ return m;
634
634
  };
635
- return S(n) ? n.map(m) : m(n);
635
+ return S(n) ? n.map(g) : g(n);
636
636
  }
637
- function nt(t) {
637
+ function et(t) {
638
638
  return t.replace(/<\/?[^>]+(>|$)/g, "");
639
639
  }
640
640
  function Xt(t, e, n = !0) {
641
- const r = typeof t == "string" ? [t] : Array.from(t), s = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = (c) => {
641
+ const r = typeof t == "string" ? [t] : Array.from(t), o = (c) => c.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = (c) => {
642
642
  let i = c;
643
- for (const l of r)
644
- if (l !== "")
643
+ for (const f of r)
644
+ if (f !== "")
645
645
  if (n)
646
- i = i.split(l).join("");
646
+ i = i.split(f).join("");
647
647
  else {
648
- const f = new RegExp(s(l), "gi");
649
- i = i.replace(f, "");
648
+ const l = new RegExp(o(f), "gi");
649
+ i = i.replace(l, "");
650
650
  }
651
651
  return i;
652
652
  };
653
- return typeof e == "string" ? o(e) : Array.from(e, (c) => o(String(c)));
653
+ return typeof e == "string" ? s(e) : Array.from(e, (c) => s(String(c)));
654
654
  }
655
655
  function Yt(t) {
656
656
  return Array.from(t).reverse().join("");
657
657
  }
658
- function vt(t, e) {
658
+ function jt(t, e) {
659
659
  const n = e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
660
660
  return e + t.replace(new RegExp(`^(?:${n})+`, "u"), "");
661
661
  }
662
- function te(t) {
662
+ function vt(t) {
663
663
  const e = String(t).trim();
664
664
  if (e === "")
665
665
  return "";
666
666
  let n = e.split(/\s+/u);
667
- return n.length > 1 ? n = n.map((s) => j(s)) : n = ot(n.join("_")).map((s) => j(s)), n.join("_").replace(/[-_ ]+/gu, "_").split("_").filter((s) => s.length > 0).join(" ");
667
+ 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(" ");
668
668
  }
669
- function ee(t) {
669
+ function te(t) {
670
670
  if (t.trim() === "")
671
671
  return t;
672
672
  const e = /* @__PURE__ */ new Set([
@@ -705,71 +705,34 @@ function ee(t) {
705
705
  "des",
706
706
  "par",
707
707
  "à"
708
- ]), n = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), s = (o) => {
709
- if (!o) return o;
710
- const c = Array.from(o), i = c[0].toLocaleUpperCase(), l = c.slice(1).join("");
711
- return i + l;
708
+ ]), n = /* @__PURE__ */ new Set([".", "!", "?", ":", "—", ","]), r = t.split(/\s+/u), o = (s) => {
709
+ if (!s) return s;
710
+ const c = Array.from(s), i = c[0].toLocaleUpperCase(), f = c.slice(1).join("");
711
+ return i + f;
712
712
  };
713
- for (let o = 0; o < r.length; o++) {
714
- const c = r[o].toLocaleLowerCase();
713
+ for (let s = 0; s < r.length; s++) {
714
+ const c = r[s].toLocaleLowerCase();
715
715
  if (c.includes("-")) {
716
- const l = c.split("-").map((f) => e.has(f) && f.length <= 3 ? f : s(f));
717
- r[o] = l.join("-");
716
+ const f = c.split("-").map((l) => e.has(l) && l.length <= 3 ? l : o(l));
717
+ r[s] = f.join("-");
718
718
  } else {
719
- const i = o > 0 ? r[o - 1] : "", l = i ? Array.from(i).slice(-1)[0] : void 0, f = o === 0 || l !== void 0 && n.has(l);
720
- e.has(c) && c.length <= 3 && !f ? r[o] = c : r[o] = s(c);
719
+ 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);
720
+ e.has(c) && c.length <= 3 && !l ? r[s] = c : r[s] = o(c);
721
721
  }
722
722
  }
723
723
  return r.join(" ");
724
724
  }
725
- function ne(t, e = "-", n = { "@": "at" }) {
726
- const r = e, s = (u) => u.replace(/[-\\^$*+?.()|[\]{}]/g, "\\$&"), o = (u) => u.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), c = (u) => {
727
- let a = u;
728
- const p = r === "-" ? "_" : "-";
729
- {
730
- const g = new RegExp(`[${s(p)}]+`, "gu");
731
- a = a.replace(g, r);
732
- }
733
- if (n && typeof n == "object") {
734
- const g = {};
735
- for (const [h, d] of Object.entries(n))
736
- g[h] = (r ?? "") + d + (r ?? "");
737
- for (const [h, d] of Object.entries(g))
738
- h !== "" && (a = a.split(h).join(d));
739
- }
740
- if (a = U(a), r === "")
741
- return a = a.replace(/[^\p{L}\p{N}\s]+/gu, ""), a = a.replace(/[\s]+/gu, ""), a;
742
- {
743
- const g = new RegExp(
744
- `[^${s(r)}\\p{L}\\p{N}\\s]+`,
745
- "gu"
746
- );
747
- a = a.replace(g, "");
748
- const h = new RegExp(
749
- `[${s(r)}\\s]+`,
750
- "gu"
751
- );
752
- a = a.replace(h, r);
753
- const d = new RegExp(
754
- `^${o(r)}+|${o(r)}+$`,
755
- "gu"
756
- );
757
- return a = a.replace(d, ""), a;
758
- }
759
- }, i = c(t), l = c(Z(t));
760
- return Object.keys(n || {}).some((u) => /[A-Za-z0-9]/.test(u)) ? l : i;
761
- }
762
- function rt(t, e = "_") {
725
+ function nt(t, e = "_") {
763
726
  const r = `${t}|${e}`;
764
727
  if (R.has(r))
765
728
  return R.get(r);
766
- let s = t;
767
- return /^[a-z]+$/.test(t) || (s = it(t).replace(/\s+/gu, ""), s = s.replace(/(.)(?=[A-Z])/g, `$1${e}`), s = U(s)), R.set(r, s), s;
729
+ let o = t;
730
+ 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;
768
731
  }
769
- function re(t) {
770
- return H(t).replace(/[\s\u3164\u1160]+/gu, " ");
732
+ function ee(t) {
733
+ return Z(t).replace(/[\s\u3164\u1160]+/gu, " ");
771
734
  }
772
- function I(t, e) {
735
+ function U(t, e) {
773
736
  if (t == null || e == null)
774
737
  return !1;
775
738
  let n = [
@@ -777,201 +740,200 @@ function I(t, e) {
777
740
  ];
778
741
  typeof e == "string" || typeof e == "number" ? n = [e] : Symbol.iterator in Object(e) && (n = Array.from(e));
779
742
  const r = String(t);
780
- for (const s of n) {
781
- if (s == null)
743
+ for (const o of n) {
744
+ if (o == null)
782
745
  continue;
783
- const o = String(s);
784
- if (o !== "" && r.startsWith(o))
746
+ const s = String(o);
747
+ if (s !== "" && r.startsWith(s))
785
748
  return !0;
786
749
  }
787
750
  return !1;
788
751
  }
789
- function se(t, e) {
790
- return !I(t, e);
752
+ function ne(t, e) {
753
+ return !U(t, e);
791
754
  }
792
- function B(t) {
755
+ function H(t) {
793
756
  const e = t;
794
757
  if (C.has(e))
795
758
  return C.get(e);
796
- const n = String(t).replace(/[-_]+/g, " "), r = n.trim() === "" ? [] : n.split(/\s+/u), s = (c) => {
759
+ const n = String(t).replace(/[-_]+/g, " "), r = n.trim() === "" ? [] : n.split(/\s+/u), o = (c) => {
797
760
  if (!c) return c;
798
- const i = Array.from(c), l = i[0].toUpperCase(), f = i.slice(1).join("");
799
- return l + f;
800
- }, o = r.map(s).join("");
801
- return C.set(e, o), o;
761
+ const i = Array.from(c), f = i[0].toUpperCase(), l = i.slice(1).join("");
762
+ return f + l;
763
+ }, s = r.map(o).join("");
764
+ return C.set(e, s), s;
802
765
  }
803
- function oe(t) {
804
- return B(t);
766
+ function re(t) {
767
+ return H(t);
805
768
  }
806
- function ie(t, e) {
769
+ function se(t, e) {
807
770
  if (!t || Object.keys(t).length === 0)
808
771
  return e;
809
- const n = Object.keys(t).filter((o) => o !== "");
772
+ const n = Object.keys(t).filter((s) => s !== "");
810
773
  if (n.length === 0)
811
774
  return e;
812
- n.sort((o, c) => c.length - o.length);
813
- const r = (o) => o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), s = new RegExp(n.map(r).join("|"), "gu");
814
- return e.replace(s, (o) => t[o] ?? o);
775
+ n.sort((s, c) => c.length - s.length);
776
+ const r = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(n.map(r).join("|"), "gu");
777
+ return e.replace(o, (s) => t[s] ?? s);
815
778
  }
816
- function ce(t, e) {
779
+ function oe(t, e) {
817
780
  return e < 0 ? x(t, e) : x(t, 0, e);
818
781
  }
819
- function st(t) {
820
- return U(x(t, 0, 1)) + x(t, 1);
782
+ function rt(t) {
783
+ return J(x(t, 0, 1)) + x(t, 1);
821
784
  }
822
- function le(t) {
823
- return V(x(t, 0, 1)) + x(t, 1);
785
+ function ie(t) {
786
+ return D(x(t, 0, 1)) + x(t, 1);
824
787
  }
825
- function ot(t) {
788
+ function st(t) {
826
789
  return t.split(new RegExp("(?=\\p{Lu})", "u")).filter(Boolean);
827
790
  }
828
- function it(t, e = ` \r
791
+ function ot(t, e = ` \r
829
792
  \f\v`) {
830
- 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");
831
- return t.replace(c, (i, l, f) => l + f.toUpperCase());
793
+ 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");
794
+ return t.replace(c, (i, f, l) => f + l.toUpperCase());
832
795
  }
833
- function fe(t, e = null) {
834
- 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);
835
- return s ? s.length : 0;
796
+ function ce(t, e = null) {
797
+ 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);
798
+ return o ? o.length : 0;
836
799
  }
837
- function ae(t, e = 75, n = `
800
+ function le(t, e = 75, n = `
838
801
  `, r = !1) {
839
802
  if (t.length === 0 || e < 1 || n === "")
840
803
  return t;
841
- const s = t.split(/\r\n|\n|\r/), o = [];
842
- for (const c of s) {
804
+ const o = t.split(/\r\n|\n|\r/), s = [];
805
+ for (const c of o) {
843
806
  let i = c;
844
807
  if (i.length === 0) {
845
- o.push("");
808
+ s.push("");
846
809
  continue;
847
810
  }
848
811
  if (r) {
849
812
  for (; i.length > 0 && !(/^\s/u.test(i) && (i = i.replace(/^\s+/u, ""), i.length === 0)); ) {
850
813
  if (i.length <= e) {
851
- o.push(i), i = "";
814
+ s.push(i), i = "";
852
815
  break;
853
816
  }
854
- let l = i.slice(0, e);
855
- l = l.replace(/\s+$/u, ""), o.push(l), i = i.slice(e).replace(/^\s+/u, "");
817
+ let f = i.slice(0, e);
818
+ f = f.replace(/\s+$/u, ""), s.push(f), i = i.slice(e).replace(/^\s+/u, "");
856
819
  }
857
820
  continue;
858
821
  }
859
822
  for (; i.length > e; ) {
860
- const l = i.replace(/^\s+/u, "");
861
- if (l.length !== i.length && (i = l, i.length <= e))
823
+ const f = i.replace(/^\s+/u, "");
824
+ if (f.length !== i.length && (i = f, i.length <= e))
862
825
  break;
863
- const f = i.slice(0, e + 1);
864
- let m = -1;
865
- for (let a = f.length - 1; a >= 0; a--)
866
- if (/\s/u.test(f[a])) {
867
- m = a;
826
+ const l = i.slice(0, e + 1);
827
+ let g = -1;
828
+ for (let m = l.length - 1; m >= 0; m--)
829
+ if (/\s/u.test(l[m])) {
830
+ g = m;
868
831
  break;
869
832
  }
870
- if (m > 0) {
871
- o.push(i.slice(0, m)), i = i.slice(m + 1);
833
+ if (g > 0) {
834
+ s.push(i.slice(0, g)), i = i.slice(g + 1);
872
835
  continue;
873
836
  }
874
837
  const u = i.search(/\s/u);
875
838
  if (u >= 0) {
876
- o.push(i.slice(0, u)), i = i.slice(u + 1);
839
+ s.push(i.slice(0, u)), i = i.slice(u + 1);
877
840
  continue;
878
841
  }
879
- o.push(i), i = "";
842
+ s.push(i), i = "";
880
843
  break;
881
844
  }
882
- i.length > 0 && o.push(i);
845
+ i.length > 0 && s.push(i);
883
846
  }
884
- return o.join(n);
847
+ return s.join(n);
885
848
  }
886
- function ue() {
849
+ function fe() {
887
850
  return R.size;
888
851
  }
889
- function pe() {
852
+ function ae() {
890
853
  return E.size;
891
854
  }
892
- function ge() {
855
+ function ue() {
893
856
  return C.size;
894
857
  }
895
- function me() {
858
+ function pe() {
896
859
  R.clear(), E.clear(), C.clear();
897
860
  }
898
861
  export {
899
- K as after,
900
- at as afterLast,
901
- ee as apa,
902
- Q as before,
862
+ T as after,
863
+ ft as afterLast,
864
+ te as apa,
865
+ V as before,
903
866
  X as beforeLast,
904
- ut as between,
905
- pt as betweenFirst,
906
- gt as camel,
907
- pe as camelCacheSize,
908
- mt as charAt,
909
- dt as chopEnd,
910
- ht as chopStart,
911
- T as contains,
912
- wt as containsAll,
913
- Tt as createRandomStringsNormally,
914
- v as createRandomStringsUsing,
915
- Kt as createRandomStringsUsingSequence,
916
- St as deduplicate,
917
- xt as doesntContain,
918
- $t as doesntEndWith,
919
- se as doesntStartWith,
867
+ at as between,
868
+ ut as betweenFirst,
869
+ pt as camel,
870
+ ae as camelCacheSize,
871
+ gt as charAt,
872
+ ht as chopEnd,
873
+ mt as chopStart,
874
+ B as contains,
875
+ yt as containsAll,
876
+ Bt as createRandomStringsNormally,
877
+ j as createRandomStringsUsing,
878
+ Tt as createRandomStringsUsingSequence,
879
+ xt as deduplicate,
880
+ wt as doesntContain,
881
+ St as doesntEndWith,
882
+ ne as doesntStartWith,
920
883
  W as endsWith,
921
- yt as excerpt,
922
- kt as finish,
923
- me as flushCache,
924
- te as headline,
925
- Lt as is,
926
- Rt as isAscii,
927
- Et as isJson,
928
- Mt as isMatch,
929
- Ct as isUrl,
930
- Ft as kebab,
931
- st as lcfirst,
884
+ dt as excerpt,
885
+ $t as finish,
886
+ pe as flushCache,
887
+ vt as headline,
888
+ bt as is,
889
+ Lt as isAscii,
890
+ Rt as isJson,
891
+ Ot as isMatch,
892
+ Et as isUrl,
893
+ Ct as kebab,
894
+ rt as lcfirst,
932
895
  F as length,
933
- zt as limit,
934
- U as lower,
896
+ Ft as limit,
897
+ J as lower,
935
898
  z as makePad,
936
- Ot as mask,
937
- Nt as match,
938
- Wt as matchAll,
939
- Ut as numbers,
940
- It as padBoth,
941
- qt as padLeft,
942
- Gt as padRight,
943
- oe as pascal,
944
- Pt as password,
945
- jt as position,
899
+ _t as mask,
900
+ Mt as match,
901
+ Nt as matchAll,
902
+ Wt as numbers,
903
+ Ut as padBoth,
904
+ It as padLeft,
905
+ qt as padRight,
906
+ re as pascal,
907
+ Gt as password,
908
+ Pt as position,
946
909
  Y as random,
947
910
  Xt as remove,
948
- Bt as repeat,
949
- Ht as replace,
950
- Jt as replaceArray,
951
- Dt as replaceEnd,
952
- tt as replaceFirst,
953
- et as replaceLast,
954
- Qt as replaceMatches,
955
- Vt as replaceStart,
911
+ Jt as repeat,
912
+ Zt as replace,
913
+ Ht as replaceArray,
914
+ Qt as replaceEnd,
915
+ v as replaceFirst,
916
+ tt as replaceLast,
917
+ Vt as replaceMatches,
918
+ Dt as replaceStart,
956
919
  Yt as reverse,
957
- ne as slug,
958
- rt as snake,
959
- ue as snakeCacheSize,
960
- re as squish,
961
- vt as start,
962
- I as startsWith,
963
- nt as stripTags,
964
- B as studly,
965
- ge as studlyCacheSize,
966
- ie as swap,
967
- ce as take,
968
- Zt as toStringOr,
969
- le as ucfirst,
970
- ot as ucsplit,
971
- it as ucwords,
972
- bt as unwrap,
973
- fe as wordCount,
974
- ae as wordWrap,
975
- _t as words,
976
- At as wrap
920
+ nt as snake,
921
+ fe as snakeCacheSize,
922
+ ee as squish,
923
+ jt as start,
924
+ U as startsWith,
925
+ et as stripTags,
926
+ H as studly,
927
+ ue as studlyCacheSize,
928
+ se as swap,
929
+ oe as take,
930
+ Kt as toStringOr,
931
+ ie as ucfirst,
932
+ st as ucsplit,
933
+ ot as ucwords,
934
+ At as unwrap,
935
+ ce as wordCount,
936
+ le as wordWrap,
937
+ zt as words,
938
+ kt as wrap
977
939
  };