@fumadocs/ui 16.4.1 → 16.4.2

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.
Files changed (73) hide show
  1. package/css/colors/ocean.css +1 -5
  2. package/css/colors/vitepress.css +3 -15
  3. package/dist/cn.d.ts +2 -2
  4. package/dist/cn.js +3 -1
  5. package/dist/components/toc/clerk.d.ts +11 -2
  6. package/dist/components/toc/clerk.d.ts.map +1 -1
  7. package/dist/components/toc/clerk.js +105 -69
  8. package/dist/components/toc/clerk.js.map +1 -0
  9. package/dist/components/toc/default.d.ts +11 -2
  10. package/dist/components/toc/default.d.ts.map +1 -1
  11. package/dist/components/toc/default.js +36 -15
  12. package/dist/components/toc/default.js.map +1 -0
  13. package/dist/components/toc/index.d.ts +23 -8
  14. package/dist/components/toc/index.d.ts.map +1 -1
  15. package/dist/components/toc/index.js +74 -59
  16. package/dist/components/toc/index.js.map +1 -0
  17. package/dist/contexts/i18n.d.ts +53 -43
  18. package/dist/contexts/i18n.d.ts.map +1 -1
  19. package/dist/contexts/i18n.js +55 -50
  20. package/dist/contexts/i18n.js.map +1 -0
  21. package/dist/contexts/search.d.ts +62 -49
  22. package/dist/contexts/search.d.ts.map +1 -1
  23. package/dist/contexts/search.js +56 -50
  24. package/dist/contexts/search.js.map +1 -0
  25. package/dist/contexts/tree.d.ts +18 -11
  26. package/dist/contexts/tree.d.ts.map +1 -1
  27. package/dist/contexts/tree.js +36 -26
  28. package/dist/contexts/tree.js.map +1 -0
  29. package/dist/hooks/use-copy-button.d.ts +6 -2
  30. package/dist/hooks/use-copy-button.d.ts.map +1 -1
  31. package/dist/hooks/use-copy-button.js +28 -25
  32. package/dist/hooks/use-copy-button.js.map +1 -0
  33. package/dist/hooks/use-footer-items.d.ts +7 -2
  34. package/dist/hooks/use-footer-items.d.ts.map +1 -1
  35. package/dist/hooks/use-footer-items.js +26 -25
  36. package/dist/hooks/use-footer-items.js.map +1 -0
  37. package/dist/hooks/use-is-scroll-top.d.ts +7 -2
  38. package/dist/hooks/use-is-scroll-top.d.ts.map +1 -1
  39. package/dist/hooks/use-is-scroll-top.js +23 -16
  40. package/dist/hooks/use-is-scroll-top.js.map +1 -0
  41. package/dist/i18n.d.ts +11 -11
  42. package/dist/i18n.d.ts.map +1 -1
  43. package/dist/i18n.js +19 -15
  44. package/dist/i18n.js.map +1 -0
  45. package/dist/link-item.d.ts +74 -66
  46. package/dist/link-item.d.ts.map +1 -1
  47. package/dist/link-item.js +23 -10
  48. package/dist/link-item.js.map +1 -0
  49. package/dist/merge-refs.d.ts +6 -2
  50. package/dist/merge-refs.d.ts.map +1 -1
  51. package/dist/merge-refs.js +12 -11
  52. package/dist/merge-refs.js.map +1 -0
  53. package/dist/og/next.d.ts +20 -12
  54. package/dist/og/next.d.ts.map +1 -1
  55. package/dist/og/next.js +68 -43
  56. package/dist/og/next.js.map +1 -0
  57. package/dist/typography/index.d.ts +10 -8
  58. package/dist/typography/index.d.ts.map +1 -1
  59. package/dist/typography/index.js +1714 -127
  60. package/dist/typography/index.js.map +1 -0
  61. package/dist/typography/styles.d.ts +92 -89
  62. package/dist/typography/styles.d.ts.map +1 -1
  63. package/dist/typography/styles.js +337 -423
  64. package/dist/typography/styles.js.map +1 -0
  65. package/dist/urls.d.ts +5 -2
  66. package/dist/urls.d.ts.map +1 -1
  67. package/dist/urls.js +14 -10
  68. package/dist/urls.js.map +1 -0
  69. package/package.json +20 -20
  70. package/dist/cn.d.ts.map +0 -1
  71. package/dist/icons.d.ts +0 -50
  72. package/dist/icons.d.ts.map +0 -1
  73. package/dist/icons.js +0 -292
