@frameless/strapi-plugin-notes 1.0.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.md +288 -0
- package/README.md +57 -0
- package/dist/_chunks/en-DgFd-WK6.js +22 -0
- package/dist/_chunks/en-LAB21eLd.mjs +22 -0
- package/dist/_chunks/nl-BeFOQQzs.mjs +22 -0
- package/dist/_chunks/nl-KLQoW4g0.js +22 -0
- package/dist/admin/index.js +2363 -0
- package/dist/admin/index.mjs +2364 -0
- package/dist/server/index.js +116 -0
- package/dist/server/index.mjs +117 -0
- package/package.json +103 -0
|
@@ -0,0 +1,2363 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const reactQuery = require("@tanstack/react-query");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const reactIntl = require("react-intl");
|
|
6
|
+
const admin = require("@strapi/strapi/admin");
|
|
7
|
+
const designSystem = require("@strapi/design-system");
|
|
8
|
+
const icons = require("@strapi/icons");
|
|
9
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
10
|
+
const v = glob[path];
|
|
11
|
+
if (v) {
|
|
12
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
13
|
+
}
|
|
14
|
+
return new Promise((_, reject) => {
|
|
15
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
16
|
+
reject.bind(
|
|
17
|
+
null,
|
|
18
|
+
new Error(
|
|
19
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
20
|
+
)
|
|
21
|
+
)
|
|
22
|
+
);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
const strapi = {
|
|
26
|
+
name: "entity-notes"
|
|
27
|
+
};
|
|
28
|
+
const pluginPkg = {
|
|
29
|
+
strapi
|
|
30
|
+
};
|
|
31
|
+
const FIVE_MINUTES = 5 * 60 * 1e3;
|
|
32
|
+
const queryClient = new reactQuery.QueryClient({
|
|
33
|
+
defaultOptions: {
|
|
34
|
+
queries: {
|
|
35
|
+
refetchOnWindowFocus: false,
|
|
36
|
+
retry: 1,
|
|
37
|
+
staleTime: FIVE_MINUTES
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const PLUGIN_ID = "entity-notes";
|
|
42
|
+
const Initializer = ({ setPlugin }) => {
|
|
43
|
+
const ref2 = react.useRef(setPlugin);
|
|
44
|
+
react.useEffect(() => {
|
|
45
|
+
ref2.current(PLUGIN_ID);
|
|
46
|
+
}, []);
|
|
47
|
+
return null;
|
|
48
|
+
};
|
|
49
|
+
const getTranslation = (id) => `${PLUGIN_ID}.${id}`;
|
|
50
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
51
|
+
function getAugmentedNamespace(n) {
|
|
52
|
+
if (n.__esModule) return n;
|
|
53
|
+
var f = n.default;
|
|
54
|
+
if (typeof f == "function") {
|
|
55
|
+
var a = function a2() {
|
|
56
|
+
if (this instanceof a2) {
|
|
57
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
58
|
+
}
|
|
59
|
+
return f.apply(this, arguments);
|
|
60
|
+
};
|
|
61
|
+
a.prototype = f.prototype;
|
|
62
|
+
} else a = {};
|
|
63
|
+
Object.defineProperty(a, "__esModule", { value: true });
|
|
64
|
+
Object.keys(n).forEach(function(k) {
|
|
65
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
66
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function() {
|
|
69
|
+
return n[k];
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
return a;
|
|
74
|
+
}
|
|
75
|
+
var type = TypeError;
|
|
76
|
+
const __viteBrowserExternal = {};
|
|
77
|
+
const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
78
|
+
__proto__: null,
|
|
79
|
+
default: __viteBrowserExternal
|
|
80
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
81
|
+
const require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
|
|
82
|
+
var hasMap = typeof Map === "function" && Map.prototype;
|
|
83
|
+
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null;
|
|
84
|
+
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null;
|
|
85
|
+
var mapForEach = hasMap && Map.prototype.forEach;
|
|
86
|
+
var hasSet = typeof Set === "function" && Set.prototype;
|
|
87
|
+
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null;
|
|
88
|
+
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null;
|
|
89
|
+
var setForEach = hasSet && Set.prototype.forEach;
|
|
90
|
+
var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype;
|
|
91
|
+
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
|
92
|
+
var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype;
|
|
93
|
+
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
|
94
|
+
var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype;
|
|
95
|
+
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
|
96
|
+
var booleanValueOf = Boolean.prototype.valueOf;
|
|
97
|
+
var objectToString = Object.prototype.toString;
|
|
98
|
+
var functionToString = Function.prototype.toString;
|
|
99
|
+
var $match = String.prototype.match;
|
|
100
|
+
var $slice = String.prototype.slice;
|
|
101
|
+
var $replace$1 = String.prototype.replace;
|
|
102
|
+
var $toUpperCase = String.prototype.toUpperCase;
|
|
103
|
+
var $toLowerCase = String.prototype.toLowerCase;
|
|
104
|
+
var $test = RegExp.prototype.test;
|
|
105
|
+
var $concat$1 = Array.prototype.concat;
|
|
106
|
+
var $join = Array.prototype.join;
|
|
107
|
+
var $arrSlice = Array.prototype.slice;
|
|
108
|
+
var $floor = Math.floor;
|
|
109
|
+
var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null;
|
|
110
|
+
var gOPS = Object.getOwnPropertySymbols;
|
|
111
|
+
var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null;
|
|
112
|
+
var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object";
|
|
113
|
+
var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null;
|
|
114
|
+
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
|
115
|
+
var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
|
|
116
|
+
return O.__proto__;
|
|
117
|
+
} : null);
|
|
118
|
+
function addNumericSeparator(num, str) {
|
|
119
|
+
if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str)) {
|
|
120
|
+
return str;
|
|
121
|
+
}
|
|
122
|
+
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
123
|
+
if (typeof num === "number") {
|
|
124
|
+
var int = num < 0 ? -$floor(-num) : $floor(num);
|
|
125
|
+
if (int !== num) {
|
|
126
|
+
var intStr = String(int);
|
|
127
|
+
var dec = $slice.call(str, intStr.length + 1);
|
|
128
|
+
return $replace$1.call(intStr, sepRegex, "$&_") + "." + $replace$1.call($replace$1.call(dec, /([0-9]{3})/g, "$&_"), /_$/, "");
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return $replace$1.call(str, sepRegex, "$&_");
|
|
132
|
+
}
|
|
133
|
+
var utilInspect = require$$0;
|
|
134
|
+
var inspectCustom = utilInspect.custom;
|
|
135
|
+
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
|
136
|
+
var quotes = {
|
|
137
|
+
__proto__: null,
|
|
138
|
+
"double": '"',
|
|
139
|
+
single: "'"
|
|
140
|
+
};
|
|
141
|
+
var quoteREs = {
|
|
142
|
+
__proto__: null,
|
|
143
|
+
"double": /(["\\])/g,
|
|
144
|
+
single: /(['\\])/g
|
|
145
|
+
};
|
|
146
|
+
var objectInspect = function inspect_(obj, options, depth, seen) {
|
|
147
|
+
var opts = options || {};
|
|
148
|
+
if (has$2(opts, "quoteStyle") && !has$2(quotes, opts.quoteStyle)) {
|
|
149
|
+
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
150
|
+
}
|
|
151
|
+
if (has$2(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) {
|
|
152
|
+
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
153
|
+
}
|
|
154
|
+
var customInspect = has$2(opts, "customInspect") ? opts.customInspect : true;
|
|
155
|
+
if (typeof customInspect !== "boolean" && customInspect !== "symbol") {
|
|
156
|
+
throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
|
|
157
|
+
}
|
|
158
|
+
if (has$2(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) {
|
|
159
|
+
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
160
|
+
}
|
|
161
|
+
if (has$2(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") {
|
|
162
|
+
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
163
|
+
}
|
|
164
|
+
var numericSeparator = opts.numericSeparator;
|
|
165
|
+
if (typeof obj === "undefined") {
|
|
166
|
+
return "undefined";
|
|
167
|
+
}
|
|
168
|
+
if (obj === null) {
|
|
169
|
+
return "null";
|
|
170
|
+
}
|
|
171
|
+
if (typeof obj === "boolean") {
|
|
172
|
+
return obj ? "true" : "false";
|
|
173
|
+
}
|
|
174
|
+
if (typeof obj === "string") {
|
|
175
|
+
return inspectString(obj, opts);
|
|
176
|
+
}
|
|
177
|
+
if (typeof obj === "number") {
|
|
178
|
+
if (obj === 0) {
|
|
179
|
+
return Infinity / obj > 0 ? "0" : "-0";
|
|
180
|
+
}
|
|
181
|
+
var str = String(obj);
|
|
182
|
+
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
|
183
|
+
}
|
|
184
|
+
if (typeof obj === "bigint") {
|
|
185
|
+
var bigIntStr = String(obj) + "n";
|
|
186
|
+
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
|
187
|
+
}
|
|
188
|
+
var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth;
|
|
189
|
+
if (typeof depth === "undefined") {
|
|
190
|
+
depth = 0;
|
|
191
|
+
}
|
|
192
|
+
if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") {
|
|
193
|
+
return isArray$2(obj) ? "[Array]" : "[Object]";
|
|
194
|
+
}
|
|
195
|
+
var indent = getIndent(opts, depth);
|
|
196
|
+
if (typeof seen === "undefined") {
|
|
197
|
+
seen = [];
|
|
198
|
+
} else if (indexOf(seen, obj) >= 0) {
|
|
199
|
+
return "[Circular]";
|
|
200
|
+
}
|
|
201
|
+
function inspect2(value, from, noIndent) {
|
|
202
|
+
if (from) {
|
|
203
|
+
seen = $arrSlice.call(seen);
|
|
204
|
+
seen.push(from);
|
|
205
|
+
}
|
|
206
|
+
if (noIndent) {
|
|
207
|
+
var newOpts = {
|
|
208
|
+
depth: opts.depth
|
|
209
|
+
};
|
|
210
|
+
if (has$2(opts, "quoteStyle")) {
|
|
211
|
+
newOpts.quoteStyle = opts.quoteStyle;
|
|
212
|
+
}
|
|
213
|
+
return inspect_(value, newOpts, depth + 1, seen);
|
|
214
|
+
}
|
|
215
|
+
return inspect_(value, opts, depth + 1, seen);
|
|
216
|
+
}
|
|
217
|
+
if (typeof obj === "function" && !isRegExp$1(obj)) {
|
|
218
|
+
var name2 = nameOf(obj);
|
|
219
|
+
var keys = arrObjKeys(obj, inspect2);
|
|
220
|
+
return "[Function" + (name2 ? ": " + name2 : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : "");
|
|
221
|
+
}
|
|
222
|
+
if (isSymbol(obj)) {
|
|
223
|
+
var symString = hasShammedSymbols ? $replace$1.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj);
|
|
224
|
+
return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString;
|
|
225
|
+
}
|
|
226
|
+
if (isElement(obj)) {
|
|
227
|
+
var s = "<" + $toLowerCase.call(String(obj.nodeName));
|
|
228
|
+
var attrs = obj.attributes || [];
|
|
229
|
+
for (var i = 0; i < attrs.length; i++) {
|
|
230
|
+
s += " " + attrs[i].name + "=" + wrapQuotes(quote(attrs[i].value), "double", opts);
|
|
231
|
+
}
|
|
232
|
+
s += ">";
|
|
233
|
+
if (obj.childNodes && obj.childNodes.length) {
|
|
234
|
+
s += "...";
|
|
235
|
+
}
|
|
236
|
+
s += "</" + $toLowerCase.call(String(obj.nodeName)) + ">";
|
|
237
|
+
return s;
|
|
238
|
+
}
|
|
239
|
+
if (isArray$2(obj)) {
|
|
240
|
+
if (obj.length === 0) {
|
|
241
|
+
return "[]";
|
|
242
|
+
}
|
|
243
|
+
var xs = arrObjKeys(obj, inspect2);
|
|
244
|
+
if (indent && !singleLineValues(xs)) {
|
|
245
|
+
return "[" + indentedJoin(xs, indent) + "]";
|
|
246
|
+
}
|
|
247
|
+
return "[ " + $join.call(xs, ", ") + " ]";
|
|
248
|
+
}
|
|
249
|
+
if (isError(obj)) {
|
|
250
|
+
var parts = arrObjKeys(obj, inspect2);
|
|
251
|
+
if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) {
|
|
252
|
+
return "{ [" + String(obj) + "] " + $join.call($concat$1.call("[cause]: " + inspect2(obj.cause), parts), ", ") + " }";
|
|
253
|
+
}
|
|
254
|
+
if (parts.length === 0) {
|
|
255
|
+
return "[" + String(obj) + "]";
|
|
256
|
+
}
|
|
257
|
+
return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }";
|
|
258
|
+
}
|
|
259
|
+
if (typeof obj === "object" && customInspect) {
|
|
260
|
+
if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) {
|
|
261
|
+
return utilInspect(obj, { depth: maxDepth - depth });
|
|
262
|
+
} else if (customInspect !== "symbol" && typeof obj.inspect === "function") {
|
|
263
|
+
return obj.inspect();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (isMap(obj)) {
|
|
267
|
+
var mapParts = [];
|
|
268
|
+
if (mapForEach) {
|
|
269
|
+
mapForEach.call(obj, function(value, key) {
|
|
270
|
+
mapParts.push(inspect2(key, obj, true) + " => " + inspect2(value, obj));
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
return collectionOf("Map", mapSize.call(obj), mapParts, indent);
|
|
274
|
+
}
|
|
275
|
+
if (isSet(obj)) {
|
|
276
|
+
var setParts = [];
|
|
277
|
+
if (setForEach) {
|
|
278
|
+
setForEach.call(obj, function(value) {
|
|
279
|
+
setParts.push(inspect2(value, obj));
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
return collectionOf("Set", setSize.call(obj), setParts, indent);
|
|
283
|
+
}
|
|
284
|
+
if (isWeakMap(obj)) {
|
|
285
|
+
return weakCollectionOf("WeakMap");
|
|
286
|
+
}
|
|
287
|
+
if (isWeakSet(obj)) {
|
|
288
|
+
return weakCollectionOf("WeakSet");
|
|
289
|
+
}
|
|
290
|
+
if (isWeakRef(obj)) {
|
|
291
|
+
return weakCollectionOf("WeakRef");
|
|
292
|
+
}
|
|
293
|
+
if (isNumber(obj)) {
|
|
294
|
+
return markBoxed(inspect2(Number(obj)));
|
|
295
|
+
}
|
|
296
|
+
if (isBigInt(obj)) {
|
|
297
|
+
return markBoxed(inspect2(bigIntValueOf.call(obj)));
|
|
298
|
+
}
|
|
299
|
+
if (isBoolean(obj)) {
|
|
300
|
+
return markBoxed(booleanValueOf.call(obj));
|
|
301
|
+
}
|
|
302
|
+
if (isString(obj)) {
|
|
303
|
+
return markBoxed(inspect2(String(obj)));
|
|
304
|
+
}
|
|
305
|
+
if (typeof window !== "undefined" && obj === window) {
|
|
306
|
+
return "{ [object Window] }";
|
|
307
|
+
}
|
|
308
|
+
if (typeof globalThis !== "undefined" && obj === globalThis || typeof commonjsGlobal !== "undefined" && obj === commonjsGlobal) {
|
|
309
|
+
return "{ [object globalThis] }";
|
|
310
|
+
}
|
|
311
|
+
if (!isDate(obj) && !isRegExp$1(obj)) {
|
|
312
|
+
var ys = arrObjKeys(obj, inspect2);
|
|
313
|
+
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
|
314
|
+
var protoTag = obj instanceof Object ? "" : "null prototype";
|
|
315
|
+
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
|
|
316
|
+
var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
|
|
317
|
+
var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
|
|
318
|
+
if (ys.length === 0) {
|
|
319
|
+
return tag + "{}";
|
|
320
|
+
}
|
|
321
|
+
if (indent) {
|
|
322
|
+
return tag + "{" + indentedJoin(ys, indent) + "}";
|
|
323
|
+
}
|
|
324
|
+
return tag + "{ " + $join.call(ys, ", ") + " }";
|
|
325
|
+
}
|
|
326
|
+
return String(obj);
|
|
327
|
+
};
|
|
328
|
+
function wrapQuotes(s, defaultStyle, opts) {
|
|
329
|
+
var style = opts.quoteStyle || defaultStyle;
|
|
330
|
+
var quoteChar = quotes[style];
|
|
331
|
+
return quoteChar + s + quoteChar;
|
|
332
|
+
}
|
|
333
|
+
function quote(s) {
|
|
334
|
+
return $replace$1.call(String(s), /"/g, """);
|
|
335
|
+
}
|
|
336
|
+
function canTrustToString(obj) {
|
|
337
|
+
return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
|
|
338
|
+
}
|
|
339
|
+
function isArray$2(obj) {
|
|
340
|
+
return toStr(obj) === "[object Array]" && canTrustToString(obj);
|
|
341
|
+
}
|
|
342
|
+
function isDate(obj) {
|
|
343
|
+
return toStr(obj) === "[object Date]" && canTrustToString(obj);
|
|
344
|
+
}
|
|
345
|
+
function isRegExp$1(obj) {
|
|
346
|
+
return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
|
|
347
|
+
}
|
|
348
|
+
function isError(obj) {
|
|
349
|
+
return toStr(obj) === "[object Error]" && canTrustToString(obj);
|
|
350
|
+
}
|
|
351
|
+
function isString(obj) {
|
|
352
|
+
return toStr(obj) === "[object String]" && canTrustToString(obj);
|
|
353
|
+
}
|
|
354
|
+
function isNumber(obj) {
|
|
355
|
+
return toStr(obj) === "[object Number]" && canTrustToString(obj);
|
|
356
|
+
}
|
|
357
|
+
function isBoolean(obj) {
|
|
358
|
+
return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
|
|
359
|
+
}
|
|
360
|
+
function isSymbol(obj) {
|
|
361
|
+
if (hasShammedSymbols) {
|
|
362
|
+
return obj && typeof obj === "object" && obj instanceof Symbol;
|
|
363
|
+
}
|
|
364
|
+
if (typeof obj === "symbol") {
|
|
365
|
+
return true;
|
|
366
|
+
}
|
|
367
|
+
if (!obj || typeof obj !== "object" || !symToString) {
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
try {
|
|
371
|
+
symToString.call(obj);
|
|
372
|
+
return true;
|
|
373
|
+
} catch (e) {
|
|
374
|
+
}
|
|
375
|
+
return false;
|
|
376
|
+
}
|
|
377
|
+
function isBigInt(obj) {
|
|
378
|
+
if (!obj || typeof obj !== "object" || !bigIntValueOf) {
|
|
379
|
+
return false;
|
|
380
|
+
}
|
|
381
|
+
try {
|
|
382
|
+
bigIntValueOf.call(obj);
|
|
383
|
+
return true;
|
|
384
|
+
} catch (e) {
|
|
385
|
+
}
|
|
386
|
+
return false;
|
|
387
|
+
}
|
|
388
|
+
var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
|
|
389
|
+
return key in this;
|
|
390
|
+
};
|
|
391
|
+
function has$2(obj, key) {
|
|
392
|
+
return hasOwn$1.call(obj, key);
|
|
393
|
+
}
|
|
394
|
+
function toStr(obj) {
|
|
395
|
+
return objectToString.call(obj);
|
|
396
|
+
}
|
|
397
|
+
function nameOf(f) {
|
|
398
|
+
if (f.name) {
|
|
399
|
+
return f.name;
|
|
400
|
+
}
|
|
401
|
+
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
|
402
|
+
if (m) {
|
|
403
|
+
return m[1];
|
|
404
|
+
}
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
function indexOf(xs, x) {
|
|
408
|
+
if (xs.indexOf) {
|
|
409
|
+
return xs.indexOf(x);
|
|
410
|
+
}
|
|
411
|
+
for (var i = 0, l = xs.length; i < l; i++) {
|
|
412
|
+
if (xs[i] === x) {
|
|
413
|
+
return i;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return -1;
|
|
417
|
+
}
|
|
418
|
+
function isMap(x) {
|
|
419
|
+
if (!mapSize || !x || typeof x !== "object") {
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
try {
|
|
423
|
+
mapSize.call(x);
|
|
424
|
+
try {
|
|
425
|
+
setSize.call(x);
|
|
426
|
+
} catch (s) {
|
|
427
|
+
return true;
|
|
428
|
+
}
|
|
429
|
+
return x instanceof Map;
|
|
430
|
+
} catch (e) {
|
|
431
|
+
}
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
function isWeakMap(x) {
|
|
435
|
+
if (!weakMapHas || !x || typeof x !== "object") {
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
try {
|
|
439
|
+
weakMapHas.call(x, weakMapHas);
|
|
440
|
+
try {
|
|
441
|
+
weakSetHas.call(x, weakSetHas);
|
|
442
|
+
} catch (s) {
|
|
443
|
+
return true;
|
|
444
|
+
}
|
|
445
|
+
return x instanceof WeakMap;
|
|
446
|
+
} catch (e) {
|
|
447
|
+
}
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
function isWeakRef(x) {
|
|
451
|
+
if (!weakRefDeref || !x || typeof x !== "object") {
|
|
452
|
+
return false;
|
|
453
|
+
}
|
|
454
|
+
try {
|
|
455
|
+
weakRefDeref.call(x);
|
|
456
|
+
return true;
|
|
457
|
+
} catch (e) {
|
|
458
|
+
}
|
|
459
|
+
return false;
|
|
460
|
+
}
|
|
461
|
+
function isSet(x) {
|
|
462
|
+
if (!setSize || !x || typeof x !== "object") {
|
|
463
|
+
return false;
|
|
464
|
+
}
|
|
465
|
+
try {
|
|
466
|
+
setSize.call(x);
|
|
467
|
+
try {
|
|
468
|
+
mapSize.call(x);
|
|
469
|
+
} catch (m) {
|
|
470
|
+
return true;
|
|
471
|
+
}
|
|
472
|
+
return x instanceof Set;
|
|
473
|
+
} catch (e) {
|
|
474
|
+
}
|
|
475
|
+
return false;
|
|
476
|
+
}
|
|
477
|
+
function isWeakSet(x) {
|
|
478
|
+
if (!weakSetHas || !x || typeof x !== "object") {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
try {
|
|
482
|
+
weakSetHas.call(x, weakSetHas);
|
|
483
|
+
try {
|
|
484
|
+
weakMapHas.call(x, weakMapHas);
|
|
485
|
+
} catch (s) {
|
|
486
|
+
return true;
|
|
487
|
+
}
|
|
488
|
+
return x instanceof WeakSet;
|
|
489
|
+
} catch (e) {
|
|
490
|
+
}
|
|
491
|
+
return false;
|
|
492
|
+
}
|
|
493
|
+
function isElement(x) {
|
|
494
|
+
if (!x || typeof x !== "object") {
|
|
495
|
+
return false;
|
|
496
|
+
}
|
|
497
|
+
if (typeof HTMLElement !== "undefined" && x instanceof HTMLElement) {
|
|
498
|
+
return true;
|
|
499
|
+
}
|
|
500
|
+
return typeof x.nodeName === "string" && typeof x.getAttribute === "function";
|
|
501
|
+
}
|
|
502
|
+
function inspectString(str, opts) {
|
|
503
|
+
if (str.length > opts.maxStringLength) {
|
|
504
|
+
var remaining = str.length - opts.maxStringLength;
|
|
505
|
+
var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : "");
|
|
506
|
+
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
|
507
|
+
}
|
|
508
|
+
var quoteRE = quoteREs[opts.quoteStyle || "single"];
|
|
509
|
+
quoteRE.lastIndex = 0;
|
|
510
|
+
var s = $replace$1.call($replace$1.call(str, quoteRE, "\\$1"), /[\x00-\x1f]/g, lowbyte);
|
|
511
|
+
return wrapQuotes(s, "single", opts);
|
|
512
|
+
}
|
|
513
|
+
function lowbyte(c) {
|
|
514
|
+
var n = c.charCodeAt(0);
|
|
515
|
+
var x = {
|
|
516
|
+
8: "b",
|
|
517
|
+
9: "t",
|
|
518
|
+
10: "n",
|
|
519
|
+
12: "f",
|
|
520
|
+
13: "r"
|
|
521
|
+
}[n];
|
|
522
|
+
if (x) {
|
|
523
|
+
return "\\" + x;
|
|
524
|
+
}
|
|
525
|
+
return "\\x" + (n < 16 ? "0" : "") + $toUpperCase.call(n.toString(16));
|
|
526
|
+
}
|
|
527
|
+
function markBoxed(str) {
|
|
528
|
+
return "Object(" + str + ")";
|
|
529
|
+
}
|
|
530
|
+
function weakCollectionOf(type2) {
|
|
531
|
+
return type2 + " { ? }";
|
|
532
|
+
}
|
|
533
|
+
function collectionOf(type2, size, entries, indent) {
|
|
534
|
+
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", ");
|
|
535
|
+
return type2 + " (" + size + ") {" + joinedEntries + "}";
|
|
536
|
+
}
|
|
537
|
+
function singleLineValues(xs) {
|
|
538
|
+
for (var i = 0; i < xs.length; i++) {
|
|
539
|
+
if (indexOf(xs[i], "\n") >= 0) {
|
|
540
|
+
return false;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return true;
|
|
544
|
+
}
|
|
545
|
+
function getIndent(opts, depth) {
|
|
546
|
+
var baseIndent;
|
|
547
|
+
if (opts.indent === " ") {
|
|
548
|
+
baseIndent = " ";
|
|
549
|
+
} else if (typeof opts.indent === "number" && opts.indent > 0) {
|
|
550
|
+
baseIndent = $join.call(Array(opts.indent + 1), " ");
|
|
551
|
+
} else {
|
|
552
|
+
return null;
|
|
553
|
+
}
|
|
554
|
+
return {
|
|
555
|
+
base: baseIndent,
|
|
556
|
+
prev: $join.call(Array(depth + 1), baseIndent)
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
function indentedJoin(xs, indent) {
|
|
560
|
+
if (xs.length === 0) {
|
|
561
|
+
return "";
|
|
562
|
+
}
|
|
563
|
+
var lineJoiner = "\n" + indent.prev + indent.base;
|
|
564
|
+
return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev;
|
|
565
|
+
}
|
|
566
|
+
function arrObjKeys(obj, inspect2) {
|
|
567
|
+
var isArr = isArray$2(obj);
|
|
568
|
+
var xs = [];
|
|
569
|
+
if (isArr) {
|
|
570
|
+
xs.length = obj.length;
|
|
571
|
+
for (var i = 0; i < obj.length; i++) {
|
|
572
|
+
xs[i] = has$2(obj, i) ? inspect2(obj[i], obj) : "";
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
var syms = typeof gOPS === "function" ? gOPS(obj) : [];
|
|
576
|
+
var symMap;
|
|
577
|
+
if (hasShammedSymbols) {
|
|
578
|
+
symMap = {};
|
|
579
|
+
for (var k = 0; k < syms.length; k++) {
|
|
580
|
+
symMap["$" + syms[k]] = syms[k];
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
for (var key in obj) {
|
|
584
|
+
if (!has$2(obj, key)) {
|
|
585
|
+
continue;
|
|
586
|
+
}
|
|
587
|
+
if (isArr && String(Number(key)) === key && key < obj.length) {
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) {
|
|
591
|
+
continue;
|
|
592
|
+
} else if ($test.call(/[^\w$]/, key)) {
|
|
593
|
+
xs.push(inspect2(key, obj) + ": " + inspect2(obj[key], obj));
|
|
594
|
+
} else {
|
|
595
|
+
xs.push(key + ": " + inspect2(obj[key], obj));
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
if (typeof gOPS === "function") {
|
|
599
|
+
for (var j = 0; j < syms.length; j++) {
|
|
600
|
+
if (isEnumerable.call(obj, syms[j])) {
|
|
601
|
+
xs.push("[" + inspect2(syms[j]) + "]: " + inspect2(obj[syms[j]], obj));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return xs;
|
|
606
|
+
}
|
|
607
|
+
var inspect$3 = objectInspect;
|
|
608
|
+
var $TypeError$5 = type;
|
|
609
|
+
var listGetNode = function(list, key, isDelete) {
|
|
610
|
+
var prev = list;
|
|
611
|
+
var curr;
|
|
612
|
+
for (; (curr = prev.next) != null; prev = curr) {
|
|
613
|
+
if (curr.key === key) {
|
|
614
|
+
prev.next = curr.next;
|
|
615
|
+
if (!isDelete) {
|
|
616
|
+
curr.next = /** @type {NonNullable<typeof list.next>} */
|
|
617
|
+
list.next;
|
|
618
|
+
list.next = curr;
|
|
619
|
+
}
|
|
620
|
+
return curr;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
var listGet = function(objects, key) {
|
|
625
|
+
if (!objects) {
|
|
626
|
+
return void 0;
|
|
627
|
+
}
|
|
628
|
+
var node = listGetNode(objects, key);
|
|
629
|
+
return node && node.value;
|
|
630
|
+
};
|
|
631
|
+
var listSet = function(objects, key, value) {
|
|
632
|
+
var node = listGetNode(objects, key);
|
|
633
|
+
if (node) {
|
|
634
|
+
node.value = value;
|
|
635
|
+
} else {
|
|
636
|
+
objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
|
|
637
|
+
{
|
|
638
|
+
// eslint-disable-line no-param-reassign, no-extra-parens
|
|
639
|
+
key,
|
|
640
|
+
next: objects.next,
|
|
641
|
+
value
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
var listHas = function(objects, key) {
|
|
646
|
+
if (!objects) {
|
|
647
|
+
return false;
|
|
648
|
+
}
|
|
649
|
+
return !!listGetNode(objects, key);
|
|
650
|
+
};
|
|
651
|
+
var listDelete = function(objects, key) {
|
|
652
|
+
if (objects) {
|
|
653
|
+
return listGetNode(objects, key, true);
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
var sideChannelList = function getSideChannelList() {
|
|
657
|
+
var $o;
|
|
658
|
+
var channel = {
|
|
659
|
+
assert: function(key) {
|
|
660
|
+
if (!channel.has(key)) {
|
|
661
|
+
throw new $TypeError$5("Side channel does not contain " + inspect$3(key));
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
"delete": function(key) {
|
|
665
|
+
var root = $o && $o.next;
|
|
666
|
+
var deletedNode = listDelete($o, key);
|
|
667
|
+
if (deletedNode && root && root === deletedNode) {
|
|
668
|
+
$o = void 0;
|
|
669
|
+
}
|
|
670
|
+
return !!deletedNode;
|
|
671
|
+
},
|
|
672
|
+
get: function(key) {
|
|
673
|
+
return listGet($o, key);
|
|
674
|
+
},
|
|
675
|
+
has: function(key) {
|
|
676
|
+
return listHas($o, key);
|
|
677
|
+
},
|
|
678
|
+
set: function(key, value) {
|
|
679
|
+
if (!$o) {
|
|
680
|
+
$o = {
|
|
681
|
+
next: void 0
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
listSet(
|
|
685
|
+
/** @type {NonNullable<typeof $o>} */
|
|
686
|
+
$o,
|
|
687
|
+
key,
|
|
688
|
+
value
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
return channel;
|
|
693
|
+
};
|
|
694
|
+
var esObjectAtoms = Object;
|
|
695
|
+
var esErrors = Error;
|
|
696
|
+
var _eval = EvalError;
|
|
697
|
+
var range = RangeError;
|
|
698
|
+
var ref = ReferenceError;
|
|
699
|
+
var syntax = SyntaxError;
|
|
700
|
+
var uri = URIError;
|
|
701
|
+
var abs$1 = Math.abs;
|
|
702
|
+
var floor$1 = Math.floor;
|
|
703
|
+
var max$1 = Math.max;
|
|
704
|
+
var min$1 = Math.min;
|
|
705
|
+
var pow$1 = Math.pow;
|
|
706
|
+
var round$1 = Math.round;
|
|
707
|
+
var _isNaN = Number.isNaN || function isNaN2(a) {
|
|
708
|
+
return a !== a;
|
|
709
|
+
};
|
|
710
|
+
var $isNaN = _isNaN;
|
|
711
|
+
var sign$1 = function sign(number) {
|
|
712
|
+
if ($isNaN(number) || number === 0) {
|
|
713
|
+
return number;
|
|
714
|
+
}
|
|
715
|
+
return number < 0 ? -1 : 1;
|
|
716
|
+
};
|
|
717
|
+
var gOPD = Object.getOwnPropertyDescriptor;
|
|
718
|
+
var $gOPD$1 = gOPD;
|
|
719
|
+
if ($gOPD$1) {
|
|
720
|
+
try {
|
|
721
|
+
$gOPD$1([], "length");
|
|
722
|
+
} catch (e) {
|
|
723
|
+
$gOPD$1 = null;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
var gopd = $gOPD$1;
|
|
727
|
+
var $defineProperty$1 = Object.defineProperty || false;
|
|
728
|
+
if ($defineProperty$1) {
|
|
729
|
+
try {
|
|
730
|
+
$defineProperty$1({}, "a", { value: 1 });
|
|
731
|
+
} catch (e) {
|
|
732
|
+
$defineProperty$1 = false;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
var esDefineProperty = $defineProperty$1;
|
|
736
|
+
var shams;
|
|
737
|
+
var hasRequiredShams;
|
|
738
|
+
function requireShams() {
|
|
739
|
+
if (hasRequiredShams) return shams;
|
|
740
|
+
hasRequiredShams = 1;
|
|
741
|
+
shams = function hasSymbols2() {
|
|
742
|
+
if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") {
|
|
743
|
+
return false;
|
|
744
|
+
}
|
|
745
|
+
if (typeof Symbol.iterator === "symbol") {
|
|
746
|
+
return true;
|
|
747
|
+
}
|
|
748
|
+
var obj = {};
|
|
749
|
+
var sym = Symbol("test");
|
|
750
|
+
var symObj = Object(sym);
|
|
751
|
+
if (typeof sym === "string") {
|
|
752
|
+
return false;
|
|
753
|
+
}
|
|
754
|
+
if (Object.prototype.toString.call(sym) !== "[object Symbol]") {
|
|
755
|
+
return false;
|
|
756
|
+
}
|
|
757
|
+
if (Object.prototype.toString.call(symObj) !== "[object Symbol]") {
|
|
758
|
+
return false;
|
|
759
|
+
}
|
|
760
|
+
var symVal = 42;
|
|
761
|
+
obj[sym] = symVal;
|
|
762
|
+
for (var _ in obj) {
|
|
763
|
+
return false;
|
|
764
|
+
}
|
|
765
|
+
if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) {
|
|
766
|
+
return false;
|
|
767
|
+
}
|
|
768
|
+
if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) {
|
|
769
|
+
return false;
|
|
770
|
+
}
|
|
771
|
+
var syms = Object.getOwnPropertySymbols(obj);
|
|
772
|
+
if (syms.length !== 1 || syms[0] !== sym) {
|
|
773
|
+
return false;
|
|
774
|
+
}
|
|
775
|
+
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) {
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
if (typeof Object.getOwnPropertyDescriptor === "function") {
|
|
779
|
+
var descriptor = (
|
|
780
|
+
/** @type {PropertyDescriptor} */
|
|
781
|
+
Object.getOwnPropertyDescriptor(obj, sym)
|
|
782
|
+
);
|
|
783
|
+
if (descriptor.value !== symVal || descriptor.enumerable !== true) {
|
|
784
|
+
return false;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
return true;
|
|
788
|
+
};
|
|
789
|
+
return shams;
|
|
790
|
+
}
|
|
791
|
+
var hasSymbols$1;
|
|
792
|
+
var hasRequiredHasSymbols;
|
|
793
|
+
function requireHasSymbols() {
|
|
794
|
+
if (hasRequiredHasSymbols) return hasSymbols$1;
|
|
795
|
+
hasRequiredHasSymbols = 1;
|
|
796
|
+
var origSymbol = typeof Symbol !== "undefined" && Symbol;
|
|
797
|
+
var hasSymbolSham = requireShams();
|
|
798
|
+
hasSymbols$1 = function hasNativeSymbols() {
|
|
799
|
+
if (typeof origSymbol !== "function") {
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
802
|
+
if (typeof Symbol !== "function") {
|
|
803
|
+
return false;
|
|
804
|
+
}
|
|
805
|
+
if (typeof origSymbol("foo") !== "symbol") {
|
|
806
|
+
return false;
|
|
807
|
+
}
|
|
808
|
+
if (typeof Symbol("bar") !== "symbol") {
|
|
809
|
+
return false;
|
|
810
|
+
}
|
|
811
|
+
return hasSymbolSham();
|
|
812
|
+
};
|
|
813
|
+
return hasSymbols$1;
|
|
814
|
+
}
|
|
815
|
+
var Reflect_getPrototypeOf;
|
|
816
|
+
var hasRequiredReflect_getPrototypeOf;
|
|
817
|
+
function requireReflect_getPrototypeOf() {
|
|
818
|
+
if (hasRequiredReflect_getPrototypeOf) return Reflect_getPrototypeOf;
|
|
819
|
+
hasRequiredReflect_getPrototypeOf = 1;
|
|
820
|
+
Reflect_getPrototypeOf = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null;
|
|
821
|
+
return Reflect_getPrototypeOf;
|
|
822
|
+
}
|
|
823
|
+
var Object_getPrototypeOf;
|
|
824
|
+
var hasRequiredObject_getPrototypeOf;
|
|
825
|
+
function requireObject_getPrototypeOf() {
|
|
826
|
+
if (hasRequiredObject_getPrototypeOf) return Object_getPrototypeOf;
|
|
827
|
+
hasRequiredObject_getPrototypeOf = 1;
|
|
828
|
+
var $Object2 = esObjectAtoms;
|
|
829
|
+
Object_getPrototypeOf = $Object2.getPrototypeOf || null;
|
|
830
|
+
return Object_getPrototypeOf;
|
|
831
|
+
}
|
|
832
|
+
var implementation;
|
|
833
|
+
var hasRequiredImplementation;
|
|
834
|
+
function requireImplementation() {
|
|
835
|
+
if (hasRequiredImplementation) return implementation;
|
|
836
|
+
hasRequiredImplementation = 1;
|
|
837
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
838
|
+
var toStr2 = Object.prototype.toString;
|
|
839
|
+
var max2 = Math.max;
|
|
840
|
+
var funcType = "[object Function]";
|
|
841
|
+
var concatty = function concatty2(a, b) {
|
|
842
|
+
var arr = [];
|
|
843
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
844
|
+
arr[i] = a[i];
|
|
845
|
+
}
|
|
846
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
847
|
+
arr[j + a.length] = b[j];
|
|
848
|
+
}
|
|
849
|
+
return arr;
|
|
850
|
+
};
|
|
851
|
+
var slicy = function slicy2(arrLike, offset) {
|
|
852
|
+
var arr = [];
|
|
853
|
+
for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
854
|
+
arr[j] = arrLike[i];
|
|
855
|
+
}
|
|
856
|
+
return arr;
|
|
857
|
+
};
|
|
858
|
+
var joiny = function(arr, joiner) {
|
|
859
|
+
var str = "";
|
|
860
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
861
|
+
str += arr[i];
|
|
862
|
+
if (i + 1 < arr.length) {
|
|
863
|
+
str += joiner;
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
return str;
|
|
867
|
+
};
|
|
868
|
+
implementation = function bind2(that) {
|
|
869
|
+
var target = this;
|
|
870
|
+
if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
|
|
871
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
872
|
+
}
|
|
873
|
+
var args = slicy(arguments, 1);
|
|
874
|
+
var bound;
|
|
875
|
+
var binder = function() {
|
|
876
|
+
if (this instanceof bound) {
|
|
877
|
+
var result = target.apply(
|
|
878
|
+
this,
|
|
879
|
+
concatty(args, arguments)
|
|
880
|
+
);
|
|
881
|
+
if (Object(result) === result) {
|
|
882
|
+
return result;
|
|
883
|
+
}
|
|
884
|
+
return this;
|
|
885
|
+
}
|
|
886
|
+
return target.apply(
|
|
887
|
+
that,
|
|
888
|
+
concatty(args, arguments)
|
|
889
|
+
);
|
|
890
|
+
};
|
|
891
|
+
var boundLength = max2(0, target.length - args.length);
|
|
892
|
+
var boundArgs = [];
|
|
893
|
+
for (var i = 0; i < boundLength; i++) {
|
|
894
|
+
boundArgs[i] = "$" + i;
|
|
895
|
+
}
|
|
896
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
897
|
+
if (target.prototype) {
|
|
898
|
+
var Empty = function Empty2() {
|
|
899
|
+
};
|
|
900
|
+
Empty.prototype = target.prototype;
|
|
901
|
+
bound.prototype = new Empty();
|
|
902
|
+
Empty.prototype = null;
|
|
903
|
+
}
|
|
904
|
+
return bound;
|
|
905
|
+
};
|
|
906
|
+
return implementation;
|
|
907
|
+
}
|
|
908
|
+
var functionBind;
|
|
909
|
+
var hasRequiredFunctionBind;
|
|
910
|
+
function requireFunctionBind() {
|
|
911
|
+
if (hasRequiredFunctionBind) return functionBind;
|
|
912
|
+
hasRequiredFunctionBind = 1;
|
|
913
|
+
var implementation2 = requireImplementation();
|
|
914
|
+
functionBind = Function.prototype.bind || implementation2;
|
|
915
|
+
return functionBind;
|
|
916
|
+
}
|
|
917
|
+
var functionCall;
|
|
918
|
+
var hasRequiredFunctionCall;
|
|
919
|
+
function requireFunctionCall() {
|
|
920
|
+
if (hasRequiredFunctionCall) return functionCall;
|
|
921
|
+
hasRequiredFunctionCall = 1;
|
|
922
|
+
functionCall = Function.prototype.call;
|
|
923
|
+
return functionCall;
|
|
924
|
+
}
|
|
925
|
+
var functionApply;
|
|
926
|
+
var hasRequiredFunctionApply;
|
|
927
|
+
function requireFunctionApply() {
|
|
928
|
+
if (hasRequiredFunctionApply) return functionApply;
|
|
929
|
+
hasRequiredFunctionApply = 1;
|
|
930
|
+
functionApply = Function.prototype.apply;
|
|
931
|
+
return functionApply;
|
|
932
|
+
}
|
|
933
|
+
var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
|
|
934
|
+
var bind$2 = requireFunctionBind();
|
|
935
|
+
var $apply$1 = requireFunctionApply();
|
|
936
|
+
var $call$2 = requireFunctionCall();
|
|
937
|
+
var $reflectApply = reflectApply;
|
|
938
|
+
var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
|
|
939
|
+
var bind$1 = requireFunctionBind();
|
|
940
|
+
var $TypeError$4 = type;
|
|
941
|
+
var $call$1 = requireFunctionCall();
|
|
942
|
+
var $actualApply = actualApply;
|
|
943
|
+
var callBindApplyHelpers = function callBindBasic(args) {
|
|
944
|
+
if (args.length < 1 || typeof args[0] !== "function") {
|
|
945
|
+
throw new $TypeError$4("a function is required");
|
|
946
|
+
}
|
|
947
|
+
return $actualApply(bind$1, $call$1, args);
|
|
948
|
+
};
|
|
949
|
+
var get;
|
|
950
|
+
var hasRequiredGet;
|
|
951
|
+
function requireGet() {
|
|
952
|
+
if (hasRequiredGet) return get;
|
|
953
|
+
hasRequiredGet = 1;
|
|
954
|
+
var callBind = callBindApplyHelpers;
|
|
955
|
+
var gOPD2 = gopd;
|
|
956
|
+
var hasProtoAccessor;
|
|
957
|
+
try {
|
|
958
|
+
hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */
|
|
959
|
+
[].__proto__ === Array.prototype;
|
|
960
|
+
} catch (e) {
|
|
961
|
+
if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") {
|
|
962
|
+
throw e;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
var desc = !!hasProtoAccessor && gOPD2 && gOPD2(
|
|
966
|
+
Object.prototype,
|
|
967
|
+
/** @type {keyof typeof Object.prototype} */
|
|
968
|
+
"__proto__"
|
|
969
|
+
);
|
|
970
|
+
var $Object2 = Object;
|
|
971
|
+
var $getPrototypeOf = $Object2.getPrototypeOf;
|
|
972
|
+
get = desc && typeof desc.get === "function" ? callBind([desc.get]) : typeof $getPrototypeOf === "function" ? (
|
|
973
|
+
/** @type {import('./get')} */
|
|
974
|
+
function getDunder(value) {
|
|
975
|
+
return $getPrototypeOf(value == null ? value : $Object2(value));
|
|
976
|
+
}
|
|
977
|
+
) : false;
|
|
978
|
+
return get;
|
|
979
|
+
}
|
|
980
|
+
var getProto$1;
|
|
981
|
+
var hasRequiredGetProto;
|
|
982
|
+
function requireGetProto() {
|
|
983
|
+
if (hasRequiredGetProto) return getProto$1;
|
|
984
|
+
hasRequiredGetProto = 1;
|
|
985
|
+
var reflectGetProto = requireReflect_getPrototypeOf();
|
|
986
|
+
var originalGetProto = requireObject_getPrototypeOf();
|
|
987
|
+
var getDunderProto = requireGet();
|
|
988
|
+
getProto$1 = reflectGetProto ? function getProto2(O) {
|
|
989
|
+
return reflectGetProto(O);
|
|
990
|
+
} : originalGetProto ? function getProto2(O) {
|
|
991
|
+
if (!O || typeof O !== "object" && typeof O !== "function") {
|
|
992
|
+
throw new TypeError("getProto: not an object");
|
|
993
|
+
}
|
|
994
|
+
return originalGetProto(O);
|
|
995
|
+
} : getDunderProto ? function getProto2(O) {
|
|
996
|
+
return getDunderProto(O);
|
|
997
|
+
} : null;
|
|
998
|
+
return getProto$1;
|
|
999
|
+
}
|
|
1000
|
+
var hasown;
|
|
1001
|
+
var hasRequiredHasown;
|
|
1002
|
+
function requireHasown() {
|
|
1003
|
+
if (hasRequiredHasown) return hasown;
|
|
1004
|
+
hasRequiredHasown = 1;
|
|
1005
|
+
var call = Function.prototype.call;
|
|
1006
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
1007
|
+
var bind2 = requireFunctionBind();
|
|
1008
|
+
hasown = bind2.call(call, $hasOwn);
|
|
1009
|
+
return hasown;
|
|
1010
|
+
}
|
|
1011
|
+
var undefined$1;
|
|
1012
|
+
var $Object = esObjectAtoms;
|
|
1013
|
+
var $Error = esErrors;
|
|
1014
|
+
var $EvalError = _eval;
|
|
1015
|
+
var $RangeError = range;
|
|
1016
|
+
var $ReferenceError = ref;
|
|
1017
|
+
var $SyntaxError = syntax;
|
|
1018
|
+
var $TypeError$3 = type;
|
|
1019
|
+
var $URIError = uri;
|
|
1020
|
+
var abs = abs$1;
|
|
1021
|
+
var floor = floor$1;
|
|
1022
|
+
var max = max$1;
|
|
1023
|
+
var min = min$1;
|
|
1024
|
+
var pow = pow$1;
|
|
1025
|
+
var round = round$1;
|
|
1026
|
+
var sign2 = sign$1;
|
|
1027
|
+
var $Function = Function;
|
|
1028
|
+
var getEvalledConstructor = function(expressionSyntax) {
|
|
1029
|
+
try {
|
|
1030
|
+
return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
|
|
1031
|
+
} catch (e) {
|
|
1032
|
+
}
|
|
1033
|
+
};
|
|
1034
|
+
var $gOPD = gopd;
|
|
1035
|
+
var $defineProperty = esDefineProperty;
|
|
1036
|
+
var throwTypeError = function() {
|
|
1037
|
+
throw new $TypeError$3();
|
|
1038
|
+
};
|
|
1039
|
+
var ThrowTypeError = $gOPD ? function() {
|
|
1040
|
+
try {
|
|
1041
|
+
arguments.callee;
|
|
1042
|
+
return throwTypeError;
|
|
1043
|
+
} catch (calleeThrows) {
|
|
1044
|
+
try {
|
|
1045
|
+
return $gOPD(arguments, "callee").get;
|
|
1046
|
+
} catch (gOPDthrows) {
|
|
1047
|
+
return throwTypeError;
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
}() : throwTypeError;
|
|
1051
|
+
var hasSymbols = requireHasSymbols()();
|
|
1052
|
+
var getProto = requireGetProto();
|
|
1053
|
+
var $ObjectGPO = requireObject_getPrototypeOf();
|
|
1054
|
+
var $ReflectGPO = requireReflect_getPrototypeOf();
|
|
1055
|
+
var $apply = requireFunctionApply();
|
|
1056
|
+
var $call = requireFunctionCall();
|
|
1057
|
+
var needsEval = {};
|
|
1058
|
+
var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
|
|
1059
|
+
var INTRINSICS = {
|
|
1060
|
+
__proto__: null,
|
|
1061
|
+
"%AggregateError%": typeof AggregateError === "undefined" ? undefined$1 : AggregateError,
|
|
1062
|
+
"%Array%": Array,
|
|
1063
|
+
"%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined$1 : ArrayBuffer,
|
|
1064
|
+
"%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
|
|
1065
|
+
"%AsyncFromSyncIteratorPrototype%": undefined$1,
|
|
1066
|
+
"%AsyncFunction%": needsEval,
|
|
1067
|
+
"%AsyncGenerator%": needsEval,
|
|
1068
|
+
"%AsyncGeneratorFunction%": needsEval,
|
|
1069
|
+
"%AsyncIteratorPrototype%": needsEval,
|
|
1070
|
+
"%Atomics%": typeof Atomics === "undefined" ? undefined$1 : Atomics,
|
|
1071
|
+
"%BigInt%": typeof BigInt === "undefined" ? undefined$1 : BigInt,
|
|
1072
|
+
"%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined$1 : BigInt64Array,
|
|
1073
|
+
"%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined$1 : BigUint64Array,
|
|
1074
|
+
"%Boolean%": Boolean,
|
|
1075
|
+
"%DataView%": typeof DataView === "undefined" ? undefined$1 : DataView,
|
|
1076
|
+
"%Date%": Date,
|
|
1077
|
+
"%decodeURI%": decodeURI,
|
|
1078
|
+
"%decodeURIComponent%": decodeURIComponent,
|
|
1079
|
+
"%encodeURI%": encodeURI,
|
|
1080
|
+
"%encodeURIComponent%": encodeURIComponent,
|
|
1081
|
+
"%Error%": $Error,
|
|
1082
|
+
"%eval%": eval,
|
|
1083
|
+
// eslint-disable-line no-eval
|
|
1084
|
+
"%EvalError%": $EvalError,
|
|
1085
|
+
"%Float16Array%": typeof Float16Array === "undefined" ? undefined$1 : Float16Array,
|
|
1086
|
+
"%Float32Array%": typeof Float32Array === "undefined" ? undefined$1 : Float32Array,
|
|
1087
|
+
"%Float64Array%": typeof Float64Array === "undefined" ? undefined$1 : Float64Array,
|
|
1088
|
+
"%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined$1 : FinalizationRegistry,
|
|
1089
|
+
"%Function%": $Function,
|
|
1090
|
+
"%GeneratorFunction%": needsEval,
|
|
1091
|
+
"%Int8Array%": typeof Int8Array === "undefined" ? undefined$1 : Int8Array,
|
|
1092
|
+
"%Int16Array%": typeof Int16Array === "undefined" ? undefined$1 : Int16Array,
|
|
1093
|
+
"%Int32Array%": typeof Int32Array === "undefined" ? undefined$1 : Int32Array,
|
|
1094
|
+
"%isFinite%": isFinite,
|
|
1095
|
+
"%isNaN%": isNaN,
|
|
1096
|
+
"%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
|
|
1097
|
+
"%JSON%": typeof JSON === "object" ? JSON : undefined$1,
|
|
1098
|
+
"%Map%": typeof Map === "undefined" ? undefined$1 : Map,
|
|
1099
|
+
"%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
1100
|
+
"%Math%": Math,
|
|
1101
|
+
"%Number%": Number,
|
|
1102
|
+
"%Object%": $Object,
|
|
1103
|
+
"%Object.getOwnPropertyDescriptor%": $gOPD,
|
|
1104
|
+
"%parseFloat%": parseFloat,
|
|
1105
|
+
"%parseInt%": parseInt,
|
|
1106
|
+
"%Promise%": typeof Promise === "undefined" ? undefined$1 : Promise,
|
|
1107
|
+
"%Proxy%": typeof Proxy === "undefined" ? undefined$1 : Proxy,
|
|
1108
|
+
"%RangeError%": $RangeError,
|
|
1109
|
+
"%ReferenceError%": $ReferenceError,
|
|
1110
|
+
"%Reflect%": typeof Reflect === "undefined" ? undefined$1 : Reflect,
|
|
1111
|
+
"%RegExp%": RegExp,
|
|
1112
|
+
"%Set%": typeof Set === "undefined" ? undefined$1 : Set,
|
|
1113
|
+
"%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined$1 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()),
|
|
1114
|
+
"%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined$1 : SharedArrayBuffer,
|
|
1115
|
+
"%String%": String,
|
|
1116
|
+
"%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined$1,
|
|
1117
|
+
"%Symbol%": hasSymbols ? Symbol : undefined$1,
|
|
1118
|
+
"%SyntaxError%": $SyntaxError,
|
|
1119
|
+
"%ThrowTypeError%": ThrowTypeError,
|
|
1120
|
+
"%TypedArray%": TypedArray,
|
|
1121
|
+
"%TypeError%": $TypeError$3,
|
|
1122
|
+
"%Uint8Array%": typeof Uint8Array === "undefined" ? undefined$1 : Uint8Array,
|
|
1123
|
+
"%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined$1 : Uint8ClampedArray,
|
|
1124
|
+
"%Uint16Array%": typeof Uint16Array === "undefined" ? undefined$1 : Uint16Array,
|
|
1125
|
+
"%Uint32Array%": typeof Uint32Array === "undefined" ? undefined$1 : Uint32Array,
|
|
1126
|
+
"%URIError%": $URIError,
|
|
1127
|
+
"%WeakMap%": typeof WeakMap === "undefined" ? undefined$1 : WeakMap,
|
|
1128
|
+
"%WeakRef%": typeof WeakRef === "undefined" ? undefined$1 : WeakRef,
|
|
1129
|
+
"%WeakSet%": typeof WeakSet === "undefined" ? undefined$1 : WeakSet,
|
|
1130
|
+
"%Function.prototype.call%": $call,
|
|
1131
|
+
"%Function.prototype.apply%": $apply,
|
|
1132
|
+
"%Object.defineProperty%": $defineProperty,
|
|
1133
|
+
"%Object.getPrototypeOf%": $ObjectGPO,
|
|
1134
|
+
"%Math.abs%": abs,
|
|
1135
|
+
"%Math.floor%": floor,
|
|
1136
|
+
"%Math.max%": max,
|
|
1137
|
+
"%Math.min%": min,
|
|
1138
|
+
"%Math.pow%": pow,
|
|
1139
|
+
"%Math.round%": round,
|
|
1140
|
+
"%Math.sign%": sign2,
|
|
1141
|
+
"%Reflect.getPrototypeOf%": $ReflectGPO
|
|
1142
|
+
};
|
|
1143
|
+
if (getProto) {
|
|
1144
|
+
try {
|
|
1145
|
+
null.error;
|
|
1146
|
+
} catch (e) {
|
|
1147
|
+
var errorProto = getProto(getProto(e));
|
|
1148
|
+
INTRINSICS["%Error.prototype%"] = errorProto;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
var doEval = function doEval2(name2) {
|
|
1152
|
+
var value;
|
|
1153
|
+
if (name2 === "%AsyncFunction%") {
|
|
1154
|
+
value = getEvalledConstructor("async function () {}");
|
|
1155
|
+
} else if (name2 === "%GeneratorFunction%") {
|
|
1156
|
+
value = getEvalledConstructor("function* () {}");
|
|
1157
|
+
} else if (name2 === "%AsyncGeneratorFunction%") {
|
|
1158
|
+
value = getEvalledConstructor("async function* () {}");
|
|
1159
|
+
} else if (name2 === "%AsyncGenerator%") {
|
|
1160
|
+
var fn = doEval2("%AsyncGeneratorFunction%");
|
|
1161
|
+
if (fn) {
|
|
1162
|
+
value = fn.prototype;
|
|
1163
|
+
}
|
|
1164
|
+
} else if (name2 === "%AsyncIteratorPrototype%") {
|
|
1165
|
+
var gen = doEval2("%AsyncGenerator%");
|
|
1166
|
+
if (gen && getProto) {
|
|
1167
|
+
value = getProto(gen.prototype);
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
INTRINSICS[name2] = value;
|
|
1171
|
+
return value;
|
|
1172
|
+
};
|
|
1173
|
+
var LEGACY_ALIASES = {
|
|
1174
|
+
__proto__: null,
|
|
1175
|
+
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
1176
|
+
"%ArrayPrototype%": ["Array", "prototype"],
|
|
1177
|
+
"%ArrayProto_entries%": ["Array", "prototype", "entries"],
|
|
1178
|
+
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
|
|
1179
|
+
"%ArrayProto_keys%": ["Array", "prototype", "keys"],
|
|
1180
|
+
"%ArrayProto_values%": ["Array", "prototype", "values"],
|
|
1181
|
+
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
|
|
1182
|
+
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
|
|
1183
|
+
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
|
|
1184
|
+
"%BooleanPrototype%": ["Boolean", "prototype"],
|
|
1185
|
+
"%DataViewPrototype%": ["DataView", "prototype"],
|
|
1186
|
+
"%DatePrototype%": ["Date", "prototype"],
|
|
1187
|
+
"%ErrorPrototype%": ["Error", "prototype"],
|
|
1188
|
+
"%EvalErrorPrototype%": ["EvalError", "prototype"],
|
|
1189
|
+
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
|
|
1190
|
+
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
|
|
1191
|
+
"%FunctionPrototype%": ["Function", "prototype"],
|
|
1192
|
+
"%Generator%": ["GeneratorFunction", "prototype"],
|
|
1193
|
+
"%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
|
|
1194
|
+
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
|
|
1195
|
+
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
|
|
1196
|
+
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
|
|
1197
|
+
"%JSONParse%": ["JSON", "parse"],
|
|
1198
|
+
"%JSONStringify%": ["JSON", "stringify"],
|
|
1199
|
+
"%MapPrototype%": ["Map", "prototype"],
|
|
1200
|
+
"%NumberPrototype%": ["Number", "prototype"],
|
|
1201
|
+
"%ObjectPrototype%": ["Object", "prototype"],
|
|
1202
|
+
"%ObjProto_toString%": ["Object", "prototype", "toString"],
|
|
1203
|
+
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
|
|
1204
|
+
"%PromisePrototype%": ["Promise", "prototype"],
|
|
1205
|
+
"%PromiseProto_then%": ["Promise", "prototype", "then"],
|
|
1206
|
+
"%Promise_all%": ["Promise", "all"],
|
|
1207
|
+
"%Promise_reject%": ["Promise", "reject"],
|
|
1208
|
+
"%Promise_resolve%": ["Promise", "resolve"],
|
|
1209
|
+
"%RangeErrorPrototype%": ["RangeError", "prototype"],
|
|
1210
|
+
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
|
|
1211
|
+
"%RegExpPrototype%": ["RegExp", "prototype"],
|
|
1212
|
+
"%SetPrototype%": ["Set", "prototype"],
|
|
1213
|
+
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
|
|
1214
|
+
"%StringPrototype%": ["String", "prototype"],
|
|
1215
|
+
"%SymbolPrototype%": ["Symbol", "prototype"],
|
|
1216
|
+
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
|
|
1217
|
+
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
|
|
1218
|
+
"%TypeErrorPrototype%": ["TypeError", "prototype"],
|
|
1219
|
+
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
|
|
1220
|
+
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
|
|
1221
|
+
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
|
|
1222
|
+
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
|
|
1223
|
+
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
1224
|
+
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
1225
|
+
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
1226
|
+
};
|
|
1227
|
+
var bind = requireFunctionBind();
|
|
1228
|
+
var hasOwn = requireHasown();
|
|
1229
|
+
var $concat = bind.call($call, Array.prototype.concat);
|
|
1230
|
+
var $spliceApply = bind.call($apply, Array.prototype.splice);
|
|
1231
|
+
var $replace = bind.call($call, String.prototype.replace);
|
|
1232
|
+
var $strSlice = bind.call($call, String.prototype.slice);
|
|
1233
|
+
var $exec = bind.call($call, RegExp.prototype.exec);
|
|
1234
|
+
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
|
1235
|
+
var reEscapeChar = /\\(\\)?/g;
|
|
1236
|
+
var stringToPath = function stringToPath2(string) {
|
|
1237
|
+
var first = $strSlice(string, 0, 1);
|
|
1238
|
+
var last = $strSlice(string, -1);
|
|
1239
|
+
if (first === "%" && last !== "%") {
|
|
1240
|
+
throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`");
|
|
1241
|
+
} else if (last === "%" && first !== "%") {
|
|
1242
|
+
throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`");
|
|
1243
|
+
}
|
|
1244
|
+
var result = [];
|
|
1245
|
+
$replace(string, rePropName, function(match, number, quote2, subString) {
|
|
1246
|
+
result[result.length] = quote2 ? $replace(subString, reEscapeChar, "$1") : number || match;
|
|
1247
|
+
});
|
|
1248
|
+
return result;
|
|
1249
|
+
};
|
|
1250
|
+
var getBaseIntrinsic = function getBaseIntrinsic2(name2, allowMissing) {
|
|
1251
|
+
var intrinsicName = name2;
|
|
1252
|
+
var alias;
|
|
1253
|
+
if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
|
|
1254
|
+
alias = LEGACY_ALIASES[intrinsicName];
|
|
1255
|
+
intrinsicName = "%" + alias[0] + "%";
|
|
1256
|
+
}
|
|
1257
|
+
if (hasOwn(INTRINSICS, intrinsicName)) {
|
|
1258
|
+
var value = INTRINSICS[intrinsicName];
|
|
1259
|
+
if (value === needsEval) {
|
|
1260
|
+
value = doEval(intrinsicName);
|
|
1261
|
+
}
|
|
1262
|
+
if (typeof value === "undefined" && !allowMissing) {
|
|
1263
|
+
throw new $TypeError$3("intrinsic " + name2 + " exists, but is not available. Please file an issue!");
|
|
1264
|
+
}
|
|
1265
|
+
return {
|
|
1266
|
+
alias,
|
|
1267
|
+
name: intrinsicName,
|
|
1268
|
+
value
|
|
1269
|
+
};
|
|
1270
|
+
}
|
|
1271
|
+
throw new $SyntaxError("intrinsic " + name2 + " does not exist!");
|
|
1272
|
+
};
|
|
1273
|
+
var getIntrinsic = function GetIntrinsic(name2, allowMissing) {
|
|
1274
|
+
if (typeof name2 !== "string" || name2.length === 0) {
|
|
1275
|
+
throw new $TypeError$3("intrinsic name must be a non-empty string");
|
|
1276
|
+
}
|
|
1277
|
+
if (arguments.length > 1 && typeof allowMissing !== "boolean") {
|
|
1278
|
+
throw new $TypeError$3('"allowMissing" argument must be a boolean');
|
|
1279
|
+
}
|
|
1280
|
+
if ($exec(/^%?[^%]*%?$/, name2) === null) {
|
|
1281
|
+
throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
1282
|
+
}
|
|
1283
|
+
var parts = stringToPath(name2);
|
|
1284
|
+
var intrinsicBaseName = parts.length > 0 ? parts[0] : "";
|
|
1285
|
+
var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing);
|
|
1286
|
+
var intrinsicRealName = intrinsic.name;
|
|
1287
|
+
var value = intrinsic.value;
|
|
1288
|
+
var skipFurtherCaching = false;
|
|
1289
|
+
var alias = intrinsic.alias;
|
|
1290
|
+
if (alias) {
|
|
1291
|
+
intrinsicBaseName = alias[0];
|
|
1292
|
+
$spliceApply(parts, $concat([0, 1], alias));
|
|
1293
|
+
}
|
|
1294
|
+
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
|
1295
|
+
var part = parts[i];
|
|
1296
|
+
var first = $strSlice(part, 0, 1);
|
|
1297
|
+
var last = $strSlice(part, -1);
|
|
1298
|
+
if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) {
|
|
1299
|
+
throw new $SyntaxError("property names with quotes must have matching quotes");
|
|
1300
|
+
}
|
|
1301
|
+
if (part === "constructor" || !isOwn) {
|
|
1302
|
+
skipFurtherCaching = true;
|
|
1303
|
+
}
|
|
1304
|
+
intrinsicBaseName += "." + part;
|
|
1305
|
+
intrinsicRealName = "%" + intrinsicBaseName + "%";
|
|
1306
|
+
if (hasOwn(INTRINSICS, intrinsicRealName)) {
|
|
1307
|
+
value = INTRINSICS[intrinsicRealName];
|
|
1308
|
+
} else if (value != null) {
|
|
1309
|
+
if (!(part in value)) {
|
|
1310
|
+
if (!allowMissing) {
|
|
1311
|
+
throw new $TypeError$3("base intrinsic for " + name2 + " exists, but the property is not available.");
|
|
1312
|
+
}
|
|
1313
|
+
return void 0;
|
|
1314
|
+
}
|
|
1315
|
+
if ($gOPD && i + 1 >= parts.length) {
|
|
1316
|
+
var desc = $gOPD(value, part);
|
|
1317
|
+
isOwn = !!desc;
|
|
1318
|
+
if (isOwn && "get" in desc && !("originalValue" in desc.get)) {
|
|
1319
|
+
value = desc.get;
|
|
1320
|
+
} else {
|
|
1321
|
+
value = value[part];
|
|
1322
|
+
}
|
|
1323
|
+
} else {
|
|
1324
|
+
isOwn = hasOwn(value, part);
|
|
1325
|
+
value = value[part];
|
|
1326
|
+
}
|
|
1327
|
+
if (isOwn && !skipFurtherCaching) {
|
|
1328
|
+
INTRINSICS[intrinsicRealName] = value;
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
return value;
|
|
1333
|
+
};
|
|
1334
|
+
var GetIntrinsic$2 = getIntrinsic;
|
|
1335
|
+
var callBindBasic2 = callBindApplyHelpers;
|
|
1336
|
+
var $indexOf = callBindBasic2([GetIntrinsic$2("%String.prototype.indexOf%")]);
|
|
1337
|
+
var callBound$2 = function callBoundIntrinsic(name2, allowMissing) {
|
|
1338
|
+
var intrinsic = (
|
|
1339
|
+
/** @type {(this: unknown, ...args: unknown[]) => unknown} */
|
|
1340
|
+
GetIntrinsic$2(name2, !!allowMissing)
|
|
1341
|
+
);
|
|
1342
|
+
if (typeof intrinsic === "function" && $indexOf(name2, ".prototype.") > -1) {
|
|
1343
|
+
return callBindBasic2(
|
|
1344
|
+
/** @type {const} */
|
|
1345
|
+
[intrinsic]
|
|
1346
|
+
);
|
|
1347
|
+
}
|
|
1348
|
+
return intrinsic;
|
|
1349
|
+
};
|
|
1350
|
+
var GetIntrinsic$1 = getIntrinsic;
|
|
1351
|
+
var callBound$1 = callBound$2;
|
|
1352
|
+
var inspect$2 = objectInspect;
|
|
1353
|
+
var $TypeError$2 = type;
|
|
1354
|
+
var $Map = GetIntrinsic$1("%Map%", true);
|
|
1355
|
+
var $mapGet = callBound$1("Map.prototype.get", true);
|
|
1356
|
+
var $mapSet = callBound$1("Map.prototype.set", true);
|
|
1357
|
+
var $mapHas = callBound$1("Map.prototype.has", true);
|
|
1358
|
+
var $mapDelete = callBound$1("Map.prototype.delete", true);
|
|
1359
|
+
var $mapSize = callBound$1("Map.prototype.size", true);
|
|
1360
|
+
var sideChannelMap = !!$Map && /** @type {Exclude<import('.'), false>} */
|
|
1361
|
+
function getSideChannelMap() {
|
|
1362
|
+
var $m;
|
|
1363
|
+
var channel = {
|
|
1364
|
+
assert: function(key) {
|
|
1365
|
+
if (!channel.has(key)) {
|
|
1366
|
+
throw new $TypeError$2("Side channel does not contain " + inspect$2(key));
|
|
1367
|
+
}
|
|
1368
|
+
},
|
|
1369
|
+
"delete": function(key) {
|
|
1370
|
+
if ($m) {
|
|
1371
|
+
var result = $mapDelete($m, key);
|
|
1372
|
+
if ($mapSize($m) === 0) {
|
|
1373
|
+
$m = void 0;
|
|
1374
|
+
}
|
|
1375
|
+
return result;
|
|
1376
|
+
}
|
|
1377
|
+
return false;
|
|
1378
|
+
},
|
|
1379
|
+
get: function(key) {
|
|
1380
|
+
if ($m) {
|
|
1381
|
+
return $mapGet($m, key);
|
|
1382
|
+
}
|
|
1383
|
+
},
|
|
1384
|
+
has: function(key) {
|
|
1385
|
+
if ($m) {
|
|
1386
|
+
return $mapHas($m, key);
|
|
1387
|
+
}
|
|
1388
|
+
return false;
|
|
1389
|
+
},
|
|
1390
|
+
set: function(key, value) {
|
|
1391
|
+
if (!$m) {
|
|
1392
|
+
$m = new $Map();
|
|
1393
|
+
}
|
|
1394
|
+
$mapSet($m, key, value);
|
|
1395
|
+
}
|
|
1396
|
+
};
|
|
1397
|
+
return channel;
|
|
1398
|
+
};
|
|
1399
|
+
var GetIntrinsic2 = getIntrinsic;
|
|
1400
|
+
var callBound = callBound$2;
|
|
1401
|
+
var inspect$1 = objectInspect;
|
|
1402
|
+
var getSideChannelMap$1 = sideChannelMap;
|
|
1403
|
+
var $TypeError$1 = type;
|
|
1404
|
+
var $WeakMap = GetIntrinsic2("%WeakMap%", true);
|
|
1405
|
+
var $weakMapGet = callBound("WeakMap.prototype.get", true);
|
|
1406
|
+
var $weakMapSet = callBound("WeakMap.prototype.set", true);
|
|
1407
|
+
var $weakMapHas = callBound("WeakMap.prototype.has", true);
|
|
1408
|
+
var $weakMapDelete = callBound("WeakMap.prototype.delete", true);
|
|
1409
|
+
var sideChannelWeakmap = $WeakMap ? (
|
|
1410
|
+
/** @type {Exclude<import('.'), false>} */
|
|
1411
|
+
function getSideChannelWeakMap() {
|
|
1412
|
+
var $wm;
|
|
1413
|
+
var $m;
|
|
1414
|
+
var channel = {
|
|
1415
|
+
assert: function(key) {
|
|
1416
|
+
if (!channel.has(key)) {
|
|
1417
|
+
throw new $TypeError$1("Side channel does not contain " + inspect$1(key));
|
|
1418
|
+
}
|
|
1419
|
+
},
|
|
1420
|
+
"delete": function(key) {
|
|
1421
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1422
|
+
if ($wm) {
|
|
1423
|
+
return $weakMapDelete($wm, key);
|
|
1424
|
+
}
|
|
1425
|
+
} else if (getSideChannelMap$1) {
|
|
1426
|
+
if ($m) {
|
|
1427
|
+
return $m["delete"](key);
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
return false;
|
|
1431
|
+
},
|
|
1432
|
+
get: function(key) {
|
|
1433
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1434
|
+
if ($wm) {
|
|
1435
|
+
return $weakMapGet($wm, key);
|
|
1436
|
+
}
|
|
1437
|
+
}
|
|
1438
|
+
return $m && $m.get(key);
|
|
1439
|
+
},
|
|
1440
|
+
has: function(key) {
|
|
1441
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1442
|
+
if ($wm) {
|
|
1443
|
+
return $weakMapHas($wm, key);
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
return !!$m && $m.has(key);
|
|
1447
|
+
},
|
|
1448
|
+
set: function(key, value) {
|
|
1449
|
+
if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) {
|
|
1450
|
+
if (!$wm) {
|
|
1451
|
+
$wm = new $WeakMap();
|
|
1452
|
+
}
|
|
1453
|
+
$weakMapSet($wm, key, value);
|
|
1454
|
+
} else if (getSideChannelMap$1) {
|
|
1455
|
+
if (!$m) {
|
|
1456
|
+
$m = getSideChannelMap$1();
|
|
1457
|
+
}
|
|
1458
|
+
$m.set(key, value);
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
};
|
|
1462
|
+
return channel;
|
|
1463
|
+
}
|
|
1464
|
+
) : getSideChannelMap$1;
|
|
1465
|
+
var $TypeError = type;
|
|
1466
|
+
var inspect = objectInspect;
|
|
1467
|
+
var getSideChannelList2 = sideChannelList;
|
|
1468
|
+
var getSideChannelMap2 = sideChannelMap;
|
|
1469
|
+
var getSideChannelWeakMap2 = sideChannelWeakmap;
|
|
1470
|
+
var makeChannel = getSideChannelWeakMap2 || getSideChannelMap2 || getSideChannelList2;
|
|
1471
|
+
var sideChannel = function getSideChannel() {
|
|
1472
|
+
var $channelData;
|
|
1473
|
+
var channel = {
|
|
1474
|
+
assert: function(key) {
|
|
1475
|
+
if (!channel.has(key)) {
|
|
1476
|
+
throw new $TypeError("Side channel does not contain " + inspect(key));
|
|
1477
|
+
}
|
|
1478
|
+
},
|
|
1479
|
+
"delete": function(key) {
|
|
1480
|
+
return !!$channelData && $channelData["delete"](key);
|
|
1481
|
+
},
|
|
1482
|
+
get: function(key) {
|
|
1483
|
+
return $channelData && $channelData.get(key);
|
|
1484
|
+
},
|
|
1485
|
+
has: function(key) {
|
|
1486
|
+
return !!$channelData && $channelData.has(key);
|
|
1487
|
+
},
|
|
1488
|
+
set: function(key, value) {
|
|
1489
|
+
if (!$channelData) {
|
|
1490
|
+
$channelData = makeChannel();
|
|
1491
|
+
}
|
|
1492
|
+
$channelData.set(key, value);
|
|
1493
|
+
}
|
|
1494
|
+
};
|
|
1495
|
+
return channel;
|
|
1496
|
+
};
|
|
1497
|
+
var replace = String.prototype.replace;
|
|
1498
|
+
var percentTwenties = /%20/g;
|
|
1499
|
+
var Format = {
|
|
1500
|
+
RFC1738: "RFC1738",
|
|
1501
|
+
RFC3986: "RFC3986"
|
|
1502
|
+
};
|
|
1503
|
+
var formats$2 = {
|
|
1504
|
+
"default": Format.RFC3986,
|
|
1505
|
+
formatters: {
|
|
1506
|
+
RFC1738: function(value) {
|
|
1507
|
+
return replace.call(value, percentTwenties, "+");
|
|
1508
|
+
},
|
|
1509
|
+
RFC3986: function(value) {
|
|
1510
|
+
return String(value);
|
|
1511
|
+
}
|
|
1512
|
+
},
|
|
1513
|
+
RFC1738: Format.RFC1738
|
|
1514
|
+
};
|
|
1515
|
+
var formats$1 = formats$2;
|
|
1516
|
+
var has$1 = Object.prototype.hasOwnProperty;
|
|
1517
|
+
var isArray$1 = Array.isArray;
|
|
1518
|
+
var hexTable = function() {
|
|
1519
|
+
var array = [];
|
|
1520
|
+
for (var i = 0; i < 256; ++i) {
|
|
1521
|
+
array.push("%" + ((i < 16 ? "0" : "") + i.toString(16)).toUpperCase());
|
|
1522
|
+
}
|
|
1523
|
+
return array;
|
|
1524
|
+
}();
|
|
1525
|
+
var compactQueue = function compactQueue2(queue) {
|
|
1526
|
+
while (queue.length > 1) {
|
|
1527
|
+
var item = queue.pop();
|
|
1528
|
+
var obj = item.obj[item.prop];
|
|
1529
|
+
if (isArray$1(obj)) {
|
|
1530
|
+
var compacted = [];
|
|
1531
|
+
for (var j = 0; j < obj.length; ++j) {
|
|
1532
|
+
if (typeof obj[j] !== "undefined") {
|
|
1533
|
+
compacted.push(obj[j]);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
item.obj[item.prop] = compacted;
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
};
|
|
1540
|
+
var arrayToObject = function arrayToObject2(source, options) {
|
|
1541
|
+
var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
1542
|
+
for (var i = 0; i < source.length; ++i) {
|
|
1543
|
+
if (typeof source[i] !== "undefined") {
|
|
1544
|
+
obj[i] = source[i];
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
return obj;
|
|
1548
|
+
};
|
|
1549
|
+
var merge = function merge2(target, source, options) {
|
|
1550
|
+
if (!source) {
|
|
1551
|
+
return target;
|
|
1552
|
+
}
|
|
1553
|
+
if (typeof source !== "object") {
|
|
1554
|
+
if (isArray$1(target)) {
|
|
1555
|
+
target.push(source);
|
|
1556
|
+
} else if (target && typeof target === "object") {
|
|
1557
|
+
if (options && (options.plainObjects || options.allowPrototypes) || !has$1.call(Object.prototype, source)) {
|
|
1558
|
+
target[source] = true;
|
|
1559
|
+
}
|
|
1560
|
+
} else {
|
|
1561
|
+
return [target, source];
|
|
1562
|
+
}
|
|
1563
|
+
return target;
|
|
1564
|
+
}
|
|
1565
|
+
if (!target || typeof target !== "object") {
|
|
1566
|
+
return [target].concat(source);
|
|
1567
|
+
}
|
|
1568
|
+
var mergeTarget = target;
|
|
1569
|
+
if (isArray$1(target) && !isArray$1(source)) {
|
|
1570
|
+
mergeTarget = arrayToObject(target, options);
|
|
1571
|
+
}
|
|
1572
|
+
if (isArray$1(target) && isArray$1(source)) {
|
|
1573
|
+
source.forEach(function(item, i) {
|
|
1574
|
+
if (has$1.call(target, i)) {
|
|
1575
|
+
var targetItem = target[i];
|
|
1576
|
+
if (targetItem && typeof targetItem === "object" && item && typeof item === "object") {
|
|
1577
|
+
target[i] = merge2(targetItem, item, options);
|
|
1578
|
+
} else {
|
|
1579
|
+
target.push(item);
|
|
1580
|
+
}
|
|
1581
|
+
} else {
|
|
1582
|
+
target[i] = item;
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
return target;
|
|
1586
|
+
}
|
|
1587
|
+
return Object.keys(source).reduce(function(acc, key) {
|
|
1588
|
+
var value = source[key];
|
|
1589
|
+
if (has$1.call(acc, key)) {
|
|
1590
|
+
acc[key] = merge2(acc[key], value, options);
|
|
1591
|
+
} else {
|
|
1592
|
+
acc[key] = value;
|
|
1593
|
+
}
|
|
1594
|
+
return acc;
|
|
1595
|
+
}, mergeTarget);
|
|
1596
|
+
};
|
|
1597
|
+
var assign = function assignSingleSource(target, source) {
|
|
1598
|
+
return Object.keys(source).reduce(function(acc, key) {
|
|
1599
|
+
acc[key] = source[key];
|
|
1600
|
+
return acc;
|
|
1601
|
+
}, target);
|
|
1602
|
+
};
|
|
1603
|
+
var decode = function(str, decoder, charset) {
|
|
1604
|
+
var strWithoutPlus = str.replace(/\+/g, " ");
|
|
1605
|
+
if (charset === "iso-8859-1") {
|
|
1606
|
+
return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
1607
|
+
}
|
|
1608
|
+
try {
|
|
1609
|
+
return decodeURIComponent(strWithoutPlus);
|
|
1610
|
+
} catch (e) {
|
|
1611
|
+
return strWithoutPlus;
|
|
1612
|
+
}
|
|
1613
|
+
};
|
|
1614
|
+
var encode = function encode2(str, defaultEncoder, charset, kind, format) {
|
|
1615
|
+
if (str.length === 0) {
|
|
1616
|
+
return str;
|
|
1617
|
+
}
|
|
1618
|
+
var string = str;
|
|
1619
|
+
if (typeof str === "symbol") {
|
|
1620
|
+
string = Symbol.prototype.toString.call(str);
|
|
1621
|
+
} else if (typeof str !== "string") {
|
|
1622
|
+
string = String(str);
|
|
1623
|
+
}
|
|
1624
|
+
if (charset === "iso-8859-1") {
|
|
1625
|
+
return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
|
|
1626
|
+
return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
|
|
1627
|
+
});
|
|
1628
|
+
}
|
|
1629
|
+
var out = "";
|
|
1630
|
+
for (var i = 0; i < string.length; ++i) {
|
|
1631
|
+
var c = string.charCodeAt(i);
|
|
1632
|
+
if (c === 45 || c === 46 || c === 95 || c === 126 || c >= 48 && c <= 57 || c >= 65 && c <= 90 || c >= 97 && c <= 122 || format === formats$1.RFC1738 && (c === 40 || c === 41)) {
|
|
1633
|
+
out += string.charAt(i);
|
|
1634
|
+
continue;
|
|
1635
|
+
}
|
|
1636
|
+
if (c < 128) {
|
|
1637
|
+
out = out + hexTable[c];
|
|
1638
|
+
continue;
|
|
1639
|
+
}
|
|
1640
|
+
if (c < 2048) {
|
|
1641
|
+
out = out + (hexTable[192 | c >> 6] + hexTable[128 | c & 63]);
|
|
1642
|
+
continue;
|
|
1643
|
+
}
|
|
1644
|
+
if (c < 55296 || c >= 57344) {
|
|
1645
|
+
out = out + (hexTable[224 | c >> 12] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63]);
|
|
1646
|
+
continue;
|
|
1647
|
+
}
|
|
1648
|
+
i += 1;
|
|
1649
|
+
c = 65536 + ((c & 1023) << 10 | string.charCodeAt(i) & 1023);
|
|
1650
|
+
out += hexTable[240 | c >> 18] + hexTable[128 | c >> 12 & 63] + hexTable[128 | c >> 6 & 63] + hexTable[128 | c & 63];
|
|
1651
|
+
}
|
|
1652
|
+
return out;
|
|
1653
|
+
};
|
|
1654
|
+
var compact = function compact2(value) {
|
|
1655
|
+
var queue = [{ obj: { o: value }, prop: "o" }];
|
|
1656
|
+
var refs = [];
|
|
1657
|
+
for (var i = 0; i < queue.length; ++i) {
|
|
1658
|
+
var item = queue[i];
|
|
1659
|
+
var obj = item.obj[item.prop];
|
|
1660
|
+
var keys = Object.keys(obj);
|
|
1661
|
+
for (var j = 0; j < keys.length; ++j) {
|
|
1662
|
+
var key = keys[j];
|
|
1663
|
+
var val = obj[key];
|
|
1664
|
+
if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) {
|
|
1665
|
+
queue.push({ obj, prop: key });
|
|
1666
|
+
refs.push(val);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
compactQueue(queue);
|
|
1671
|
+
return value;
|
|
1672
|
+
};
|
|
1673
|
+
var isRegExp = function isRegExp2(obj) {
|
|
1674
|
+
return Object.prototype.toString.call(obj) === "[object RegExp]";
|
|
1675
|
+
};
|
|
1676
|
+
var isBuffer = function isBuffer2(obj) {
|
|
1677
|
+
if (!obj || typeof obj !== "object") {
|
|
1678
|
+
return false;
|
|
1679
|
+
}
|
|
1680
|
+
return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
|
|
1681
|
+
};
|
|
1682
|
+
var combine = function combine2(a, b) {
|
|
1683
|
+
return [].concat(a, b);
|
|
1684
|
+
};
|
|
1685
|
+
var maybeMap = function maybeMap2(val, fn) {
|
|
1686
|
+
if (isArray$1(val)) {
|
|
1687
|
+
var mapped = [];
|
|
1688
|
+
for (var i = 0; i < val.length; i += 1) {
|
|
1689
|
+
mapped.push(fn(val[i]));
|
|
1690
|
+
}
|
|
1691
|
+
return mapped;
|
|
1692
|
+
}
|
|
1693
|
+
return fn(val);
|
|
1694
|
+
};
|
|
1695
|
+
var utils$1 = {
|
|
1696
|
+
arrayToObject,
|
|
1697
|
+
assign,
|
|
1698
|
+
combine,
|
|
1699
|
+
compact,
|
|
1700
|
+
decode,
|
|
1701
|
+
encode,
|
|
1702
|
+
isBuffer,
|
|
1703
|
+
isRegExp,
|
|
1704
|
+
maybeMap,
|
|
1705
|
+
merge
|
|
1706
|
+
};
|
|
1707
|
+
var getSideChannel2 = sideChannel;
|
|
1708
|
+
var utils = utils$1;
|
|
1709
|
+
var formats = formats$2;
|
|
1710
|
+
var has = Object.prototype.hasOwnProperty;
|
|
1711
|
+
var arrayPrefixGenerators = {
|
|
1712
|
+
brackets: function brackets(prefix) {
|
|
1713
|
+
return prefix + "[]";
|
|
1714
|
+
},
|
|
1715
|
+
comma: "comma",
|
|
1716
|
+
indices: function indices(prefix, key) {
|
|
1717
|
+
return prefix + "[" + key + "]";
|
|
1718
|
+
},
|
|
1719
|
+
repeat: function repeat(prefix) {
|
|
1720
|
+
return prefix;
|
|
1721
|
+
}
|
|
1722
|
+
};
|
|
1723
|
+
var isArray = Array.isArray;
|
|
1724
|
+
var push = Array.prototype.push;
|
|
1725
|
+
var pushToArray = function(arr, valueOrArray) {
|
|
1726
|
+
push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
|
|
1727
|
+
};
|
|
1728
|
+
var toISO = Date.prototype.toISOString;
|
|
1729
|
+
var defaultFormat = formats["default"];
|
|
1730
|
+
var defaults = {
|
|
1731
|
+
addQueryPrefix: false,
|
|
1732
|
+
allowDots: false,
|
|
1733
|
+
charset: "utf-8",
|
|
1734
|
+
charsetSentinel: false,
|
|
1735
|
+
delimiter: "&",
|
|
1736
|
+
encode: true,
|
|
1737
|
+
encoder: utils.encode,
|
|
1738
|
+
encodeValuesOnly: false,
|
|
1739
|
+
format: defaultFormat,
|
|
1740
|
+
formatter: formats.formatters[defaultFormat],
|
|
1741
|
+
// deprecated
|
|
1742
|
+
indices: false,
|
|
1743
|
+
serializeDate: function serializeDate(date) {
|
|
1744
|
+
return toISO.call(date);
|
|
1745
|
+
},
|
|
1746
|
+
skipNulls: false,
|
|
1747
|
+
strictNullHandling: false
|
|
1748
|
+
};
|
|
1749
|
+
var isNonNullishPrimitive = function isNonNullishPrimitive2(v) {
|
|
1750
|
+
return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
|
|
1751
|
+
};
|
|
1752
|
+
var sentinel = {};
|
|
1753
|
+
var stringify$1 = function stringify(object, prefix, generateArrayPrefix, commaRoundTrip, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate2, format, formatter, encodeValuesOnly, charset, sideChannel2) {
|
|
1754
|
+
var obj = object;
|
|
1755
|
+
var tmpSc = sideChannel2;
|
|
1756
|
+
var step = 0;
|
|
1757
|
+
var findFlag = false;
|
|
1758
|
+
while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) {
|
|
1759
|
+
var pos = tmpSc.get(object);
|
|
1760
|
+
step += 1;
|
|
1761
|
+
if (typeof pos !== "undefined") {
|
|
1762
|
+
if (pos === step) {
|
|
1763
|
+
throw new RangeError("Cyclic object value");
|
|
1764
|
+
} else {
|
|
1765
|
+
findFlag = true;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
if (typeof tmpSc.get(sentinel) === "undefined") {
|
|
1769
|
+
step = 0;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
if (typeof filter === "function") {
|
|
1773
|
+
obj = filter(prefix, obj);
|
|
1774
|
+
} else if (obj instanceof Date) {
|
|
1775
|
+
obj = serializeDate2(obj);
|
|
1776
|
+
} else if (generateArrayPrefix === "comma" && isArray(obj)) {
|
|
1777
|
+
obj = utils.maybeMap(obj, function(value2) {
|
|
1778
|
+
if (value2 instanceof Date) {
|
|
1779
|
+
return serializeDate2(value2);
|
|
1780
|
+
}
|
|
1781
|
+
return value2;
|
|
1782
|
+
});
|
|
1783
|
+
}
|
|
1784
|
+
if (obj === null) {
|
|
1785
|
+
if (strictNullHandling) {
|
|
1786
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, "key", format) : prefix;
|
|
1787
|
+
}
|
|
1788
|
+
obj = "";
|
|
1789
|
+
}
|
|
1790
|
+
if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
|
|
1791
|
+
if (encoder) {
|
|
1792
|
+
var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, "key", format);
|
|
1793
|
+
return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults.encoder, charset, "value", format))];
|
|
1794
|
+
}
|
|
1795
|
+
return [formatter(prefix) + "=" + formatter(String(obj))];
|
|
1796
|
+
}
|
|
1797
|
+
var values = [];
|
|
1798
|
+
if (typeof obj === "undefined") {
|
|
1799
|
+
return values;
|
|
1800
|
+
}
|
|
1801
|
+
var objKeys;
|
|
1802
|
+
if (generateArrayPrefix === "comma" && isArray(obj)) {
|
|
1803
|
+
if (encodeValuesOnly && encoder) {
|
|
1804
|
+
obj = utils.maybeMap(obj, encoder);
|
|
1805
|
+
}
|
|
1806
|
+
objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }];
|
|
1807
|
+
} else if (isArray(filter)) {
|
|
1808
|
+
objKeys = filter;
|
|
1809
|
+
} else {
|
|
1810
|
+
var keys = Object.keys(obj);
|
|
1811
|
+
objKeys = sort ? keys.sort(sort) : keys;
|
|
1812
|
+
}
|
|
1813
|
+
var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + "[]" : prefix;
|
|
1814
|
+
for (var j = 0; j < objKeys.length; ++j) {
|
|
1815
|
+
var key = objKeys[j];
|
|
1816
|
+
var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key];
|
|
1817
|
+
if (skipNulls && value === null) {
|
|
1818
|
+
continue;
|
|
1819
|
+
}
|
|
1820
|
+
var keyPrefix = isArray(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + key : "[" + key + "]");
|
|
1821
|
+
sideChannel2.set(object, step);
|
|
1822
|
+
var valueSideChannel = getSideChannel2();
|
|
1823
|
+
valueSideChannel.set(sentinel, sideChannel2);
|
|
1824
|
+
pushToArray(values, stringify(
|
|
1825
|
+
value,
|
|
1826
|
+
keyPrefix,
|
|
1827
|
+
generateArrayPrefix,
|
|
1828
|
+
commaRoundTrip,
|
|
1829
|
+
strictNullHandling,
|
|
1830
|
+
skipNulls,
|
|
1831
|
+
generateArrayPrefix === "comma" && encodeValuesOnly && isArray(obj) ? null : encoder,
|
|
1832
|
+
filter,
|
|
1833
|
+
sort,
|
|
1834
|
+
allowDots,
|
|
1835
|
+
serializeDate2,
|
|
1836
|
+
format,
|
|
1837
|
+
formatter,
|
|
1838
|
+
encodeValuesOnly,
|
|
1839
|
+
charset,
|
|
1840
|
+
valueSideChannel
|
|
1841
|
+
));
|
|
1842
|
+
}
|
|
1843
|
+
return values;
|
|
1844
|
+
};
|
|
1845
|
+
var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) {
|
|
1846
|
+
if (!opts) {
|
|
1847
|
+
return defaults;
|
|
1848
|
+
}
|
|
1849
|
+
if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") {
|
|
1850
|
+
throw new TypeError("Encoder has to be a function.");
|
|
1851
|
+
}
|
|
1852
|
+
var charset = opts.charset || defaults.charset;
|
|
1853
|
+
if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") {
|
|
1854
|
+
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
1855
|
+
}
|
|
1856
|
+
var format = formats["default"];
|
|
1857
|
+
if (typeof opts.format !== "undefined") {
|
|
1858
|
+
if (!has.call(formats.formatters, opts.format)) {
|
|
1859
|
+
throw new TypeError("Unknown format option provided.");
|
|
1860
|
+
}
|
|
1861
|
+
format = opts.format;
|
|
1862
|
+
}
|
|
1863
|
+
var formatter = formats.formatters[format];
|
|
1864
|
+
var filter = defaults.filter;
|
|
1865
|
+
if (typeof opts.filter === "function" || isArray(opts.filter)) {
|
|
1866
|
+
filter = opts.filter;
|
|
1867
|
+
}
|
|
1868
|
+
return {
|
|
1869
|
+
addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults.addQueryPrefix,
|
|
1870
|
+
allowDots: typeof opts.allowDots === "undefined" ? defaults.allowDots : !!opts.allowDots,
|
|
1871
|
+
charset,
|
|
1872
|
+
charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults.charsetSentinel,
|
|
1873
|
+
delimiter: typeof opts.delimiter === "undefined" ? defaults.delimiter : opts.delimiter,
|
|
1874
|
+
encode: typeof opts.encode === "boolean" ? opts.encode : defaults.encode,
|
|
1875
|
+
encoder: typeof opts.encoder === "function" ? opts.encoder : defaults.encoder,
|
|
1876
|
+
encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
|
|
1877
|
+
filter,
|
|
1878
|
+
format,
|
|
1879
|
+
formatter,
|
|
1880
|
+
serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults.serializeDate,
|
|
1881
|
+
skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults.skipNulls,
|
|
1882
|
+
sort: typeof opts.sort === "function" ? opts.sort : null,
|
|
1883
|
+
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
|
|
1884
|
+
};
|
|
1885
|
+
};
|
|
1886
|
+
var stringify_1 = function(object, opts) {
|
|
1887
|
+
var obj = object;
|
|
1888
|
+
var options = normalizeStringifyOptions(opts);
|
|
1889
|
+
var objKeys;
|
|
1890
|
+
var filter;
|
|
1891
|
+
if (typeof options.filter === "function") {
|
|
1892
|
+
filter = options.filter;
|
|
1893
|
+
obj = filter("", obj);
|
|
1894
|
+
} else if (isArray(options.filter)) {
|
|
1895
|
+
filter = options.filter;
|
|
1896
|
+
objKeys = filter;
|
|
1897
|
+
}
|
|
1898
|
+
var keys = [];
|
|
1899
|
+
if (typeof obj !== "object" || obj === null) {
|
|
1900
|
+
return "";
|
|
1901
|
+
}
|
|
1902
|
+
var arrayFormat;
|
|
1903
|
+
if (opts && opts.arrayFormat in arrayPrefixGenerators) {
|
|
1904
|
+
arrayFormat = opts.arrayFormat;
|
|
1905
|
+
} else if (opts && "indices" in opts) {
|
|
1906
|
+
arrayFormat = opts.indices ? "indices" : "repeat";
|
|
1907
|
+
} else {
|
|
1908
|
+
arrayFormat = "indices";
|
|
1909
|
+
}
|
|
1910
|
+
var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
|
|
1911
|
+
if (opts && "commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") {
|
|
1912
|
+
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
1913
|
+
}
|
|
1914
|
+
var commaRoundTrip = generateArrayPrefix === "comma" && opts && opts.commaRoundTrip;
|
|
1915
|
+
if (!objKeys) {
|
|
1916
|
+
objKeys = Object.keys(obj);
|
|
1917
|
+
}
|
|
1918
|
+
if (options.sort) {
|
|
1919
|
+
objKeys.sort(options.sort);
|
|
1920
|
+
}
|
|
1921
|
+
var sideChannel2 = getSideChannel2();
|
|
1922
|
+
for (var i = 0; i < objKeys.length; ++i) {
|
|
1923
|
+
var key = objKeys[i];
|
|
1924
|
+
if (options.skipNulls && obj[key] === null) {
|
|
1925
|
+
continue;
|
|
1926
|
+
}
|
|
1927
|
+
pushToArray(keys, stringify$1(
|
|
1928
|
+
obj[key],
|
|
1929
|
+
key,
|
|
1930
|
+
generateArrayPrefix,
|
|
1931
|
+
commaRoundTrip,
|
|
1932
|
+
options.strictNullHandling,
|
|
1933
|
+
options.skipNulls,
|
|
1934
|
+
options.encode ? options.encoder : null,
|
|
1935
|
+
options.filter,
|
|
1936
|
+
options.sort,
|
|
1937
|
+
options.allowDots,
|
|
1938
|
+
options.serializeDate,
|
|
1939
|
+
options.format,
|
|
1940
|
+
options.formatter,
|
|
1941
|
+
options.encodeValuesOnly,
|
|
1942
|
+
options.charset,
|
|
1943
|
+
sideChannel2
|
|
1944
|
+
));
|
|
1945
|
+
}
|
|
1946
|
+
var joined = keys.join(options.delimiter);
|
|
1947
|
+
var prefix = options.addQueryPrefix === true ? "?" : "";
|
|
1948
|
+
if (options.charsetSentinel) {
|
|
1949
|
+
if (options.charset === "iso-8859-1") {
|
|
1950
|
+
prefix += "utf8=%26%2310003%3B&";
|
|
1951
|
+
} else {
|
|
1952
|
+
prefix += "utf8=%E2%9C%93&";
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
return joined.length > 0 ? prefix + joined : "";
|
|
1956
|
+
};
|
|
1957
|
+
var stringify2 = stringify_1;
|
|
1958
|
+
var lib = {
|
|
1959
|
+
stringify: stringify2
|
|
1960
|
+
};
|
|
1961
|
+
const buildQueryKey = (...args) => args.filter((a) => Boolean(a));
|
|
1962
|
+
const useNotes = ({ entitySlug, documentId }) => {
|
|
1963
|
+
const { toggleNotification } = admin.useNotification();
|
|
1964
|
+
const { del, post, put, get: get2 } = admin.useFetchClient();
|
|
1965
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
1966
|
+
const queryClient2 = reactQuery.useQueryClient();
|
|
1967
|
+
const queryKey = buildQueryKey(PLUGIN_ID, "notes", entitySlug, documentId);
|
|
1968
|
+
const showNotification = (notification) => {
|
|
1969
|
+
toggleNotification({
|
|
1970
|
+
type: notification.type,
|
|
1971
|
+
message: notification.message
|
|
1972
|
+
});
|
|
1973
|
+
};
|
|
1974
|
+
const handleError = (error) => {
|
|
1975
|
+
const errorMessage = error?.response?.data?.error?.message || error?.message || { id: "notification.error" };
|
|
1976
|
+
showNotification({
|
|
1977
|
+
type: "warning",
|
|
1978
|
+
message: errorMessage
|
|
1979
|
+
});
|
|
1980
|
+
};
|
|
1981
|
+
const invalidateNotes = () => {
|
|
1982
|
+
queryClient2.invalidateQueries({ queryKey });
|
|
1983
|
+
};
|
|
1984
|
+
const notes = reactQuery.useQuery({
|
|
1985
|
+
queryKey,
|
|
1986
|
+
queryFn: async () => {
|
|
1987
|
+
const query = lib.stringify({ entitySlug, documentId }, { encodeValuesOnly: true });
|
|
1988
|
+
const response = await get2(`/${PLUGIN_ID}/notes/by-document?${query}`);
|
|
1989
|
+
return response.data;
|
|
1990
|
+
},
|
|
1991
|
+
select: (response) => response.data,
|
|
1992
|
+
enabled: !!documentId && !!entitySlug
|
|
1993
|
+
});
|
|
1994
|
+
const { mutateAsync: createNote } = reactQuery.useMutation({
|
|
1995
|
+
mutationFn: async (input) => {
|
|
1996
|
+
const response = await post(`/${PLUGIN_ID}/notes`, {
|
|
1997
|
+
data: {
|
|
1998
|
+
title: input.title,
|
|
1999
|
+
content: input.content,
|
|
2000
|
+
entitySlug: input.entitySlug,
|
|
2001
|
+
entityId: input.entityId
|
|
2002
|
+
// For new notes, this should be documentId
|
|
2003
|
+
}
|
|
2004
|
+
});
|
|
2005
|
+
return response.data.data;
|
|
2006
|
+
},
|
|
2007
|
+
onSuccess: () => {
|
|
2008
|
+
invalidateNotes();
|
|
2009
|
+
showNotification({
|
|
2010
|
+
type: "success",
|
|
2011
|
+
message: formatMessage({
|
|
2012
|
+
id: getTranslation("notification.noteCreated"),
|
|
2013
|
+
defaultMessage: "Note created successfully"
|
|
2014
|
+
})
|
|
2015
|
+
});
|
|
2016
|
+
},
|
|
2017
|
+
onError: handleError
|
|
2018
|
+
});
|
|
2019
|
+
const { mutateAsync: updateNote } = reactQuery.useMutation({
|
|
2020
|
+
mutationFn: async (input) => {
|
|
2021
|
+
const response = await put(`/${PLUGIN_ID}/notes/${input.documentId}`, {
|
|
2022
|
+
data: { title: input.title, content: input.content }
|
|
2023
|
+
});
|
|
2024
|
+
return response.data.data;
|
|
2025
|
+
},
|
|
2026
|
+
onSuccess: () => {
|
|
2027
|
+
invalidateNotes();
|
|
2028
|
+
showNotification({
|
|
2029
|
+
type: "success",
|
|
2030
|
+
message: formatMessage({
|
|
2031
|
+
id: getTranslation("notification.noteUpdated"),
|
|
2032
|
+
defaultMessage: "Note updated successfully"
|
|
2033
|
+
})
|
|
2034
|
+
});
|
|
2035
|
+
},
|
|
2036
|
+
onError: handleError
|
|
2037
|
+
});
|
|
2038
|
+
const { mutateAsync: deleteNote } = reactQuery.useMutation({
|
|
2039
|
+
mutationFn: async (id) => {
|
|
2040
|
+
await del(`/${PLUGIN_ID}/notes/${id}`);
|
|
2041
|
+
},
|
|
2042
|
+
onSuccess: () => {
|
|
2043
|
+
invalidateNotes();
|
|
2044
|
+
showNotification({
|
|
2045
|
+
type: "success",
|
|
2046
|
+
message: formatMessage({
|
|
2047
|
+
id: getTranslation("notification.noteDeleted"),
|
|
2048
|
+
defaultMessage: "Note deleted successfully"
|
|
2049
|
+
})
|
|
2050
|
+
});
|
|
2051
|
+
},
|
|
2052
|
+
onError: handleError
|
|
2053
|
+
});
|
|
2054
|
+
return {
|
|
2055
|
+
notes,
|
|
2056
|
+
createNote,
|
|
2057
|
+
updateNote,
|
|
2058
|
+
deleteNote
|
|
2059
|
+
};
|
|
2060
|
+
};
|
|
2061
|
+
const NoteModal = ({
|
|
2062
|
+
note,
|
|
2063
|
+
entitySlug,
|
|
2064
|
+
documentId,
|
|
2065
|
+
isEditing,
|
|
2066
|
+
onClose,
|
|
2067
|
+
onCreateNote,
|
|
2068
|
+
onUpdateNote
|
|
2069
|
+
}) => {
|
|
2070
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
2071
|
+
const [title, setTitle] = react.useState("");
|
|
2072
|
+
const [content, setContent] = react.useState("");
|
|
2073
|
+
const [isLoading, setIsLoading] = react.useState(false);
|
|
2074
|
+
react.useEffect(() => {
|
|
2075
|
+
if (note) {
|
|
2076
|
+
setTitle(note.title);
|
|
2077
|
+
setContent(note.content);
|
|
2078
|
+
} else {
|
|
2079
|
+
setTitle("");
|
|
2080
|
+
setContent("");
|
|
2081
|
+
}
|
|
2082
|
+
}, [note]);
|
|
2083
|
+
const handleSave = async () => {
|
|
2084
|
+
setIsLoading(true);
|
|
2085
|
+
try {
|
|
2086
|
+
if (isEditing && note) {
|
|
2087
|
+
await onUpdateNote({
|
|
2088
|
+
documentId: note.documentId,
|
|
2089
|
+
title,
|
|
2090
|
+
content
|
|
2091
|
+
});
|
|
2092
|
+
} else {
|
|
2093
|
+
await onCreateNote({
|
|
2094
|
+
title,
|
|
2095
|
+
content,
|
|
2096
|
+
entitySlug,
|
|
2097
|
+
entityId: documentId
|
|
2098
|
+
});
|
|
2099
|
+
}
|
|
2100
|
+
onClose();
|
|
2101
|
+
} finally {
|
|
2102
|
+
setIsLoading(false);
|
|
2103
|
+
}
|
|
2104
|
+
};
|
|
2105
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: true, onOpenChange: onClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
|
|
2106
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { width: "100%", children: formatMessage({
|
|
2107
|
+
id: getTranslation(`component.noteModal.${isEditing ? "edit" : "create"}.title`),
|
|
2108
|
+
defaultMessage: isEditing ? "Edit note" : "Create note"
|
|
2109
|
+
}) }),
|
|
2110
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 4, width: "100%", children: [
|
|
2111
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
2112
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
2113
|
+
id: getTranslation("component.noteModal.title.input.label"),
|
|
2114
|
+
defaultMessage: "Title"
|
|
2115
|
+
}) }),
|
|
2116
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2117
|
+
designSystem.Field.Input,
|
|
2118
|
+
{
|
|
2119
|
+
value: title,
|
|
2120
|
+
onChange: (e) => setTitle(e.target.value),
|
|
2121
|
+
placeholder: formatMessage({
|
|
2122
|
+
id: getTranslation("component.noteModal.title.input.placeholder"),
|
|
2123
|
+
defaultMessage: "Enter note title"
|
|
2124
|
+
})
|
|
2125
|
+
}
|
|
2126
|
+
)
|
|
2127
|
+
] }),
|
|
2128
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { children: [
|
|
2129
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
2130
|
+
id: getTranslation("component.noteModal.content.input.label"),
|
|
2131
|
+
defaultMessage: "Content"
|
|
2132
|
+
}) }),
|
|
2133
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2134
|
+
designSystem.Textarea,
|
|
2135
|
+
{
|
|
2136
|
+
value: content,
|
|
2137
|
+
onChange: (e) => setContent(e.target.value),
|
|
2138
|
+
placeholder: formatMessage({
|
|
2139
|
+
id: getTranslation("component.noteModal.content.input.placeholder"),
|
|
2140
|
+
defaultMessage: "Enter note content"
|
|
2141
|
+
})
|
|
2142
|
+
}
|
|
2143
|
+
)
|
|
2144
|
+
] })
|
|
2145
|
+
] }) }),
|
|
2146
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
|
|
2147
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: onClose, children: formatMessage({ id: getTranslation("component.noteModal.actions.cancel"), defaultMessage: "Cancel" }) }) }),
|
|
2148
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Action, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2149
|
+
designSystem.Button,
|
|
2150
|
+
{
|
|
2151
|
+
onClick: handleSave,
|
|
2152
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
|
|
2153
|
+
disabled: isLoading || !title.trim(),
|
|
2154
|
+
loading: isLoading,
|
|
2155
|
+
children: formatMessage({ id: getTranslation("component.noteModal.actions.save"), defaultMessage: "Save" })
|
|
2156
|
+
}
|
|
2157
|
+
) })
|
|
2158
|
+
] })
|
|
2159
|
+
] }) });
|
|
2160
|
+
};
|
|
2161
|
+
const NoteListItem = ({ note, onEdit, onDelete }) => {
|
|
2162
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
2163
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2164
|
+
designSystem.Grid.Root,
|
|
2165
|
+
{
|
|
2166
|
+
gap: 5,
|
|
2167
|
+
padding: 3,
|
|
2168
|
+
background: "neutral0",
|
|
2169
|
+
borderColor: "neutral200",
|
|
2170
|
+
borderWidth: "1px",
|
|
2171
|
+
borderStyle: "solid",
|
|
2172
|
+
borderRadius: "4px",
|
|
2173
|
+
width: "100%",
|
|
2174
|
+
children: [
|
|
2175
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Item, { xs: 12, alignItems: "flex-start", direction: "column", children: [
|
|
2176
|
+
note?.title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2177
|
+
designSystem.Typography,
|
|
2178
|
+
{
|
|
2179
|
+
fontWeight: "semibold",
|
|
2180
|
+
textColor: "neutral800",
|
|
2181
|
+
marginBottom: 3,
|
|
2182
|
+
style: {
|
|
2183
|
+
display: "-webkit-box",
|
|
2184
|
+
WebkitLineClamp: 1,
|
|
2185
|
+
WebkitBoxOrient: "vertical",
|
|
2186
|
+
overflow: "hidden"
|
|
2187
|
+
},
|
|
2188
|
+
children: note.title
|
|
2189
|
+
}
|
|
2190
|
+
),
|
|
2191
|
+
note?.content && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2192
|
+
designSystem.Typography,
|
|
2193
|
+
{
|
|
2194
|
+
variant: "pi",
|
|
2195
|
+
textColor: "neutral600",
|
|
2196
|
+
style: {
|
|
2197
|
+
display: "-webkit-box",
|
|
2198
|
+
WebkitLineClamp: 2,
|
|
2199
|
+
WebkitBoxOrient: "vertical",
|
|
2200
|
+
overflow: "hidden"
|
|
2201
|
+
},
|
|
2202
|
+
children: note.content
|
|
2203
|
+
}
|
|
2204
|
+
)
|
|
2205
|
+
] }),
|
|
2206
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Item, { gap: 1, children: [
|
|
2207
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2208
|
+
designSystem.IconButton,
|
|
2209
|
+
{
|
|
2210
|
+
onClick: onEdit,
|
|
2211
|
+
label: formatMessage({ id: getTranslation("components.NoteList.edit"), defaultMessage: "Edit note" }),
|
|
2212
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Pencil, {})
|
|
2213
|
+
}
|
|
2214
|
+
) }),
|
|
2215
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2216
|
+
designSystem.IconButton,
|
|
2217
|
+
{
|
|
2218
|
+
onClick: onDelete,
|
|
2219
|
+
label: formatMessage({ id: getTranslation("components.NoteList.delete"), defaultMessage: "Delete note" }),
|
|
2220
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Trash, {})
|
|
2221
|
+
}
|
|
2222
|
+
) })
|
|
2223
|
+
] })
|
|
2224
|
+
]
|
|
2225
|
+
}
|
|
2226
|
+
);
|
|
2227
|
+
};
|
|
2228
|
+
const NoteListLayout = () => {
|
|
2229
|
+
const data = admin.unstable_useContentManagerContext();
|
|
2230
|
+
const { id, isCreatingEntry } = data || {};
|
|
2231
|
+
if (isCreatingEntry || !id) {
|
|
2232
|
+
return null;
|
|
2233
|
+
}
|
|
2234
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NoteListContent, {});
|
|
2235
|
+
};
|
|
2236
|
+
const NoteListContent = () => {
|
|
2237
|
+
const { id, slug } = admin.unstable_useContentManagerContext();
|
|
2238
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
2239
|
+
const [isModalOpen, setIsModalOpen] = react.useState(false);
|
|
2240
|
+
const [editingNote, setEditingNote] = react.useState(null);
|
|
2241
|
+
const { notes, createNote, deleteNote, updateNote } = useNotes({
|
|
2242
|
+
entitySlug: slug,
|
|
2243
|
+
documentId: id
|
|
2244
|
+
});
|
|
2245
|
+
const handleOpenModal = (noteId) => {
|
|
2246
|
+
setEditingNote(noteId ?? null);
|
|
2247
|
+
setIsModalOpen(true);
|
|
2248
|
+
};
|
|
2249
|
+
const handleCloseModal = () => {
|
|
2250
|
+
setIsModalOpen(false);
|
|
2251
|
+
setEditingNote(null);
|
|
2252
|
+
};
|
|
2253
|
+
const selectedNote = notes.data?.find((note) => note.documentId === editingNote);
|
|
2254
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { paddingTop: 8, width: "100%", children: [
|
|
2255
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", textColor: "neutral600", children: formatMessage({
|
|
2256
|
+
id: getTranslation("plugin.name"),
|
|
2257
|
+
defaultMessage: "Notes"
|
|
2258
|
+
}) }),
|
|
2259
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 2, marginBottom: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}) }),
|
|
2260
|
+
notes.isLoading ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage({
|
|
2261
|
+
id: getTranslation("component.loading.notes"),
|
|
2262
|
+
defaultMessage: "Loading notes..."
|
|
2263
|
+
}) }) : notes.data?.length ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2264
|
+
designSystem.Flex,
|
|
2265
|
+
{
|
|
2266
|
+
gap: {
|
|
2267
|
+
initial: 2
|
|
2268
|
+
},
|
|
2269
|
+
style: { maxHeight: "200px", overflowY: "auto", overflowX: "hidden" },
|
|
2270
|
+
width: "100%",
|
|
2271
|
+
direction: "column",
|
|
2272
|
+
wrap: "nowrap",
|
|
2273
|
+
children: notes.data.map((note) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2274
|
+
NoteListItem,
|
|
2275
|
+
{
|
|
2276
|
+
note,
|
|
2277
|
+
onEdit: () => handleOpenModal(note.documentId),
|
|
2278
|
+
onDelete: () => deleteNote(note.documentId)
|
|
2279
|
+
},
|
|
2280
|
+
note.documentId
|
|
2281
|
+
))
|
|
2282
|
+
}
|
|
2283
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
2284
|
+
designSystem.EmptyStateLayout,
|
|
2285
|
+
{
|
|
2286
|
+
content: formatMessage({
|
|
2287
|
+
id: getTranslation("component.emptyStateLayout"),
|
|
2288
|
+
defaultMessage: "No notes yet"
|
|
2289
|
+
})
|
|
2290
|
+
}
|
|
2291
|
+
),
|
|
2292
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2293
|
+
designSystem.Button,
|
|
2294
|
+
{
|
|
2295
|
+
fullWidth: true,
|
|
2296
|
+
variant: "default",
|
|
2297
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}),
|
|
2298
|
+
disabled: notes.isLoading,
|
|
2299
|
+
onClick: () => handleOpenModal(),
|
|
2300
|
+
marginTop: 4,
|
|
2301
|
+
children: formatMessage({
|
|
2302
|
+
id: getTranslation("component.noteListContent.add.button"),
|
|
2303
|
+
defaultMessage: "Add note"
|
|
2304
|
+
})
|
|
2305
|
+
}
|
|
2306
|
+
),
|
|
2307
|
+
isModalOpen && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2308
|
+
NoteModal,
|
|
2309
|
+
{
|
|
2310
|
+
note: selectedNote,
|
|
2311
|
+
entitySlug: slug,
|
|
2312
|
+
documentId: id,
|
|
2313
|
+
onClose: handleCloseModal,
|
|
2314
|
+
onCreateNote: createNote,
|
|
2315
|
+
onUpdateNote: updateNote,
|
|
2316
|
+
isEditing: !!editingNote
|
|
2317
|
+
}
|
|
2318
|
+
)
|
|
2319
|
+
] });
|
|
2320
|
+
};
|
|
2321
|
+
const prefixPluginTranslations = (trad, pluginId) => {
|
|
2322
|
+
return Object.keys(trad).reduce((acc, current) => {
|
|
2323
|
+
acc[`${pluginId}.${current}`] = trad[current];
|
|
2324
|
+
return acc;
|
|
2325
|
+
}, {});
|
|
2326
|
+
};
|
|
2327
|
+
const name = pluginPkg.strapi.name;
|
|
2328
|
+
const index = {
|
|
2329
|
+
register(app) {
|
|
2330
|
+
app.registerPlugin({
|
|
2331
|
+
id: PLUGIN_ID,
|
|
2332
|
+
initializer: Initializer,
|
|
2333
|
+
isReady: false,
|
|
2334
|
+
name
|
|
2335
|
+
});
|
|
2336
|
+
},
|
|
2337
|
+
bootstrap(app) {
|
|
2338
|
+
app.getPlugin("content-manager").injectComponent("editView", "right-links", {
|
|
2339
|
+
name: "note-list",
|
|
2340
|
+
Component: () => /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(NoteListLayout, {}) })
|
|
2341
|
+
});
|
|
2342
|
+
},
|
|
2343
|
+
async registerTrads({ locales }) {
|
|
2344
|
+
const importedTranslations = await Promise.all(
|
|
2345
|
+
locales.map((locale) => {
|
|
2346
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("../_chunks/en-DgFd-WK6.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("../_chunks/nl-KLQoW4g0.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
|
|
2347
|
+
return {
|
|
2348
|
+
data: prefixPluginTranslations(data, PLUGIN_ID),
|
|
2349
|
+
locale
|
|
2350
|
+
};
|
|
2351
|
+
}).catch((error) => {
|
|
2352
|
+
console.warn(`[${PLUGIN_ID}] Could not load translations for locale "${locale}":`, error);
|
|
2353
|
+
return {
|
|
2354
|
+
data: {},
|
|
2355
|
+
locale
|
|
2356
|
+
};
|
|
2357
|
+
});
|
|
2358
|
+
})
|
|
2359
|
+
);
|
|
2360
|
+
return importedTranslations;
|
|
2361
|
+
}
|
|
2362
|
+
};
|
|
2363
|
+
module.exports = index;
|