@d1g1tal/transportr 3.3.2 → 3.3.4
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/CHANGELOG.md +19 -0
- package/dist/VSS64DLN.js +8 -0
- package/dist/VSS64DLN.js.map +7 -0
- package/dist/iife/content-type.js +8 -0
- package/dist/iife/content-type.js.map +7 -0
- package/dist/iife/request-header.js +8 -0
- package/dist/iife/request-header.js.map +7 -0
- package/dist/iife/request-method.js +8 -0
- package/dist/iife/request-method.js.map +7 -0
- package/dist/iife/response-header.js +8 -0
- package/dist/iife/response-header.js.map +7 -0
- package/dist/iife/transportr.js +1292 -0
- package/dist/iife/transportr.js.map +7 -0
- package/dist/transportr.js +1 -1
- package/dist/transportr.js.map +2 -2
- package/package.json +7 -7
- package/dist/OP3JQ447.js +0 -8
- package/dist/OP3JQ447.js.map +0 -7
|
@@ -0,0 +1,1292 @@
|
|
|
1
|
+
(() => {
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __esm = (fn2, res) => function __init() {
|
|
5
|
+
return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
|
|
6
|
+
};
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// iife:/home/runner/work/transportr/transportr/dist/VSS64DLN.js
|
|
13
|
+
var VSS64DLN_exports = {};
|
|
14
|
+
__export(VSS64DLN_exports, {
|
|
15
|
+
default: () => mn
|
|
16
|
+
});
|
|
17
|
+
function R(s2) {
|
|
18
|
+
return function(o) {
|
|
19
|
+
o instanceof RegExp && (o.lastIndex = 0);
|
|
20
|
+
for (var l = arguments.length, a = new Array(l > 1 ? l - 1 : 0), c = 1; c < l; c++) a[c - 1] = arguments[c];
|
|
21
|
+
return Ue(s2, o, a);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function Zt(s2) {
|
|
25
|
+
return function() {
|
|
26
|
+
for (var o = arguments.length, l = new Array(o), a = 0; a < o; a++) l[a] = arguments[a];
|
|
27
|
+
return Fe(s2, l);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function r(s2, o) {
|
|
31
|
+
let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Ee;
|
|
32
|
+
ft && ft(s2, null);
|
|
33
|
+
let a = o.length;
|
|
34
|
+
for (; a--; ) {
|
|
35
|
+
let c = o[a];
|
|
36
|
+
if (typeof c == "string") {
|
|
37
|
+
let O2 = l(c);
|
|
38
|
+
O2 !== c && (Yt(o) || (o[a] = O2), c = O2);
|
|
39
|
+
}
|
|
40
|
+
s2[c] = true;
|
|
41
|
+
}
|
|
42
|
+
return s2;
|
|
43
|
+
}
|
|
44
|
+
function Jt(s2) {
|
|
45
|
+
for (let o = 0; o < s2.length; o++) C(s2, o) || (s2[o] = null);
|
|
46
|
+
return s2;
|
|
47
|
+
}
|
|
48
|
+
function M(s2) {
|
|
49
|
+
let o = ne(null);
|
|
50
|
+
for (let [l, a] of gt(s2)) C(s2, l) && (Array.isArray(a) ? o[l] = Jt(a) : a && typeof a == "object" && a.constructor === Object ? o[l] = M(a) : o[l] = a);
|
|
51
|
+
return o;
|
|
52
|
+
}
|
|
53
|
+
function ee(s2, o) {
|
|
54
|
+
for (; s2 !== null; ) {
|
|
55
|
+
let a = jt(s2, o);
|
|
56
|
+
if (a) {
|
|
57
|
+
if (a.get) return R(a.get);
|
|
58
|
+
if (typeof a.value == "function") return R(a.value);
|
|
59
|
+
}
|
|
60
|
+
s2 = Xt(s2);
|
|
61
|
+
}
|
|
62
|
+
function l() {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
return l;
|
|
66
|
+
}
|
|
67
|
+
function St() {
|
|
68
|
+
let s2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fn(), o = (i) => St(i);
|
|
69
|
+
if (o.version = "3.4.0", o.removed = [], !s2 || !s2.document || s2.document.nodeType !== te.document || !s2.Element) return o.isSupported = false, o;
|
|
70
|
+
let { document: l } = s2, a = l, c = a.currentScript, { DocumentFragment: O2, HTMLTemplateElement: F2, Node: _e2, Element: He2, NodeFilter: Y2, NamedNodeMap: Rt = s2.NamedNodeMap || s2.MozNamedAttrMap, HTMLFormElement: Ot, DOMParser: Dt, trustedTypes: oe } = s2, X2 = He2.prototype, Lt = ee(X2, "cloneNode"), bt = ee(X2, "remove"), yt = ee(X2, "nextSibling"), Ct = ee(X2, "childNodes"), ie = ee(X2, "parentNode");
|
|
71
|
+
if (typeof F2 == "function") {
|
|
72
|
+
let i = l.createElement("template");
|
|
73
|
+
i.content && i.content.ownerDocument && (l = i.content.ownerDocument);
|
|
74
|
+
}
|
|
75
|
+
let g, j2 = "", { implementation: ge2, createNodeIterator: It, createDocumentFragment: Nt, getElementsByTagName: Mt } = l, { importNode: wt } = a, h = _t();
|
|
76
|
+
o.isSupported = typeof gt == "function" && typeof ie == "function" && ge2 && ge2.createHTMLDocument !== void 0;
|
|
77
|
+
let { MUSTACHE_EXPR: ae2, ERB_EXPR: re2, TMPLIT_EXPR: se2, DATA_ATTR: xt, ARIA_ATTR: Pt, IS_SCRIPT_OR_DATA: kt, ATTR_WHITESPACE: ze, CUSTOM_ELEMENT: vt } = Et, { IS_ALLOWED_URI: Ge } = Et, T2 = null, We = r({}, [...mt, ...xe, ...Pe, ...ke, ...pt]), d = null, Be2 = r({}, [...Tt, ...ve, ...dt, ...de]), u = Object.seal(ne(null, { tagNameCheck: { writable: true, configurable: false, enumerable: true, value: null }, attributeNameCheck: { writable: true, configurable: false, enumerable: true, value: null }, allowCustomizedBuiltInElements: { writable: true, configurable: false, enumerable: true, value: false } })), V2 = null, le2 = null, x = Object.seal(ne(null, { tagCheck: { writable: true, configurable: false, enumerable: true, value: null }, attributeCheck: { writable: true, configurable: false, enumerable: true, value: null } })), Ye = true, he2 = true, Xe = false, je2 = true, k2 = false, $2 = true, v2 = false, Ae2 = false, Se2 = false, H2 = false, ce2 = false, fe2 = false, Ve = true, $e2 = false, Ut = "user-content-", Re2 = true, q = false, z2 = {}, I2 = null, Oe2 = r({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]), qe2 = null, Ke = r({}, ["audio", "video", "img", "source", "image", "track"]), De2 = null, Ze = r({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ue2 = "http://www.w3.org/1998/Math/MathML", me2 = "http://www.w3.org/2000/svg", N2 = "http://www.w3.org/1999/xhtml", G2 = N2, Le2 = false, be2 = null, Ft = r({}, [ue2, me2, N2], Me), pe2 = r({}, ["mi", "mo", "mn", "ms", "mtext"]), Te2 = r({}, ["annotation-xml"]), Ht = r({}, ["title", "style", "font", "a", "script"]), K2 = null, zt = ["application/xhtml+xml", "text/html"], Gt = "text/html", p = null, W2 = null, Wt = l.createElement("form"), Je2 = function(e) {
|
|
78
|
+
return e instanceof RegExp || e instanceof Function;
|
|
79
|
+
}, ye2 = function() {
|
|
80
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
81
|
+
if (!(W2 && W2 === e)) {
|
|
82
|
+
if ((!e || typeof e != "object") && (e = {}), e = M(e), K2 = zt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? Gt : e.PARSER_MEDIA_TYPE, p = K2 === "application/xhtml+xml" ? Me : Ee, T2 = C(e, "ALLOWED_TAGS") ? r({}, e.ALLOWED_TAGS, p) : We, d = C(e, "ALLOWED_ATTR") ? r({}, e.ALLOWED_ATTR, p) : Be2, be2 = C(e, "ALLOWED_NAMESPACES") ? r({}, e.ALLOWED_NAMESPACES, Me) : Ft, De2 = C(e, "ADD_URI_SAFE_ATTR") ? r(M(Ze), e.ADD_URI_SAFE_ATTR, p) : Ze, qe2 = C(e, "ADD_DATA_URI_TAGS") ? r(M(Ke), e.ADD_DATA_URI_TAGS, p) : Ke, I2 = C(e, "FORBID_CONTENTS") ? r({}, e.FORBID_CONTENTS, p) : Oe2, V2 = C(e, "FORBID_TAGS") ? r({}, e.FORBID_TAGS, p) : M({}), le2 = C(e, "FORBID_ATTR") ? r({}, e.FORBID_ATTR, p) : M({}), z2 = C(e, "USE_PROFILES") ? e.USE_PROFILES : false, Ye = e.ALLOW_ARIA_ATTR !== false, he2 = e.ALLOW_DATA_ATTR !== false, Xe = e.ALLOW_UNKNOWN_PROTOCOLS || false, je2 = e.ALLOW_SELF_CLOSE_IN_ATTR !== false, k2 = e.SAFE_FOR_TEMPLATES || false, $2 = e.SAFE_FOR_XML !== false, v2 = e.WHOLE_DOCUMENT || false, H2 = e.RETURN_DOM || false, ce2 = e.RETURN_DOM_FRAGMENT || false, fe2 = e.RETURN_TRUSTED_TYPE || false, Se2 = e.FORCE_BODY || false, Ve = e.SANITIZE_DOM !== false, $e2 = e.SANITIZE_NAMED_PROPS || false, Re2 = e.KEEP_CONTENT !== false, q = e.IN_PLACE || false, Ge = e.ALLOWED_URI_REGEXP || ht, G2 = e.NAMESPACE || N2, pe2 = e.MATHML_TEXT_INTEGRATION_POINTS || pe2, Te2 = e.HTML_INTEGRATION_POINTS || Te2, u = e.CUSTOM_ELEMENT_HANDLING || ne(null), e.CUSTOM_ELEMENT_HANDLING && Je2(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (u.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && Je2(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (u.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (u.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), k2 && (he2 = false), ce2 && (H2 = true), z2 && (T2 = r({}, pt), d = ne(null), z2.html === true && (r(T2, mt), r(d, Tt)), z2.svg === true && (r(T2, xe), r(d, ve), r(d, de)), z2.svgFilters === true && (r(T2, Pe), r(d, ve), r(d, de)), z2.mathMl === true && (r(T2, ke), r(d, dt), r(d, de))), x.tagCheck = null, x.attributeCheck = null, e.ADD_TAGS && (typeof e.ADD_TAGS == "function" ? x.tagCheck = e.ADD_TAGS : (T2 === We && (T2 = M(T2)), r(T2, e.ADD_TAGS, p))), e.ADD_ATTR && (typeof e.ADD_ATTR == "function" ? x.attributeCheck = e.ADD_ATTR : (d === Be2 && (d = M(d)), r(d, e.ADD_ATTR, p))), e.ADD_URI_SAFE_ATTR && r(De2, e.ADD_URI_SAFE_ATTR, p), e.FORBID_CONTENTS && (I2 === Oe2 && (I2 = M(I2)), r(I2, e.FORBID_CONTENTS, p)), e.ADD_FORBID_CONTENTS && (I2 === Oe2 && (I2 = M(I2)), r(I2, e.ADD_FORBID_CONTENTS, p)), Re2 && (T2["#text"] = true), v2 && r(T2, ["html", "head", "body"]), T2.table && (r(T2, ["tbody"]), delete V2.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
83
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
84
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
85
|
+
g = e.TRUSTED_TYPES_POLICY, j2 = g.createHTML("");
|
|
86
|
+
} else g === void 0 && (g = un(oe, c)), g !== null && typeof j2 == "string" && (j2 = g.createHTML(""));
|
|
87
|
+
S && S(e), W2 = e;
|
|
88
|
+
}
|
|
89
|
+
}, Qe = r({}, [...xe, ...Pe, ...Qt]), et = r({}, [...ke, ...en]), Bt = function(e) {
|
|
90
|
+
let t = ie(e);
|
|
91
|
+
(!t || !t.tagName) && (t = { namespaceURI: G2, tagName: "template" });
|
|
92
|
+
let n = Ee(e.tagName), f = Ee(t.tagName);
|
|
93
|
+
return be2[e.namespaceURI] ? e.namespaceURI === me2 ? t.namespaceURI === N2 ? n === "svg" : t.namespaceURI === ue2 ? n === "svg" && (f === "annotation-xml" || pe2[f]) : !!Qe[n] : e.namespaceURI === ue2 ? t.namespaceURI === N2 ? n === "math" : t.namespaceURI === me2 ? n === "math" && Te2[f] : !!et[n] : e.namespaceURI === N2 ? t.namespaceURI === me2 && !Te2[f] || t.namespaceURI === ue2 && !pe2[f] ? false : !et[n] && (Ht[n] || !Qe[n]) : !!(K2 === "application/xhtml+xml" && be2[e.namespaceURI]) : false;
|
|
94
|
+
}, y2 = function(e) {
|
|
95
|
+
J(o.removed, { element: e });
|
|
96
|
+
try {
|
|
97
|
+
ie(e).removeChild(e);
|
|
98
|
+
} catch {
|
|
99
|
+
bt(e);
|
|
100
|
+
}
|
|
101
|
+
}, U = function(e, t) {
|
|
102
|
+
try {
|
|
103
|
+
J(o.removed, { attribute: t.getAttributeNode(e), from: t });
|
|
104
|
+
} catch {
|
|
105
|
+
J(o.removed, { attribute: null, from: t });
|
|
106
|
+
}
|
|
107
|
+
if (t.removeAttribute(e), e === "is") if (H2 || ce2) try {
|
|
108
|
+
y2(t);
|
|
109
|
+
} catch {
|
|
110
|
+
}
|
|
111
|
+
else try {
|
|
112
|
+
t.setAttribute(e, "");
|
|
113
|
+
} catch {
|
|
114
|
+
}
|
|
115
|
+
}, tt = function(e) {
|
|
116
|
+
let t = null, n = null;
|
|
117
|
+
if (Se2) e = "<remove></remove>" + e;
|
|
118
|
+
else {
|
|
119
|
+
let m2 = we(e, /^[\r\n\t ]+/);
|
|
120
|
+
n = m2 && m2[0];
|
|
121
|
+
}
|
|
122
|
+
K2 === "application/xhtml+xml" && G2 === N2 && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
123
|
+
let f = g ? g.createHTML(e) : e;
|
|
124
|
+
if (G2 === N2) try {
|
|
125
|
+
t = new Dt().parseFromString(f, K2);
|
|
126
|
+
} catch {
|
|
127
|
+
}
|
|
128
|
+
if (!t || !t.documentElement) {
|
|
129
|
+
t = ge2.createDocument(G2, "template", null);
|
|
130
|
+
try {
|
|
131
|
+
t.documentElement.innerHTML = Le2 ? j2 : f;
|
|
132
|
+
} catch {
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
let _2 = t.body || t.documentElement;
|
|
136
|
+
return e && n && _2.insertBefore(l.createTextNode(n), _2.childNodes[0] || null), G2 === N2 ? Mt.call(t, v2 ? "html" : "body")[0] : v2 ? t.documentElement : _2;
|
|
137
|
+
}, nt = function(e) {
|
|
138
|
+
return It.call(e.ownerDocument || e, e, Y2.SHOW_ELEMENT | Y2.SHOW_COMMENT | Y2.SHOW_TEXT | Y2.SHOW_PROCESSING_INSTRUCTION | Y2.SHOW_CDATA_SECTION, null);
|
|
139
|
+
}, Ce2 = function(e) {
|
|
140
|
+
return e instanceof Ot && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof Rt) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
141
|
+
}, Ie2 = function(e) {
|
|
142
|
+
return typeof _e2 == "function" && e instanceof _e2;
|
|
143
|
+
};
|
|
144
|
+
function w2(i, e, t) {
|
|
145
|
+
Z(i, (n) => {
|
|
146
|
+
n.call(o, e, t, W2);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
let ot = function(e) {
|
|
150
|
+
let t = null;
|
|
151
|
+
if (w2(h.beforeSanitizeElements, e, null), Ce2(e)) return y2(e), true;
|
|
152
|
+
let n = p(e.nodeName);
|
|
153
|
+
if (w2(h.uponSanitizeElement, e, { tagName: n, allowedTags: T2 }), $2 && e.hasChildNodes() && !Ie2(e.firstElementChild) && A(/<[/\w!]/g, e.innerHTML) && A(/<[/\w!]/g, e.textContent) || $2 && e.namespaceURI === N2 && n === "style" && Ie2(e.firstElementChild) || e.nodeType === te.progressingInstruction || $2 && e.nodeType === te.comment && A(/<[/\w]/g, e.data)) return y2(e), true;
|
|
154
|
+
if (V2[n] || !(x.tagCheck instanceof Function && x.tagCheck(n)) && !T2[n]) {
|
|
155
|
+
if (!V2[n] && at(n) && (u.tagNameCheck instanceof RegExp && A(u.tagNameCheck, n) || u.tagNameCheck instanceof Function && u.tagNameCheck(n))) return false;
|
|
156
|
+
if (Re2 && !I2[n]) {
|
|
157
|
+
let f = ie(e) || e.parentNode, _2 = Ct(e) || e.childNodes;
|
|
158
|
+
if (_2 && f) {
|
|
159
|
+
let m2 = _2.length;
|
|
160
|
+
for (let D2 = m2 - 1; D2 >= 0; --D2) {
|
|
161
|
+
let L2 = Lt(_2[D2], true);
|
|
162
|
+
L2.__removalCount = (e.__removalCount || 0) + 1, f.insertBefore(L2, yt(e));
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return y2(e), true;
|
|
167
|
+
}
|
|
168
|
+
return e instanceof He2 && !Bt(e) || (n === "noscript" || n === "noembed" || n === "noframes") && A(/<\/no(script|embed|frames)/i, e.innerHTML) ? (y2(e), true) : (k2 && e.nodeType === te.text && (t = e.textContent, Z([ae2, re2, se2], (f) => {
|
|
169
|
+
t = B(t, f, " ");
|
|
170
|
+
}), e.textContent !== t && (J(o.removed, { element: e.cloneNode() }), e.textContent = t)), w2(h.afterSanitizeElements, e, null), false);
|
|
171
|
+
}, it = function(e, t, n) {
|
|
172
|
+
if (le2[t] || Ve && (t === "id" || t === "name") && (n in l || n in Wt)) return false;
|
|
173
|
+
if (!(he2 && !le2[t] && A(xt, t))) {
|
|
174
|
+
if (!(Ye && A(Pt, t))) {
|
|
175
|
+
if (!(x.attributeCheck instanceof Function && x.attributeCheck(t, e))) {
|
|
176
|
+
if (!d[t] || le2[t]) {
|
|
177
|
+
if (!(at(e) && (u.tagNameCheck instanceof RegExp && A(u.tagNameCheck, e) || u.tagNameCheck instanceof Function && u.tagNameCheck(e)) && (u.attributeNameCheck instanceof RegExp && A(u.attributeNameCheck, t) || u.attributeNameCheck instanceof Function && u.attributeNameCheck(t, e)) || t === "is" && u.allowCustomizedBuiltInElements && (u.tagNameCheck instanceof RegExp && A(u.tagNameCheck, n) || u.tagNameCheck instanceof Function && u.tagNameCheck(n)))) return false;
|
|
178
|
+
} else if (!De2[t]) {
|
|
179
|
+
if (!A(Ge, B(n, ze, ""))) {
|
|
180
|
+
if (!((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && qt(n, "data:") === 0 && qe2[e])) {
|
|
181
|
+
if (!(Xe && !A(kt, B(n, ze, "")))) {
|
|
182
|
+
if (n) return false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return true;
|
|
191
|
+
}, at = function(e) {
|
|
192
|
+
return e !== "annotation-xml" && we(e, vt);
|
|
193
|
+
}, rt = function(e) {
|
|
194
|
+
w2(h.beforeSanitizeAttributes, e, null);
|
|
195
|
+
let { attributes: t } = e;
|
|
196
|
+
if (!t || Ce2(e)) return;
|
|
197
|
+
let n = { attrName: "", attrValue: "", keepAttr: true, allowedAttributes: d, forceKeepAttr: void 0 }, f = t.length;
|
|
198
|
+
for (; f--; ) {
|
|
199
|
+
let _2 = t[f], { name: m2, namespaceURI: D2, value: L2 } = _2, P2 = p(m2), Ne2 = L2, E = m2 === "value" ? Ne2 : Kt(Ne2);
|
|
200
|
+
if (n.attrName = P2, n.attrValue = E, n.keepAttr = true, n.forceKeepAttr = void 0, w2(h.uponSanitizeAttribute, e, n), E = n.attrValue, $e2 && (P2 === "id" || P2 === "name") && (U(m2, e), E = Ut + E), $2 && A(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, E)) {
|
|
201
|
+
U(m2, e);
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
if (P2 === "attributename" && we(E, "href")) {
|
|
205
|
+
U(m2, e);
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (n.forceKeepAttr) continue;
|
|
209
|
+
if (!n.keepAttr) {
|
|
210
|
+
U(m2, e);
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
if (!je2 && A(/\/>/i, E)) {
|
|
214
|
+
U(m2, e);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
k2 && Z([ae2, re2, se2], (ct) => {
|
|
218
|
+
E = B(E, ct, " ");
|
|
219
|
+
});
|
|
220
|
+
let lt = p(e.nodeName);
|
|
221
|
+
if (!it(lt, P2, E)) {
|
|
222
|
+
U(m2, e);
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
if (g && typeof oe == "object" && typeof oe.getAttributeType == "function" && !D2) switch (oe.getAttributeType(lt, P2)) {
|
|
226
|
+
case "TrustedHTML": {
|
|
227
|
+
E = g.createHTML(E);
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
case "TrustedScriptURL": {
|
|
231
|
+
E = g.createScriptURL(E);
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (E !== Ne2) try {
|
|
236
|
+
D2 ? e.setAttributeNS(D2, m2, E) : e.setAttribute(m2, E), Ce2(e) ? y2(e) : ut(o.removed);
|
|
237
|
+
} catch {
|
|
238
|
+
U(m2, e);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
w2(h.afterSanitizeAttributes, e, null);
|
|
242
|
+
}, st = function(e) {
|
|
243
|
+
let t = null, n = nt(e);
|
|
244
|
+
for (w2(h.beforeSanitizeShadowDOM, e, null); t = n.nextNode(); ) w2(h.uponSanitizeShadowNode, t, null), ot(t), rt(t), t.content instanceof O2 && st(t.content);
|
|
245
|
+
w2(h.afterSanitizeShadowDOM, e, null);
|
|
246
|
+
};
|
|
247
|
+
return o.sanitize = function(i) {
|
|
248
|
+
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = null, n = null, f = null, _2 = null;
|
|
249
|
+
if (Le2 = !i, Le2 && (i = "<!-->"), typeof i != "string" && !Ie2(i)) if (typeof i.toString == "function") {
|
|
250
|
+
if (i = i.toString(), typeof i != "string") throw Q("dirty is not a string, aborting");
|
|
251
|
+
} else throw Q("toString is not a function");
|
|
252
|
+
if (!o.isSupported) return i;
|
|
253
|
+
if (Ae2 || ye2(e), o.removed = [], typeof i == "string" && (q = false), q) {
|
|
254
|
+
if (i.nodeName) {
|
|
255
|
+
let L2 = p(i.nodeName);
|
|
256
|
+
if (!T2[L2] || V2[L2]) throw Q("root node is forbidden and cannot be sanitized in-place");
|
|
257
|
+
}
|
|
258
|
+
} else if (i instanceof _e2) t = tt("<!---->"), n = t.ownerDocument.importNode(i, true), n.nodeType === te.element && n.nodeName === "BODY" || n.nodeName === "HTML" ? t = n : t.appendChild(n);
|
|
259
|
+
else {
|
|
260
|
+
if (!H2 && !k2 && !v2 && i.indexOf("<") === -1) return g && fe2 ? g.createHTML(i) : i;
|
|
261
|
+
if (t = tt(i), !t) return H2 ? null : fe2 ? j2 : "";
|
|
262
|
+
}
|
|
263
|
+
t && Se2 && y2(t.firstChild);
|
|
264
|
+
let m2 = nt(q ? i : t);
|
|
265
|
+
for (; f = m2.nextNode(); ) ot(f), rt(f), f.content instanceof O2 && st(f.content);
|
|
266
|
+
if (q) return i;
|
|
267
|
+
if (H2) {
|
|
268
|
+
if (k2) {
|
|
269
|
+
t.normalize();
|
|
270
|
+
let L2 = t.innerHTML;
|
|
271
|
+
Z([ae2, re2, se2], (P2) => {
|
|
272
|
+
L2 = B(L2, P2, " ");
|
|
273
|
+
}), t.innerHTML = L2;
|
|
274
|
+
}
|
|
275
|
+
if (ce2) for (_2 = Nt.call(t.ownerDocument); t.firstChild; ) _2.appendChild(t.firstChild);
|
|
276
|
+
else _2 = t;
|
|
277
|
+
return (d.shadowroot || d.shadowrootmode) && (_2 = wt.call(a, _2, true)), _2;
|
|
278
|
+
}
|
|
279
|
+
let D2 = v2 ? t.outerHTML : t.innerHTML;
|
|
280
|
+
return v2 && T2["!doctype"] && t.ownerDocument && t.ownerDocument.doctype && t.ownerDocument.doctype.name && A(At, t.ownerDocument.doctype.name) && (D2 = "<!DOCTYPE " + t.ownerDocument.doctype.name + `>
|
|
281
|
+
` + D2), k2 && Z([ae2, re2, se2], (L2) => {
|
|
282
|
+
D2 = B(D2, L2, " ");
|
|
283
|
+
}), g && fe2 ? g.createHTML(D2) : D2;
|
|
284
|
+
}, o.setConfig = function() {
|
|
285
|
+
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
286
|
+
ye2(i), Ae2 = true;
|
|
287
|
+
}, o.clearConfig = function() {
|
|
288
|
+
W2 = null, Ae2 = false;
|
|
289
|
+
}, o.isValidAttribute = function(i, e, t) {
|
|
290
|
+
W2 || ye2({});
|
|
291
|
+
let n = p(i), f = p(e);
|
|
292
|
+
return it(n, f, t);
|
|
293
|
+
}, o.addHook = function(i, e) {
|
|
294
|
+
typeof e == "function" && J(h[i], e);
|
|
295
|
+
}, o.removeHook = function(i, e) {
|
|
296
|
+
if (e !== void 0) {
|
|
297
|
+
let t = Vt(h[i], e);
|
|
298
|
+
return t === -1 ? void 0 : $t(h[i], t, 1)[0];
|
|
299
|
+
}
|
|
300
|
+
return ut(h[i]);
|
|
301
|
+
}, o.removeHooks = function(i) {
|
|
302
|
+
h[i] = [];
|
|
303
|
+
}, o.removeAllHooks = function() {
|
|
304
|
+
h = _t();
|
|
305
|
+
}, o;
|
|
306
|
+
}
|
|
307
|
+
var gt, ft, Yt, Xt, jt, S, b, ne, Ue, Fe, Z, Vt, ut, J, $t, Ee, Me, we, B, qt, Kt, C, A, Q, mt, xe, Pe, Qt, ke, en, pt, Tt, ve, dt, de, tn, nn, on, an, rn, ht, sn, ln, At, cn, Et, te, fn, un, _t, mn;
|
|
308
|
+
var init_VSS64DLN = __esm({
|
|
309
|
+
"iife:/home/runner/work/transportr/transportr/dist/VSS64DLN.js"() {
|
|
310
|
+
({ entries: gt, setPrototypeOf: ft, isFrozen: Yt, getPrototypeOf: Xt, getOwnPropertyDescriptor: jt } = Object);
|
|
311
|
+
({ freeze: S, seal: b, create: ne } = Object);
|
|
312
|
+
({ apply: Ue, construct: Fe } = typeof Reflect < "u" && Reflect);
|
|
313
|
+
S || (S = function(o) {
|
|
314
|
+
return o;
|
|
315
|
+
});
|
|
316
|
+
b || (b = function(o) {
|
|
317
|
+
return o;
|
|
318
|
+
});
|
|
319
|
+
Ue || (Ue = function(o, l) {
|
|
320
|
+
for (var a = arguments.length, c = new Array(a > 2 ? a - 2 : 0), O2 = 2; O2 < a; O2++) c[O2 - 2] = arguments[O2];
|
|
321
|
+
return o.apply(l, c);
|
|
322
|
+
});
|
|
323
|
+
Fe || (Fe = function(o) {
|
|
324
|
+
for (var l = arguments.length, a = new Array(l > 1 ? l - 1 : 0), c = 1; c < l; c++) a[c - 1] = arguments[c];
|
|
325
|
+
return new o(...a);
|
|
326
|
+
});
|
|
327
|
+
Z = R(Array.prototype.forEach);
|
|
328
|
+
Vt = R(Array.prototype.lastIndexOf);
|
|
329
|
+
ut = R(Array.prototype.pop);
|
|
330
|
+
J = R(Array.prototype.push);
|
|
331
|
+
$t = R(Array.prototype.splice);
|
|
332
|
+
Ee = R(String.prototype.toLowerCase);
|
|
333
|
+
Me = R(String.prototype.toString);
|
|
334
|
+
we = R(String.prototype.match);
|
|
335
|
+
B = R(String.prototype.replace);
|
|
336
|
+
qt = R(String.prototype.indexOf);
|
|
337
|
+
Kt = R(String.prototype.trim);
|
|
338
|
+
C = R(Object.prototype.hasOwnProperty);
|
|
339
|
+
A = R(RegExp.prototype.test);
|
|
340
|
+
Q = Zt(TypeError);
|
|
341
|
+
mt = S(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
|
|
342
|
+
xe = S(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
|
|
343
|
+
Pe = S(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]);
|
|
344
|
+
Qt = S(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
|
|
345
|
+
ke = S(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
|
|
346
|
+
en = S(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
|
|
347
|
+
pt = S(["#text"]);
|
|
348
|
+
Tt = S(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]);
|
|
349
|
+
ve = S(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
|
|
350
|
+
dt = S(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
|
|
351
|
+
de = S(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
|
|
352
|
+
tn = b(/\{\{[\w\W]*|[\w\W]*\}\}/gm);
|
|
353
|
+
nn = b(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
354
|
+
on = b(/\$\{[\w\W]*/gm);
|
|
355
|
+
an = b(/^data-[\-\w.\u00B7-\uFFFF]+$/);
|
|
356
|
+
rn = b(/^aria-[\-\w]+$/);
|
|
357
|
+
ht = b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i);
|
|
358
|
+
sn = b(/^(?:\w+script|data):/i);
|
|
359
|
+
ln = b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g);
|
|
360
|
+
At = b(/^html$/i);
|
|
361
|
+
cn = b(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
362
|
+
Et = Object.freeze({ __proto__: null, ARIA_ATTR: rn, ATTR_WHITESPACE: ln, CUSTOM_ELEMENT: cn, DATA_ATTR: an, DOCTYPE_NAME: At, ERB_EXPR: nn, IS_ALLOWED_URI: ht, IS_SCRIPT_OR_DATA: sn, MUSTACHE_EXPR: tn, TMPLIT_EXPR: on });
|
|
363
|
+
te = { element: 1, text: 3, progressingInstruction: 7, comment: 8, document: 9 };
|
|
364
|
+
fn = function() {
|
|
365
|
+
return typeof window > "u" ? null : window;
|
|
366
|
+
};
|
|
367
|
+
un = function(o, l) {
|
|
368
|
+
if (typeof o != "object" || typeof o.createPolicy != "function") return null;
|
|
369
|
+
let a = null, c = "data-tt-policy-suffix";
|
|
370
|
+
l && l.hasAttribute(c) && (a = l.getAttribute(c));
|
|
371
|
+
let O2 = "dompurify" + (a ? "#" + a : "");
|
|
372
|
+
try {
|
|
373
|
+
return o.createPolicy(O2, { createHTML(F2) {
|
|
374
|
+
return F2;
|
|
375
|
+
}, createScriptURL(F2) {
|
|
376
|
+
return F2;
|
|
377
|
+
} });
|
|
378
|
+
} catch {
|
|
379
|
+
return console.warn("TrustedTypes policy " + O2 + " could not be created."), null;
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
_t = function() {
|
|
383
|
+
return { afterSanitizeAttributes: [], afterSanitizeElements: [], afterSanitizeShadowDOM: [], beforeSanitizeAttributes: [], beforeSanitizeElements: [], beforeSanitizeShadowDOM: [], uponSanitizeAttribute: [], uponSanitizeElement: [], uponSanitizeShadowNode: [] };
|
|
384
|
+
};
|
|
385
|
+
mn = St();
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
// iife:/home/runner/work/transportr/transportr/dist/transportr.js
|
|
390
|
+
var M2 = /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/u;
|
|
391
|
+
var Me2 = /(["\\])/ug;
|
|
392
|
+
var Ie = /^[\t\u0020-\u007E\u0080-\u00FF]*$/u;
|
|
393
|
+
var ae = class ue extends Map {
|
|
394
|
+
constructor(e = []) {
|
|
395
|
+
super(e);
|
|
396
|
+
}
|
|
397
|
+
static isValid(e, t) {
|
|
398
|
+
return M2.test(e) && Ie.test(t);
|
|
399
|
+
}
|
|
400
|
+
get(e) {
|
|
401
|
+
return super.get(e.toLowerCase());
|
|
402
|
+
}
|
|
403
|
+
has(e) {
|
|
404
|
+
return super.has(e.toLowerCase());
|
|
405
|
+
}
|
|
406
|
+
set(e, t) {
|
|
407
|
+
if (!ue.isValid(e, t)) throw new Error(`Invalid media type parameter name/value: ${e}/${t}`);
|
|
408
|
+
return super.set(e.toLowerCase(), t), this;
|
|
409
|
+
}
|
|
410
|
+
delete(e) {
|
|
411
|
+
return super.delete(e.toLowerCase());
|
|
412
|
+
}
|
|
413
|
+
toString() {
|
|
414
|
+
return Array.from(this).map(([e, t]) => `;${e}=${!t || !M2.test(t) ? `"${t.replace(Me2, "\\$1")}"` : t}`).join("");
|
|
415
|
+
}
|
|
416
|
+
get [Symbol.toStringTag]() {
|
|
417
|
+
return "MediaTypeParameters";
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
var Le = /* @__PURE__ */ new Set([" ", " ", `
|
|
421
|
+
`, "\r"]);
|
|
422
|
+
var Ne = /[ \t\n\r]+$/u;
|
|
423
|
+
var De = /^[ \t\n\r]+|[ \t\n\r]+$/ug;
|
|
424
|
+
var _e = class O {
|
|
425
|
+
static parse(e) {
|
|
426
|
+
e = e.replace(De, "");
|
|
427
|
+
let t = 0, [n, r2] = O.collect(e, t, ["/"]);
|
|
428
|
+
if (t = r2, !n.length || t >= e.length || !M2.test(n)) throw new TypeError(O.generateErrorMessage("type", n));
|
|
429
|
+
++t;
|
|
430
|
+
let [o, i] = O.collect(e, t, [";"], true, true);
|
|
431
|
+
if (t = i, !o.length || !M2.test(o)) throw new TypeError(O.generateErrorMessage("subtype", o));
|
|
432
|
+
let a = new ae();
|
|
433
|
+
for (; t < e.length; ) {
|
|
434
|
+
for (++t; Le.has(e[t]); ) ++t;
|
|
435
|
+
let u;
|
|
436
|
+
if ([u, t] = O.collect(e, t, [";", "="], false), t >= e.length || e[t] === ";") continue;
|
|
437
|
+
++t;
|
|
438
|
+
let p;
|
|
439
|
+
if (e[t] === '"') for ([p, t] = O.collectHttpQuotedString(e, t); t < e.length && e[t] !== ";"; ) ++t;
|
|
440
|
+
else if ([p, t] = O.collect(e, t, [";"], false, true), !p) continue;
|
|
441
|
+
u && ae.isValid(u, p) && !a.has(u) && a.set(u, p);
|
|
442
|
+
}
|
|
443
|
+
return { type: n, subtype: o, parameters: a };
|
|
444
|
+
}
|
|
445
|
+
get [Symbol.toStringTag]() {
|
|
446
|
+
return "MediaTypeParser";
|
|
447
|
+
}
|
|
448
|
+
static collect(e, t, n, r2 = true, o = false) {
|
|
449
|
+
let i = "";
|
|
450
|
+
for (let { length: a } = e; t < a && !n.includes(e[t]); t++) i += e[t];
|
|
451
|
+
return r2 && (i = i.toLowerCase()), o && (i = i.replace(Ne, "")), [i, t];
|
|
452
|
+
}
|
|
453
|
+
static collectHttpQuotedString(e, t) {
|
|
454
|
+
let n = "";
|
|
455
|
+
for (let r2 = e.length, o; ++t < r2 && (o = e[t]) !== '"'; ) n += o == "\\" && ++t < r2 ? e[t] : o;
|
|
456
|
+
return [n, t];
|
|
457
|
+
}
|
|
458
|
+
static generateErrorMessage(e, t) {
|
|
459
|
+
return `Invalid ${e} "${t}": only HTTP token code points are valid.`;
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
var T = class le {
|
|
463
|
+
_type;
|
|
464
|
+
_subtype;
|
|
465
|
+
_parameters;
|
|
466
|
+
constructor(e, t = {}) {
|
|
467
|
+
if (t === null || typeof t != "object" || Array.isArray(t)) throw new TypeError("The parameters argument must be an object");
|
|
468
|
+
({ type: this._type, subtype: this._subtype, parameters: this._parameters } = _e.parse(e));
|
|
469
|
+
for (let [n, r2] of Object.entries(t)) this._parameters.set(n, r2);
|
|
470
|
+
}
|
|
471
|
+
static parse(e) {
|
|
472
|
+
try {
|
|
473
|
+
return new le(e);
|
|
474
|
+
} catch {
|
|
475
|
+
}
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
478
|
+
get type() {
|
|
479
|
+
return this._type;
|
|
480
|
+
}
|
|
481
|
+
get subtype() {
|
|
482
|
+
return this._subtype;
|
|
483
|
+
}
|
|
484
|
+
get essence() {
|
|
485
|
+
return `${this._type}/${this._subtype}`;
|
|
486
|
+
}
|
|
487
|
+
get parameters() {
|
|
488
|
+
return this._parameters;
|
|
489
|
+
}
|
|
490
|
+
matches(e) {
|
|
491
|
+
return typeof e == "string" ? this.essence.includes(e) : this._type === e._type && this._subtype === e._subtype;
|
|
492
|
+
}
|
|
493
|
+
toString() {
|
|
494
|
+
return `${this.essence}${this._parameters.toString()}`;
|
|
495
|
+
}
|
|
496
|
+
get [Symbol.toStringTag]() {
|
|
497
|
+
return "MediaType";
|
|
498
|
+
}
|
|
499
|
+
};
|
|
500
|
+
var je = class extends Map {
|
|
501
|
+
set(s2, e) {
|
|
502
|
+
return super.set(s2, e instanceof Set ? e : (super.get(s2) ?? /* @__PURE__ */ new Set()).add(e)), this;
|
|
503
|
+
}
|
|
504
|
+
getOrInsert(s2, e) {
|
|
505
|
+
return this.has(s2) ? super.get(s2) : (super.set(s2, e instanceof Set ? e : (super.get(s2) ?? /* @__PURE__ */ new Set()).add(e)), e);
|
|
506
|
+
}
|
|
507
|
+
getOrInsertComputed(s2, e) {
|
|
508
|
+
if (this.has(s2)) return super.get(s2);
|
|
509
|
+
let t = e(s2);
|
|
510
|
+
return super.set(s2, t instanceof Set ? t : (super.get(s2) ?? /* @__PURE__ */ new Set()).add(t)), t;
|
|
511
|
+
}
|
|
512
|
+
find(s2, e) {
|
|
513
|
+
let t = this.get(s2);
|
|
514
|
+
if (t !== void 0) return Array.from(t).find(e);
|
|
515
|
+
}
|
|
516
|
+
hasValue(s2, e) {
|
|
517
|
+
let t = super.get(s2);
|
|
518
|
+
return t ? t.has(e) : false;
|
|
519
|
+
}
|
|
520
|
+
deleteValue(s2, e) {
|
|
521
|
+
if (e === void 0) return this.delete(s2);
|
|
522
|
+
let t = super.get(s2);
|
|
523
|
+
if (t) {
|
|
524
|
+
let n = t.delete(e);
|
|
525
|
+
return t.size === 0 && super.delete(s2), n;
|
|
526
|
+
}
|
|
527
|
+
return false;
|
|
528
|
+
}
|
|
529
|
+
get [Symbol.toStringTag]() {
|
|
530
|
+
return "SetMultiMap";
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
var Fe2 = class {
|
|
534
|
+
context;
|
|
535
|
+
eventHandler;
|
|
536
|
+
constructor(s2, e) {
|
|
537
|
+
this.context = s2, this.eventHandler = e;
|
|
538
|
+
}
|
|
539
|
+
handle(s2, e) {
|
|
540
|
+
this.eventHandler.call(this.context, s2, e);
|
|
541
|
+
}
|
|
542
|
+
get [Symbol.toStringTag]() {
|
|
543
|
+
return "ContextEventHandler";
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
var Je = class {
|
|
547
|
+
_eventName;
|
|
548
|
+
_contextEventHandler;
|
|
549
|
+
constructor(s2, e) {
|
|
550
|
+
this._eventName = s2, this._contextEventHandler = e;
|
|
551
|
+
}
|
|
552
|
+
get eventName() {
|
|
553
|
+
return this._eventName;
|
|
554
|
+
}
|
|
555
|
+
get contextEventHandler() {
|
|
556
|
+
return this._contextEventHandler;
|
|
557
|
+
}
|
|
558
|
+
get [Symbol.toStringTag]() {
|
|
559
|
+
return "Subscription";
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
var I = class {
|
|
563
|
+
subscribers = new je();
|
|
564
|
+
errorHandler;
|
|
565
|
+
setErrorHandler(s2) {
|
|
566
|
+
this.errorHandler = s2;
|
|
567
|
+
}
|
|
568
|
+
subscribe(s2, e, t = e, n) {
|
|
569
|
+
if (this.validateEventName(s2), n?.once) {
|
|
570
|
+
let i = e;
|
|
571
|
+
e = (a, u) => {
|
|
572
|
+
i.call(t, a, u), this.unsubscribe(o);
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
let r2 = new Fe2(t, e);
|
|
576
|
+
this.subscribers.set(s2, r2);
|
|
577
|
+
let o = new Je(s2, r2);
|
|
578
|
+
return o;
|
|
579
|
+
}
|
|
580
|
+
unsubscribe({ eventName: s2, contextEventHandler: e }) {
|
|
581
|
+
let t = this.subscribers.get(s2) ?? /* @__PURE__ */ new Set(), n = t.delete(e);
|
|
582
|
+
return n && t.size === 0 && this.subscribers.delete(s2), n;
|
|
583
|
+
}
|
|
584
|
+
publish(s2, e = new CustomEvent(s2), t) {
|
|
585
|
+
this.validateEventName(s2), this.subscribers.get(s2)?.forEach((n) => {
|
|
586
|
+
try {
|
|
587
|
+
n.handle(e, t);
|
|
588
|
+
} catch (r2) {
|
|
589
|
+
this.errorHandler ? this.errorHandler(r2, s2, e, t) : console.error(`Error in event handler for '${s2}':`, r2);
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
isSubscribed({ eventName: s2, contextEventHandler: e }) {
|
|
594
|
+
return this.subscribers.get(s2)?.has(e) ?? false;
|
|
595
|
+
}
|
|
596
|
+
validateEventName(s2) {
|
|
597
|
+
if (!s2 || typeof s2 != "string") throw new TypeError("Event name must be a non-empty string");
|
|
598
|
+
if (s2.trim() !== s2) throw new Error("Event name cannot have leading or trailing whitespace");
|
|
599
|
+
}
|
|
600
|
+
destroy() {
|
|
601
|
+
this.subscribers.clear();
|
|
602
|
+
}
|
|
603
|
+
get [Symbol.toStringTag]() {
|
|
604
|
+
return "Subscribr";
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
var B2 = class extends Error {
|
|
608
|
+
_entity;
|
|
609
|
+
responseStatus;
|
|
610
|
+
_url;
|
|
611
|
+
_method;
|
|
612
|
+
_timing;
|
|
613
|
+
constructor(e, { message: t, cause: n, entity: r2, url: o, method: i, timing: a } = {}) {
|
|
614
|
+
super(t, { cause: n }), this._entity = r2, this.responseStatus = e, this._url = o, this._method = i, this._timing = a;
|
|
615
|
+
}
|
|
616
|
+
get entity() {
|
|
617
|
+
return this._entity;
|
|
618
|
+
}
|
|
619
|
+
get statusCode() {
|
|
620
|
+
return this.responseStatus.code;
|
|
621
|
+
}
|
|
622
|
+
get statusText() {
|
|
623
|
+
return this.responseStatus?.text;
|
|
624
|
+
}
|
|
625
|
+
get url() {
|
|
626
|
+
return this._url;
|
|
627
|
+
}
|
|
628
|
+
get method() {
|
|
629
|
+
return this._method;
|
|
630
|
+
}
|
|
631
|
+
get timing() {
|
|
632
|
+
return this._timing;
|
|
633
|
+
}
|
|
634
|
+
get name() {
|
|
635
|
+
return "HttpError";
|
|
636
|
+
}
|
|
637
|
+
get [Symbol.toStringTag]() {
|
|
638
|
+
return this.name;
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
var w = class {
|
|
642
|
+
_code;
|
|
643
|
+
_text;
|
|
644
|
+
constructor(e, t) {
|
|
645
|
+
this._code = e, this._text = t;
|
|
646
|
+
}
|
|
647
|
+
get code() {
|
|
648
|
+
return this._code;
|
|
649
|
+
}
|
|
650
|
+
get text() {
|
|
651
|
+
return this._text;
|
|
652
|
+
}
|
|
653
|
+
get [Symbol.toStringTag]() {
|
|
654
|
+
return "ResponseStatus";
|
|
655
|
+
}
|
|
656
|
+
toString() {
|
|
657
|
+
return `${this._code} ${this._text}`;
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
var v = { charset: "utf-8" };
|
|
661
|
+
var de2 = /\/$/;
|
|
662
|
+
var ce = "XSRF-TOKEN";
|
|
663
|
+
var pe = "X-XSRF-TOKEN";
|
|
664
|
+
var m = { PNG: new T("image/png"), TEXT: new T("text/plain", v), JSON: new T("application/json", v), HTML: new T("text/html", v), JAVA_SCRIPT: new T("text/javascript", v), CSS: new T("text/css", v), XML: new T("application/xml", v), BIN: new T("application/octet-stream"), EVENT_STREAM: new T("text/event-stream", v), NDJSON: new T("application/x-ndjson", v) };
|
|
665
|
+
var G = m.JSON.toString();
|
|
666
|
+
var X = globalThis.location?.origin ?? "http://localhost";
|
|
667
|
+
var fe = { DEFAULT: "default", FORCE_CACHE: "force-cache", NO_CACHE: "no-cache", NO_STORE: "no-store", ONLY_IF_CACHED: "only-if-cached", RELOAD: "reload" };
|
|
668
|
+
var b2 = { CONFIGURED: "configured", SUCCESS: "success", ERROR: "error", ABORTED: "aborted", TIMEOUT: "timeout", RETRY: "retry", COMPLETE: "complete", ALL_COMPLETE: "all-complete" };
|
|
669
|
+
var P = { ABORT: "abort", TIMEOUT: "timeout" };
|
|
670
|
+
var H = { ABORT: "AbortError", TIMEOUT: "TimeoutError" };
|
|
671
|
+
var k = { once: true, passive: true };
|
|
672
|
+
var L = () => new CustomEvent(P.ABORT, { detail: { cause: H.ABORT } });
|
|
673
|
+
var Re = () => new CustomEvent(P.TIMEOUT, { detail: { cause: H.TIMEOUT } });
|
|
674
|
+
var he = ["POST", "PUT", "PATCH", "DELETE"];
|
|
675
|
+
var ge = new w(500, "Internal Server Error");
|
|
676
|
+
var me = new w(499, "Aborted");
|
|
677
|
+
var ye = new w(504, "Request Timeout");
|
|
678
|
+
var V = [408, 413, 429, 500, 502, 503, 504];
|
|
679
|
+
var z = ["GET", "PUT", "HEAD", "DELETE", "OPTIONS"];
|
|
680
|
+
var N = 300;
|
|
681
|
+
var D = 2;
|
|
682
|
+
var _ = class {
|
|
683
|
+
abortSignal;
|
|
684
|
+
abortController = new AbortController();
|
|
685
|
+
events = /* @__PURE__ */ new Map();
|
|
686
|
+
constructor({ signal: e, timeout: t = 1 / 0 } = {}) {
|
|
687
|
+
if (t < 0) throw new RangeError("The timeout cannot be negative");
|
|
688
|
+
let n = [this.abortController.signal];
|
|
689
|
+
e != null && n.push(e), t !== 1 / 0 && n.push(AbortSignal.timeout(t)), (this.abortSignal = AbortSignal.any(n)).addEventListener(P.ABORT, this, k);
|
|
690
|
+
}
|
|
691
|
+
handleEvent({ target: { reason: e } }) {
|
|
692
|
+
this.abortController.signal.aborted || e instanceof DOMException && e.name === H.TIMEOUT && this.abortSignal.dispatchEvent(Re());
|
|
693
|
+
}
|
|
694
|
+
get signal() {
|
|
695
|
+
return this.abortSignal;
|
|
696
|
+
}
|
|
697
|
+
onAbort(e) {
|
|
698
|
+
return this.addEventListener(P.ABORT, e);
|
|
699
|
+
}
|
|
700
|
+
onTimeout(e) {
|
|
701
|
+
return this.addEventListener(P.TIMEOUT, e);
|
|
702
|
+
}
|
|
703
|
+
abort(e = L()) {
|
|
704
|
+
this.abortController.abort(e.detail?.cause);
|
|
705
|
+
}
|
|
706
|
+
destroy() {
|
|
707
|
+
this.abortSignal.removeEventListener(P.ABORT, this, k);
|
|
708
|
+
for (let [e, t] of this.events) this.abortSignal.removeEventListener(t, e, k);
|
|
709
|
+
return this.events.clear(), this;
|
|
710
|
+
}
|
|
711
|
+
addEventListener(e, t) {
|
|
712
|
+
return this.abortSignal.addEventListener(e, t, k), this.events.set(t, e), this;
|
|
713
|
+
}
|
|
714
|
+
get [Symbol.toStringTag]() {
|
|
715
|
+
return "SignalController";
|
|
716
|
+
}
|
|
717
|
+
};
|
|
718
|
+
var j;
|
|
719
|
+
var W;
|
|
720
|
+
var F = () => j || (j = (typeof document > "u" || typeof DOMParser > "u" || typeof DocumentFragment > "u" ? import("jsdom").then(({ JSDOM: e }) => {
|
|
721
|
+
let { window: t } = new e("<!DOCTYPE html><html><head></head><body></body></html>", { url: "http://localhost" });
|
|
722
|
+
globalThis.window = t, Object.assign(globalThis, { document: t.document, DOMParser: t.DOMParser, DocumentFragment: t.DocumentFragment });
|
|
723
|
+
}).catch(() => {
|
|
724
|
+
throw j = void 0, new Error("jsdom is required for HTML/XML/DOM features in Node.js environments. Install it with: npm install jsdom");
|
|
725
|
+
}) : Promise.resolve()).then(() => Promise.resolve().then(() => (init_VSS64DLN(), VSS64DLN_exports))).then(({ default: e }) => {
|
|
726
|
+
W = e;
|
|
727
|
+
}));
|
|
728
|
+
var be = async (s2, e) => (await F(), new DOMParser().parseFromString(W.sanitize(await s2.text()), e));
|
|
729
|
+
var K = async (s2, e) => {
|
|
730
|
+
await F();
|
|
731
|
+
let t = URL.createObjectURL(await s2.blob());
|
|
732
|
+
try {
|
|
733
|
+
return new Promise((n, r2) => e(t, n, r2));
|
|
734
|
+
} finally {
|
|
735
|
+
URL.revokeObjectURL(t);
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
var Te = async (s2) => await s2.text();
|
|
739
|
+
var Y = (s2) => K(s2, (e, t, n) => {
|
|
740
|
+
let r2 = document.createElement("script");
|
|
741
|
+
Object.assign(r2, { src: e, type: "text/javascript", async: true }), r2.onload = () => {
|
|
742
|
+
document.head.removeChild(r2), t();
|
|
743
|
+
}, r2.onerror = () => {
|
|
744
|
+
document.head.removeChild(r2), n(new Error("Script failed to load"));
|
|
745
|
+
}, document.head.appendChild(r2);
|
|
746
|
+
});
|
|
747
|
+
var Q2 = (s2) => K(s2, (e, t, n) => {
|
|
748
|
+
let r2 = document.createElement("link");
|
|
749
|
+
Object.assign(r2, { href: e, type: "text/css", rel: "stylesheet" }), r2.onload = () => t(), r2.onerror = () => {
|
|
750
|
+
document.head.removeChild(r2), n(new Error("Stylesheet load failed"));
|
|
751
|
+
}, document.head.appendChild(r2);
|
|
752
|
+
});
|
|
753
|
+
var Z2 = async (s2) => await s2.json();
|
|
754
|
+
var Ee2 = async (s2) => await s2.blob();
|
|
755
|
+
var ee2 = (s2) => K(s2, (e, t, n) => {
|
|
756
|
+
let r2 = new Image();
|
|
757
|
+
r2.onload = () => t(r2), r2.onerror = () => n(new Error("Image failed to load")), r2.src = e;
|
|
758
|
+
});
|
|
759
|
+
var Se = async (s2) => await s2.arrayBuffer();
|
|
760
|
+
var te2 = async (s2) => Promise.resolve(s2.body);
|
|
761
|
+
var se = async (s2) => be(s2, "application/xml");
|
|
762
|
+
var ne2 = async (s2) => be(s2, "text/html");
|
|
763
|
+
var Oe = async (s2) => (await F(), document.createRange().createContextualFragment(W.sanitize(await s2.text())));
|
|
764
|
+
var we2 = async (s2) => (await F(), document.createRange().createContextualFragment(await s2.text()));
|
|
765
|
+
async function* ve2(s2, e, t) {
|
|
766
|
+
let n = s2.getReader(), r2 = new TextDecoder(), o = "";
|
|
767
|
+
try {
|
|
768
|
+
for (; ; ) {
|
|
769
|
+
let i;
|
|
770
|
+
for (; (i = o.indexOf(e)) !== -1; ) yield o.slice(0, i), o = o.slice(i + e.length);
|
|
771
|
+
let { done: a, value: u } = await n.read();
|
|
772
|
+
if (a) break;
|
|
773
|
+
o += r2.decode(u, { stream: true });
|
|
774
|
+
}
|
|
775
|
+
if (t) {
|
|
776
|
+
let i = (o + r2.decode()).trim();
|
|
777
|
+
i && (yield i);
|
|
778
|
+
}
|
|
779
|
+
} finally {
|
|
780
|
+
await n.cancel();
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
var $e = (s2) => {
|
|
784
|
+
let e = "message", t = "", n, r2 = [], o = s2.split(`
|
|
785
|
+
`);
|
|
786
|
+
for (let i = 0, a = o.length; i < a; i++) {
|
|
787
|
+
let u = o[i];
|
|
788
|
+
if (u.charCodeAt(0) === 58) continue;
|
|
789
|
+
let p = u.indexOf(":"), R2, d;
|
|
790
|
+
switch (p === -1 ? (R2 = u, d = "") : (R2 = u.slice(0, p), d = u.charCodeAt(p + 1) === 32 ? u.slice(p + 2) : u.slice(p + 1)), R2) {
|
|
791
|
+
case "event":
|
|
792
|
+
e = d;
|
|
793
|
+
break;
|
|
794
|
+
case "data":
|
|
795
|
+
r2.push(d);
|
|
796
|
+
break;
|
|
797
|
+
case "id":
|
|
798
|
+
t = d;
|
|
799
|
+
break;
|
|
800
|
+
case "retry": {
|
|
801
|
+
let h = parseInt(d, 10);
|
|
802
|
+
isNaN(h) || (n = h);
|
|
803
|
+
break;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
return r2.length > 0 || e !== "message" ? { event: e, data: r2.join(`
|
|
808
|
+
`), id: t, retry: n } : void 0;
|
|
809
|
+
};
|
|
810
|
+
var qe = (s2) => ({ async *[Symbol.asyncIterator]() {
|
|
811
|
+
for await (let e of ve2(s2.body, `
|
|
812
|
+
|
|
813
|
+
`, false)) {
|
|
814
|
+
if (!e) continue;
|
|
815
|
+
let t = $e(e);
|
|
816
|
+
t && (yield t);
|
|
817
|
+
}
|
|
818
|
+
} });
|
|
819
|
+
var Pe2 = (s2) => ({ async *[Symbol.asyncIterator]() {
|
|
820
|
+
for await (let e of ve2(s2.body, `
|
|
821
|
+
`, true)) {
|
|
822
|
+
let t = e.trim();
|
|
823
|
+
t && (yield JSON.parse(t));
|
|
824
|
+
}
|
|
825
|
+
} });
|
|
826
|
+
var He = (s2) => s2 !== void 0 && he.includes(s2);
|
|
827
|
+
var Ae = (s2) => s2 instanceof FormData || s2 instanceof Blob || s2 instanceof ArrayBuffer || s2 instanceof ReadableStream || s2 instanceof URLSearchParams || ArrayBuffer.isView(s2);
|
|
828
|
+
var Be = (s2) => {
|
|
829
|
+
if (typeof document > "u" || !document.cookie) return;
|
|
830
|
+
let e = `${s2}=`, t = document.cookie.split(";");
|
|
831
|
+
for (let n = 0, r2 = t.length; n < r2; n++) {
|
|
832
|
+
let o = t[n].trim();
|
|
833
|
+
if (o.startsWith(e)) return decodeURIComponent(o.slice(e.length));
|
|
834
|
+
}
|
|
835
|
+
};
|
|
836
|
+
var Ce = (s2) => JSON.stringify(s2);
|
|
837
|
+
var J2 = (s2) => s2 !== null && typeof s2 == "string";
|
|
838
|
+
var ke2 = (s2) => s2 instanceof ArrayBuffer || Object.prototype.toString.call(s2) === "[object ArrayBuffer]";
|
|
839
|
+
var y = (s2) => s2 !== null && typeof s2 == "object" && !Array.isArray(s2) && Object.getPrototypeOf(s2) === Object.prototype;
|
|
840
|
+
var $ = (...s2) => {
|
|
841
|
+
let e = s2.length;
|
|
842
|
+
if (e === 0) return;
|
|
843
|
+
if (e === 1) {
|
|
844
|
+
let [n] = s2;
|
|
845
|
+
return y(n) ? re(n) : n;
|
|
846
|
+
}
|
|
847
|
+
let t = {};
|
|
848
|
+
for (let n of s2) {
|
|
849
|
+
if (!y(n)) return;
|
|
850
|
+
for (let [r2, o] of Object.entries(n)) {
|
|
851
|
+
let i = t[r2];
|
|
852
|
+
Array.isArray(o) ? t[r2] = [...o, ...Array.isArray(i) ? i.filter((a) => !o.includes(a)) : []] : y(o) ? t[r2] = y(i) ? $(i, o) : re(o) : t[r2] = o;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
return t;
|
|
856
|
+
};
|
|
857
|
+
function re(s2) {
|
|
858
|
+
if (y(s2)) {
|
|
859
|
+
let e = {}, t = Object.keys(s2);
|
|
860
|
+
for (let n = 0, r2 = t.length, o; n < r2; n++) o = t[n], e[o] = re(s2[o]);
|
|
861
|
+
return e;
|
|
862
|
+
}
|
|
863
|
+
return s2;
|
|
864
|
+
}
|
|
865
|
+
var xe2 = class s {
|
|
866
|
+
_baseUrl;
|
|
867
|
+
_options;
|
|
868
|
+
subscribr;
|
|
869
|
+
hooks = { beforeRequest: [], afterResponse: [], beforeError: [] };
|
|
870
|
+
static globalSubscribr = new I();
|
|
871
|
+
static globalHooks = { beforeRequest: [], afterResponse: [], beforeError: [] };
|
|
872
|
+
static signalControllers = /* @__PURE__ */ new Set();
|
|
873
|
+
static inflightRequests = /* @__PURE__ */ new Map();
|
|
874
|
+
static noRetryConfig = { limit: 0, statusCodes: [], methods: [], delay: N, backoffFactor: D };
|
|
875
|
+
static mediaTypeCache = new Map(Object.values(m).map((e) => [e.toString(), e]));
|
|
876
|
+
static contentTypeHandlers = [[m.TEXT.type, Te], [m.JSON.subtype, Z2], [m.BIN.subtype, te2], [m.HTML.subtype, ne2], [m.XML.subtype, se], [m.PNG.type, ee2], [m.JAVA_SCRIPT.subtype, Y], [m.CSS.subtype, Q2]];
|
|
877
|
+
constructor(e = X, t = {}) {
|
|
878
|
+
y(e) && ([e, t] = [X, e]), this._baseUrl = s.getBaseUrl(e), this._options = s.createOptions(t, s.defaultRequestOptions), this.subscribr = new I();
|
|
879
|
+
}
|
|
880
|
+
static CredentialsPolicy = { INCLUDE: "include", OMIT: "omit", SAME_ORIGIN: "same-origin" };
|
|
881
|
+
static RequestMode = { CORS: "cors", NAVIGATE: "navigate", NO_CORS: "no-cors", SAME_ORIGIN: "same-origin" };
|
|
882
|
+
static RequestPriority = { HIGH: "high", LOW: "low", AUTO: "auto" };
|
|
883
|
+
static RedirectPolicy = { ERROR: "error", FOLLOW: "follow", MANUAL: "manual" };
|
|
884
|
+
static ReferrerPolicy = { NO_REFERRER: "no-referrer", NO_REFERRER_WHEN_DOWNGRADE: "no-referrer-when-downgrade", ORIGIN: "origin", ORIGIN_WHEN_CROSS_ORIGIN: "origin-when-cross-origin", SAME_ORIGIN: "same-origin", STRICT_ORIGIN: "strict-origin", STRICT_ORIGIN_WHEN_CROSS_ORIGIN: "strict-origin-when-cross-origin", UNSAFE_URL: "unsafe-url" };
|
|
885
|
+
static RequestEvent = b2;
|
|
886
|
+
static defaultRequestOptions = { body: void 0, cache: fe.NO_STORE, credentials: s.CredentialsPolicy.SAME_ORIGIN, headers: new Headers({ "content-type": G, accept: G }), searchParams: void 0, integrity: void 0, keepalive: void 0, method: "GET", mode: s.RequestMode.CORS, priority: s.RequestPriority.AUTO, redirect: s.RedirectPolicy.FOLLOW, referrer: "about:client", referrerPolicy: s.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN, signal: void 0, timeout: 3e4, global: true };
|
|
887
|
+
static register(e, t, n) {
|
|
888
|
+
return s.globalSubscribr.subscribe(e, t, n);
|
|
889
|
+
}
|
|
890
|
+
static unregister(e) {
|
|
891
|
+
return s.globalSubscribr.unsubscribe(e);
|
|
892
|
+
}
|
|
893
|
+
static abortAll() {
|
|
894
|
+
for (let e of this.signalControllers) e.abort(L());
|
|
895
|
+
this.signalControllers.clear();
|
|
896
|
+
}
|
|
897
|
+
static all(e) {
|
|
898
|
+
return Promise.all(e);
|
|
899
|
+
}
|
|
900
|
+
static async race(e) {
|
|
901
|
+
let t = [], n = new Array(e.length);
|
|
902
|
+
for (let r2 = 0; r2 < e.length; r2++) {
|
|
903
|
+
let o = new AbortController();
|
|
904
|
+
t.push(o), n[r2] = e[r2](o.signal);
|
|
905
|
+
}
|
|
906
|
+
try {
|
|
907
|
+
return await Promise.race(n);
|
|
908
|
+
} finally {
|
|
909
|
+
for (let r2 of t) r2.abort();
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
static registerContentTypeHandler(e, t) {
|
|
913
|
+
s.contentTypeHandlers.unshift([e, t]);
|
|
914
|
+
}
|
|
915
|
+
static unregisterContentTypeHandler(e) {
|
|
916
|
+
let t = s.contentTypeHandlers.findIndex(([n]) => n === e);
|
|
917
|
+
return t === -1 ? false : (s.contentTypeHandlers.splice(t, 1), true);
|
|
918
|
+
}
|
|
919
|
+
static addHooks(e) {
|
|
920
|
+
e.beforeRequest && s.globalHooks.beforeRequest.push(...e.beforeRequest), e.afterResponse && s.globalHooks.afterResponse.push(...e.afterResponse), e.beforeError && s.globalHooks.beforeError.push(...e.beforeError);
|
|
921
|
+
}
|
|
922
|
+
static clearHooks() {
|
|
923
|
+
s.globalHooks = { beforeRequest: [], afterResponse: [], beforeError: [] };
|
|
924
|
+
}
|
|
925
|
+
static unregisterAll() {
|
|
926
|
+
s.abortAll(), s.globalSubscribr = new I(), s.clearHooks(), s.inflightRequests.clear();
|
|
927
|
+
}
|
|
928
|
+
get baseUrl() {
|
|
929
|
+
return this._baseUrl;
|
|
930
|
+
}
|
|
931
|
+
register(e, t, n) {
|
|
932
|
+
return this.subscribr.subscribe(e, t, n);
|
|
933
|
+
}
|
|
934
|
+
unregister(e) {
|
|
935
|
+
return this.subscribr.unsubscribe(e);
|
|
936
|
+
}
|
|
937
|
+
addHooks(e) {
|
|
938
|
+
return e.beforeRequest && this.hooks.beforeRequest.push(...e.beforeRequest), e.afterResponse && this.hooks.afterResponse.push(...e.afterResponse), e.beforeError && this.hooks.beforeError.push(...e.beforeError), this;
|
|
939
|
+
}
|
|
940
|
+
clearHooks() {
|
|
941
|
+
return this.hooks.beforeRequest.length = 0, this.hooks.afterResponse.length = 0, this.hooks.beforeError.length = 0, this;
|
|
942
|
+
}
|
|
943
|
+
configure({ headers: e, searchParams: t, hooks: n, ...r2 }) {
|
|
944
|
+
return e && s.mergeHeaders(this._options.headers, e), t && s.mergeSearchParams(this._options.searchParams, t), Object.keys(r2).length > 0 && Object.assign(this._options, r2), n && this.addHooks(n), this;
|
|
945
|
+
}
|
|
946
|
+
destroy() {
|
|
947
|
+
this.clearHooks(), this.subscribr.destroy();
|
|
948
|
+
}
|
|
949
|
+
async get(e, t) {
|
|
950
|
+
return this._get(e, t);
|
|
951
|
+
}
|
|
952
|
+
async post(e, t, n) {
|
|
953
|
+
return this.executeBodyMethod("POST", e, t, n);
|
|
954
|
+
}
|
|
955
|
+
async put(e, t, n) {
|
|
956
|
+
return this.executeBodyMethod("PUT", e, t, n);
|
|
957
|
+
}
|
|
958
|
+
async patch(e, t, n) {
|
|
959
|
+
return this.executeBodyMethod("PATCH", e, t, n);
|
|
960
|
+
}
|
|
961
|
+
async delete(e, t, n) {
|
|
962
|
+
return this.executeBodyMethod("DELETE", e, t, n);
|
|
963
|
+
}
|
|
964
|
+
async head(e, t) {
|
|
965
|
+
return this.execute(e, t, { method: "HEAD" });
|
|
966
|
+
}
|
|
967
|
+
async options(e, t = {}) {
|
|
968
|
+
y(e) && ([e, t] = [void 0, e]);
|
|
969
|
+
let n = this.processRequestOptions(t, { method: "OPTIONS" }), { requestOptions: r2 } = n, o = r2.unwrap !== false, i = r2.hooks;
|
|
970
|
+
try {
|
|
971
|
+
let a = s.createUrl(this._baseUrl, e, r2.searchParams), u = [s.globalHooks.beforeRequest, this.hooks.beforeRequest, i?.beforeRequest];
|
|
972
|
+
for (let c of u) if (c) for (let l of c) {
|
|
973
|
+
let g = await l(r2, a);
|
|
974
|
+
g && (Object.assign(r2, g), g.searchParams !== void 0 && (a = s.createUrl(this._baseUrl, e, r2.searchParams)));
|
|
975
|
+
}
|
|
976
|
+
let p = await this._request(e, n), R2 = [s.globalHooks.afterResponse, this.hooks.afterResponse, i?.afterResponse];
|
|
977
|
+
for (let c of R2) if (c) for (let l of c) {
|
|
978
|
+
let g = await l(p, r2);
|
|
979
|
+
g && (p = g);
|
|
980
|
+
}
|
|
981
|
+
let d = p.headers.get("allow"), h;
|
|
982
|
+
if (d) {
|
|
983
|
+
let c = d.split(",");
|
|
984
|
+
h = new Array(c.length);
|
|
985
|
+
for (let l = 0, g = c.length; l < g; l++) h[l] = c[l].trim();
|
|
986
|
+
}
|
|
987
|
+
return this.publish({ name: b2.SUCCESS, data: h, global: t.global }), o ? h : [true, h];
|
|
988
|
+
} catch (a) {
|
|
989
|
+
if (!o) return [false, a];
|
|
990
|
+
throw a;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
async request(e, t = {}) {
|
|
994
|
+
y(e) && ([e, t] = [void 0, e]);
|
|
995
|
+
let n = this.processRequestOptions(t, {}), r2 = n.requestOptions.unwrap !== false;
|
|
996
|
+
try {
|
|
997
|
+
let o = await this._request(e, n);
|
|
998
|
+
return this.publish({ name: b2.SUCCESS, data: o, global: t.global }), r2 ? o : [true, o];
|
|
999
|
+
} catch (o) {
|
|
1000
|
+
if (!r2) return [false, o];
|
|
1001
|
+
throw o;
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
async getJson(e, t) {
|
|
1005
|
+
return this._get(e, t, { headers: { accept: `${m.JSON}` } }, Z2);
|
|
1006
|
+
}
|
|
1007
|
+
async getXml(e, t) {
|
|
1008
|
+
return this._get(e, t, { headers: { accept: `${m.XML}` } }, se);
|
|
1009
|
+
}
|
|
1010
|
+
async getHtml(e, t, n) {
|
|
1011
|
+
let r2 = await this._get(e, t, { headers: { accept: `${m.HTML}` } }, ne2);
|
|
1012
|
+
return Array.isArray(r2) ? r2 : n && r2 ? r2.querySelector(n) : r2;
|
|
1013
|
+
}
|
|
1014
|
+
async getHtmlFragment(e, t, n) {
|
|
1015
|
+
let r2 = (y(e) ? e : t)?.allowScripts === true, o = await this._get(e, t, { headers: { accept: `${m.HTML}` } }, r2 ? we2 : Oe);
|
|
1016
|
+
return Array.isArray(o) ? o : n && o ? o.querySelector(n) : o;
|
|
1017
|
+
}
|
|
1018
|
+
async getScript(e, t) {
|
|
1019
|
+
return this._get(e, t, { headers: { accept: `${m.JAVA_SCRIPT}` } }, Y);
|
|
1020
|
+
}
|
|
1021
|
+
async getStylesheet(e, t) {
|
|
1022
|
+
return this._get(e, t, { headers: { accept: `${m.CSS}` } }, Q2);
|
|
1023
|
+
}
|
|
1024
|
+
async getBlob(e, t) {
|
|
1025
|
+
return this._get(e, t, { headers: { accept: "application/octet-stream" } }, Ee2);
|
|
1026
|
+
}
|
|
1027
|
+
async getImage(e, t) {
|
|
1028
|
+
return this._get(e, t, { headers: { accept: "image/*" } }, ee2);
|
|
1029
|
+
}
|
|
1030
|
+
async getBuffer(e, t) {
|
|
1031
|
+
return this._get(e, t, { headers: { accept: "application/octet-stream" } }, Se);
|
|
1032
|
+
}
|
|
1033
|
+
async getStream(e, t) {
|
|
1034
|
+
return this._get(e, t, { headers: { accept: "application/octet-stream" } }, te2);
|
|
1035
|
+
}
|
|
1036
|
+
async getEventStream(e, t) {
|
|
1037
|
+
y(e) && ([e, t] = [void 0, e]);
|
|
1038
|
+
let n = this.processRequestOptions(t ?? {}, { method: t?.body ? "POST" : "GET", headers: { accept: `${m.EVENT_STREAM}` } }), { requestOptions: r2 } = n, o = r2.unwrap !== false, i = r2.hooks;
|
|
1039
|
+
try {
|
|
1040
|
+
let a = s.createUrl(this._baseUrl, e, r2.searchParams), u = [s.globalHooks.beforeRequest, this.hooks.beforeRequest, i?.beforeRequest];
|
|
1041
|
+
for (let c of u) if (c) for (let l of c) {
|
|
1042
|
+
let g = await l(r2, a);
|
|
1043
|
+
g && (Object.assign(r2, g), g.searchParams !== void 0 && (a = s.createUrl(this._baseUrl, e, r2.searchParams)));
|
|
1044
|
+
}
|
|
1045
|
+
let R2 = await this._request(e, n), d = [s.globalHooks.afterResponse, this.hooks.afterResponse, i?.afterResponse];
|
|
1046
|
+
for (let c of d) if (c) for (let l of c) {
|
|
1047
|
+
let g = await l(R2, r2);
|
|
1048
|
+
g && (R2 = g);
|
|
1049
|
+
}
|
|
1050
|
+
this.publish({ name: b2.SUCCESS, data: R2, global: n.global });
|
|
1051
|
+
let h = qe(R2);
|
|
1052
|
+
return o ? h : [true, h];
|
|
1053
|
+
} catch (a) {
|
|
1054
|
+
if (!o) return [false, a];
|
|
1055
|
+
throw a;
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
async getJsonStream(e, t) {
|
|
1059
|
+
y(e) && ([e, t] = [void 0, e]);
|
|
1060
|
+
let n = this.processRequestOptions(t ?? {}, { method: "GET", headers: { accept: `${m.NDJSON}` } }), { requestOptions: r2 } = n, o = r2.unwrap !== false, i = r2.hooks;
|
|
1061
|
+
try {
|
|
1062
|
+
let a = s.createUrl(this._baseUrl, e, r2.searchParams), u = [s.globalHooks.beforeRequest, this.hooks.beforeRequest, i?.beforeRequest];
|
|
1063
|
+
for (let c of u) if (c) for (let l of c) {
|
|
1064
|
+
let g = await l(r2, a);
|
|
1065
|
+
g && (Object.assign(r2, g), g.searchParams !== void 0 && (a = s.createUrl(this._baseUrl, e, r2.searchParams)));
|
|
1066
|
+
}
|
|
1067
|
+
let R2 = await this._request(e, n), d = [s.globalHooks.afterResponse, this.hooks.afterResponse, i?.afterResponse];
|
|
1068
|
+
for (let c of d) if (c) for (let l of c) {
|
|
1069
|
+
let g = await l(R2, r2);
|
|
1070
|
+
g && (R2 = g);
|
|
1071
|
+
}
|
|
1072
|
+
this.publish({ name: b2.SUCCESS, data: R2, global: n.global });
|
|
1073
|
+
let h = Pe2(R2);
|
|
1074
|
+
return o ? h : [true, h];
|
|
1075
|
+
} catch (a) {
|
|
1076
|
+
if (!o) return [false, a];
|
|
1077
|
+
throw a;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
async _get(e, t, n = {}, r2) {
|
|
1081
|
+
return n.method = "GET", n.body = void 0, this.execute(e, t, n, r2);
|
|
1082
|
+
}
|
|
1083
|
+
async _request(e, { signalController: t, requestOptions: n, global: r2 }) {
|
|
1084
|
+
s.signalControllers.add(t);
|
|
1085
|
+
let o = s.normalizeRetryOptions(n.retry), i = n.method ?? "GET", a = o.limit > 0 && o.methods.includes(i), u = n.dedupe === true && (i === "GET" || i === "HEAD"), p = 0, R2 = performance.now(), d = () => {
|
|
1086
|
+
let h = performance.now();
|
|
1087
|
+
return { start: R2, end: h, duration: h - R2 };
|
|
1088
|
+
};
|
|
1089
|
+
try {
|
|
1090
|
+
let h = s.createUrl(this._baseUrl, e, n.searchParams), c;
|
|
1091
|
+
if (u) {
|
|
1092
|
+
c = `${i}:${h.href}`;
|
|
1093
|
+
let f = s.inflightRequests.get(c);
|
|
1094
|
+
if (f) return (await f).clone();
|
|
1095
|
+
}
|
|
1096
|
+
let l = n.body, g = n.onUploadProgress, A2 = async () => {
|
|
1097
|
+
if (!g || l == null) return;
|
|
1098
|
+
let f = null;
|
|
1099
|
+
if (typeof l == "string") f = new TextEncoder().encode(l);
|
|
1100
|
+
else if (l instanceof Blob) f = new Uint8Array(await l.arrayBuffer());
|
|
1101
|
+
else if (ke2(l)) f = new Uint8Array(l);
|
|
1102
|
+
else if (ArrayBuffer.isView(l)) f = new Uint8Array(l.buffer, l.byteOffset, l.byteLength);
|
|
1103
|
+
else if (!(l instanceof ReadableStream)) return;
|
|
1104
|
+
let E = f ? f.byteLength : null, x = f ? new ReadableStream({ start(q) {
|
|
1105
|
+
q.enqueue(f), q.close();
|
|
1106
|
+
} }) : l, S2 = 0, C2 = new TransformStream({ transform(q, U) {
|
|
1107
|
+
S2 += q.byteLength, g({ loaded: S2, total: E, percentage: E !== null && E > 0 ? Math.round(S2 / E * 100) : null }), U.enqueue(q);
|
|
1108
|
+
} });
|
|
1109
|
+
n.body = x.pipeThrough(C2), Object.assign(n, { duplex: "half" });
|
|
1110
|
+
}, oe = async () => {
|
|
1111
|
+
for (; ; ) try {
|
|
1112
|
+
await A2();
|
|
1113
|
+
let f = await fetch(h, n);
|
|
1114
|
+
if (!f.ok) {
|
|
1115
|
+
if (a && p < o.limit && o.statusCodes.includes(f.status)) {
|
|
1116
|
+
p++, this.publish({ name: b2.RETRY, data: { attempt: p, status: f.status, method: i, path: e, timing: d() }, global: r2 }), await s.retryDelay(o, p);
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
let E;
|
|
1120
|
+
try {
|
|
1121
|
+
E = await f.text();
|
|
1122
|
+
} catch {
|
|
1123
|
+
}
|
|
1124
|
+
throw await this.handleError(e, f, { entity: E, url: h, method: i, timing: d() }, n);
|
|
1125
|
+
}
|
|
1126
|
+
return f;
|
|
1127
|
+
} catch (f) {
|
|
1128
|
+
if (f instanceof B2) throw f;
|
|
1129
|
+
if (a && p < o.limit) {
|
|
1130
|
+
p++, this.publish({ name: b2.RETRY, data: { attempt: p, error: f.message, method: i, path: e, timing: d() }, global: r2 }), await s.retryDelay(o, p);
|
|
1131
|
+
continue;
|
|
1132
|
+
}
|
|
1133
|
+
throw await this.handleError(e, void 0, { cause: f, url: h, method: i, timing: d() }, n);
|
|
1134
|
+
}
|
|
1135
|
+
}, ie = (f) => {
|
|
1136
|
+
let E = n.onDownloadProgress;
|
|
1137
|
+
if (!E || !f.body) return f;
|
|
1138
|
+
let x = f.headers.get("content-length"), S2 = x ? parseInt(x, 10) : null, C2 = 0, q = new TransformStream({ transform(U, Ue2) {
|
|
1139
|
+
C2 += U.byteLength, E({ loaded: C2, total: S2, percentage: S2 !== null && S2 > 0 ? Math.round(C2 / S2 * 100) : null }), Ue2.enqueue(U);
|
|
1140
|
+
} });
|
|
1141
|
+
return new Response(f.body.pipeThrough(q), { status: f.status, statusText: f.statusText, headers: f.headers });
|
|
1142
|
+
};
|
|
1143
|
+
if (u) {
|
|
1144
|
+
let f = oe();
|
|
1145
|
+
s.inflightRequests.set(c, f);
|
|
1146
|
+
try {
|
|
1147
|
+
return ie(await f);
|
|
1148
|
+
} finally {
|
|
1149
|
+
s.inflightRequests.delete(c);
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
return ie(await oe());
|
|
1153
|
+
} finally {
|
|
1154
|
+
s.signalControllers.delete(t.destroy()), n.signal?.aborted || (this.publish({ name: b2.COMPLETE, data: { timing: d() }, global: r2 }), s.signalControllers.size === 0 && this.publish({ name: b2.ALL_COMPLETE, global: r2 }));
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
static normalizeRetryOptions(e) {
|
|
1158
|
+
return e === void 0 ? s.noRetryConfig : typeof e == "number" ? { limit: e, statusCodes: V, methods: z, delay: N, backoffFactor: D } : { limit: e.limit ?? 0, statusCodes: e.statusCodes ?? V, methods: e.methods ?? z, delay: e.delay ?? N, backoffFactor: e.backoffFactor ?? D };
|
|
1159
|
+
}
|
|
1160
|
+
static retryDelay(e, t) {
|
|
1161
|
+
let n = typeof e.delay == "function" ? e.delay(t) : e.delay * e.backoffFactor ** (t - 1);
|
|
1162
|
+
return new Promise((r2) => setTimeout(r2, n));
|
|
1163
|
+
}
|
|
1164
|
+
executeBodyMethod(e, t, n, r2, o) {
|
|
1165
|
+
let [i, a, u] = J2(t) ? [t, n, r2] : [void 0, t, n];
|
|
1166
|
+
return this.execute(i, Object.assign(u ?? {}, { body: a, method: e }), {}, o);
|
|
1167
|
+
}
|
|
1168
|
+
async execute(e, t = {}, n = {}, r2) {
|
|
1169
|
+
y(e) && ([e, t] = [void 0, e]);
|
|
1170
|
+
let o = this.processRequestOptions(t, n), { requestOptions: i } = o, a = i.unwrap !== false, u = i.hooks;
|
|
1171
|
+
try {
|
|
1172
|
+
let p = s.createUrl(this._baseUrl, e, i.searchParams);
|
|
1173
|
+
for (let d of [s.globalHooks.beforeRequest, this.hooks.beforeRequest, u?.beforeRequest]) if (d) for (let h of d) {
|
|
1174
|
+
let c = await h(i, p);
|
|
1175
|
+
c && (Object.assign(i, c), c.searchParams !== void 0 && (p = s.createUrl(this._baseUrl, e, i.searchParams)));
|
|
1176
|
+
}
|
|
1177
|
+
let R2 = await this._request(e, o);
|
|
1178
|
+
for (let d of [s.globalHooks.afterResponse, this.hooks.afterResponse, u?.afterResponse]) if (d) for (let h of d) {
|
|
1179
|
+
let c = await h(R2, i);
|
|
1180
|
+
c && (R2 = c);
|
|
1181
|
+
}
|
|
1182
|
+
try {
|
|
1183
|
+
!r2 && R2.status !== 204 && (r2 = this.getResponseHandler(R2.headers.get("content-type")));
|
|
1184
|
+
let d = await r2?.(R2);
|
|
1185
|
+
return this.publish({ name: b2.SUCCESS, data: d, global: o.global }), a ? d : [true, d];
|
|
1186
|
+
} catch (d) {
|
|
1187
|
+
throw await this.handleError(e, R2, { cause: d }, i);
|
|
1188
|
+
}
|
|
1189
|
+
} catch (p) {
|
|
1190
|
+
if (!a) return [false, p];
|
|
1191
|
+
throw p;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
static createOptions({ headers: e, searchParams: t, ...n }, { headers: r2, searchParams: o, ...i }) {
|
|
1195
|
+
return r2 = s.mergeHeaders(new Headers(), e, r2), o = s.mergeSearchParams(new URLSearchParams(), t, o), { ...$(i, n), headers: r2, searchParams: o };
|
|
1196
|
+
}
|
|
1197
|
+
static mergeHeaders(e, ...t) {
|
|
1198
|
+
for (let n of t) if (n !== void 0) if (n instanceof Headers) n.forEach((r2, o) => e.set(o, r2));
|
|
1199
|
+
else if (Array.isArray(n)) for (let [r2, o] of n) e.set(r2, o);
|
|
1200
|
+
else {
|
|
1201
|
+
let r2 = Object.keys(n);
|
|
1202
|
+
for (let o = 0, i = r2.length; o < i; o++) {
|
|
1203
|
+
let a = r2[o], u = n[a];
|
|
1204
|
+
u !== void 0 && e.set(a, u);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
return e;
|
|
1208
|
+
}
|
|
1209
|
+
static mergeSearchParams(e, ...t) {
|
|
1210
|
+
for (let n of t) if (n !== void 0) if (n instanceof URLSearchParams) n.forEach((r2, o) => e.set(o, r2));
|
|
1211
|
+
else if (J2(n) || Array.isArray(n)) for (let [r2, o] of new URLSearchParams(n)) e.set(r2, o);
|
|
1212
|
+
else {
|
|
1213
|
+
let r2 = Object.keys(n);
|
|
1214
|
+
for (let o = 0; o < r2.length; o++) {
|
|
1215
|
+
let i = r2[o], a = n[i];
|
|
1216
|
+
a !== void 0 && e.set(i, typeof a == "string" ? a : String(a));
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
return e;
|
|
1220
|
+
}
|
|
1221
|
+
processRequestOptions({ body: e, headers: t, searchParams: n, ...r2 }, { headers: o, searchParams: i, ...a }) {
|
|
1222
|
+
let u = { ...this._options, ...r2, ...a, headers: s.mergeHeaders(new Headers(this._options.headers), t, o), searchParams: s.mergeSearchParams(new URLSearchParams(this._options.searchParams), n, i) };
|
|
1223
|
+
if (He(u.method)) if (Ae(e)) Object.assign(u, { body: e }), u.headers.delete("content-type");
|
|
1224
|
+
else {
|
|
1225
|
+
let l = this._options.body, g = y(l) && y(e) ? $(l, e) : e !== void 0 ? e : l, A2 = u.headers.get("content-type")?.includes("json") ?? false;
|
|
1226
|
+
Object.assign(u, { body: A2 && y(g) ? Ce(g) : g });
|
|
1227
|
+
}
|
|
1228
|
+
else u.headers.delete("content-type"), u.body instanceof URLSearchParams && s.mergeSearchParams(u.searchParams, u.body), u.body = void 0;
|
|
1229
|
+
let { signal: p, timeout: R2, global: d = false, xsrf: h } = u;
|
|
1230
|
+
if (h) {
|
|
1231
|
+
let { cookieName: l, headerName: g } = typeof h == "object" ? h : {}, A2 = Be(l ?? ce);
|
|
1232
|
+
A2 && u.headers.set(g ?? pe, A2);
|
|
1233
|
+
}
|
|
1234
|
+
let c = new _({ signal: p, timeout: R2 }).onAbort((l) => this.publish({ name: b2.ABORTED, event: l, global: d })).onTimeout((l) => this.publish({ name: b2.TIMEOUT, event: l, global: d }));
|
|
1235
|
+
return u.signal = c.signal, this.publish({ name: b2.CONFIGURED, data: u, global: d }), { signalController: c, requestOptions: u, global: d };
|
|
1236
|
+
}
|
|
1237
|
+
static getBaseUrl(e) {
|
|
1238
|
+
if (e instanceof URL) return e;
|
|
1239
|
+
if (!J2(e)) throw new TypeError("Invalid URL");
|
|
1240
|
+
return new URL(e, e.startsWith("/") ? globalThis.location.origin : void 0);
|
|
1241
|
+
}
|
|
1242
|
+
static getOrParseMediaType(e) {
|
|
1243
|
+
if (e === null) return;
|
|
1244
|
+
let t = s.mediaTypeCache.get(e);
|
|
1245
|
+
return t !== void 0 || (t = T.parse(e) ?? void 0, t !== void 0 && (s.mediaTypeCache.size >= 100 && s.mediaTypeCache.delete(s.mediaTypeCache.keys().next().value), s.mediaTypeCache.set(e, t))), t;
|
|
1246
|
+
}
|
|
1247
|
+
static createUrl(e, t, n) {
|
|
1248
|
+
let r2 = t ? new URL(`${e.pathname.replace(de2, "")}${t}`, e.origin) : new URL(e);
|
|
1249
|
+
return n && s.mergeSearchParams(r2.searchParams, n), r2;
|
|
1250
|
+
}
|
|
1251
|
+
static generateResponseStatusFromError(e, { status: t, statusText: n } = new Response()) {
|
|
1252
|
+
switch (e) {
|
|
1253
|
+
case H.ABORT:
|
|
1254
|
+
return me;
|
|
1255
|
+
case H.TIMEOUT:
|
|
1256
|
+
return ye;
|
|
1257
|
+
default:
|
|
1258
|
+
return t >= 400 ? new w(t, n) : ge;
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
async handleError(e, t, { cause: n, entity: r2, url: o, method: i, timing: a } = {}, u) {
|
|
1262
|
+
let p = i && o ? `${i} ${o.href} failed${t ? ` with status ${t.status}` : ""}` : `An error has occurred with your request to: '${e}'`, R2 = new B2(s.generateResponseStatusFromError(n?.name, t), { message: p, cause: n, entity: r2, url: o, method: i, timing: a });
|
|
1263
|
+
for (let d of [s.globalHooks.beforeError, this.hooks.beforeError, u?.hooks?.beforeError]) if (d) for (let h of d) {
|
|
1264
|
+
let c = await h(R2);
|
|
1265
|
+
c instanceof B2 && (R2 = c);
|
|
1266
|
+
}
|
|
1267
|
+
return this.publish({ name: b2.ERROR, data: R2 }), R2;
|
|
1268
|
+
}
|
|
1269
|
+
publish({ name: e, event: t = new CustomEvent(e), data: n, global: r2 = true }) {
|
|
1270
|
+
r2 && s.globalSubscribr.publish(e, t, n), this.subscribr.publish(e, t, n);
|
|
1271
|
+
}
|
|
1272
|
+
getResponseHandler(e) {
|
|
1273
|
+
if (!e) return;
|
|
1274
|
+
let t = s.getOrParseMediaType(e);
|
|
1275
|
+
if (t) {
|
|
1276
|
+
for (let [n, r2] of s.contentTypeHandlers) if (t.matches(n)) return r2;
|
|
1277
|
+
}
|
|
1278
|
+
}
|
|
1279
|
+
get [Symbol.toStringTag]() {
|
|
1280
|
+
return "Transportr";
|
|
1281
|
+
}
|
|
1282
|
+
};
|
|
1283
|
+
|
|
1284
|
+
Object.assign(globalThis, { Transportr: xe2 });
|
|
1285
|
+
})();
|
|
1286
|
+
/*! Bundled license information:
|
|
1287
|
+
|
|
1288
|
+
dompurify/dist/purify.es.mjs:
|
|
1289
|
+
(*! @license DOMPurify 3.4.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.0/LICENSE *)
|
|
1290
|
+
*/
|
|
1291
|
+
|
|
1292
|
+
//# sourceMappingURL=transportr.js.map
|