@@ -1,137 +1,1724 @@
1
- import * as styles from './styles.js';
2
- import plugin from 'tailwindcss/plugin';
3
- import merge from 'lodash.merge';
4
- import parser from 'postcss-selector-parser';
1
+ import { DEFAULT, normalTable, roundedTable } from "./styles.js";
2
+ import plugin from "tailwindcss/plugin";
3
+ import parser from "postcss-selector-parser";
4
+
5
+ //#region rolldown:runtime
6
+ var __create = Object.create;
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __getProtoOf = Object.getPrototypeOf;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
16
+ key = keys[i];
17
+ if (!__hasOwnProp.call(to, key) && key !== except) {
18
+ __defProp(to, key, {
19
+ get: ((k) => from[k]).bind(null, key),
20
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
+ });
22
+ }
23
+ }
24
+ }
25
+ return to;
26
+ };
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+
32
+ //#endregion
33
+ //#region ../../node_modules/.pnpm/lodash.merge@4.6.2/node_modules/lodash.merge/index.js
34
+ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
35
+ /**
36
+ * Lodash (Custom Build) <https://lodash.com/>
37
+ * Build: `lodash modularize exports="npm" -o ./`
38
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
39
+ * Released under MIT license <https://lodash.com/license>
40
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
41
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
42
+ */
43
+ /** Used as the size to enable large array optimizations. */
44
+ var LARGE_ARRAY_SIZE = 200;
45
+ /** Used to stand-in for `undefined` hash values. */
46
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
47
+ /** Used to detect hot functions by number of calls within a span of milliseconds. */
48
+ var HOT_COUNT = 800, HOT_SPAN = 16;
49
+ /** Used as references for various `Number` constants. */
50
+ var MAX_SAFE_INTEGER = 9007199254740991;
51
+ /** `Object#toString` result references. */
52
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]";
53
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
54
+ /**
55
+ * Used to match `RegExp`
56
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
57
+ */
58
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
59
+ /** Used to detect host constructors (Safari). */
60
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
61
+ /** Used to detect unsigned integer values. */
62
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
63
+ /** Used to identify `toStringTag` values of typed arrays. */
64
+ var typedArrayTags = {};
65
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
66
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
67
+ /** Detect free variable `global` from Node.js. */
68
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
69
+ /** Detect free variable `self`. */
70
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
71
+ /** Used as a reference to the global object. */
72
+ var root = freeGlobal || freeSelf || Function("return this")();
73
+ /** Detect free variable `exports`. */
74
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
75
+ /** Detect free variable `module`. */
76
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
77
+ /** Detect the popular CommonJS extension `module.exports`. */
78
+ var moduleExports = freeModule && freeModule.exports === freeExports;
79
+ /** Detect free variable `process` from Node.js. */
80
+ var freeProcess = moduleExports && freeGlobal.process;
81
+ /** Used to access faster Node.js helpers. */
82
+ var nodeUtil = function() {
83
+ try {
84
+ var types = freeModule && freeModule.require && freeModule.require("util").types;
85
+ if (types) return types;
86
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
87
+ } catch (e) {}
88
+ }();
89
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
90
+ /**
91
+ * A faster alternative to `Function#apply`, this function invokes `func`
92
+ * with the `this` binding of `thisArg` and the arguments of `args`.
93
+ *
94
+ * @private
95
+ * @param {Function} func The function to invoke.
96
+ * @param {*} thisArg The `this` binding of `func`.
97
+ * @param {Array} args The arguments to invoke `func` with.
98
+ * @returns {*} Returns the result of `func`.
99
+ */
100
+ function apply(func, thisArg, args) {
101
+ switch (args.length) {
102
+ case 0: return func.call(thisArg);
103
+ case 1: return func.call(thisArg, args[0]);
104
+ case 2: return func.call(thisArg, args[0], args[1]);
105
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
106
+ }
107
+ return func.apply(thisArg, args);
108
+ }
109
+ /**
110
+ * The base implementation of `_.times` without support for iteratee shorthands
111
+ * or max array length checks.
112
+ *
113
+ * @private
114
+ * @param {number} n The number of times to invoke `iteratee`.
115
+ * @param {Function} iteratee The function invoked per iteration.
116
+ * @returns {Array} Returns the array of results.
117
+ */
118
+ function baseTimes(n, iteratee) {
119
+ var index = -1, result = Array(n);
120
+ while (++index < n) result[index] = iteratee(index);
121
+ return result;
122
+ }
123
+ /**
124
+ * The base implementation of `_.unary` without support for storing metadata.
125
+ *
126
+ * @private
127
+ * @param {Function} func The function to cap arguments for.
128
+ * @returns {Function} Returns the new capped function.
129
+ */
130
+ function baseUnary(func) {
131
+ return function(value) {
132
+ return func(value);
133
+ };
134
+ }
135
+ /**
136
+ * Gets the value at `key` of `object`.
137
+ *
138
+ * @private
139
+ * @param {Object} [object] The object to query.
140
+ * @param {string} key The key of the property to get.
141
+ * @returns {*} Returns the property value.
142
+ */
143
+ function getValue(object, key) {
144
+ return object == null ? void 0 : object[key];
145
+ }
146
+ /**
147
+ * Creates a unary function that invokes `func` with its argument transformed.
148
+ *
149
+ * @private
150
+ * @param {Function} func The function to wrap.
151
+ * @param {Function} transform The argument transform.
152
+ * @returns {Function} Returns the new function.
153
+ */
154
+ function overArg(func, transform) {
155
+ return function(arg) {
156
+ return func(transform(arg));
157
+ };
158
+ }
159
+ /** Used for built-in method references. */
160
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
161
+ /** Used to detect overreaching core-js shims. */
162
+ var coreJsData = root["__core-js_shared__"];
163
+ /** Used to resolve the decompiled source of functions. */
164
+ var funcToString = funcProto.toString;
165
+ /** Used to check objects for own properties. */
166
+ var hasOwnProperty = objectProto.hasOwnProperty;
167
+ /** Used to detect methods masquerading as native. */
168
+ var maskSrcKey = function() {
169
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
170
+ return uid ? "Symbol(src)_1." + uid : "";
171
+ }();
172
+ /**
173
+ * Used to resolve the
174
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
175
+ * of values.
176
+ */
177
+ var nativeObjectToString = objectProto.toString;
178
+ /** Used to infer the `Object` constructor. */
179
+ var objectCtorString = funcToString.call(Object);
180
+ /** Used to detect if a method is native. */
181
+ var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
182
+ /** Built-in value references. */
183
+ var Buffer = moduleExports ? root.Buffer : void 0, Symbol = root.Symbol, Uint8Array = root.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol ? Symbol.toStringTag : void 0;
184
+ var defineProperty = function() {
185
+ try {
186
+ var func = getNative(Object, "defineProperty");
187
+ func({}, "", {});
188
+ return func;
189
+ } catch (e) {}
190
+ }();
191
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeMax = Math.max, nativeNow = Date.now;
192
+ var Map = getNative(root, "Map"), nativeCreate = getNative(Object, "create");
193
+ /**
194
+ * The base implementation of `_.create` without support for assigning
195
+ * properties to the created object.
196
+ *
197
+ * @private
198
+ * @param {Object} proto The object to inherit from.
199
+ * @returns {Object} Returns the new object.
200
+ */
201
+ var baseCreate = function() {
202
+ function object() {}
203
+ return function(proto) {
204
+ if (!isObject(proto)) return {};
205
+ if (objectCreate) return objectCreate(proto);
206
+ object.prototype = proto;
207
+ var result = new object();
208
+ object.prototype = void 0;
209
+ return result;
210
+ };
211
+ }();
212
+ /**
213
+ * Creates a hash object.
214
+ *
215
+ * @private
216
+ * @constructor
217
+ * @param {Array} [entries] The key-value pairs to cache.
218
+ */
219
+ function Hash(entries) {
220
+ var index = -1, length = entries == null ? 0 : entries.length;
221
+ this.clear();
222
+ while (++index < length) {
223
+ var entry = entries[index];
224
+ this.set(entry[0], entry[1]);
225
+ }
226
+ }
227
+ /**
228
+ * Removes all key-value entries from the hash.
229
+ *
230
+ * @private
231
+ * @name clear
232
+ * @memberOf Hash
233
+ */
234
+ function hashClear() {
235
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
236
+ this.size = 0;
237
+ }
238
+ /**
239
+ * Removes `key` and its value from the hash.
240
+ *
241
+ * @private
242
+ * @name delete
243
+ * @memberOf Hash
244
+ * @param {Object} hash The hash to modify.
245
+ * @param {string} key The key of the value to remove.
246
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
247
+ */
248
+ function hashDelete(key) {
249
+ var result = this.has(key) && delete this.__data__[key];
250
+ this.size -= result ? 1 : 0;
251
+ return result;
252
+ }
253
+ /**
254
+ * Gets the hash value for `key`.
255
+ *
256
+ * @private
257
+ * @name get
258
+ * @memberOf Hash
259
+ * @param {string} key The key of the value to get.
260
+ * @returns {*} Returns the entry value.
261
+ */
262
+ function hashGet(key) {
263
+ var data = this.__data__;
264
+ if (nativeCreate) {
265
+ var result = data[key];
266
+ return result === HASH_UNDEFINED ? void 0 : result;
267
+ }
268
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
269
+ }
270
+ /**
271
+ * Checks if a hash value for `key` exists.
272
+ *
273
+ * @private
274
+ * @name has
275
+ * @memberOf Hash
276
+ * @param {string} key The key of the entry to check.
277
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
278
+ */
279
+ function hashHas(key) {
280
+ var data = this.__data__;
281
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
282
+ }
283
+ /**
284
+ * Sets the hash `key` to `value`.
285
+ *
286
+ * @private
287
+ * @name set
288
+ * @memberOf Hash
289
+ * @param {string} key The key of the value to set.
290
+ * @param {*} value The value to set.
291
+ * @returns {Object} Returns the hash instance.
292
+ */
293
+ function hashSet(key, value) {
294
+ var data = this.__data__;
295
+ this.size += this.has(key) ? 0 : 1;
296
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
297
+ return this;
298
+ }
299
+ Hash.prototype.clear = hashClear;
300
+ Hash.prototype["delete"] = hashDelete;
301
+ Hash.prototype.get = hashGet;
302
+ Hash.prototype.has = hashHas;
303
+ Hash.prototype.set = hashSet;
304
+ /**
305
+ * Creates an list cache object.
306
+ *
307
+ * @private
308
+ * @constructor
309
+ * @param {Array} [entries] The key-value pairs to cache.
310
+ */
311
+ function ListCache(entries) {
312
+ var index = -1, length = entries == null ? 0 : entries.length;
313
+ this.clear();
314
+ while (++index < length) {
315
+ var entry = entries[index];
316
+ this.set(entry[0], entry[1]);
317
+ }
318
+ }
319
+ /**
320
+ * Removes all key-value entries from the list cache.
321
+ *
322
+ * @private
323
+ * @name clear
324
+ * @memberOf ListCache
325
+ */
326
+ function listCacheClear() {
327
+ this.__data__ = [];
328
+ this.size = 0;
329
+ }
330
+ /**
331
+ * Removes `key` and its value from the list cache.
332
+ *
333
+ * @private
334
+ * @name delete
335
+ * @memberOf ListCache
336
+ * @param {string} key The key of the value to remove.
337
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
338
+ */
339
+ function listCacheDelete(key) {
340
+ var data = this.__data__, index = assocIndexOf(data, key);
341
+ if (index < 0) return false;
342
+ if (index == data.length - 1) data.pop();
343
+ else splice.call(data, index, 1);
344
+ --this.size;
345
+ return true;
346
+ }
347
+ /**
348
+ * Gets the list cache value for `key`.
349
+ *
350
+ * @private
351
+ * @name get
352
+ * @memberOf ListCache
353
+ * @param {string} key The key of the value to get.
354
+ * @returns {*} Returns the entry value.
355
+ */
356
+ function listCacheGet(key) {
357
+ var data = this.__data__, index = assocIndexOf(data, key);
358
+ return index < 0 ? void 0 : data[index][1];
359
+ }
360
+ /**
361
+ * Checks if a list cache value for `key` exists.
362
+ *
363
+ * @private
364
+ * @name has
365
+ * @memberOf ListCache
366
+ * @param {string} key The key of the entry to check.
367
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
368
+ */
369
+ function listCacheHas(key) {
370
+ return assocIndexOf(this.__data__, key) > -1;
371
+ }
372
+ /**
373
+ * Sets the list cache `key` to `value`.
374
+ *
375
+ * @private
376
+ * @name set
377
+ * @memberOf ListCache
378
+ * @param {string} key The key of the value to set.
379
+ * @param {*} value The value to set.
380
+ * @returns {Object} Returns the list cache instance.
381
+ */
382
+ function listCacheSet(key, value) {
383
+ var data = this.__data__, index = assocIndexOf(data, key);
384
+ if (index < 0) {
385
+ ++this.size;
386
+ data.push([key, value]);
387
+ } else data[index][1] = value;
388
+ return this;
389
+ }
390
+ ListCache.prototype.clear = listCacheClear;
391
+ ListCache.prototype["delete"] = listCacheDelete;
392
+ ListCache.prototype.get = listCacheGet;
393
+ ListCache.prototype.has = listCacheHas;
394
+ ListCache.prototype.set = listCacheSet;
395
+ /**
396
+ * Creates a map cache object to store key-value pairs.
397
+ *
398
+ * @private
399
+ * @constructor
400
+ * @param {Array} [entries] The key-value pairs to cache.
401
+ */
402
+ function MapCache(entries) {
403
+ var index = -1, length = entries == null ? 0 : entries.length;
404
+ this.clear();
405
+ while (++index < length) {
406
+ var entry = entries[index];
407
+ this.set(entry[0], entry[1]);
408
+ }
409
+ }
410
+ /**
411
+ * Removes all key-value entries from the map.
412
+ *
413
+ * @private
414
+ * @name clear
415
+ * @memberOf MapCache
416
+ */
417
+ function mapCacheClear() {
418
+ this.size = 0;
419
+ this.__data__ = {
420
+ "hash": new Hash(),
421
+ "map": new (Map || ListCache)(),
422
+ "string": new Hash()
423
+ };
424
+ }
425
+ /**
426
+ * Removes `key` and its value from the map.
427
+ *
428
+ * @private
429
+ * @name delete
430
+ * @memberOf MapCache
431
+ * @param {string} key The key of the value to remove.
432
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
433
+ */
434
+ function mapCacheDelete(key) {
435
+ var result = getMapData(this, key)["delete"](key);
436
+ this.size -= result ? 1 : 0;
437
+ return result;
438
+ }
439
+ /**
440
+ * Gets the map value for `key`.
441
+ *
442
+ * @private
443
+ * @name get
444
+ * @memberOf MapCache
445
+ * @param {string} key The key of the value to get.
446
+ * @returns {*} Returns the entry value.
447
+ */
448
+ function mapCacheGet(key) {
449
+ return getMapData(this, key).get(key);
450
+ }
451
+ /**
452
+ * Checks if a map value for `key` exists.
453
+ *
454
+ * @private
455
+ * @name has
456
+ * @memberOf MapCache
457
+ * @param {string} key The key of the entry to check.
458
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
459
+ */
460
+ function mapCacheHas(key) {
461
+ return getMapData(this, key).has(key);
462
+ }
463
+ /**
464
+ * Sets the map `key` to `value`.
465
+ *
466
+ * @private
467
+ * @name set
468
+ * @memberOf MapCache
469
+ * @param {string} key The key of the value to set.
470
+ * @param {*} value The value to set.
471
+ * @returns {Object} Returns the map cache instance.
472
+ */
473
+ function mapCacheSet(key, value) {
474
+ var data = getMapData(this, key), size = data.size;
475
+ data.set(key, value);
476
+ this.size += data.size == size ? 0 : 1;
477
+ return this;
478
+ }
479
+ MapCache.prototype.clear = mapCacheClear;
480
+ MapCache.prototype["delete"] = mapCacheDelete;
481
+ MapCache.prototype.get = mapCacheGet;
482
+ MapCache.prototype.has = mapCacheHas;
483
+ MapCache.prototype.set = mapCacheSet;
484
+ /**
485
+ * Creates a stack cache object to store key-value pairs.
486
+ *
487
+ * @private
488
+ * @constructor
489
+ * @param {Array} [entries] The key-value pairs to cache.
490
+ */
491
+ function Stack(entries) {
492
+ this.size = (this.__data__ = new ListCache(entries)).size;
493
+ }
494
+ /**
495
+ * Removes all key-value entries from the stack.
496
+ *
497
+ * @private
498
+ * @name clear
499
+ * @memberOf Stack
500
+ */
501
+ function stackClear() {
502
+ this.__data__ = new ListCache();
503
+ this.size = 0;
504
+ }
505
+ /**
506
+ * Removes `key` and its value from the stack.
507
+ *
508
+ * @private
509
+ * @name delete
510
+ * @memberOf Stack
511
+ * @param {string} key The key of the value to remove.
512
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
513
+ */
514
+ function stackDelete(key) {
515
+ var data = this.__data__, result = data["delete"](key);
516
+ this.size = data.size;
517
+ return result;
518
+ }
519
+ /**
520
+ * Gets the stack value for `key`.
521
+ *
522
+ * @private
523
+ * @name get
524
+ * @memberOf Stack
525
+ * @param {string} key The key of the value to get.
526
+ * @returns {*} Returns the entry value.
527
+ */
528
+ function stackGet(key) {
529
+ return this.__data__.get(key);
530
+ }
531
+ /**
532
+ * Checks if a stack value for `key` exists.
533
+ *
534
+ * @private
535
+ * @name has
536
+ * @memberOf Stack
537
+ * @param {string} key The key of the entry to check.
538
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
539
+ */
540
+ function stackHas(key) {
541
+ return this.__data__.has(key);
542
+ }
543
+ /**
544
+ * Sets the stack `key` to `value`.
545
+ *
546
+ * @private
547
+ * @name set
548
+ * @memberOf Stack
549
+ * @param {string} key The key of the value to set.
550
+ * @param {*} value The value to set.
551
+ * @returns {Object} Returns the stack cache instance.
552
+ */
553
+ function stackSet(key, value) {
554
+ var data = this.__data__;
555
+ if (data instanceof ListCache) {
556
+ var pairs = data.__data__;
557
+ if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
558
+ pairs.push([key, value]);
559
+ this.size = ++data.size;
560
+ return this;
561
+ }
562
+ data = this.__data__ = new MapCache(pairs);
563
+ }
564
+ data.set(key, value);
565
+ this.size = data.size;
566
+ return this;
567
+ }
568
+ Stack.prototype.clear = stackClear;
569
+ Stack.prototype["delete"] = stackDelete;
570
+ Stack.prototype.get = stackGet;
571
+ Stack.prototype.has = stackHas;
572
+ Stack.prototype.set = stackSet;
573
+ /**
574
+ * Creates an array of the enumerable property names of the array-like `value`.
575
+ *
576
+ * @private
577
+ * @param {*} value The value to query.
578
+ * @param {boolean} inherited Specify returning inherited property names.
579
+ * @returns {Array} Returns the array of property names.
580
+ */
581
+ function arrayLikeKeys(value, inherited) {
582
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
583
+ for (var key in value) if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) result.push(key);
584
+ return result;
585
+ }
586
+ /**
587
+ * This function is like `assignValue` except that it doesn't assign
588
+ * `undefined` values.
589
+ *
590
+ * @private
591
+ * @param {Object} object The object to modify.
592
+ * @param {string} key The key of the property to assign.
593
+ * @param {*} value The value to assign.
594
+ */
595
+ function assignMergeValue(object, key, value) {
596
+ if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
597
+ }
598
+ /**
599
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
600
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
601
+ * for equality comparisons.
602
+ *
603
+ * @private
604
+ * @param {Object} object The object to modify.
605
+ * @param {string} key The key of the property to assign.
606
+ * @param {*} value The value to assign.
607
+ */
608
+ function assignValue(object, key, value) {
609
+ var objValue = object[key];
610
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
611
+ }
612
+ /**
613
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
614
+ *
615
+ * @private
616
+ * @param {Array} array The array to inspect.
617
+ * @param {*} key The key to search for.
618
+ * @returns {number} Returns the index of the matched value, else `-1`.
619
+ */
620
+ function assocIndexOf(array, key) {
621
+ var length = array.length;
622
+ while (length--) if (eq(array[length][0], key)) return length;
623
+ return -1;
624
+ }
625
+ /**
626
+ * The base implementation of `assignValue` and `assignMergeValue` without
627
+ * value checks.
628
+ *
629
+ * @private
630
+ * @param {Object} object The object to modify.
631
+ * @param {string} key The key of the property to assign.
632
+ * @param {*} value The value to assign.
633
+ */
634
+ function baseAssignValue(object, key, value) {
635
+ if (key == "__proto__" && defineProperty) defineProperty(object, key, {
636
+ "configurable": true,
637
+ "enumerable": true,
638
+ "value": value,
639
+ "writable": true
640
+ });
641
+ else object[key] = value;
642
+ }
643
+ /**
644
+ * The base implementation of `baseForOwn` which iterates over `object`
645
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
646
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
647
+ *
648
+ * @private
649
+ * @param {Object} object The object to iterate over.
650
+ * @param {Function} iteratee The function invoked per iteration.
651
+ * @param {Function} keysFunc The function to get the keys of `object`.
652
+ * @returns {Object} Returns `object`.
653
+ */
654
+ var baseFor = createBaseFor();
655
+ /**
656
+ * The base implementation of `getTag` without fallbacks for buggy environments.
657
+ *
658
+ * @private
659
+ * @param {*} value The value to query.
660
+ * @returns {string} Returns the `toStringTag`.
661
+ */
662
+ function baseGetTag(value) {
663
+ if (value == null) return value === void 0 ? undefinedTag : nullTag;
664
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
665
+ }
666
+ /**
667
+ * The base implementation of `_.isArguments`.
668
+ *
669
+ * @private
670
+ * @param {*} value The value to check.
671
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
672
+ */
673
+ function baseIsArguments(value) {
674
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
675
+ }
676
+ /**
677
+ * The base implementation of `_.isNative` without bad shim checks.
678
+ *
679
+ * @private
680
+ * @param {*} value The value to check.
681
+ * @returns {boolean} Returns `true` if `value` is a native function,
682
+ * else `false`.
683
+ */
684
+ function baseIsNative(value) {
685
+ if (!isObject(value) || isMasked(value)) return false;
686
+ return (isFunction(value) ? reIsNative : reIsHostCtor).test(toSource(value));
687
+ }
688
+ /**
689
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
690
+ *
691
+ * @private
692
+ * @param {*} value The value to check.
693
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
694
+ */
695
+ function baseIsTypedArray(value) {
696
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
697
+ }
698
+ /**
699
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
700
+ *
701
+ * @private
702
+ * @param {Object} object The object to query.
703
+ * @returns {Array} Returns the array of property names.
704
+ */
705
+ function baseKeysIn(object) {
706
+ if (!isObject(object)) return nativeKeysIn(object);
707
+ var isProto = isPrototype(object), result = [];
708
+ for (var key in object) if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) result.push(key);
709
+ return result;
710
+ }
711
+ /**
712
+ * The base implementation of `_.merge` without support for multiple sources.
713
+ *
714
+ * @private
715
+ * @param {Object} object The destination object.
716
+ * @param {Object} source The source object.
717
+ * @param {number} srcIndex The index of `source`.
718
+ * @param {Function} [customizer] The function to customize merged values.
719
+ * @param {Object} [stack] Tracks traversed source values and their merged
720
+ * counterparts.
721
+ */
722
+ function baseMerge(object, source, srcIndex, customizer, stack) {
723
+ if (object === source) return;
724
+ baseFor(source, function(srcValue, key) {
725
+ stack || (stack = new Stack());
726
+ if (isObject(srcValue)) baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
727
+ else {
728
+ var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
729
+ if (newValue === void 0) newValue = srcValue;
730
+ assignMergeValue(object, key, newValue);
731
+ }
732
+ }, keysIn);
733
+ }
734
+ /**
735
+ * A specialized version of `baseMerge` for arrays and objects which performs
736
+ * deep merges and tracks traversed objects enabling objects with circular
737
+ * references to be merged.
738
+ *
739
+ * @private
740
+ * @param {Object} object The destination object.
741
+ * @param {Object} source The source object.
742
+ * @param {string} key The key of the value to merge.
743
+ * @param {number} srcIndex The index of `source`.
744
+ * @param {Function} mergeFunc The function to merge values.
745
+ * @param {Function} [customizer] The function to customize assigned values.
746
+ * @param {Object} [stack] Tracks traversed source values and their merged
747
+ * counterparts.
748
+ */
749
+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
750
+ var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
751
+ if (stacked) {
752
+ assignMergeValue(object, key, stacked);
753
+ return;
754
+ }
755
+ var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
756
+ var isCommon = newValue === void 0;
757
+ if (isCommon) {
758
+ var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
759
+ newValue = srcValue;
760
+ if (isArr || isBuff || isTyped) if (isArray(objValue)) newValue = objValue;
761
+ else if (isArrayLikeObject(objValue)) newValue = copyArray(objValue);
762
+ else if (isBuff) {
763
+ isCommon = false;
764
+ newValue = cloneBuffer(srcValue, true);
765
+ } else if (isTyped) {
766
+ isCommon = false;
767
+ newValue = cloneTypedArray(srcValue, true);
768
+ } else newValue = [];
769
+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {
770
+ newValue = objValue;
771
+ if (isArguments(objValue)) newValue = toPlainObject(objValue);
772
+ else if (!isObject(objValue) || isFunction(objValue)) newValue = initCloneObject(srcValue);
773
+ } else isCommon = false;
774
+ }
775
+ if (isCommon) {
776
+ stack.set(srcValue, newValue);
777
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
778
+ stack["delete"](srcValue);
779
+ }
780
+ assignMergeValue(object, key, newValue);
781
+ }
782
+ /**
783
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
784
+ *
785
+ * @private
786
+ * @param {Function} func The function to apply a rest parameter to.
787
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
788
+ * @returns {Function} Returns the new function.
789
+ */
790
+ function baseRest(func, start) {
791
+ return setToString(overRest(func, start, identity), func + "");
792
+ }
793
+ /**
794
+ * The base implementation of `setToString` without support for hot loop shorting.
795
+ *
796
+ * @private
797
+ * @param {Function} func The function to modify.
798
+ * @param {Function} string The `toString` result.
799
+ * @returns {Function} Returns `func`.
800
+ */
801
+ var baseSetToString = !defineProperty ? identity : function(func, string) {
802
+ return defineProperty(func, "toString", {
803
+ "configurable": true,
804
+ "enumerable": false,
805
+ "value": constant(string),
806
+ "writable": true
807
+ });
808
+ };
809
+ /**
810
+ * Creates a clone of `buffer`.
811
+ *
812
+ * @private
813
+ * @param {Buffer} buffer The buffer to clone.
814
+ * @param {boolean} [isDeep] Specify a deep clone.
815
+ * @returns {Buffer} Returns the cloned buffer.
816
+ */
817
+ function cloneBuffer(buffer, isDeep) {
818
+ if (isDeep) return buffer.slice();
819
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
820
+ buffer.copy(result);
821
+ return result;
822
+ }
823
+ /**
824
+ * Creates a clone of `arrayBuffer`.
825
+ *
826
+ * @private
827
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
828
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
829
+ */
830
+ function cloneArrayBuffer(arrayBuffer) {
831
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
832
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
833
+ return result;
834
+ }
835
+ /**
836
+ * Creates a clone of `typedArray`.
837
+ *
838
+ * @private
839
+ * @param {Object} typedArray The typed array to clone.
840
+ * @param {boolean} [isDeep] Specify a deep clone.
841
+ * @returns {Object} Returns the cloned typed array.
842
+ */
843
+ function cloneTypedArray(typedArray, isDeep) {
844
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
845
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
846
+ }
847
+ /**
848
+ * Copies the values of `source` to `array`.
849
+ *
850
+ * @private
851
+ * @param {Array} source The array to copy values from.
852
+ * @param {Array} [array=[]] The array to copy values to.
853
+ * @returns {Array} Returns `array`.
854
+ */
855
+ function copyArray(source, array) {
856
+ var index = -1, length = source.length;
857
+ array || (array = Array(length));
858
+ while (++index < length) array[index] = source[index];
859
+ return array;
860
+ }
861
+ /**
862
+ * Copies properties of `source` to `object`.
863
+ *
864
+ * @private
865
+ * @param {Object} source The object to copy properties from.
866
+ * @param {Array} props The property identifiers to copy.
867
+ * @param {Object} [object={}] The object to copy properties to.
868
+ * @param {Function} [customizer] The function to customize copied values.
869
+ * @returns {Object} Returns `object`.
870
+ */
871
+ function copyObject(source, props, object, customizer) {
872
+ var isNew = !object;
873
+ object || (object = {});
874
+ var index = -1, length = props.length;
875
+ while (++index < length) {
876
+ var key = props[index];
877
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
878
+ if (newValue === void 0) newValue = source[key];
879
+ if (isNew) baseAssignValue(object, key, newValue);
880
+ else assignValue(object, key, newValue);
881
+ }
882
+ return object;
883
+ }
884
+ /**
885
+ * Creates a function like `_.assign`.
886
+ *
887
+ * @private
888
+ * @param {Function} assigner The function to assign values.
889
+ * @returns {Function} Returns the new assigner function.
890
+ */
891
+ function createAssigner(assigner) {
892
+ return baseRest(function(object, sources) {
893
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
894
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
895
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
896
+ customizer = length < 3 ? void 0 : customizer;
897
+ length = 1;
898
+ }
899
+ object = Object(object);
900
+ while (++index < length) {
901
+ var source = sources[index];
902
+ if (source) assigner(object, source, index, customizer);
903
+ }
904
+ return object;
905
+ });
906
+ }
907
+ /**
908
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
909
+ *
910
+ * @private
911
+ * @param {boolean} [fromRight] Specify iterating from right to left.
912
+ * @returns {Function} Returns the new base function.
913
+ */
914
+ function createBaseFor(fromRight) {
915
+ return function(object, iteratee, keysFunc) {
916
+ var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
917
+ while (length--) {
918
+ var key = props[fromRight ? length : ++index];
919
+ if (iteratee(iterable[key], key, iterable) === false) break;
920
+ }
921
+ return object;
922
+ };
923
+ }
924
+ /**
925
+ * Gets the data for `map`.
926
+ *
927
+ * @private
928
+ * @param {Object} map The map to query.
929
+ * @param {string} key The reference key.
930
+ * @returns {*} Returns the map data.
931
+ */
932
+ function getMapData(map, key) {
933
+ var data = map.__data__;
934
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
935
+ }
936
+ /**
937
+ * Gets the native function at `key` of `object`.
938
+ *
939
+ * @private
940
+ * @param {Object} object The object to query.
941
+ * @param {string} key The key of the method to get.
942
+ * @returns {*} Returns the function if it's native, else `undefined`.
943
+ */
944
+ function getNative(object, key) {
945
+ var value = getValue(object, key);
946
+ return baseIsNative(value) ? value : void 0;
947
+ }
948
+ /**
949
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
950
+ *
951
+ * @private
952
+ * @param {*} value The value to query.
953
+ * @returns {string} Returns the raw `toStringTag`.
954
+ */
955
+ function getRawTag(value) {
956
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
957
+ try {
958
+ value[symToStringTag] = void 0;
959
+ var unmasked = true;
960
+ } catch (e) {}
961
+ var result = nativeObjectToString.call(value);
962
+ if (unmasked) if (isOwn) value[symToStringTag] = tag;
963
+ else delete value[symToStringTag];
964
+ return result;
965
+ }
966
+ /**
967
+ * Initializes an object clone.
968
+ *
969
+ * @private
970
+ * @param {Object} object The object to clone.
971
+ * @returns {Object} Returns the initialized clone.
972
+ */
973
+ function initCloneObject(object) {
974
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
975
+ }
976
+ /**
977
+ * Checks if `value` is a valid array-like index.
978
+ *
979
+ * @private
980
+ * @param {*} value The value to check.
981
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
982
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
983
+ */
984
+ function isIndex(value, length) {
985
+ var type = typeof value;
986
+ length = length == null ? MAX_SAFE_INTEGER : length;
987
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
988
+ }
989
+ /**
990
+ * Checks if the given arguments are from an iteratee call.
991
+ *
992
+ * @private
993
+ * @param {*} value The potential iteratee value argument.
994
+ * @param {*} index The potential iteratee index or key argument.
995
+ * @param {*} object The potential iteratee object argument.
996
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
997
+ * else `false`.
998
+ */
999
+ function isIterateeCall(value, index, object) {
1000
+ if (!isObject(object)) return false;
1001
+ var type = typeof index;
1002
+ if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) return eq(object[index], value);
1003
+ return false;
1004
+ }
1005
+ /**
1006
+ * Checks if `value` is suitable for use as unique object key.
1007
+ *
1008
+ * @private
1009
+ * @param {*} value The value to check.
1010
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1011
+ */
1012
+ function isKeyable(value) {
1013
+ var type = typeof value;
1014
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1015
+ }
1016
+ /**
1017
+ * Checks if `func` has its source masked.
1018
+ *
1019
+ * @private
1020
+ * @param {Function} func The function to check.
1021
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1022
+ */
1023
+ function isMasked(func) {
1024
+ return !!maskSrcKey && maskSrcKey in func;
1025
+ }
1026
+ /**
1027
+ * Checks if `value` is likely a prototype object.
1028
+ *
1029
+ * @private
1030
+ * @param {*} value The value to check.
1031
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1032
+ */
1033
+ function isPrototype(value) {
1034
+ var Ctor = value && value.constructor;
1035
+ return value === (typeof Ctor == "function" && Ctor.prototype || objectProto);
1036
+ }
1037
+ /**
1038
+ * This function is like
1039
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1040
+ * except that it includes inherited enumerable properties.
1041
+ *
1042
+ * @private
1043
+ * @param {Object} object The object to query.
1044
+ * @returns {Array} Returns the array of property names.
1045
+ */
1046
+ function nativeKeysIn(object) {
1047
+ var result = [];
1048
+ if (object != null) for (var key in Object(object)) result.push(key);
1049
+ return result;
1050
+ }
1051
+ /**
1052
+ * Converts `value` to a string using `Object.prototype.toString`.
1053
+ *
1054
+ * @private
1055
+ * @param {*} value The value to convert.
1056
+ * @returns {string} Returns the converted string.
1057
+ */
1058
+ function objectToString(value) {
1059
+ return nativeObjectToString.call(value);
1060
+ }
1061
+ /**
1062
+ * A specialized version of `baseRest` which transforms the rest array.
1063
+ *
1064
+ * @private
1065
+ * @param {Function} func The function to apply a rest parameter to.
1066
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
1067
+ * @param {Function} transform The rest array transform.
1068
+ * @returns {Function} Returns the new function.
1069
+ */
1070
+ function overRest(func, start, transform) {
1071
+ start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
1072
+ return function() {
1073
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
1074
+ while (++index < length) array[index] = args[start + index];
1075
+ index = -1;
1076
+ var otherArgs = Array(start + 1);
1077
+ while (++index < start) otherArgs[index] = args[index];
1078
+ otherArgs[start] = transform(array);
1079
+ return apply(func, this, otherArgs);
1080
+ };
1081
+ }
1082
+ /**
1083
+ * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
1084
+ *
1085
+ * @private
1086
+ * @param {Object} object The object to query.
1087
+ * @param {string} key The key of the property to get.
1088
+ * @returns {*} Returns the property value.
1089
+ */
1090
+ function safeGet(object, key) {
1091
+ if (key === "constructor" && typeof object[key] === "function") return;
1092
+ if (key == "__proto__") return;
1093
+ return object[key];
1094
+ }
1095
+ /**
1096
+ * Sets the `toString` method of `func` to return `string`.
1097
+ *
1098
+ * @private
1099
+ * @param {Function} func The function to modify.
1100
+ * @param {Function} string The `toString` result.
1101
+ * @returns {Function} Returns `func`.
1102
+ */
1103
+ var setToString = shortOut(baseSetToString);
1104
+ /**
1105
+ * Creates a function that'll short out and invoke `identity` instead
1106
+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
1107
+ * milliseconds.
1108
+ *
1109
+ * @private
1110
+ * @param {Function} func The function to restrict.
1111
+ * @returns {Function} Returns the new shortable function.
1112
+ */
1113
+ function shortOut(func) {
1114
+ var count = 0, lastCalled = 0;
1115
+ return function() {
1116
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
1117
+ lastCalled = stamp;
1118
+ if (remaining > 0) {
1119
+ if (++count >= HOT_COUNT) return arguments[0];
1120
+ } else count = 0;
1121
+ return func.apply(void 0, arguments);
1122
+ };
1123
+ }
1124
+ /**
1125
+ * Converts `func` to its source code.
1126
+ *
1127
+ * @private
1128
+ * @param {Function} func The function to convert.
1129
+ * @returns {string} Returns the source code.
1130
+ */
1131
+ function toSource(func) {
1132
+ if (func != null) {
1133
+ try {
1134
+ return funcToString.call(func);
1135
+ } catch (e) {}
1136
+ try {
1137
+ return func + "";
1138
+ } catch (e) {}
1139
+ }
1140
+ return "";
1141
+ }
1142
+ /**
1143
+ * Performs a
1144
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1145
+ * comparison between two values to determine if they are equivalent.
1146
+ *
1147
+ * @static
1148
+ * @memberOf _
1149
+ * @since 4.0.0
1150
+ * @category Lang
1151
+ * @param {*} value The value to compare.
1152
+ * @param {*} other The other value to compare.
1153
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1154
+ * @example
1155
+ *
1156
+ * var object = { 'a': 1 };
1157
+ * var other = { 'a': 1 };
1158
+ *
1159
+ * _.eq(object, object);
1160
+ * // => true
1161
+ *
1162
+ * _.eq(object, other);
1163
+ * // => false
1164
+ *
1165
+ * _.eq('a', 'a');
1166
+ * // => true
1167
+ *
1168
+ * _.eq('a', Object('a'));
1169
+ * // => false
1170
+ *
1171
+ * _.eq(NaN, NaN);
1172
+ * // => true
1173
+ */
1174
+ function eq(value, other) {
1175
+ return value === other || value !== value && other !== other;
1176
+ }
1177
+ /**
1178
+ * Checks if `value` is likely an `arguments` object.
1179
+ *
1180
+ * @static
1181
+ * @memberOf _
1182
+ * @since 0.1.0
1183
+ * @category Lang
1184
+ * @param {*} value The value to check.
1185
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1186
+ * else `false`.
1187
+ * @example
1188
+ *
1189
+ * _.isArguments(function() { return arguments; }());
1190
+ * // => true
1191
+ *
1192
+ * _.isArguments([1, 2, 3]);
1193
+ * // => false
1194
+ */
1195
+ var isArguments = baseIsArguments(function() {
1196
+ return arguments;
1197
+ }()) ? baseIsArguments : function(value) {
1198
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
1199
+ };
1200
+ /**
1201
+ * Checks if `value` is classified as an `Array` object.
1202
+ *
1203
+ * @static
1204
+ * @memberOf _
1205
+ * @since 0.1.0
1206
+ * @category Lang
1207
+ * @param {*} value The value to check.
1208
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1209
+ * @example
1210
+ *
1211
+ * _.isArray([1, 2, 3]);
1212
+ * // => true
1213
+ *
1214
+ * _.isArray(document.body.children);
1215
+ * // => false
1216
+ *
1217
+ * _.isArray('abc');
1218
+ * // => false
1219
+ *
1220
+ * _.isArray(_.noop);
1221
+ * // => false
1222
+ */
1223
+ var isArray = Array.isArray;
1224
+ /**
1225
+ * Checks if `value` is array-like. A value is considered array-like if it's
1226
+ * not a function and has a `value.length` that's an integer greater than or
1227
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1228
+ *
1229
+ * @static
1230
+ * @memberOf _
1231
+ * @since 4.0.0
1232
+ * @category Lang
1233
+ * @param {*} value The value to check.
1234
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1235
+ * @example
1236
+ *
1237
+ * _.isArrayLike([1, 2, 3]);
1238
+ * // => true
1239
+ *
1240
+ * _.isArrayLike(document.body.children);
1241
+ * // => true
1242
+ *
1243
+ * _.isArrayLike('abc');
1244
+ * // => true
1245
+ *
1246
+ * _.isArrayLike(_.noop);
1247
+ * // => false
1248
+ */
1249
+ function isArrayLike(value) {
1250
+ return value != null && isLength(value.length) && !isFunction(value);
1251
+ }
1252
+ /**
1253
+ * This method is like `_.isArrayLike` except that it also checks if `value`
1254
+ * is an object.
1255
+ *
1256
+ * @static
1257
+ * @memberOf _
1258
+ * @since 4.0.0
1259
+ * @category Lang
1260
+ * @param {*} value The value to check.
1261
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
1262
+ * else `false`.
1263
+ * @example
1264
+ *
1265
+ * _.isArrayLikeObject([1, 2, 3]);
1266
+ * // => true
1267
+ *
1268
+ * _.isArrayLikeObject(document.body.children);
1269
+ * // => true
1270
+ *
1271
+ * _.isArrayLikeObject('abc');
1272
+ * // => false
1273
+ *
1274
+ * _.isArrayLikeObject(_.noop);
1275
+ * // => false
1276
+ */
1277
+ function isArrayLikeObject(value) {
1278
+ return isObjectLike(value) && isArrayLike(value);
1279
+ }
1280
+ /**
1281
+ * Checks if `value` is a buffer.
1282
+ *
1283
+ * @static
1284
+ * @memberOf _
1285
+ * @since 4.3.0
1286
+ * @category Lang
1287
+ * @param {*} value The value to check.
1288
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1289
+ * @example
1290
+ *
1291
+ * _.isBuffer(new Buffer(2));
1292
+ * // => true
1293
+ *
1294
+ * _.isBuffer(new Uint8Array(2));
1295
+ * // => false
1296
+ */
1297
+ var isBuffer = nativeIsBuffer || stubFalse;
1298
+ /**
1299
+ * Checks if `value` is classified as a `Function` object.
1300
+ *
1301
+ * @static
1302
+ * @memberOf _
1303
+ * @since 0.1.0
1304
+ * @category Lang
1305
+ * @param {*} value The value to check.
1306
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1307
+ * @example
1308
+ *
1309
+ * _.isFunction(_);
1310
+ * // => true
1311
+ *
1312
+ * _.isFunction(/abc/);
1313
+ * // => false
1314
+ */
1315
+ function isFunction(value) {
1316
+ if (!isObject(value)) return false;
1317
+ var tag = baseGetTag(value);
1318
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1319
+ }
1320
+ /**
1321
+ * Checks if `value` is a valid array-like length.
1322
+ *
1323
+ * **Note:** This method is loosely based on
1324
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1325
+ *
1326
+ * @static
1327
+ * @memberOf _
1328
+ * @since 4.0.0
1329
+ * @category Lang
1330
+ * @param {*} value The value to check.
1331
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1332
+ * @example
1333
+ *
1334
+ * _.isLength(3);
1335
+ * // => true
1336
+ *
1337
+ * _.isLength(Number.MIN_VALUE);
1338
+ * // => false
1339
+ *
1340
+ * _.isLength(Infinity);
1341
+ * // => false
1342
+ *
1343
+ * _.isLength('3');
1344
+ * // => false
1345
+ */
1346
+ function isLength(value) {
1347
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1348
+ }
1349
+ /**
1350
+ * Checks if `value` is the
1351
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1352
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1353
+ *
1354
+ * @static
1355
+ * @memberOf _
1356
+ * @since 0.1.0
1357
+ * @category Lang
1358
+ * @param {*} value The value to check.
1359
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1360
+ * @example
1361
+ *
1362
+ * _.isObject({});
1363
+ * // => true
1364
+ *
1365
+ * _.isObject([1, 2, 3]);
1366
+ * // => true
1367
+ *
1368
+ * _.isObject(_.noop);
1369
+ * // => true
1370
+ *
1371
+ * _.isObject(null);
1372
+ * // => false
1373
+ */
1374
+ function isObject(value) {
1375
+ var type = typeof value;
1376
+ return value != null && (type == "object" || type == "function");
1377
+ }
1378
+ /**
1379
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1380
+ * and has a `typeof` result of "object".
1381
+ *
1382
+ * @static
1383
+ * @memberOf _
1384
+ * @since 4.0.0
1385
+ * @category Lang
1386
+ * @param {*} value The value to check.
1387
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1388
+ * @example
1389
+ *
1390
+ * _.isObjectLike({});
1391
+ * // => true
1392
+ *
1393
+ * _.isObjectLike([1, 2, 3]);
1394
+ * // => true
1395
+ *
1396
+ * _.isObjectLike(_.noop);
1397
+ * // => false
1398
+ *
1399
+ * _.isObjectLike(null);
1400
+ * // => false
1401
+ */
1402
+ function isObjectLike(value) {
1403
+ return value != null && typeof value == "object";
1404
+ }
1405
+ /**
1406
+ * Checks if `value` is a plain object, that is, an object created by the
1407
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
1408
+ *
1409
+ * @static
1410
+ * @memberOf _
1411
+ * @since 0.8.0
1412
+ * @category Lang
1413
+ * @param {*} value The value to check.
1414
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
1415
+ * @example
1416
+ *
1417
+ * function Foo() {
1418
+ * this.a = 1;
1419
+ * }
1420
+ *
1421
+ * _.isPlainObject(new Foo);
1422
+ * // => false
1423
+ *
1424
+ * _.isPlainObject([1, 2, 3]);
1425
+ * // => false
1426
+ *
1427
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
1428
+ * // => true
1429
+ *
1430
+ * _.isPlainObject(Object.create(null));
1431
+ * // => true
1432
+ */
1433
+ function isPlainObject(value) {
1434
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) return false;
1435
+ var proto = getPrototype(value);
1436
+ if (proto === null) return true;
1437
+ var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
1438
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
1439
+ }
1440
+ /**
1441
+ * Checks if `value` is classified as a typed array.
1442
+ *
1443
+ * @static
1444
+ * @memberOf _
1445
+ * @since 3.0.0
1446
+ * @category Lang
1447
+ * @param {*} value The value to check.
1448
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1449
+ * @example
1450
+ *
1451
+ * _.isTypedArray(new Uint8Array);
1452
+ * // => true
1453
+ *
1454
+ * _.isTypedArray([]);
1455
+ * // => false
1456
+ */
1457
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1458
+ /**
1459
+ * Converts `value` to a plain object flattening inherited enumerable string
1460
+ * keyed properties of `value` to own properties of the plain object.
1461
+ *
1462
+ * @static
1463
+ * @memberOf _
1464
+ * @since 3.0.0
1465
+ * @category Lang
1466
+ * @param {*} value The value to convert.
1467
+ * @returns {Object} Returns the converted plain object.
1468
+ * @example
1469
+ *
1470
+ * function Foo() {
1471
+ * this.b = 2;
1472
+ * }
1473
+ *
1474
+ * Foo.prototype.c = 3;
1475
+ *
1476
+ * _.assign({ 'a': 1 }, new Foo);
1477
+ * // => { 'a': 1, 'b': 2 }
1478
+ *
1479
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
1480
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
1481
+ */
1482
+ function toPlainObject(value) {
1483
+ return copyObject(value, keysIn(value));
1484
+ }
1485
+ /**
1486
+ * Creates an array of the own and inherited enumerable property names of `object`.
1487
+ *
1488
+ * **Note:** Non-object values are coerced to objects.
1489
+ *
1490
+ * @static
1491
+ * @memberOf _
1492
+ * @since 3.0.0
1493
+ * @category Object
1494
+ * @param {Object} object The object to query.
1495
+ * @returns {Array} Returns the array of property names.
1496
+ * @example
1497
+ *
1498
+ * function Foo() {
1499
+ * this.a = 1;
1500
+ * this.b = 2;
1501
+ * }
1502
+ *
1503
+ * Foo.prototype.c = 3;
1504
+ *
1505
+ * _.keysIn(new Foo);
1506
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1507
+ */
1508
+ function keysIn(object) {
1509
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1510
+ }
1511
+ /**
1512
+ * This method is like `_.assign` except that it recursively merges own and
1513
+ * inherited enumerable string keyed properties of source objects into the
1514
+ * destination object. Source properties that resolve to `undefined` are
1515
+ * skipped if a destination value exists. Array and plain object properties
1516
+ * are merged recursively. Other objects and value types are overridden by
1517
+ * assignment. Source objects are applied from left to right. Subsequent
1518
+ * sources overwrite property assignments of previous sources.
1519
+ *
1520
+ * **Note:** This method mutates `object`.
1521
+ *
1522
+ * @static
1523
+ * @memberOf _
1524
+ * @since 0.5.0
1525
+ * @category Object
1526
+ * @param {Object} object The destination object.
1527
+ * @param {...Object} [sources] The source objects.
1528
+ * @returns {Object} Returns `object`.
1529
+ * @example
1530
+ *
1531
+ * var object = {
1532
+ * 'a': [{ 'b': 2 }, { 'd': 4 }]
1533
+ * };
1534
+ *
1535
+ * var other = {
1536
+ * 'a': [{ 'c': 3 }, { 'e': 5 }]
1537
+ * };
1538
+ *
1539
+ * _.merge(object, other);
1540
+ * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
1541
+ */
1542
+ var merge = createAssigner(function(object, source, srcIndex) {
1543
+ baseMerge(object, source, srcIndex);
1544
+ });
1545
+ /**
1546
+ * Creates a function that returns `value`.
1547
+ *
1548
+ * @static
1549
+ * @memberOf _
1550
+ * @since 2.4.0
1551
+ * @category Util
1552
+ * @param {*} value The value to return from the new function.
1553
+ * @returns {Function} Returns the new constant function.
1554
+ * @example
1555
+ *
1556
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
1557
+ *
1558
+ * console.log(objects);
1559
+ * // => [{ 'a': 1 }, { 'a': 1 }]
1560
+ *
1561
+ * console.log(objects[0] === objects[1]);
1562
+ * // => true
1563
+ */
1564
+ function constant(value) {
1565
+ return function() {
1566
+ return value;
1567
+ };
1568
+ }
1569
+ /**
1570
+ * This method returns the first argument it receives.
1571
+ *
1572
+ * @static
1573
+ * @since 0.1.0
1574
+ * @memberOf _
1575
+ * @category Util
1576
+ * @param {*} value Any value.
1577
+ * @returns {*} Returns `value`.
1578
+ * @example
1579
+ *
1580
+ * var object = { 'a': 1 };
1581
+ *
1582
+ * console.log(_.identity(object) === object);
1583
+ * // => true
1584
+ */
1585
+ function identity(value) {
1586
+ return value;
1587
+ }
1588
+ /**
1589
+ * This method returns `false`.
1590
+ *
1591
+ * @static
1592
+ * @memberOf _
1593
+ * @since 4.13.0
1594
+ * @category Util
1595
+ * @returns {boolean} Returns `false`.
1596
+ * @example
1597
+ *
1598
+ * _.times(2, _.stubFalse);
1599
+ * // => [false, false]
1600
+ */
1601
+ function stubFalse() {
1602
+ return false;
1603
+ }
1604
+ module.exports = merge;
1605
+ }));
1606
+
1607
+ //#endregion
1608
+ //#region src/typography/index.ts
1609
+ var import_lodash = /* @__PURE__ */ __toESM(require_lodash());
5
1610
  function inWhere(selector, { className, prefix, modifier }) {
6
- const prefixedNot = prefix(`.not-${className}`).slice(1);
7
- const selectorPrefix = selector.startsWith('>')
8
- ? `${modifier === 'DEFAULT' ? `.${className}` : `.${className}-${modifier}`} `
9
- : '';
10
- // Parse the selector, if every component ends in the same pseudo element(s) then move it to the end
11
- const [trailingPseudo, rebuiltSelector] = commonTrailingPseudos(selector);
12
- if (trailingPseudo) {
13
- return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))${trailingPseudo}`;
14
- }
15
- return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))`;
1611
+ const prefixedNot = prefix(`.not-${className}`).slice(1);
1612
+ const selectorPrefix = selector.startsWith(">") ? `${modifier === "DEFAULT" ? `.${className}` : `.${className}-${modifier}`} ` : "";
1613
+ const [trailingPseudo, rebuiltSelector] = commonTrailingPseudos(selector);
1614
+ if (trailingPseudo) return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))${trailingPseudo}`;
1615
+ return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))`;
16
1616
  }
