lakutata 2.0.32 → 2.0.34

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.
@@ -0,0 +1,435 @@
1
+ import { g as e, c as t } from "../../../vendor/Package.5.mjs";
2
+
3
+ "use strict";
4
+
5
+ var s = function e(t, s) {
6
+ s = s.split(":")[0];
7
+ t = +t;
8
+ if (!t) return false;
9
+ switch (s) {
10
+ case "http":
11
+ case "ws":
12
+ return t !== 80;
13
+
14
+ case "https":
15
+ case "wss":
16
+ return t !== 443;
17
+
18
+ case "ftp":
19
+ return t !== 21;
20
+
21
+ case "gopher":
22
+ return t !== 70;
23
+
24
+ case "file":
25
+ return false;
26
+ }
27
+ return t !== 0;
28
+ };
29
+
30
+ const o = e(s);
31
+
32
+ var r = {};
33
+
34
+ "use strict";
35
+
36
+ var n = Object.prototype.hasOwnProperty, i;
37
+
38
+ function a(e) {
39
+ try {
40
+ return decodeURIComponent(e.replace(/\+/g, " "));
41
+ } catch (e) {
42
+ return null;
43
+ }
44
+ }
45
+
46
+ function h(e) {
47
+ try {
48
+ return encodeURIComponent(e);
49
+ } catch (e) {
50
+ return null;
51
+ }
52
+ }
53
+
54
+ function l(e) {
55
+ var t = /([^=?#&]+)=?([^&]*)/g, s = {}, o;
56
+ while (o = t.exec(e)) {
57
+ var r = a(o[1]), n = a(o[2]);
58
+ if (r === null || n === null || r in s) continue;
59
+ s[r] = n;
60
+ }
61
+ return s;
62
+ }
63
+
64
+ function c(e, t) {
65
+ t = t || "";
66
+ var s = [], o, r;
67
+ if ("string" !== typeof t) t = "?";
68
+ for (r in e) {
69
+ if (n.call(e, r)) {
70
+ o = e[r];
71
+ if (!o && (o === null || o === i || isNaN(o))) {
72
+ o = "";
73
+ }
74
+ r = h(r);
75
+ o = h(o);
76
+ if (r === null || o === null) continue;
77
+ s.push(r + "=" + o);
78
+ }
79
+ }
80
+ return s.length ? t + s.join("&") : "";
81
+ }
82
+
83
+ var f = r.stringify = c;
84
+
85
+ var u = r.parse = l;
86
+
87
+ "use strict";
88
+
89
+ var p = s, d = r, m = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, w = /[\n\r\t]/g, g = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, y = /:\d+$/, v = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, b = /^[a-zA-Z]:/;
90
+
91
+ function j(e) {
92
+ return (e ? e : "").toString().replace(m, "");
93
+ }
94
+
95
+ var O = [ [ "#", "hash" ], [ "?", "query" ], function e(t, s) {
96
+ return U(s.protocol) ? t.replace(/\\/g, "/") : t;
97
+ }, [ "/", "pathname" ], [ "@", "auth", 1 ], [ NaN, "host", undefined, 1, 1 ], [ /:(\d*)$/, "port", undefined, 1 ], [ NaN, "hostname", undefined, 1, 1 ] ];
98
+
99
+ var C = {
100
+ hash: 1,
101
+ query: 1
102
+ };
103
+
104
+ function R(e) {
105
+ var s;
106
+ if (typeof window !== "undefined") s = window; else if (typeof t !== "undefined") s = t; else if (typeof self !== "undefined") s = self; else s = {};
107
+ var o = s.location || {};
108
+ e = e || o;
109
+ var r = {}, n = typeof e, i;
110
+ if ("blob:" === e.protocol) {
111
+ r = new x(unescape(e.pathname), {});
112
+ } else if ("string" === n) {
113
+ r = new x(e, {});
114
+ for (i in C) delete r[i];
115
+ } else if ("object" === n) {
116
+ for (i in e) {
117
+ if (i in C) continue;
118
+ r[i] = e[i];
119
+ }
120
+ if (r.slashes === undefined) {
121
+ r.slashes = g.test(e.href);
122
+ }
123
+ }
124
+ return r;
125
+ }
126
+
127
+ function U(e) {
128
+ return e === "file:" || e === "ftp:" || e === "http:" || e === "https:" || e === "ws:" || e === "wss:";
129
+ }
130
+
131
+ function I(e, t) {
132
+ e = j(e);
133
+ e = e.replace(w, "");
134
+ t = t || {};
135
+ var s = v.exec(e);
136
+ var o = s[1] ? s[1].toLowerCase() : "";
137
+ var r = !!s[2];
138
+ var n = !!s[3];
139
+ var i = 0;
140
+ var a;
141
+ if (r) {
142
+ if (n) {
143
+ a = s[2] + s[3] + s[4];
144
+ i = s[2].length + s[3].length;
145
+ } else {
146
+ a = s[2] + s[4];
147
+ i = s[2].length;
148
+ }
149
+ } else {
150
+ if (n) {
151
+ a = s[3] + s[4];
152
+ i = s[3].length;
153
+ } else {
154
+ a = s[4];
155
+ }
156
+ }
157
+ if (o === "file:") {
158
+ if (i >= 2) {
159
+ a = a.slice(2);
160
+ }
161
+ } else if (U(o)) {
162
+ a = s[4];
163
+ } else if (o) {
164
+ if (r) {
165
+ a = a.slice(2);
166
+ }
167
+ } else if (i >= 2 && U(t.protocol)) {
168
+ a = s[4];
169
+ }
170
+ return {
171
+ protocol: o,
172
+ slashes: r || U(o),
173
+ slashesCount: i,
174
+ rest: a
175
+ };
176
+ }
177
+
178
+ function q(e, t) {
179
+ if (e === "") return t;
180
+ var s = (t || "/").split("/").slice(0, -1).concat(e.split("/")), o = s.length, r = s[o - 1], n = false, i = 0;
181
+ while (o--) {
182
+ if (s[o] === ".") {
183
+ s.splice(o, 1);
184
+ } else if (s[o] === "..") {
185
+ s.splice(o, 1);
186
+ i++;
187
+ } else if (i) {
188
+ if (o === 0) n = true;
189
+ s.splice(o, 1);
190
+ i--;
191
+ }
192
+ }
193
+ if (n) s.unshift("");
194
+ if (r === "." || r === "..") s.push("");
195
+ return s.join("/");
196
+ }
197
+
198
+ function x(e, t, s) {
199
+ e = j(e);
200
+ e = e.replace(w, "");
201
+ if (!(this instanceof x)) {
202
+ return new x(e, t, s);
203
+ }
204
+ var o, r, n, i, a, h, l = O.slice(), c = typeof t, f = this, u = 0;
205
+ if ("object" !== c && "string" !== c) {
206
+ s = t;
207
+ t = null;
208
+ }
209
+ if (s && "function" !== typeof s) s = d.parse;
210
+ t = R(t);
211
+ r = I(e || "", t);
212
+ o = !r.protocol && !r.slashes;
213
+ f.slashes = r.slashes || o && t.slashes;
214
+ f.protocol = r.protocol || t.protocol || "";
215
+ e = r.rest;
216
+ if (r.protocol === "file:" && (r.slashesCount !== 2 || b.test(e)) || !r.slashes && (r.protocol || r.slashesCount < 2 || !U(f.protocol))) {
217
+ l[3] = [ /(.*)/, "pathname" ];
218
+ }
219
+ for (;u < l.length; u++) {
220
+ i = l[u];
221
+ if (typeof i === "function") {
222
+ e = i(e, f);
223
+ continue;
224
+ }
225
+ n = i[0];
226
+ h = i[1];
227
+ if (n !== n) {
228
+ f[h] = e;
229
+ } else if ("string" === typeof n) {
230
+ a = n === "@" ? e.lastIndexOf(n) : e.indexOf(n);
231
+ if (~a) {
232
+ if ("number" === typeof i[2]) {
233
+ f[h] = e.slice(0, a);
234
+ e = e.slice(a + i[2]);
235
+ } else {
236
+ f[h] = e.slice(a);
237
+ e = e.slice(0, a);
238
+ }
239
+ }
240
+ } else if (a = n.exec(e)) {
241
+ f[h] = a[1];
242
+ e = e.slice(0, a.index);
243
+ }
244
+ f[h] = f[h] || (o && i[3] ? t[h] || "" : "");
245
+ if (i[4]) f[h] = f[h].toLowerCase();
246
+ }
247
+ if (s) f.query = s(f.query);
248
+ if (o && t.slashes && f.pathname.charAt(0) !== "/" && (f.pathname !== "" || t.pathname !== "")) {
249
+ f.pathname = q(f.pathname, t.pathname);
250
+ }
251
+ if (f.pathname.charAt(0) !== "/" && U(f.protocol)) {
252
+ f.pathname = "/" + f.pathname;
253
+ }
254
+ if (!p(f.port, f.protocol)) {
255
+ f.host = f.hostname;
256
+ f.port = "";
257
+ }
258
+ f.username = f.password = "";
259
+ if (f.auth) {
260
+ a = f.auth.indexOf(":");
261
+ if (~a) {
262
+ f.username = f.auth.slice(0, a);
263
+ f.username = encodeURIComponent(decodeURIComponent(f.username));
264
+ f.password = f.auth.slice(a + 1);
265
+ f.password = encodeURIComponent(decodeURIComponent(f.password));
266
+ } else {
267
+ f.username = encodeURIComponent(decodeURIComponent(f.auth));
268
+ }
269
+ f.auth = f.password ? f.username + ":" + f.password : f.username;
270
+ }
271
+ f.origin = f.protocol !== "file:" && U(f.protocol) && f.host ? f.protocol + "//" + f.host : "null";
272
+ f.href = f.toString();
273
+ }
274
+
275
+ function S(e, t, s) {
276
+ var o = this;
277
+ switch (e) {
278
+ case "query":
279
+ if ("string" === typeof t && t.length) {
280
+ t = (s || d.parse)(t);
281
+ }
282
+ o[e] = t;
283
+ break;
284
+
285
+ case "port":
286
+ o[e] = t;
287
+ if (!p(t, o.protocol)) {
288
+ o.host = o.hostname;
289
+ o[e] = "";
290
+ } else if (t) {
291
+ o.host = o.hostname + ":" + t;
292
+ }
293
+ break;
294
+
295
+ case "hostname":
296
+ o[e] = t;
297
+ if (o.port) t += ":" + o.port;
298
+ o.host = t;
299
+ break;
300
+
301
+ case "host":
302
+ o[e] = t;
303
+ if (y.test(t)) {
304
+ t = t.split(":");
305
+ o.port = t.pop();
306
+ o.hostname = t.join(":");
307
+ } else {
308
+ o.hostname = t;
309
+ o.port = "";
310
+ }
311
+ break;
312
+
313
+ case "protocol":
314
+ o.protocol = t.toLowerCase();
315
+ o.slashes = !s;
316
+ break;
317
+
318
+ case "pathname":
319
+ case "hash":
320
+ if (t) {
321
+ var r = e === "pathname" ? "/" : "#";
322
+ o[e] = t.charAt(0) !== r ? r + t : t;
323
+ } else {
324
+ o[e] = t;
325
+ }
326
+ break;
327
+
328
+ case "username":
329
+ case "password":
330
+ o[e] = encodeURIComponent(t);
331
+ break;
332
+
333
+ case "auth":
334
+ var n = t.indexOf(":");
335
+ if (~n) {
336
+ o.username = t.slice(0, n);
337
+ o.username = encodeURIComponent(decodeURIComponent(o.username));
338
+ o.password = t.slice(n + 1);
339
+ o.password = encodeURIComponent(decodeURIComponent(o.password));
340
+ } else {
341
+ o.username = encodeURIComponent(decodeURIComponent(t));
342
+ }
343
+ }
344
+ for (var i = 0; i < O.length; i++) {
345
+ var a = O[i];
346
+ if (a[4]) o[a[1]] = o[a[1]].toLowerCase();
347
+ }
348
+ o.auth = o.password ? o.username + ":" + o.password : o.username;
349
+ o.origin = o.protocol !== "file:" && U(o.protocol) && o.host ? o.protocol + "//" + o.host : "null";
350
+ o.href = o.toString();
351
+ return o;
352
+ }
353
+
354
+ function k(e) {
355
+ if (!e || "function" !== typeof e) e = d.stringify;
356
+ var t, s = this, o = s.host, r = s.protocol;
357
+ if (r && r.charAt(r.length - 1) !== ":") r += ":";
358
+ var n = r + (s.protocol && s.slashes || U(s.protocol) ? "//" : "");
359
+ if (s.username) {
360
+ n += s.username;
361
+ if (s.password) n += ":" + s.password;
362
+ n += "@";
363
+ } else if (s.password) {
364
+ n += ":" + s.password;
365
+ n += "@";
366
+ } else if (s.protocol !== "file:" && U(s.protocol) && !o && s.pathname !== "/") {
367
+ n += "@";
368
+ }
369
+ if (o[o.length - 1] === ":" || y.test(s.hostname) && !s.port) {
370
+ o += ":";
371
+ }
372
+ n += o + s.pathname;
373
+ t = "object" === typeof s.query ? e(s.query) : s.query;
374
+ if (t) n += "?" !== t.charAt(0) ? "?" + t : t;
375
+ if (s.hash) n += s.hash;
376
+ return n;
377
+ }
378
+
379
+ x.prototype = {
380
+ set: S,
381
+ toString: k
382
+ };
383
+
384
+ x.extractProtocol = I;
385
+
386
+ x.location = R;
387
+
388
+ x.trimLeft = j;
389
+
390
+ x.qs = d;
391
+
392
+ var A = x;
393
+
394
+ const L = e(A);
395
+
396
+ class URLBuilder {
397
+ static parse(e) {
398
+ return new URLBuilder(JSON.parse(JSON.stringify(L(e, true))));
399
+ }
400
+ #e;
401
+ constructor(e = {}) {
402
+ this.#e = L("");
403
+ this.auth = e.auth;
404
+ this.hash = e.hash;
405
+ this.host = e.host;
406
+ this.hostname = e.hostname;
407
+ this.href = e.href;
408
+ this.origin = e.origin;
409
+ this.password = e.password;
410
+ this.pathname = e.pathname;
411
+ this.port = e.port;
412
+ this.protocol = e.protocol;
413
+ this.query = e.query;
414
+ this.slashes = e.slashes;
415
+ this.username = e.username;
416
+ }
417
+ toString() {
418
+ if (this.auth) this.#e.set("auth", this.auth);
419
+ if (this.hash) this.#e.set("hash", this.hash);
420
+ if (this.host) this.#e.set("host", this.host);
421
+ if (this.hostname) this.#e.set("hostname", this.hostname);
422
+ if (this.href) this.#e.set("href", this.href);
423
+ if (this.origin !== undefined) this.#e.set("origin", this.origin.toString());
424
+ if (this.password) this.#e.set("password", this.password);
425
+ if (this.pathname) this.#e.set("pathname", this.pathname);
426
+ if (this.port !== undefined) this.#e.set("port", this.port);
427
+ if (this.protocol) this.#e.set("protocol", this.protocol);
428
+ if (this.query) this.#e.set("query", this.query);
429
+ if (this.slashes !== undefined) this.#e.set("slashes", this.slashes);
430
+ if (this.username) this.#e.set("username", this.username);
431
+ return this.#e.toString();
432
+ }
433
+ }
434
+
435
+ export { URLBuilder };