astro-md-editor 0.0.1
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/.output/nitro.json +17 -0
- package/.output/public/assets/index-Cc7yKB0o.js +19 -0
- package/.output/public/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/.output/public/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/.output/public/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/.output/public/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/.output/public/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/.output/public/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/.output/public/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/.output/public/assets/main-DDBjVFnt.js +17 -0
- package/.output/public/assets/styles-ggfdUHMo.css +1 -0
- package/.output/public/favicon.ico +0 -0
- package/.output/public/logo192.png +0 -0
- package/.output/public/logo512.png +0 -0
- package/.output/public/manifest.json +25 -0
- package/.output/public/robots.txt +3 -0
- package/.output/server/__root-C09LBXMv.mjs +40 -0
- package/.output/server/_chunks/ssr-renderer.mjs +21 -0
- package/.output/server/_libs/ajv-formats.mjs +330 -0
- package/.output/server/_libs/ajv.mjs +5484 -0
- package/.output/server/_libs/base-ui__react.mjs +8712 -0
- package/.output/server/_libs/base-ui__utils.mjs +980 -0
- package/.output/server/_libs/class-variance-authority.mjs +44 -0
- package/.output/server/_libs/clsx.mjs +16 -0
- package/.output/server/_libs/cookie-es.mjs +58 -0
- package/.output/server/_libs/croner.mjs +1 -0
- package/.output/server/_libs/crossws.mjs +1 -0
- package/.output/server/_libs/date-fns.mjs +1716 -0
- package/.output/server/_libs/date-fns__tz.mjs +217 -0
- package/.output/server/_libs/extend-shallow.mjs +35 -0
- package/.output/server/_libs/fast-deep-equal.mjs +38 -0
- package/.output/server/_libs/fast-uri.mjs +725 -0
- package/.output/server/_libs/floating-ui__core.mjs +663 -0
- package/.output/server/_libs/floating-ui__dom.mjs +624 -0
- package/.output/server/_libs/floating-ui__react-dom.mjs +279 -0
- package/.output/server/_libs/floating-ui__utils.mjs +322 -0
- package/.output/server/_libs/gray-matter.mjs +393 -0
- package/.output/server/_libs/h3-v2.mjs +276 -0
- package/.output/server/_libs/h3.mjs +400 -0
- package/.output/server/_libs/hookable.mjs +1 -0
- package/.output/server/_libs/is-extendable.mjs +13 -0
- package/.output/server/_libs/isbot.mjs +20 -0
- package/.output/server/_libs/js-yaml.mjs +2822 -0
- package/.output/server/_libs/json-schema-traverse.mjs +91 -0
- package/.output/server/_libs/kind-of.mjs +125 -0
- package/.output/server/_libs/lucide-react.mjs +177 -0
- package/.output/server/_libs/ohash.mjs +1 -0
- package/.output/server/_libs/react-day-picker.mjs +2216 -0
- package/.output/server/_libs/react-dom.mjs +10779 -0
- package/.output/server/_libs/react-resizable-panels.mjs +2024 -0
- package/.output/server/_libs/react.mjs +513 -0
- package/.output/server/_libs/reselect.mjs +326 -0
- package/.output/server/_libs/rou3.mjs +8 -0
- package/.output/server/_libs/section-matter.mjs +112 -0
- package/.output/server/_libs/seroval-plugins.mjs +58 -0
- package/.output/server/_libs/seroval.mjs +1765 -0
- package/.output/server/_libs/srvx.mjs +736 -0
- package/.output/server/_libs/strip-bom-string.mjs +16 -0
- package/.output/server/_libs/tabbable.mjs +342 -0
- package/.output/server/_libs/tailwind-merge.mjs +3175 -0
- package/.output/server/_libs/tanstack__history.mjs +217 -0
- package/.output/server/_libs/tanstack__react-router.mjs +1464 -0
- package/.output/server/_libs/tanstack__react-store.mjs +1 -0
- package/.output/server/_libs/tanstack__router-core.mjs +4912 -0
- package/.output/server/_libs/tanstack__store.mjs +1 -0
- package/.output/server/_libs/tiny-invariant.mjs +12 -0
- package/.output/server/_libs/tiny-warning.mjs +5 -0
- package/.output/server/_libs/ufo.mjs +54 -0
- package/.output/server/_libs/unctx.mjs +1 -0
- package/.output/server/_libs/unstorage.mjs +1 -0
- package/.output/server/_libs/use-sync-external-store.mjs +139 -0
- package/.output/server/_libs/zod.mjs +3634 -0
- package/.output/server/_libs/zustand.mjs +43 -0
- package/.output/server/_ssr/RightSidebar-RSY9M7XF.mjs +218 -0
- package/.output/server/_ssr/collections.server-D6U2tEsT.mjs +120 -0
- package/.output/server/_ssr/createServerRpc-29xaFZcb.mjs +12 -0
- package/.output/server/_ssr/index-BaqV4cZC.mjs +2083 -0
- package/.output/server/_ssr/index-sQBM6rwN.mjs +115 -0
- package/.output/server/_ssr/index.mjs +1448 -0
- package/.output/server/_ssr/router-D4G1DGr3.mjs +155 -0
- package/.output/server/_ssr/start-HYkvq4Ni.mjs +4 -0
- package/.output/server/_tanstack-start-manifest_v-CYEHh_qB.mjs +4 -0
- package/.output/server/index.mjs +451 -0
- package/README.md +118 -0
- package/index.mjs +21 -0
- package/package.json +86 -0
- package/scripts/bootstrap-collections.mjs +1201 -0
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
var fastUri = { exports: {} };
|
|
2
|
+
var utils;
|
|
3
|
+
var hasRequiredUtils;
|
|
4
|
+
function requireUtils() {
|
|
5
|
+
if (hasRequiredUtils) return utils;
|
|
6
|
+
hasRequiredUtils = 1;
|
|
7
|
+
const isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
8
|
+
const isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
9
|
+
function stringArrayToHexStripped(input) {
|
|
10
|
+
let acc = "";
|
|
11
|
+
let code = 0;
|
|
12
|
+
let i = 0;
|
|
13
|
+
for (i = 0; i < input.length; i++) {
|
|
14
|
+
code = input[i].charCodeAt(0);
|
|
15
|
+
if (code === 48) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
acc += input[i];
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
for (i += 1; i < input.length; i++) {
|
|
25
|
+
code = input[i].charCodeAt(0);
|
|
26
|
+
if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
|
|
27
|
+
return "";
|
|
28
|
+
}
|
|
29
|
+
acc += input[i];
|
|
30
|
+
}
|
|
31
|
+
return acc;
|
|
32
|
+
}
|
|
33
|
+
const nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
34
|
+
function consumeIsZone(buffer) {
|
|
35
|
+
buffer.length = 0;
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
function consumeHextets(buffer, address, output) {
|
|
39
|
+
if (buffer.length) {
|
|
40
|
+
const hex = stringArrayToHexStripped(buffer);
|
|
41
|
+
if (hex !== "") {
|
|
42
|
+
address.push(hex);
|
|
43
|
+
} else {
|
|
44
|
+
output.error = true;
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
buffer.length = 0;
|
|
48
|
+
}
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
function getIPV6(input) {
|
|
52
|
+
let tokenCount = 0;
|
|
53
|
+
const output = { error: false, address: "", zone: "" };
|
|
54
|
+
const address = [];
|
|
55
|
+
const buffer = [];
|
|
56
|
+
let endipv6Encountered = false;
|
|
57
|
+
let endIpv6 = false;
|
|
58
|
+
let consume = consumeHextets;
|
|
59
|
+
for (let i = 0; i < input.length; i++) {
|
|
60
|
+
const cursor = input[i];
|
|
61
|
+
if (cursor === "[" || cursor === "]") {
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
if (cursor === ":") {
|
|
65
|
+
if (endipv6Encountered === true) {
|
|
66
|
+
endIpv6 = true;
|
|
67
|
+
}
|
|
68
|
+
if (!consume(buffer, address, output)) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
if (++tokenCount > 7) {
|
|
72
|
+
output.error = true;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
if (i > 0 && input[i - 1] === ":") {
|
|
76
|
+
endipv6Encountered = true;
|
|
77
|
+
}
|
|
78
|
+
address.push(":");
|
|
79
|
+
continue;
|
|
80
|
+
} else if (cursor === "%") {
|
|
81
|
+
if (!consume(buffer, address, output)) {
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
consume = consumeIsZone;
|
|
85
|
+
} else {
|
|
86
|
+
buffer.push(cursor);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (buffer.length) {
|
|
91
|
+
if (consume === consumeIsZone) {
|
|
92
|
+
output.zone = buffer.join("");
|
|
93
|
+
} else if (endIpv6) {
|
|
94
|
+
address.push(buffer.join(""));
|
|
95
|
+
} else {
|
|
96
|
+
address.push(stringArrayToHexStripped(buffer));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
output.address = address.join("");
|
|
100
|
+
return output;
|
|
101
|
+
}
|
|
102
|
+
function normalizeIPv6(host) {
|
|
103
|
+
if (findToken(host, ":") < 2) {
|
|
104
|
+
return { host, isIPV6: false };
|
|
105
|
+
}
|
|
106
|
+
const ipv6 = getIPV6(host);
|
|
107
|
+
if (!ipv6.error) {
|
|
108
|
+
let newHost = ipv6.address;
|
|
109
|
+
let escapedHost = ipv6.address;
|
|
110
|
+
if (ipv6.zone) {
|
|
111
|
+
newHost += "%" + ipv6.zone;
|
|
112
|
+
escapedHost += "%25" + ipv6.zone;
|
|
113
|
+
}
|
|
114
|
+
return { host: newHost, isIPV6: true, escapedHost };
|
|
115
|
+
} else {
|
|
116
|
+
return { host, isIPV6: false };
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function findToken(str, token) {
|
|
120
|
+
let ind = 0;
|
|
121
|
+
for (let i = 0; i < str.length; i++) {
|
|
122
|
+
if (str[i] === token) ind++;
|
|
123
|
+
}
|
|
124
|
+
return ind;
|
|
125
|
+
}
|
|
126
|
+
function removeDotSegments(path) {
|
|
127
|
+
let input = path;
|
|
128
|
+
const output = [];
|
|
129
|
+
let nextSlash = -1;
|
|
130
|
+
let len = 0;
|
|
131
|
+
while (len = input.length) {
|
|
132
|
+
if (len === 1) {
|
|
133
|
+
if (input === ".") {
|
|
134
|
+
break;
|
|
135
|
+
} else if (input === "/") {
|
|
136
|
+
output.push("/");
|
|
137
|
+
break;
|
|
138
|
+
} else {
|
|
139
|
+
output.push(input);
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
} else if (len === 2) {
|
|
143
|
+
if (input[0] === ".") {
|
|
144
|
+
if (input[1] === ".") {
|
|
145
|
+
break;
|
|
146
|
+
} else if (input[1] === "/") {
|
|
147
|
+
input = input.slice(2);
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
} else if (input[0] === "/") {
|
|
151
|
+
if (input[1] === "." || input[1] === "/") {
|
|
152
|
+
output.push("/");
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
} else if (len === 3) {
|
|
157
|
+
if (input === "/..") {
|
|
158
|
+
if (output.length !== 0) {
|
|
159
|
+
output.pop();
|
|
160
|
+
}
|
|
161
|
+
output.push("/");
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (input[0] === ".") {
|
|
166
|
+
if (input[1] === ".") {
|
|
167
|
+
if (input[2] === "/") {
|
|
168
|
+
input = input.slice(3);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
} else if (input[1] === "/") {
|
|
172
|
+
input = input.slice(2);
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
} else if (input[0] === "/") {
|
|
176
|
+
if (input[1] === ".") {
|
|
177
|
+
if (input[2] === "/") {
|
|
178
|
+
input = input.slice(2);
|
|
179
|
+
continue;
|
|
180
|
+
} else if (input[2] === ".") {
|
|
181
|
+
if (input[3] === "/") {
|
|
182
|
+
input = input.slice(3);
|
|
183
|
+
if (output.length !== 0) {
|
|
184
|
+
output.pop();
|
|
185
|
+
}
|
|
186
|
+
continue;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if ((nextSlash = input.indexOf("/", 1)) === -1) {
|
|
192
|
+
output.push(input);
|
|
193
|
+
break;
|
|
194
|
+
} else {
|
|
195
|
+
output.push(input.slice(0, nextSlash));
|
|
196
|
+
input = input.slice(nextSlash);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
return output.join("");
|
|
200
|
+
}
|
|
201
|
+
function normalizeComponentEncoding(component, esc) {
|
|
202
|
+
const func = esc !== true ? escape : unescape;
|
|
203
|
+
if (component.scheme !== void 0) {
|
|
204
|
+
component.scheme = func(component.scheme);
|
|
205
|
+
}
|
|
206
|
+
if (component.userinfo !== void 0) {
|
|
207
|
+
component.userinfo = func(component.userinfo);
|
|
208
|
+
}
|
|
209
|
+
if (component.host !== void 0) {
|
|
210
|
+
component.host = func(component.host);
|
|
211
|
+
}
|
|
212
|
+
if (component.path !== void 0) {
|
|
213
|
+
component.path = func(component.path);
|
|
214
|
+
}
|
|
215
|
+
if (component.query !== void 0) {
|
|
216
|
+
component.query = func(component.query);
|
|
217
|
+
}
|
|
218
|
+
if (component.fragment !== void 0) {
|
|
219
|
+
component.fragment = func(component.fragment);
|
|
220
|
+
}
|
|
221
|
+
return component;
|
|
222
|
+
}
|
|
223
|
+
function recomposeAuthority(component) {
|
|
224
|
+
const uriTokens = [];
|
|
225
|
+
if (component.userinfo !== void 0) {
|
|
226
|
+
uriTokens.push(component.userinfo);
|
|
227
|
+
uriTokens.push("@");
|
|
228
|
+
}
|
|
229
|
+
if (component.host !== void 0) {
|
|
230
|
+
let host = unescape(component.host);
|
|
231
|
+
if (!isIPv4(host)) {
|
|
232
|
+
const ipV6res = normalizeIPv6(host);
|
|
233
|
+
if (ipV6res.isIPV6 === true) {
|
|
234
|
+
host = `[${ipV6res.escapedHost}]`;
|
|
235
|
+
} else {
|
|
236
|
+
host = component.host;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
uriTokens.push(host);
|
|
240
|
+
}
|
|
241
|
+
if (typeof component.port === "number" || typeof component.port === "string") {
|
|
242
|
+
uriTokens.push(":");
|
|
243
|
+
uriTokens.push(String(component.port));
|
|
244
|
+
}
|
|
245
|
+
return uriTokens.length ? uriTokens.join("") : void 0;
|
|
246
|
+
}
|
|
247
|
+
utils = {
|
|
248
|
+
nonSimpleDomain,
|
|
249
|
+
recomposeAuthority,
|
|
250
|
+
normalizeComponentEncoding,
|
|
251
|
+
removeDotSegments,
|
|
252
|
+
isIPv4,
|
|
253
|
+
isUUID,
|
|
254
|
+
normalizeIPv6,
|
|
255
|
+
stringArrayToHexStripped
|
|
256
|
+
};
|
|
257
|
+
return utils;
|
|
258
|
+
}
|
|
259
|
+
var schemes;
|
|
260
|
+
var hasRequiredSchemes;
|
|
261
|
+
function requireSchemes() {
|
|
262
|
+
if (hasRequiredSchemes) return schemes;
|
|
263
|
+
hasRequiredSchemes = 1;
|
|
264
|
+
const { isUUID } = /* @__PURE__ */ requireUtils();
|
|
265
|
+
const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
|
|
266
|
+
const supportedSchemeNames = (
|
|
267
|
+
/** @type {const} */
|
|
268
|
+
[
|
|
269
|
+
"http",
|
|
270
|
+
"https",
|
|
271
|
+
"ws",
|
|
272
|
+
"wss",
|
|
273
|
+
"urn",
|
|
274
|
+
"urn:uuid"
|
|
275
|
+
]
|
|
276
|
+
);
|
|
277
|
+
function isValidSchemeName(name) {
|
|
278
|
+
return supportedSchemeNames.indexOf(
|
|
279
|
+
/** @type {*} */
|
|
280
|
+
name
|
|
281
|
+
) !== -1;
|
|
282
|
+
}
|
|
283
|
+
function wsIsSecure(wsComponent) {
|
|
284
|
+
if (wsComponent.secure === true) {
|
|
285
|
+
return true;
|
|
286
|
+
} else if (wsComponent.secure === false) {
|
|
287
|
+
return false;
|
|
288
|
+
} else if (wsComponent.scheme) {
|
|
289
|
+
return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === "w" || wsComponent.scheme[0] === "W") && (wsComponent.scheme[1] === "s" || wsComponent.scheme[1] === "S") && (wsComponent.scheme[2] === "s" || wsComponent.scheme[2] === "S");
|
|
290
|
+
} else {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
function httpParse(component) {
|
|
295
|
+
if (!component.host) {
|
|
296
|
+
component.error = component.error || "HTTP URIs must have a host.";
|
|
297
|
+
}
|
|
298
|
+
return component;
|
|
299
|
+
}
|
|
300
|
+
function httpSerialize(component) {
|
|
301
|
+
const secure = String(component.scheme).toLowerCase() === "https";
|
|
302
|
+
if (component.port === (secure ? 443 : 80) || component.port === "") {
|
|
303
|
+
component.port = void 0;
|
|
304
|
+
}
|
|
305
|
+
if (!component.path) {
|
|
306
|
+
component.path = "/";
|
|
307
|
+
}
|
|
308
|
+
return component;
|
|
309
|
+
}
|
|
310
|
+
function wsParse(wsComponent) {
|
|
311
|
+
wsComponent.secure = wsIsSecure(wsComponent);
|
|
312
|
+
wsComponent.resourceName = (wsComponent.path || "/") + (wsComponent.query ? "?" + wsComponent.query : "");
|
|
313
|
+
wsComponent.path = void 0;
|
|
314
|
+
wsComponent.query = void 0;
|
|
315
|
+
return wsComponent;
|
|
316
|
+
}
|
|
317
|
+
function wsSerialize(wsComponent) {
|
|
318
|
+
if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === "") {
|
|
319
|
+
wsComponent.port = void 0;
|
|
320
|
+
}
|
|
321
|
+
if (typeof wsComponent.secure === "boolean") {
|
|
322
|
+
wsComponent.scheme = wsComponent.secure ? "wss" : "ws";
|
|
323
|
+
wsComponent.secure = void 0;
|
|
324
|
+
}
|
|
325
|
+
if (wsComponent.resourceName) {
|
|
326
|
+
const [path, query] = wsComponent.resourceName.split("?");
|
|
327
|
+
wsComponent.path = path && path !== "/" ? path : void 0;
|
|
328
|
+
wsComponent.query = query;
|
|
329
|
+
wsComponent.resourceName = void 0;
|
|
330
|
+
}
|
|
331
|
+
wsComponent.fragment = void 0;
|
|
332
|
+
return wsComponent;
|
|
333
|
+
}
|
|
334
|
+
function urnParse(urnComponent, options) {
|
|
335
|
+
if (!urnComponent.path) {
|
|
336
|
+
urnComponent.error = "URN can not be parsed";
|
|
337
|
+
return urnComponent;
|
|
338
|
+
}
|
|
339
|
+
const matches = urnComponent.path.match(URN_REG);
|
|
340
|
+
if (matches) {
|
|
341
|
+
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
342
|
+
urnComponent.nid = matches[1].toLowerCase();
|
|
343
|
+
urnComponent.nss = matches[2];
|
|
344
|
+
const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`;
|
|
345
|
+
const schemeHandler = getSchemeHandler(urnScheme);
|
|
346
|
+
urnComponent.path = void 0;
|
|
347
|
+
if (schemeHandler) {
|
|
348
|
+
urnComponent = schemeHandler.parse(urnComponent, options);
|
|
349
|
+
}
|
|
350
|
+
} else {
|
|
351
|
+
urnComponent.error = urnComponent.error || "URN can not be parsed.";
|
|
352
|
+
}
|
|
353
|
+
return urnComponent;
|
|
354
|
+
}
|
|
355
|
+
function urnSerialize(urnComponent, options) {
|
|
356
|
+
if (urnComponent.nid === void 0) {
|
|
357
|
+
throw new Error("URN without nid cannot be serialized");
|
|
358
|
+
}
|
|
359
|
+
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
360
|
+
const nid = urnComponent.nid.toLowerCase();
|
|
361
|
+
const urnScheme = `${scheme}:${options.nid || nid}`;
|
|
362
|
+
const schemeHandler = getSchemeHandler(urnScheme);
|
|
363
|
+
if (schemeHandler) {
|
|
364
|
+
urnComponent = schemeHandler.serialize(urnComponent, options);
|
|
365
|
+
}
|
|
366
|
+
const uriComponent = urnComponent;
|
|
367
|
+
const nss = urnComponent.nss;
|
|
368
|
+
uriComponent.path = `${nid || options.nid}:${nss}`;
|
|
369
|
+
options.skipEscape = true;
|
|
370
|
+
return uriComponent;
|
|
371
|
+
}
|
|
372
|
+
function urnuuidParse(urnComponent, options) {
|
|
373
|
+
const uuidComponent = urnComponent;
|
|
374
|
+
uuidComponent.uuid = uuidComponent.nss;
|
|
375
|
+
uuidComponent.nss = void 0;
|
|
376
|
+
if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
|
|
377
|
+
uuidComponent.error = uuidComponent.error || "UUID is not valid.";
|
|
378
|
+
}
|
|
379
|
+
return uuidComponent;
|
|
380
|
+
}
|
|
381
|
+
function urnuuidSerialize(uuidComponent) {
|
|
382
|
+
const urnComponent = uuidComponent;
|
|
383
|
+
urnComponent.nss = (uuidComponent.uuid || "").toLowerCase();
|
|
384
|
+
return urnComponent;
|
|
385
|
+
}
|
|
386
|
+
const http = (
|
|
387
|
+
/** @type {SchemeHandler} */
|
|
388
|
+
{
|
|
389
|
+
scheme: "http",
|
|
390
|
+
domainHost: true,
|
|
391
|
+
parse: httpParse,
|
|
392
|
+
serialize: httpSerialize
|
|
393
|
+
}
|
|
394
|
+
);
|
|
395
|
+
const https = (
|
|
396
|
+
/** @type {SchemeHandler} */
|
|
397
|
+
{
|
|
398
|
+
scheme: "https",
|
|
399
|
+
domainHost: http.domainHost,
|
|
400
|
+
parse: httpParse,
|
|
401
|
+
serialize: httpSerialize
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
const ws = (
|
|
405
|
+
/** @type {SchemeHandler} */
|
|
406
|
+
{
|
|
407
|
+
scheme: "ws",
|
|
408
|
+
domainHost: true,
|
|
409
|
+
parse: wsParse,
|
|
410
|
+
serialize: wsSerialize
|
|
411
|
+
}
|
|
412
|
+
);
|
|
413
|
+
const wss = (
|
|
414
|
+
/** @type {SchemeHandler} */
|
|
415
|
+
{
|
|
416
|
+
scheme: "wss",
|
|
417
|
+
domainHost: ws.domainHost,
|
|
418
|
+
parse: ws.parse,
|
|
419
|
+
serialize: ws.serialize
|
|
420
|
+
}
|
|
421
|
+
);
|
|
422
|
+
const urn = (
|
|
423
|
+
/** @type {SchemeHandler} */
|
|
424
|
+
{
|
|
425
|
+
scheme: "urn",
|
|
426
|
+
parse: urnParse,
|
|
427
|
+
serialize: urnSerialize,
|
|
428
|
+
skipNormalize: true
|
|
429
|
+
}
|
|
430
|
+
);
|
|
431
|
+
const urnuuid = (
|
|
432
|
+
/** @type {SchemeHandler} */
|
|
433
|
+
{
|
|
434
|
+
scheme: "urn:uuid",
|
|
435
|
+
parse: urnuuidParse,
|
|
436
|
+
serialize: urnuuidSerialize,
|
|
437
|
+
skipNormalize: true
|
|
438
|
+
}
|
|
439
|
+
);
|
|
440
|
+
const SCHEMES = (
|
|
441
|
+
/** @type {Record<SchemeName, SchemeHandler>} */
|
|
442
|
+
{
|
|
443
|
+
http,
|
|
444
|
+
https,
|
|
445
|
+
ws,
|
|
446
|
+
wss,
|
|
447
|
+
urn,
|
|
448
|
+
"urn:uuid": urnuuid
|
|
449
|
+
}
|
|
450
|
+
);
|
|
451
|
+
Object.setPrototypeOf(SCHEMES, null);
|
|
452
|
+
function getSchemeHandler(scheme) {
|
|
453
|
+
return scheme && (SCHEMES[
|
|
454
|
+
/** @type {SchemeName} */
|
|
455
|
+
scheme
|
|
456
|
+
] || SCHEMES[
|
|
457
|
+
/** @type {SchemeName} */
|
|
458
|
+
scheme.toLowerCase()
|
|
459
|
+
]) || void 0;
|
|
460
|
+
}
|
|
461
|
+
schemes = {
|
|
462
|
+
wsIsSecure,
|
|
463
|
+
SCHEMES,
|
|
464
|
+
isValidSchemeName,
|
|
465
|
+
getSchemeHandler
|
|
466
|
+
};
|
|
467
|
+
return schemes;
|
|
468
|
+
}
|
|
469
|
+
var hasRequiredFastUri;
|
|
470
|
+
function requireFastUri() {
|
|
471
|
+
if (hasRequiredFastUri) return fastUri.exports;
|
|
472
|
+
hasRequiredFastUri = 1;
|
|
473
|
+
const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = /* @__PURE__ */ requireUtils();
|
|
474
|
+
const { SCHEMES, getSchemeHandler } = /* @__PURE__ */ requireSchemes();
|
|
475
|
+
function normalize(uri, options) {
|
|
476
|
+
if (typeof uri === "string") {
|
|
477
|
+
uri = /** @type {T} */
|
|
478
|
+
serialize(parse(uri, options), options);
|
|
479
|
+
} else if (typeof uri === "object") {
|
|
480
|
+
uri = /** @type {T} */
|
|
481
|
+
parse(serialize(uri, options), options);
|
|
482
|
+
}
|
|
483
|
+
return uri;
|
|
484
|
+
}
|
|
485
|
+
function resolve(baseURI, relativeURI, options) {
|
|
486
|
+
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
487
|
+
const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
488
|
+
schemelessOptions.skipEscape = true;
|
|
489
|
+
return serialize(resolved, schemelessOptions);
|
|
490
|
+
}
|
|
491
|
+
function resolveComponent(base, relative, options, skipNormalization) {
|
|
492
|
+
const target = {};
|
|
493
|
+
if (!skipNormalization) {
|
|
494
|
+
base = parse(serialize(base, options), options);
|
|
495
|
+
relative = parse(serialize(relative, options), options);
|
|
496
|
+
}
|
|
497
|
+
options = options || {};
|
|
498
|
+
if (!options.tolerant && relative.scheme) {
|
|
499
|
+
target.scheme = relative.scheme;
|
|
500
|
+
target.userinfo = relative.userinfo;
|
|
501
|
+
target.host = relative.host;
|
|
502
|
+
target.port = relative.port;
|
|
503
|
+
target.path = removeDotSegments(relative.path || "");
|
|
504
|
+
target.query = relative.query;
|
|
505
|
+
} else {
|
|
506
|
+
if (relative.userinfo !== void 0 || relative.host !== void 0 || relative.port !== void 0) {
|
|
507
|
+
target.userinfo = relative.userinfo;
|
|
508
|
+
target.host = relative.host;
|
|
509
|
+
target.port = relative.port;
|
|
510
|
+
target.path = removeDotSegments(relative.path || "");
|
|
511
|
+
target.query = relative.query;
|
|
512
|
+
} else {
|
|
513
|
+
if (!relative.path) {
|
|
514
|
+
target.path = base.path;
|
|
515
|
+
if (relative.query !== void 0) {
|
|
516
|
+
target.query = relative.query;
|
|
517
|
+
} else {
|
|
518
|
+
target.query = base.query;
|
|
519
|
+
}
|
|
520
|
+
} else {
|
|
521
|
+
if (relative.path[0] === "/") {
|
|
522
|
+
target.path = removeDotSegments(relative.path);
|
|
523
|
+
} else {
|
|
524
|
+
if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
|
|
525
|
+
target.path = "/" + relative.path;
|
|
526
|
+
} else if (!base.path) {
|
|
527
|
+
target.path = relative.path;
|
|
528
|
+
} else {
|
|
529
|
+
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
|
|
530
|
+
}
|
|
531
|
+
target.path = removeDotSegments(target.path);
|
|
532
|
+
}
|
|
533
|
+
target.query = relative.query;
|
|
534
|
+
}
|
|
535
|
+
target.userinfo = base.userinfo;
|
|
536
|
+
target.host = base.host;
|
|
537
|
+
target.port = base.port;
|
|
538
|
+
}
|
|
539
|
+
target.scheme = base.scheme;
|
|
540
|
+
}
|
|
541
|
+
target.fragment = relative.fragment;
|
|
542
|
+
return target;
|
|
543
|
+
}
|
|
544
|
+
function equal(uriA, uriB, options) {
|
|
545
|
+
if (typeof uriA === "string") {
|
|
546
|
+
uriA = unescape(uriA);
|
|
547
|
+
uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true });
|
|
548
|
+
} else if (typeof uriA === "object") {
|
|
549
|
+
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
550
|
+
}
|
|
551
|
+
if (typeof uriB === "string") {
|
|
552
|
+
uriB = unescape(uriB);
|
|
553
|
+
uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true });
|
|
554
|
+
} else if (typeof uriB === "object") {
|
|
555
|
+
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
556
|
+
}
|
|
557
|
+
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
558
|
+
}
|
|
559
|
+
function serialize(cmpts, opts) {
|
|
560
|
+
const component = {
|
|
561
|
+
host: cmpts.host,
|
|
562
|
+
scheme: cmpts.scheme,
|
|
563
|
+
userinfo: cmpts.userinfo,
|
|
564
|
+
port: cmpts.port,
|
|
565
|
+
path: cmpts.path,
|
|
566
|
+
query: cmpts.query,
|
|
567
|
+
nid: cmpts.nid,
|
|
568
|
+
nss: cmpts.nss,
|
|
569
|
+
uuid: cmpts.uuid,
|
|
570
|
+
fragment: cmpts.fragment,
|
|
571
|
+
reference: cmpts.reference,
|
|
572
|
+
resourceName: cmpts.resourceName,
|
|
573
|
+
secure: cmpts.secure,
|
|
574
|
+
error: ""
|
|
575
|
+
};
|
|
576
|
+
const options = Object.assign({}, opts);
|
|
577
|
+
const uriTokens = [];
|
|
578
|
+
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
579
|
+
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
580
|
+
if (component.path !== void 0) {
|
|
581
|
+
if (!options.skipEscape) {
|
|
582
|
+
component.path = escape(component.path);
|
|
583
|
+
if (component.scheme !== void 0) {
|
|
584
|
+
component.path = component.path.split("%3A").join(":");
|
|
585
|
+
}
|
|
586
|
+
} else {
|
|
587
|
+
component.path = unescape(component.path);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
if (options.reference !== "suffix" && component.scheme) {
|
|
591
|
+
uriTokens.push(component.scheme, ":");
|
|
592
|
+
}
|
|
593
|
+
const authority = recomposeAuthority(component);
|
|
594
|
+
if (authority !== void 0) {
|
|
595
|
+
if (options.reference !== "suffix") {
|
|
596
|
+
uriTokens.push("//");
|
|
597
|
+
}
|
|
598
|
+
uriTokens.push(authority);
|
|
599
|
+
if (component.path && component.path[0] !== "/") {
|
|
600
|
+
uriTokens.push("/");
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
if (component.path !== void 0) {
|
|
604
|
+
let s = component.path;
|
|
605
|
+
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
606
|
+
s = removeDotSegments(s);
|
|
607
|
+
}
|
|
608
|
+
if (authority === void 0 && s[0] === "/" && s[1] === "/") {
|
|
609
|
+
s = "/%2F" + s.slice(2);
|
|
610
|
+
}
|
|
611
|
+
uriTokens.push(s);
|
|
612
|
+
}
|
|
613
|
+
if (component.query !== void 0) {
|
|
614
|
+
uriTokens.push("?", component.query);
|
|
615
|
+
}
|
|
616
|
+
if (component.fragment !== void 0) {
|
|
617
|
+
uriTokens.push("#", component.fragment);
|
|
618
|
+
}
|
|
619
|
+
return uriTokens.join("");
|
|
620
|
+
}
|
|
621
|
+
const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
622
|
+
function parse(uri, opts) {
|
|
623
|
+
const options = Object.assign({}, opts);
|
|
624
|
+
const parsed = {
|
|
625
|
+
scheme: void 0,
|
|
626
|
+
userinfo: void 0,
|
|
627
|
+
host: "",
|
|
628
|
+
port: void 0,
|
|
629
|
+
path: "",
|
|
630
|
+
query: void 0,
|
|
631
|
+
fragment: void 0
|
|
632
|
+
};
|
|
633
|
+
let isIP = false;
|
|
634
|
+
if (options.reference === "suffix") {
|
|
635
|
+
if (options.scheme) {
|
|
636
|
+
uri = options.scheme + ":" + uri;
|
|
637
|
+
} else {
|
|
638
|
+
uri = "//" + uri;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
const matches = uri.match(URI_PARSE);
|
|
642
|
+
if (matches) {
|
|
643
|
+
parsed.scheme = matches[1];
|
|
644
|
+
parsed.userinfo = matches[3];
|
|
645
|
+
parsed.host = matches[4];
|
|
646
|
+
parsed.port = parseInt(matches[5], 10);
|
|
647
|
+
parsed.path = matches[6] || "";
|
|
648
|
+
parsed.query = matches[7];
|
|
649
|
+
parsed.fragment = matches[8];
|
|
650
|
+
if (isNaN(parsed.port)) {
|
|
651
|
+
parsed.port = matches[5];
|
|
652
|
+
}
|
|
653
|
+
if (parsed.host) {
|
|
654
|
+
const ipv4result = isIPv4(parsed.host);
|
|
655
|
+
if (ipv4result === false) {
|
|
656
|
+
const ipv6result = normalizeIPv6(parsed.host);
|
|
657
|
+
parsed.host = ipv6result.host.toLowerCase();
|
|
658
|
+
isIP = ipv6result.isIPV6;
|
|
659
|
+
} else {
|
|
660
|
+
isIP = true;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) {
|
|
664
|
+
parsed.reference = "same-document";
|
|
665
|
+
} else if (parsed.scheme === void 0) {
|
|
666
|
+
parsed.reference = "relative";
|
|
667
|
+
} else if (parsed.fragment === void 0) {
|
|
668
|
+
parsed.reference = "absolute";
|
|
669
|
+
} else {
|
|
670
|
+
parsed.reference = "uri";
|
|
671
|
+
}
|
|
672
|
+
if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
|
|
673
|
+
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
674
|
+
}
|
|
675
|
+
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
676
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
|
|
677
|
+
if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
678
|
+
try {
|
|
679
|
+
parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
|
|
680
|
+
} catch (e) {
|
|
681
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
686
|
+
if (uri.indexOf("%") !== -1) {
|
|
687
|
+
if (parsed.scheme !== void 0) {
|
|
688
|
+
parsed.scheme = unescape(parsed.scheme);
|
|
689
|
+
}
|
|
690
|
+
if (parsed.host !== void 0) {
|
|
691
|
+
parsed.host = unescape(parsed.host);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
if (parsed.path) {
|
|
695
|
+
parsed.path = escape(unescape(parsed.path));
|
|
696
|
+
}
|
|
697
|
+
if (parsed.fragment) {
|
|
698
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
if (schemeHandler && schemeHandler.parse) {
|
|
702
|
+
schemeHandler.parse(parsed, options);
|
|
703
|
+
}
|
|
704
|
+
} else {
|
|
705
|
+
parsed.error = parsed.error || "URI can not be parsed.";
|
|
706
|
+
}
|
|
707
|
+
return parsed;
|
|
708
|
+
}
|
|
709
|
+
const fastUri$1 = {
|
|
710
|
+
SCHEMES,
|
|
711
|
+
normalize,
|
|
712
|
+
resolve,
|
|
713
|
+
resolveComponent,
|
|
714
|
+
equal,
|
|
715
|
+
serialize,
|
|
716
|
+
parse
|
|
717
|
+
};
|
|
718
|
+
fastUri.exports = fastUri$1;
|
|
719
|
+
fastUri.exports.default = fastUri$1;
|
|
720
|
+
fastUri.exports.fastUri = fastUri$1;
|
|
721
|
+
return fastUri.exports;
|
|
722
|
+
}
|
|
723
|
+
export {
|
|
724
|
+
requireFastUri as r
|
|
725
|
+
};
|