17
1617
  function configToCss(config = {}, { className, modifier, prefix }) {
18
- function updateSelector(k, v) {
19
- if (Array.isArray(v)) {
20
- return [k, v];
21
- }
22
- if (typeof v === 'object' && v !== null) {
23
- const nested = Object.values(v).some((prop) => typeof prop === 'object');
24
- if (nested) {
25
- return [
26
- inWhere(k, { className, modifier, prefix }),
27
- v,
28
- Object.fromEntries(Object.entries(v).map(([k, v]) => updateSelector(k, v))),
29
- ];
30
- }
31
- return [inWhere(k, { className, modifier, prefix }), v];
32
- }
33
- return [k, v];
34
- }
35
- const css = config.css ?? [];
36
- return Object.fromEntries(Object.entries(merge({}, ...(Array.isArray(css) ? css : [css]))).map(([k, v]) => updateSelector(k, v)));
1618
+ function updateSelector(k, v) {
1619
+ if (Array.isArray(v)) return [k, v];
1620
+ if (typeof v === "object" && v !== null) {
1621
+ if (Object.values(v).some((prop) => typeof prop === "object")) return [
1622
+ inWhere(k, {
1623
+ className,
1624
+ modifier,
1625
+ prefix
1626
+ }),
1627
+ v,
1628
+ Object.fromEntries(Object.entries(v).map(([k$1, v$1]) => updateSelector(k$1, v$1)))
1629
+ ];
1630
+ return [inWhere(k, {
1631
+ className,
1632
+ modifier,
1633
+ prefix
1634
+ }), v];
1635
+ }
1636
+ return [k, v];
1637
+ }
1638
+ const css = config.css ?? [];
1639
+ return Object.fromEntries(Object.entries((0, import_lodash.default)({}, ...Array.isArray(css) ? css : [css])).map(([k, v]) => updateSelector(k, v)));
37
1640
  }
