@iamjariwala/react-doc-viewer 0.2.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/LICENSE +201 -0
- package/README.md +568 -0
- package/dist/DocViewer.d.ts +21 -0
- package/dist/components/DocumentNav.d.ts +3 -0
- package/dist/components/FileName.d.ts +3 -0
- package/dist/components/HeaderBar.d.ts +3 -0
- package/dist/components/LoadingTimout.d.ts +3 -0
- package/dist/components/ProxyRenderer.d.ts +3 -0
- package/dist/components/common/Button.d.ts +16 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/icons/index.d.ts +8 -0
- package/dist/cssStyles.d.ts +1 -0
- package/dist/defaultTheme.d.ts +3 -0
- package/dist/empty-DBAFSQIv.cjs +1 -0
- package/dist/empty-GlqisfcO.js +4 -0
- package/dist/features/annotations/components/AnnotationLayer.d.ts +10 -0
- package/dist/features/annotations/components/AnnotationToolbar.d.ts +3 -0
- package/dist/features/annotations/components/ColorPicker.d.ts +3 -0
- package/dist/features/annotations/components/CommentMarker.d.ts +8 -0
- package/dist/features/annotations/components/CommentPopover.d.ts +9 -0
- package/dist/features/annotations/components/TextHighlight.d.ts +8 -0
- package/dist/features/annotations/components/icons/index.d.ts +13 -0
- package/dist/features/annotations/hooks/useAnnotationExport.d.ts +9 -0
- package/dist/features/annotations/hooks/useDrawingCanvas.d.ts +15 -0
- package/dist/features/annotations/hooks/useTextSelection.d.ts +10 -0
- package/dist/features/annotations/index.d.ts +13 -0
- package/dist/features/annotations/state/actions.d.ts +52 -0
- package/dist/features/annotations/state/index.d.ts +17 -0
- package/dist/features/annotations/state/reducer.d.ts +17 -0
- package/dist/features/annotations/types/index.d.ts +44 -0
- package/dist/features/drag-drop/components/DropZoneOverlay.d.ts +9 -0
- package/dist/features/drag-drop/hooks/useDragDrop.d.ts +11 -0
- package/dist/features/drag-drop/hooks/useFileProcessor.d.ts +13 -0
- package/dist/features/drag-drop/index.d.ts +4 -0
- package/dist/features/drag-drop/types/index.d.ts +19 -0
- package/dist/features/thumbnail-sidebar/components/ThumbnailItem.d.ts +11 -0
- package/dist/features/thumbnail-sidebar/components/ThumbnailSidebar.d.ts +8 -0
- package/dist/features/thumbnail-sidebar/components/ThumbnailToggle.d.ts +7 -0
- package/dist/features/thumbnail-sidebar/hooks/useThumbnailGenerator.d.ts +13 -0
- package/dist/features/thumbnail-sidebar/index.d.ts +6 -0
- package/dist/features/thumbnail-sidebar/state/actions.d.ts +31 -0
- package/dist/features/thumbnail-sidebar/state/index.d.ts +15 -0
- package/dist/features/thumbnail-sidebar/state/reducer.d.ts +11 -0
- package/dist/hooks/useDocumentLoader.d.ts +13 -0
- package/dist/hooks/useRendererSelector.d.ts +5 -0
- package/dist/hooks/useTranslation.d.ts +3 -0
- package/dist/hooks/useWindowSize.d.ts +4 -0
- package/dist/i18n.d.ts +158 -0
- package/dist/index-BW6EMUiE.cjs +797 -0
- package/dist/index-CYjVmFQ0.cjs +10 -0
- package/dist/index-DHMTXjv6.cjs +1 -0
- package/dist/index-Dg8HfAtq.js +21246 -0
- package/dist/index-dGGNa2HA.js +3350 -0
- package/dist/index-nyGAOsVK.js +42 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/locales/ar.json.d.ts +13 -0
- package/dist/locales/de.json.d.ts +13 -0
- package/dist/locales/en.json.d.ts +26 -0
- package/dist/locales/es.json.d.ts +13 -0
- package/dist/locales/fr.json.d.ts +13 -0
- package/dist/locales/it.json.d.ts +13 -0
- package/dist/locales/ja.json.d.ts +13 -0
- package/dist/locales/pl.json.d.ts +13 -0
- package/dist/locales/pt.json.d.ts +13 -0
- package/dist/locales/ru.json.d.ts +13 -0
- package/dist/locales/se.json.d.ts +13 -0
- package/dist/locales/sr.json.d.ts +13 -0
- package/dist/locales/sr_cyr.json.d.ts +13 -0
- package/dist/locales/tr.json.d.ts +13 -0
- package/dist/models.d.ts +122 -0
- package/dist/react-doc-viewer.cjs +1 -0
- package/dist/react-doc-viewer.js +23 -0
- package/dist/renderers/bmp/index.d.ts +4 -0
- package/dist/renderers/csv/index.d.ts +4 -0
- package/dist/renderers/gif/index.d.ts +4 -0
- package/dist/renderers/html/index.d.ts +4 -0
- package/dist/renderers/image/index.d.ts +4 -0
- package/dist/renderers/index.d.ts +15 -0
- package/dist/renderers/jpg/index.d.ts +4 -0
- package/dist/renderers/msdoc/index.d.ts +4 -0
- package/dist/renderers/pdf/components/PDFControls.d.ts +4 -0
- package/dist/renderers/pdf/components/PDFPagination.d.ts +4 -0
- package/dist/renderers/pdf/components/PDFThumbnailGenerator.d.ts +3 -0
- package/dist/renderers/pdf/components/icons/index.d.ts +9 -0
- package/dist/renderers/pdf/components/pages/PDFAllPages.d.ts +7 -0
- package/dist/renderers/pdf/components/pages/PDFPages.d.ts +4 -0
- package/dist/renderers/pdf/components/pages/PDFSinglePage.d.ts +7 -0
- package/dist/renderers/pdf/index.d.ts +4 -0
- package/dist/renderers/pdf/state/actions.d.ts +32 -0
- package/dist/renderers/pdf/state/index.d.ts +13 -0
- package/dist/renderers/pdf/state/reducer.d.ts +15 -0
- package/dist/renderers/png/index.d.ts +4 -0
- package/dist/renderers/tiff/index.d.ts +4 -0
- package/dist/renderers/tiff/tiffToCanvas.d.ts +1 -0
- package/dist/renderers/txt/index.d.ts +4 -0
- package/dist/renderers/video/index.d.ts +4 -0
- package/dist/renderers/webp/index.d.ts +4 -0
- package/dist/store/DocViewerProvider.d.ts +22 -0
- package/dist/store/actions.d.ts +63 -0
- package/dist/store/mainStateReducer.d.ts +23 -0
- package/dist/url-BH2U_nez.cjs +3 -0
- package/dist/url-Dk8Xia2J.js +560 -0
- package/dist/utils/fileLoaders.d.ts +13 -0
- package/dist/utils/getFileName.d.ts +3 -0
- package/package.json +122 -0
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
import { c as oe, g as Ie } from "./index-Dg8HfAtq.js";
|
|
2
|
+
var re = { exports: {} };
|
|
3
|
+
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
4
|
+
re.exports;
|
|
5
|
+
(function(e, r) {
|
|
6
|
+
(function(t) {
|
|
7
|
+
var o = r && !r.nodeType && r, a = e && !e.nodeType && e, p = typeof oe == "object" && oe;
|
|
8
|
+
(p.global === p || p.window === p || p.self === p) && (t = p);
|
|
9
|
+
var l, n = 2147483647, m = 36, c = 1, x = 26, _ = 38, g = 700, u = 72, w = 128, N = "-", A = /^xn--/, W = /[^\x20-\x7E]/, h = /[\x2E\u3002\uFF0E\uFF61]/g, y = {
|
|
10
|
+
overflow: "Overflow: input needs wider integers to process",
|
|
11
|
+
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
|
|
12
|
+
"invalid-input": "Invalid input"
|
|
13
|
+
}, T = m - c, v = Math.floor, C = String.fromCharCode, z;
|
|
14
|
+
function U(s) {
|
|
15
|
+
throw new RangeError(y[s]);
|
|
16
|
+
}
|
|
17
|
+
function j(s, i) {
|
|
18
|
+
for (var f = s.length, d = []; f--; )
|
|
19
|
+
d[f] = i(s[f]);
|
|
20
|
+
return d;
|
|
21
|
+
}
|
|
22
|
+
function M(s, i) {
|
|
23
|
+
var f = s.split("@"), d = "";
|
|
24
|
+
f.length > 1 && (d = f[0] + "@", s = f[1]), s = s.replace(h, ".");
|
|
25
|
+
var b = s.split("."), I = j(b, i).join(".");
|
|
26
|
+
return d + I;
|
|
27
|
+
}
|
|
28
|
+
function J(s) {
|
|
29
|
+
for (var i = [], f = 0, d = s.length, b, I; f < d; )
|
|
30
|
+
b = s.charCodeAt(f++), b >= 55296 && b <= 56319 && f < d ? (I = s.charCodeAt(f++), (I & 64512) == 56320 ? i.push(((b & 1023) << 10) + (I & 1023) + 65536) : (i.push(b), f--)) : i.push(b);
|
|
31
|
+
return i;
|
|
32
|
+
}
|
|
33
|
+
function ee(s) {
|
|
34
|
+
return j(s, function(i) {
|
|
35
|
+
var f = "";
|
|
36
|
+
return i > 65535 && (i -= 65536, f += C(i >>> 10 & 1023 | 55296), i = 56320 | i & 1023), f += C(i), f;
|
|
37
|
+
}).join("");
|
|
38
|
+
}
|
|
39
|
+
function G(s) {
|
|
40
|
+
return s - 48 < 10 ? s - 22 : s - 65 < 26 ? s - 65 : s - 97 < 26 ? s - 97 : m;
|
|
41
|
+
}
|
|
42
|
+
function X(s, i) {
|
|
43
|
+
return s + 22 + 75 * (s < 26) - ((i != 0) << 5);
|
|
44
|
+
}
|
|
45
|
+
function Y(s, i, f) {
|
|
46
|
+
var d = 0;
|
|
47
|
+
for (s = f ? v(s / g) : s >> 1, s += v(s / i); s > T * x >> 1; d += m)
|
|
48
|
+
s = v(s / T);
|
|
49
|
+
return v(d + (T + 1) * s / (s + _));
|
|
50
|
+
}
|
|
51
|
+
function Z(s) {
|
|
52
|
+
var i = [], f = s.length, d, b = 0, I = w, R = u, F, S, $, D, O, L, q, B, V;
|
|
53
|
+
for (F = s.lastIndexOf(N), F < 0 && (F = 0), S = 0; S < F; ++S)
|
|
54
|
+
s.charCodeAt(S) >= 128 && U("not-basic"), i.push(s.charCodeAt(S));
|
|
55
|
+
for ($ = F > 0 ? F + 1 : 0; $ < f; ) {
|
|
56
|
+
for (D = b, O = 1, L = m; $ >= f && U("invalid-input"), q = G(s.charCodeAt($++)), (q >= m || q > v((n - b) / O)) && U("overflow"), b += q * O, B = L <= R ? c : L >= R + x ? x : L - R, !(q < B); L += m)
|
|
57
|
+
V = m - B, O > v(n / V) && U("overflow"), O *= V;
|
|
58
|
+
d = i.length + 1, R = Y(b - D, d, D == 0), v(b / d) > n - I && U("overflow"), I += v(b / d), b %= d, i.splice(b++, 0, I);
|
|
59
|
+
}
|
|
60
|
+
return ee(i);
|
|
61
|
+
}
|
|
62
|
+
function te(s) {
|
|
63
|
+
var i, f, d, b, I, R, F, S, $, D, O, L = [], q, B, V, ne;
|
|
64
|
+
for (s = J(s), q = s.length, i = w, f = 0, I = u, R = 0; R < q; ++R)
|
|
65
|
+
O = s[R], O < 128 && L.push(C(O));
|
|
66
|
+
for (d = b = L.length, b && L.push(N); d < q; ) {
|
|
67
|
+
for (F = n, R = 0; R < q; ++R)
|
|
68
|
+
O = s[R], O >= i && O < F && (F = O);
|
|
69
|
+
for (B = d + 1, F - i > v((n - f) / B) && U("overflow"), f += (F - i) * B, i = F, R = 0; R < q; ++R)
|
|
70
|
+
if (O = s[R], O < i && ++f > n && U("overflow"), O == i) {
|
|
71
|
+
for (S = f, $ = m; D = $ <= I ? c : $ >= I + x ? x : $ - I, !(S < D); $ += m)
|
|
72
|
+
ne = S - D, V = m - D, L.push(
|
|
73
|
+
C(X(D + ne % V, 0))
|
|
74
|
+
), S = v(ne / V);
|
|
75
|
+
L.push(C(X(S, 0))), I = Y(f, B, d == b), f = 0, ++d;
|
|
76
|
+
}
|
|
77
|
+
++f, ++i;
|
|
78
|
+
}
|
|
79
|
+
return L.join("");
|
|
80
|
+
}
|
|
81
|
+
function Ue(s) {
|
|
82
|
+
return M(s, function(i) {
|
|
83
|
+
return A.test(i) ? Z(i.slice(4).toLowerCase()) : i;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function Oe(s) {
|
|
87
|
+
return M(s, function(i) {
|
|
88
|
+
return W.test(i) ? "xn--" + te(i) : i;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
if (l = {
|
|
92
|
+
/**
|
|
93
|
+
* A string representing the current Punycode.js version number.
|
|
94
|
+
* @memberOf punycode
|
|
95
|
+
* @type String
|
|
96
|
+
*/
|
|
97
|
+
version: "1.4.1",
|
|
98
|
+
/**
|
|
99
|
+
* An object of methods to convert from JavaScript's internal character
|
|
100
|
+
* representation (UCS-2) to Unicode code points, and back.
|
|
101
|
+
* @see <https://mathiasbynens.be/notes/javascript-encoding>
|
|
102
|
+
* @memberOf punycode
|
|
103
|
+
* @type Object
|
|
104
|
+
*/
|
|
105
|
+
ucs2: {
|
|
106
|
+
decode: J,
|
|
107
|
+
encode: ee
|
|
108
|
+
},
|
|
109
|
+
decode: Z,
|
|
110
|
+
encode: te,
|
|
111
|
+
toASCII: Oe,
|
|
112
|
+
toUnicode: Ue
|
|
113
|
+
}, o && a)
|
|
114
|
+
if (e.exports == o)
|
|
115
|
+
a.exports = l;
|
|
116
|
+
else
|
|
117
|
+
for (z in l)
|
|
118
|
+
l.hasOwnProperty(z) && (o[z] = l[z]);
|
|
119
|
+
else
|
|
120
|
+
t.punycode = l;
|
|
121
|
+
})(oe);
|
|
122
|
+
})(re, re.exports);
|
|
123
|
+
var Te = re.exports;
|
|
124
|
+
const je = /* @__PURE__ */ Ie(Te);
|
|
125
|
+
function Fe(e, r) {
|
|
126
|
+
return Object.prototype.hasOwnProperty.call(e, r);
|
|
127
|
+
}
|
|
128
|
+
var Le = function(e, r, t, o) {
|
|
129
|
+
r = r || "&", t = t || "=";
|
|
130
|
+
var a = {};
|
|
131
|
+
if (typeof e != "string" || e.length === 0)
|
|
132
|
+
return a;
|
|
133
|
+
var p = /\+/g;
|
|
134
|
+
e = e.split(r);
|
|
135
|
+
var l = 1e3;
|
|
136
|
+
o && typeof o.maxKeys == "number" && (l = o.maxKeys);
|
|
137
|
+
var n = e.length;
|
|
138
|
+
l > 0 && n > l && (n = l);
|
|
139
|
+
for (var m = 0; m < n; ++m) {
|
|
140
|
+
var c = e[m].replace(p, "%20"), x = c.indexOf(t), _, g, u, w;
|
|
141
|
+
x >= 0 ? (_ = c.substr(0, x), g = c.substr(x + 1)) : (_ = c, g = ""), u = decodeURIComponent(_), w = decodeURIComponent(g), Fe(a, u) ? Pe(a[u]) ? a[u].push(w) : a[u] = [a[u], w] : a[u] = w;
|
|
142
|
+
}
|
|
143
|
+
return a;
|
|
144
|
+
}, Pe = Array.isArray || function(e) {
|
|
145
|
+
return Object.prototype.toString.call(e) === "[object Array]";
|
|
146
|
+
}, Q = function(e) {
|
|
147
|
+
switch (typeof e) {
|
|
148
|
+
case "string":
|
|
149
|
+
return e;
|
|
150
|
+
case "boolean":
|
|
151
|
+
return e ? "true" : "false";
|
|
152
|
+
case "number":
|
|
153
|
+
return isFinite(e) ? e : "";
|
|
154
|
+
default:
|
|
155
|
+
return "";
|
|
156
|
+
}
|
|
157
|
+
}, _e = function(e, r, t, o) {
|
|
158
|
+
return r = r || "&", t = t || "=", e === null && (e = void 0), typeof e == "object" ? ie(qe(e), function(a) {
|
|
159
|
+
var p = encodeURIComponent(Q(a)) + t;
|
|
160
|
+
return Se(e[a]) ? ie(e[a], function(l) {
|
|
161
|
+
return p + encodeURIComponent(Q(l));
|
|
162
|
+
}).join(r) : p + encodeURIComponent(Q(e[a]));
|
|
163
|
+
}).join(r) : o ? encodeURIComponent(Q(o)) + t + encodeURIComponent(Q(e)) : "";
|
|
164
|
+
}, Se = Array.isArray || function(e) {
|
|
165
|
+
return Object.prototype.toString.call(e) === "[object Array]";
|
|
166
|
+
};
|
|
167
|
+
function ie(e, r) {
|
|
168
|
+
if (e.map)
|
|
169
|
+
return e.map(r);
|
|
170
|
+
for (var t = [], o = 0; o < e.length; o++)
|
|
171
|
+
t.push(r(e[o], o));
|
|
172
|
+
return t;
|
|
173
|
+
}
|
|
174
|
+
var qe = Object.keys || function(e) {
|
|
175
|
+
var r = [];
|
|
176
|
+
for (var t in e)
|
|
177
|
+
Object.prototype.hasOwnProperty.call(e, t) && r.push(t);
|
|
178
|
+
return r;
|
|
179
|
+
}, le, pe, $e = pe = Le, Ee = le = _e;
|
|
180
|
+
function Me(e) {
|
|
181
|
+
return encodeURIComponent(e);
|
|
182
|
+
}
|
|
183
|
+
function De(e) {
|
|
184
|
+
return decodeURIComponent(e);
|
|
185
|
+
}
|
|
186
|
+
var Ne = {
|
|
187
|
+
decode: $e,
|
|
188
|
+
encode: Ee,
|
|
189
|
+
parse: pe,
|
|
190
|
+
stringify: le,
|
|
191
|
+
escape: Me,
|
|
192
|
+
unescape: De
|
|
193
|
+
}, ze = {
|
|
194
|
+
isString: function(e) {
|
|
195
|
+
return typeof e == "string";
|
|
196
|
+
},
|
|
197
|
+
isObject: function(e) {
|
|
198
|
+
return typeof e == "object" && e !== null;
|
|
199
|
+
},
|
|
200
|
+
isNull: function(e) {
|
|
201
|
+
return e === null;
|
|
202
|
+
},
|
|
203
|
+
isNullOrUndefined: function(e) {
|
|
204
|
+
return e == null;
|
|
205
|
+
}
|
|
206
|
+
}, Be = je, E = ze, Ke = k, We = rt, me = nt, Ge = tt, Ze = P;
|
|
207
|
+
function P() {
|
|
208
|
+
this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;
|
|
209
|
+
}
|
|
210
|
+
var Ve = /^([a-z0-9.+-]+:)/i, Je = /:[0-9]*$/, Xe = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, Ye = ["<", ">", '"', "`", " ", "\r", `
|
|
211
|
+
`, " "], He = ["{", "}", "|", "\\", "^", "`"].concat(Ye), se = ["'"].concat(He), fe = ["%", "/", "?", ";", "#"].concat(se), ue = ["/", "?", "#"], Qe = 255, ce = /^[+a-z0-9A-Z_-]{0,63}$/, ke = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, et = {
|
|
212
|
+
javascript: !0,
|
|
213
|
+
"javascript:": !0
|
|
214
|
+
}, ae = {
|
|
215
|
+
javascript: !0,
|
|
216
|
+
"javascript:": !0
|
|
217
|
+
}, H = {
|
|
218
|
+
http: !0,
|
|
219
|
+
https: !0,
|
|
220
|
+
ftp: !0,
|
|
221
|
+
gopher: !0,
|
|
222
|
+
file: !0,
|
|
223
|
+
"http:": !0,
|
|
224
|
+
"https:": !0,
|
|
225
|
+
"ftp:": !0,
|
|
226
|
+
"gopher:": !0,
|
|
227
|
+
"file:": !0
|
|
228
|
+
}, he = Ne;
|
|
229
|
+
function k(e, r, t) {
|
|
230
|
+
if (e && E.isObject(e) && e instanceof P)
|
|
231
|
+
return e;
|
|
232
|
+
var o = new P();
|
|
233
|
+
return o.parse(e, r, t), o;
|
|
234
|
+
}
|
|
235
|
+
P.prototype.parse = function(e, r, t) {
|
|
236
|
+
if (!E.isString(e))
|
|
237
|
+
throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
|
|
238
|
+
var o = e.indexOf("?"), a = o !== -1 && o < e.indexOf("#") ? "?" : "#", p = e.split(a), l = /\\/g;
|
|
239
|
+
p[0] = p[0].replace(l, "/"), e = p.join(a);
|
|
240
|
+
var n = e;
|
|
241
|
+
if (n = n.trim(), !t && e.split("#").length === 1) {
|
|
242
|
+
var m = Xe.exec(n);
|
|
243
|
+
if (m)
|
|
244
|
+
return this.path = n, this.href = n, this.pathname = m[1], m[2] ? (this.search = m[2], r ? this.query = he.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : r && (this.search = "", this.query = {}), this;
|
|
245
|
+
}
|
|
246
|
+
var c = Ve.exec(n);
|
|
247
|
+
if (c) {
|
|
248
|
+
c = c[0];
|
|
249
|
+
var x = c.toLowerCase();
|
|
250
|
+
this.protocol = x, n = n.substr(c.length);
|
|
251
|
+
}
|
|
252
|
+
if (t || c || n.match(/^\/\/[^@\/]+@[^@\/]+/)) {
|
|
253
|
+
var _ = n.substr(0, 2) === "//";
|
|
254
|
+
_ && !(c && ae[c]) && (n = n.substr(2), this.slashes = !0);
|
|
255
|
+
}
|
|
256
|
+
if (!ae[c] && (_ || c && !H[c])) {
|
|
257
|
+
for (var g = -1, u = 0; u < ue.length; u++) {
|
|
258
|
+
var w = n.indexOf(ue[u]);
|
|
259
|
+
w !== -1 && (g === -1 || w < g) && (g = w);
|
|
260
|
+
}
|
|
261
|
+
var N, A;
|
|
262
|
+
g === -1 ? A = n.lastIndexOf("@") : A = n.lastIndexOf("@", g), A !== -1 && (N = n.slice(0, A), n = n.slice(A + 1), this.auth = decodeURIComponent(N)), g = -1;
|
|
263
|
+
for (var u = 0; u < fe.length; u++) {
|
|
264
|
+
var w = n.indexOf(fe[u]);
|
|
265
|
+
w !== -1 && (g === -1 || w < g) && (g = w);
|
|
266
|
+
}
|
|
267
|
+
g === -1 && (g = n.length), this.host = n.slice(0, g), n = n.slice(g), this.parseHost(), this.hostname = this.hostname || "";
|
|
268
|
+
var W = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
|
|
269
|
+
if (!W)
|
|
270
|
+
for (var h = this.hostname.split(/\./), u = 0, y = h.length; u < y; u++) {
|
|
271
|
+
var T = h[u];
|
|
272
|
+
if (T && !T.match(ce)) {
|
|
273
|
+
for (var v = "", C = 0, z = T.length; C < z; C++)
|
|
274
|
+
T.charCodeAt(C) > 127 ? v += "x" : v += T[C];
|
|
275
|
+
if (!v.match(ce)) {
|
|
276
|
+
var U = h.slice(0, u), j = h.slice(u + 1), M = T.match(ke);
|
|
277
|
+
M && (U.push(M[1]), j.unshift(M[2])), j.length && (n = "/" + j.join(".") + n), this.hostname = U.join(".");
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
this.hostname.length > Qe ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(), W || (this.hostname = Be.toASCII(this.hostname));
|
|
283
|
+
var J = this.port ? ":" + this.port : "", ee = this.hostname || "";
|
|
284
|
+
this.host = ee + J, this.href += this.host, W && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), n[0] !== "/" && (n = "/" + n));
|
|
285
|
+
}
|
|
286
|
+
if (!et[x])
|
|
287
|
+
for (var u = 0, y = se.length; u < y; u++) {
|
|
288
|
+
var G = se[u];
|
|
289
|
+
if (n.indexOf(G) !== -1) {
|
|
290
|
+
var X = encodeURIComponent(G);
|
|
291
|
+
X === G && (X = escape(G)), n = n.split(G).join(X);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
var Y = n.indexOf("#");
|
|
295
|
+
Y !== -1 && (this.hash = n.substr(Y), n = n.slice(0, Y));
|
|
296
|
+
var Z = n.indexOf("?");
|
|
297
|
+
if (Z !== -1 ? (this.search = n.substr(Z), this.query = n.substr(Z + 1), r && (this.query = he.parse(this.query)), n = n.slice(0, Z)) : r && (this.search = "", this.query = {}), n && (this.pathname = n), H[x] && this.hostname && !this.pathname && (this.pathname = "/"), this.pathname || this.search) {
|
|
298
|
+
var J = this.pathname || "", te = this.search || "";
|
|
299
|
+
this.path = J + te;
|
|
300
|
+
}
|
|
301
|
+
return this.href = this.format(), this;
|
|
302
|
+
};
|
|
303
|
+
function tt(e) {
|
|
304
|
+
return E.isString(e) && (e = k(e)), e instanceof P ? e.format() : P.prototype.format.call(e);
|
|
305
|
+
}
|
|
306
|
+
P.prototype.format = function() {
|
|
307
|
+
var e = this.auth || "";
|
|
308
|
+
e && (e = encodeURIComponent(e), e = e.replace(/%3A/i, ":"), e += "@");
|
|
309
|
+
var r = this.protocol || "", t = this.pathname || "", o = this.hash || "", a = !1, p = "";
|
|
310
|
+
this.host ? a = e + this.host : this.hostname && (a = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"), this.port && (a += ":" + this.port)), this.query && E.isObject(this.query) && Object.keys(this.query).length && (p = he.stringify(this.query));
|
|
311
|
+
var l = this.search || p && "?" + p || "";
|
|
312
|
+
return r && r.substr(-1) !== ":" && (r += ":"), this.slashes || (!r || H[r]) && a !== !1 ? (a = "//" + (a || ""), t && t.charAt(0) !== "/" && (t = "/" + t)) : a || (a = ""), o && o.charAt(0) !== "#" && (o = "#" + o), l && l.charAt(0) !== "?" && (l = "?" + l), t = t.replace(/[?#]/g, function(n) {
|
|
313
|
+
return encodeURIComponent(n);
|
|
314
|
+
}), l = l.replace("#", "%23"), r + a + t + l + o;
|
|
315
|
+
};
|
|
316
|
+
function rt(e, r) {
|
|
317
|
+
return k(e, !1, !0).resolve(r);
|
|
318
|
+
}
|
|
319
|
+
P.prototype.resolve = function(e) {
|
|
320
|
+
return this.resolveObject(k(e, !1, !0)).format();
|
|
321
|
+
};
|
|
322
|
+
function nt(e, r) {
|
|
323
|
+
return e ? k(e, !1, !0).resolveObject(r) : r;
|
|
324
|
+
}
|
|
325
|
+
P.prototype.resolveObject = function(e) {
|
|
326
|
+
if (E.isString(e)) {
|
|
327
|
+
var r = new P();
|
|
328
|
+
r.parse(e, !1, !0), e = r;
|
|
329
|
+
}
|
|
330
|
+
for (var t = new P(), o = Object.keys(this), a = 0; a < o.length; a++) {
|
|
331
|
+
var p = o[a];
|
|
332
|
+
t[p] = this[p];
|
|
333
|
+
}
|
|
334
|
+
if (t.hash = e.hash, e.href === "")
|
|
335
|
+
return t.href = t.format(), t;
|
|
336
|
+
if (e.slashes && !e.protocol) {
|
|
337
|
+
for (var l = Object.keys(e), n = 0; n < l.length; n++) {
|
|
338
|
+
var m = l[n];
|
|
339
|
+
m !== "protocol" && (t[m] = e[m]);
|
|
340
|
+
}
|
|
341
|
+
return H[t.protocol] && t.hostname && !t.pathname && (t.path = t.pathname = "/"), t.href = t.format(), t;
|
|
342
|
+
}
|
|
343
|
+
if (e.protocol && e.protocol !== t.protocol) {
|
|
344
|
+
if (!H[e.protocol]) {
|
|
345
|
+
for (var c = Object.keys(e), x = 0; x < c.length; x++) {
|
|
346
|
+
var _ = c[x];
|
|
347
|
+
t[_] = e[_];
|
|
348
|
+
}
|
|
349
|
+
return t.href = t.format(), t;
|
|
350
|
+
}
|
|
351
|
+
if (t.protocol = e.protocol, !e.host && !ae[e.protocol]) {
|
|
352
|
+
for (var y = (e.pathname || "").split("/"); y.length && !(e.host = y.shift()); )
|
|
353
|
+
;
|
|
354
|
+
e.host || (e.host = ""), e.hostname || (e.hostname = ""), y[0] !== "" && y.unshift(""), y.length < 2 && y.unshift(""), t.pathname = y.join("/");
|
|
355
|
+
} else
|
|
356
|
+
t.pathname = e.pathname;
|
|
357
|
+
if (t.search = e.search, t.query = e.query, t.host = e.host || "", t.auth = e.auth, t.hostname = e.hostname || e.host, t.port = e.port, t.pathname || t.search) {
|
|
358
|
+
var g = t.pathname || "", u = t.search || "";
|
|
359
|
+
t.path = g + u;
|
|
360
|
+
}
|
|
361
|
+
return t.slashes = t.slashes || e.slashes, t.href = t.format(), t;
|
|
362
|
+
}
|
|
363
|
+
var w = t.pathname && t.pathname.charAt(0) === "/", N = e.host || e.pathname && e.pathname.charAt(0) === "/", A = N || w || t.host && e.pathname, W = A, h = t.pathname && t.pathname.split("/") || [], y = e.pathname && e.pathname.split("/") || [], T = t.protocol && !H[t.protocol];
|
|
364
|
+
if (T && (t.hostname = "", t.port = null, t.host && (h[0] === "" ? h[0] = t.host : h.unshift(t.host)), t.host = "", e.protocol && (e.hostname = null, e.port = null, e.host && (y[0] === "" ? y[0] = e.host : y.unshift(e.host)), e.host = null), A = A && (y[0] === "" || h[0] === "")), N)
|
|
365
|
+
t.host = e.host || e.host === "" ? e.host : t.host, t.hostname = e.hostname || e.hostname === "" ? e.hostname : t.hostname, t.search = e.search, t.query = e.query, h = y;
|
|
366
|
+
else if (y.length)
|
|
367
|
+
h || (h = []), h.pop(), h = h.concat(y), t.search = e.search, t.query = e.query;
|
|
368
|
+
else if (!E.isNullOrUndefined(e.search)) {
|
|
369
|
+
if (T) {
|
|
370
|
+
t.hostname = t.host = h.shift();
|
|
371
|
+
var v = t.host && t.host.indexOf("@") > 0 ? t.host.split("@") : !1;
|
|
372
|
+
v && (t.auth = v.shift(), t.host = t.hostname = v.shift());
|
|
373
|
+
}
|
|
374
|
+
return t.search = e.search, t.query = e.query, (!E.isNull(t.pathname) || !E.isNull(t.search)) && (t.path = (t.pathname ? t.pathname : "") + (t.search ? t.search : "")), t.href = t.format(), t;
|
|
375
|
+
}
|
|
376
|
+
if (!h.length)
|
|
377
|
+
return t.pathname = null, t.search ? t.path = "/" + t.search : t.path = null, t.href = t.format(), t;
|
|
378
|
+
for (var C = h.slice(-1)[0], z = (t.host || e.host || h.length > 1) && (C === "." || C === "..") || C === "", U = 0, j = h.length; j >= 0; j--)
|
|
379
|
+
C = h[j], C === "." ? h.splice(j, 1) : C === ".." ? (h.splice(j, 1), U++) : U && (h.splice(j, 1), U--);
|
|
380
|
+
if (!A && !W)
|
|
381
|
+
for (; U--; U)
|
|
382
|
+
h.unshift("..");
|
|
383
|
+
A && h[0] !== "" && (!h[0] || h[0].charAt(0) !== "/") && h.unshift(""), z && h.join("/").substr(-1) !== "/" && h.push("");
|
|
384
|
+
var M = h[0] === "" || h[0] && h[0].charAt(0) === "/";
|
|
385
|
+
if (T) {
|
|
386
|
+
t.hostname = t.host = M ? "" : h.length ? h.shift() : "";
|
|
387
|
+
var v = t.host && t.host.indexOf("@") > 0 ? t.host.split("@") : !1;
|
|
388
|
+
v && (t.auth = v.shift(), t.host = t.hostname = v.shift());
|
|
389
|
+
}
|
|
390
|
+
return A = A || t.host && h.length, A && !M && h.unshift(""), h.length ? t.pathname = h.join("/") : (t.pathname = null, t.path = null), (!E.isNull(t.pathname) || !E.isNull(t.search)) && (t.path = (t.pathname ? t.pathname : "") + (t.search ? t.search : "")), t.auth = e.auth || t.auth, t.slashes = t.slashes || e.slashes, t.href = t.format(), t;
|
|
391
|
+
};
|
|
392
|
+
P.prototype.parseHost = function() {
|
|
393
|
+
var e = this.host, r = Je.exec(e);
|
|
394
|
+
r && (r = r[0], r !== ":" && (this.port = r.substr(1)), e = e.substr(0, e.length - r.length)), e && (this.hostname = e);
|
|
395
|
+
};
|
|
396
|
+
function ot(e, r) {
|
|
397
|
+
for (var t = 0, o = e.length - 1; o >= 0; o--) {
|
|
398
|
+
var a = e[o];
|
|
399
|
+
a === "." ? e.splice(o, 1) : a === ".." ? (e.splice(o, 1), t++) : t && (e.splice(o, 1), t--);
|
|
400
|
+
}
|
|
401
|
+
if (r)
|
|
402
|
+
for (; t--; t)
|
|
403
|
+
e.unshift("..");
|
|
404
|
+
return e;
|
|
405
|
+
}
|
|
406
|
+
function st() {
|
|
407
|
+
for (var e = "", r = !1, t = arguments.length - 1; t >= -1 && !r; t--) {
|
|
408
|
+
var o = t >= 0 ? arguments[t] : "/";
|
|
409
|
+
if (typeof o != "string")
|
|
410
|
+
throw new TypeError("Arguments to path.resolve must be strings");
|
|
411
|
+
if (!o)
|
|
412
|
+
continue;
|
|
413
|
+
e = o + "/" + e, r = o.charAt(0) === "/";
|
|
414
|
+
}
|
|
415
|
+
return e = ot(at(e.split("/"), function(a) {
|
|
416
|
+
return !!a;
|
|
417
|
+
}), !r).join("/"), (r ? "/" : "") + e || ".";
|
|
418
|
+
}
|
|
419
|
+
function at(e, r) {
|
|
420
|
+
if (e.filter)
|
|
421
|
+
return e.filter(r);
|
|
422
|
+
for (var t = [], o = 0; o < e.length; o++)
|
|
423
|
+
r(e[o], o, e) && t.push(e[o]);
|
|
424
|
+
return t;
|
|
425
|
+
}
|
|
426
|
+
var de = function(e) {
|
|
427
|
+
function r() {
|
|
428
|
+
var o = this || self;
|
|
429
|
+
return delete e.prototype.__magic__, o;
|
|
430
|
+
}
|
|
431
|
+
if (typeof globalThis == "object")
|
|
432
|
+
return globalThis;
|
|
433
|
+
if (this)
|
|
434
|
+
return r();
|
|
435
|
+
e.defineProperty(e.prototype, "__magic__", {
|
|
436
|
+
configurable: !0,
|
|
437
|
+
get: r
|
|
438
|
+
});
|
|
439
|
+
var t = __magic__;
|
|
440
|
+
return t;
|
|
441
|
+
}(Object), ht = (
|
|
442
|
+
/** @type {formatImport}*/
|
|
443
|
+
Ge
|
|
444
|
+
), ve = (
|
|
445
|
+
/** @type {parseImport}*/
|
|
446
|
+
Ke
|
|
447
|
+
), ge = (
|
|
448
|
+
/** @type {resolveImport}*/
|
|
449
|
+
We
|
|
450
|
+
), ye = (
|
|
451
|
+
/** @type {UrlImport}*/
|
|
452
|
+
Ze
|
|
453
|
+
), K = de.URL, be = de.URLSearchParams, it = /%/g, ft = /\\/g, ut = /\n/g, ct = /\r/g, lt = /\t/g, pt = 47;
|
|
454
|
+
function mt(e) {
|
|
455
|
+
var r = (
|
|
456
|
+
/** @type {URL|null} */
|
|
457
|
+
e ?? null
|
|
458
|
+
);
|
|
459
|
+
return !!(r !== null && (r != null && r.href) && (r != null && r.origin));
|
|
460
|
+
}
|
|
461
|
+
function dt(e) {
|
|
462
|
+
if (e.hostname !== "")
|
|
463
|
+
throw new TypeError('File URL host must be "localhost" or empty on browser');
|
|
464
|
+
for (var r = e.pathname, t = 0; t < r.length; t++)
|
|
465
|
+
if (r[t] === "%") {
|
|
466
|
+
var o = r.codePointAt(t + 2) | 32;
|
|
467
|
+
if (r[t + 1] === "2" && o === 102)
|
|
468
|
+
throw new TypeError("File URL path must not include encoded / characters");
|
|
469
|
+
}
|
|
470
|
+
return decodeURIComponent(r);
|
|
471
|
+
}
|
|
472
|
+
function vt(e) {
|
|
473
|
+
return e.includes("%") && (e = e.replace(it, "%25")), e.includes("\\") && (e = e.replace(ft, "%5C")), e.includes(`
|
|
474
|
+
`) && (e = e.replace(ut, "%0A")), e.includes("\r") && (e = e.replace(ct, "%0D")), e.includes(" ") && (e = e.replace(lt, "%09")), e;
|
|
475
|
+
}
|
|
476
|
+
var xe = (
|
|
477
|
+
/**
|
|
478
|
+
* @type {domainToASCII}
|
|
479
|
+
*/
|
|
480
|
+
function(r) {
|
|
481
|
+
if (typeof r > "u")
|
|
482
|
+
throw new TypeError('The "domain" argument must be specified');
|
|
483
|
+
return new K("http://" + r).hostname;
|
|
484
|
+
}
|
|
485
|
+
), we = (
|
|
486
|
+
/**
|
|
487
|
+
* @type {domainToUnicode}
|
|
488
|
+
*/
|
|
489
|
+
function(r) {
|
|
490
|
+
if (typeof r > "u")
|
|
491
|
+
throw new TypeError('The "domain" argument must be specified');
|
|
492
|
+
return new K("http://" + r).hostname;
|
|
493
|
+
}
|
|
494
|
+
), Ce = (
|
|
495
|
+
/**
|
|
496
|
+
* @type {(url: string) => URL}
|
|
497
|
+
*/
|
|
498
|
+
function(r) {
|
|
499
|
+
var t = new K("file://"), o = st(r), a = r.charCodeAt(r.length - 1);
|
|
500
|
+
return a === pt && o[o.length - 1] !== "/" && (o += "/"), t.pathname = vt(o), t;
|
|
501
|
+
}
|
|
502
|
+
), Re = (
|
|
503
|
+
/**
|
|
504
|
+
* @type {fileURLToPath & ((path: string | URL) => string)}
|
|
505
|
+
*/
|
|
506
|
+
function(r) {
|
|
507
|
+
if (!mt(r) && typeof r != "string")
|
|
508
|
+
throw new TypeError('The "path" argument must be of type string or an instance of URL. Received type ' + typeof r + " (" + r + ")");
|
|
509
|
+
var t = new K(r);
|
|
510
|
+
if (t.protocol !== "file:")
|
|
511
|
+
throw new TypeError("The URL must be of scheme file");
|
|
512
|
+
return dt(t);
|
|
513
|
+
}
|
|
514
|
+
), Ae = (
|
|
515
|
+
/**
|
|
516
|
+
* @type {(
|
|
517
|
+
* ((urlObject: URL, options?: URLFormatOptions) => string) &
|
|
518
|
+
* ((urlObject: UrlObject | string, options?: never) => string)
|
|
519
|
+
* )}
|
|
520
|
+
*/
|
|
521
|
+
function(r, t) {
|
|
522
|
+
var o, a, p;
|
|
523
|
+
if (t === void 0 && (t = {}), !(r instanceof K))
|
|
524
|
+
return ht(r);
|
|
525
|
+
if (typeof t != "object" || t === null)
|
|
526
|
+
throw new TypeError('The "options" argument must be of type object.');
|
|
527
|
+
var l = (o = t.auth) != null ? o : !0, n = (a = t.fragment) != null ? a : !0, m = (p = t.search) != null ? p : !0, c = new K(r.toString());
|
|
528
|
+
return l || (c.username = "", c.password = ""), n || (c.hash = ""), m || (c.search = ""), c.toString();
|
|
529
|
+
}
|
|
530
|
+
), gt = {
|
|
531
|
+
format: Ae,
|
|
532
|
+
parse: ve,
|
|
533
|
+
resolve: ge,
|
|
534
|
+
resolveObject: me,
|
|
535
|
+
Url: ye,
|
|
536
|
+
URL: K,
|
|
537
|
+
URLSearchParams: be,
|
|
538
|
+
domainToASCII: xe,
|
|
539
|
+
domainToUnicode: we,
|
|
540
|
+
pathToFileURL: Ce,
|
|
541
|
+
fileURLToPath: Re
|
|
542
|
+
};
|
|
543
|
+
const bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
544
|
+
__proto__: null,
|
|
545
|
+
URL: K,
|
|
546
|
+
URLSearchParams: be,
|
|
547
|
+
Url: ye,
|
|
548
|
+
default: gt,
|
|
549
|
+
domainToASCII: xe,
|
|
550
|
+
domainToUnicode: we,
|
|
551
|
+
fileURLToPath: Re,
|
|
552
|
+
format: Ae,
|
|
553
|
+
parse: ve,
|
|
554
|
+
pathToFileURL: Ce,
|
|
555
|
+
resolve: ge,
|
|
556
|
+
resolveObject: me
|
|
557
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
558
|
+
export {
|
|
559
|
+
bt as u
|
|
560
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface FileLoaderFuncProps {
|
|
2
|
+
documentURI: string;
|
|
3
|
+
signal: AbortSignal;
|
|
4
|
+
fileLoaderComplete: FileLoaderComplete;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
}
|
|
7
|
+
export type FileLoaderComplete = (fileReader?: FileReader) => void;
|
|
8
|
+
export type FileLoaderFunction = (props: FileLoaderFuncProps) => void;
|
|
9
|
+
export declare const arrayBufferFileLoader: FileLoaderFunction;
|
|
10
|
+
export declare const dataURLFileLoader: FileLoaderFunction;
|
|
11
|
+
export declare const textFileLoader: FileLoaderFunction;
|
|
12
|
+
export declare const binaryStringFileLoader: FileLoaderFunction;
|
|
13
|
+
export declare const defaultFileLoader: FileLoaderFunction;
|