@tolki/str 1.2.2 → 1.3.0

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