38
1641
  const parseSelector = parser();
39
1642
  function commonTrailingPseudos(selector) {
40
- const ast = parseSelector.astSync(selector);
41
- const matrix = [];
42
- // Put the pseudo elements in reverse order in a sparse, column-major 2D array
43
- for (const [i, sel] of ast.nodes.entries()) {
44
- for (const [j, child] of [...sel.nodes].reverse().entries()) {
45
- // We only care about pseudo elements
46
- if (child.type !== 'pseudo' || !child.value.startsWith('::')) {
47
- break;
48
- }
49
- matrix[j] = matrix[j] || [];
50
- matrix[j][i] = child;
51
- }
52
- }
53
- const trailingPseudos = parser.selector({
54
- value: '',
55
- });
56
- // At this point the pseudo elements are in a column-major 2D array
57
- // This means each row contains one "column" of pseudo elements from each selector
58
- // We can compare all the pseudo elements in a row to see if they are the same
59
- for (const pseudos of matrix) {
60
- // It's a sparse 2D array so there are going to be holes in the rows
61
- // We skip those
62
- if (!pseudos) {
63
- continue;
64
- }
65
- const values = new Set(pseudos.map((p) => p.value));
66
- // The pseudo elements are not the same
67
- if (values.size > 1) {
68
- break;
69
- }
70
- pseudos.forEach((pseudo) => pseudo.remove());
71
- trailingPseudos.prepend(pseudos[0]);
72
- }
73
- if (trailingPseudos.nodes.length) {
74
- return [trailingPseudos.toString(), ast.toString()];
75
- }
76
- return [null, selector];
1643
+ const ast = parseSelector.astSync(selector);
1644
+ const matrix = [];
1645
+ for (const [i, sel] of ast.nodes.entries()) for (const [j, child] of [...sel.nodes].reverse().entries()) {
1646
+ if (child.type !== "pseudo" || !child.value.startsWith("::")) break;
1647
+ matrix[j] = matrix[j] || [];
1648
+ matrix[j][i] = child;
1649
+ }
1650
+ const trailingPseudos = parser.selector({ value: "" });
1651
+ for (const pseudos of matrix) {
1652
+ if (!pseudos) continue;
1653
+ if (new Set(pseudos.map((p) => p.value)).size > 1) break;
1654
+ pseudos.forEach((pseudo) => pseudo.remove());
1655
+ trailingPseudos.prepend(pseudos[0]);
1656
+ }
1657
+ if (trailingPseudos.nodes.length) return [trailingPseudos.toString(), ast.toString()];
1658
+ return [null, selector];
77
1659
  }
78
1660
  const SELECTORS = [
79
- ['headings', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'th'],
80
- ['h1'],
81
- ['h2'],
82
- ['h3'],
83
- ['h4'],
84
- ['h5'],
85
- ['h6'],
86
- ['p'],
87
- ['a'],
88
- ['blockquote'],
89
- ['figure'],
90
- ['figcaption'],
91
- ['strong'],
92
- ['em'],
93
- ['kbd'],
94
- ['code'],
95
- ['pre'],
96
- ['ol'],
97
- ['ul'],
98
- ['li'],
99
- ['table'],
100
- ['thead'],
101
- ['tr'],
102
- ['th'],
103
- ['td'],
104
- ['img'],
105
- ['video'],
106
- ['hr'],
107
- ['lead', '[class~="lead"]'],
1661
+ [
1662
+ "headings",
1663
+ "h1",
1664
+ "h2",
1665
+ "h3",
1666
+ "h4",
1667
+ "h5",
1668
+ "h6",
1669
+ "th"
1670
+ ],
1671
+ ["h1"],
1672
+ ["h2"],
1673
+ ["h3"],
1674
+ ["h4"],
1675
+ ["h5"],
1676
+ ["h6"],
1677
+ ["p"],
1678
+ ["a"],
1679
+ ["blockquote"],
1680
+ ["figure"],
1681
+ ["figcaption"],
1682
+ ["strong"],
1683
+ ["em"],
1684
+ ["kbd"],
1685
+ ["code"],
1686
+ ["pre"],
1687
+ ["ol"],
1688
+ ["ul"],
1689
+ ["li"],
1690
+ ["table"],
1691
+ ["thead"],
1692
+ ["tr"],
1693
+ ["th"],
1694
+ ["td"],
1695
+ ["img"],
1696
+ ["video"],
1697
+ ["hr"],
1698
+ ["lead", "[class~=\"lead\"]"]
108
1699
  ];
109
- export const typography = plugin.withOptions(({ className = 'prose', ...styleOptions } = {}) => {
110
- return ({ addVariant, addComponents, ...rest }) => {
111
- const prefix = rest.prefix;
112
- for (const [name, ...values] of SELECTORS) {
113
- const selectors = values.length === 0 ? [name] : values;
114
- const selector = selectors.join(', ');
115
- addVariant(`${className}-${name}`, `& :is(${inWhere(selector, {
116
- prefix,
117
- className,
118
- })})`);
119
- }
120
- addComponents({
121
- [`.${className}`]: configToCss({
122
- ...styles.DEFAULT,
123
- css: [
124
- ...(styles.DEFAULT.css ?? []),
125
- styleOptions.disableRoundedTable
126
- ? styles.normalTable
127
- : styles.roundedTable,
128
- ],
129
- }, {
130
- className,
131
- modifier: 'DEFAULT',
132
- prefix,
133
- }),
134
- });
135
- };
1700
+ const typography = plugin.withOptions(({ className = "prose", ...styleOptions } = {}) => {
1701
+ return ({ addVariant, addComponents, ...rest }) => {
1702
+ const prefix = rest.prefix;
1703
+ for (const [name, ...values] of SELECTORS) {
1704
+ const selector = (values.length === 0 ? [name] : values).join(", ");
1705
+ addVariant(`${className}-${name}`, `& :is(${inWhere(selector, {
1706
+ prefix,
1707
+ className
1708
+ })})`);
1709
+ }
1710
+ addComponents({ [`.${className}`]: configToCss({
1711
+ ...DEFAULT,
1712
+ css: [...DEFAULT.css ?? [], styleOptions.disableRoundedTable ? normalTable : roundedTable]
1713
+ }, {
1714
+ className,
1715
+ modifier: "DEFAULT",
1716
+ prefix
1717
+ }) });
1718
+ };
136
1719
  });
137
- export default typography;
1720
+ var typography_default = typography;
1721
+
1722
+ //#endregion
1723
+ export { typography_default as default, typography };
1724
+ //# sourceMappingURL=index.js.map