@cleartrip/ct-design-typography 4.0.0 → 5.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.
Files changed (38) hide show
  1. package/README.md +169 -0
  2. package/dist/Typography.d.ts +2 -2
  3. package/dist/Typography.d.ts.map +1 -1
  4. package/dist/Typography.native.d.ts +6 -0
  5. package/dist/Typography.native.d.ts.map +1 -0
  6. package/dist/constants.d.ts +53 -0
  7. package/dist/constants.d.ts.map +1 -0
  8. package/dist/ct-design-typography.browser.cjs.js +1 -1
  9. package/dist/ct-design-typography.browser.cjs.js.map +1 -1
  10. package/dist/ct-design-typography.browser.esm.js +1 -1
  11. package/dist/ct-design-typography.browser.esm.js.map +1 -1
  12. package/dist/ct-design-typography.cjs.js +103 -55
  13. package/dist/ct-design-typography.cjs.js.map +1 -1
  14. package/dist/ct-design-typography.esm.js +103 -55
  15. package/dist/ct-design-typography.esm.js.map +1 -1
  16. package/dist/ct-design-typography.umd.js +1752 -95
  17. package/dist/ct-design-typography.umd.js.map +1 -1
  18. package/dist/index.d.ts +3 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/style.d.ts +174 -498
  21. package/dist/style.d.ts.map +1 -1
  22. package/dist/type.d.ts +10 -48
  23. package/dist/type.d.ts.map +1 -1
  24. package/package.json +21 -11
  25. package/src/Typography.native.tsx +109 -0
  26. package/src/Typography.tsx +122 -0
  27. package/src/constants.ts +53 -0
  28. package/src/index.ts +4 -0
  29. package/src/style.ts +306 -0
  30. package/src/type.ts +94 -0
  31. package/dist/StyledTypography/StyledTypography.d.ts +0 -8
  32. package/dist/StyledTypography/StyledTypography.d.ts.map +0 -1
  33. package/dist/StyledTypography/index.d.ts +0 -2
  34. package/dist/StyledTypography/index.d.ts.map +0 -1
  35. package/dist/StyledTypography/style.d.ts +0 -6
  36. package/dist/StyledTypography/style.d.ts.map +0 -1
  37. package/dist/StyledTypography/type.d.ts +0 -18
  38. package/dist/StyledTypography/type.d.ts.map +0 -1
@@ -1,78 +1,13 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('@cleartrip/ct-design-theme'), require('styled-components'), require('@cleartrip/ct-design-conditional-wrap'), require('@cleartrip/ct-design-container')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', '@cleartrip/ct-design-theme', 'styled-components', '@cleartrip/ct-design-conditional-wrap', '@cleartrip/ct-design-container'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystem = {}, global.jsxRuntime, global.ctDesignTheme, global.styled, global.ConditionalWrap, global.ctDesignContainer));
5
- })(this, (function (exports, jsxRuntime, ctDesignTheme, styled, ConditionalWrap, ctDesignContainer) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react/jsx-runtime'), require('react'), require('@cleartrip/ct-design-theme'), require('@cleartrip/ct-design-style-manager'), require('@cleartrip/ct-design-container'), require('@cleartrip/ct-design-conditional-wrap')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'react/jsx-runtime', 'react', '@cleartrip/ct-design-theme', '@cleartrip/ct-design-style-manager', '@cleartrip/ct-design-container', '@cleartrip/ct-design-conditional-wrap'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.CTDesignSystem = {}, global.jsxRuntime, global.React, global.ctDesignTheme, global.ctDesignStyleManager, global.ctDesignContainer, global.ConditionalWrap));
5
+ })(this, (function (exports, jsxRuntime, react, ctDesignTheme, ctDesignStyleManager, ctDesignContainer, ConditionalWrap) { 'use strict';
6
6
 
7
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
9
- var styled__default = /*#__PURE__*/_interopDefault(styled);
10
9
  var ConditionalWrap__default = /*#__PURE__*/_interopDefault(ConditionalWrap);
11
10
 
12
- /******************************************************************************
13
- Copyright (c) Microsoft Corporation.
14
-
15
- Permission to use, copy, modify, and/or distribute this software for any
16
- purpose with or without fee is hereby granted.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
19
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
20
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
21
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
23
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
24
- PERFORMANCE OF THIS SOFTWARE.
25
- ***************************************************************************** */
26
- /* global Reflect, Promise, SuppressedError, Symbol */
27
-
28
- var __assign = function () {
29
- __assign = Object.assign || function __assign(t) {
30
- for (var s, i = 1, n = arguments.length; i < n; i++) {
31
- s = arguments[i];
32
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
33
- }
34
- return t;
35
- };
36
- return __assign.apply(this, arguments);
37
- };
38
- function __rest(s, e) {
39
- var t = {};
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
41
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
42
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
43
- }
44
- return t;
45
- }
46
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
47
- var e = new Error(message);
48
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
49
- };
50
-
51
- var getStyledTypographyStyles = function (_a) {
52
- var fontSize = _a.fontSize, fontWeight = _a.fontWeight, lineHeight = _a.lineHeight, color = _a.color, textDecoration = _a.textDecoration, fontStyle = _a.fontStyle, width = _a.width, display = _a.display, webkitLineClamp = _a.webkitLineClamp, webkitBoxOrient = _a.webkitBoxOrient, overflow = _a.overflow, cursor = _a.cursor, _b = _a.css, css = _b === void 0 ? {} : _b, restCss = __rest(_a, ["fontSize", "fontWeight", "lineHeight", "color", "textDecoration", "fontStyle", "width", "display", "webkitLineClamp", "webkitBoxOrient", "overflow", "cursor", "css"]);
53
- return (__assign(__assign({ fontSize: fontSize, fontWeight: fontWeight, lineHeight: lineHeight, color: color, textDecoration: textDecoration, fontStyle: fontStyle, width: width, display: display, '-webkit-line-clamp': "".concat(webkitLineClamp), '-webkit-box-orient': webkitBoxOrient, overflow: overflow, cursor: cursor }, restCss), css));
54
- };
55
-
56
- var StyledTypography = styled__default.default.div(function (_a) {
57
- var color = _a.color, cursor = _a.cursor, fontSize = _a.fontSize, fontWeight = _a.fontWeight, lineHeight = _a.lineHeight, textDecoration = _a.textDecoration, fontStyle = _a.fontStyle, width = _a.width, display = _a.display, webkitLineClamp = _a.webkitLineClamp, webkitBoxOrient = _a.webkitBoxOrient, overflow = _a.overflow, textTransform = _a.textTransform, letterSpacing = _a.letterSpacing, _b = _a.css, css = _b === void 0 ? {} : _b;
58
- return (__assign(__assign({}, getStyledTypographyStyles({
59
- color: color,
60
- cursor: cursor,
61
- fontSize: fontSize,
62
- fontWeight: fontWeight,
63
- lineHeight: lineHeight,
64
- textDecoration: textDecoration,
65
- fontStyle: fontStyle,
66
- width: width,
67
- display: display,
68
- webkitLineClamp: webkitLineClamp,
69
- webkitBoxOrient: webkitBoxOrient,
70
- overflow: overflow,
71
- textTransform: textTransform,
72
- letterSpacing: letterSpacing,
73
- })), css));
74
- });
75
-
76
11
  exports.TypographyVariant = void 0;
77
12
  (function (TypographyVariant) {
78
13
  TypographyVariant["HD1"] = "HD1";
@@ -91,11 +26,14 @@
91
26
  TypographyVariant["P1"] = "P1";
92
27
  TypographyVariant["P2"] = "P2";
93
28
  TypographyVariant["P3"] = "P3";
29
+ TypographyVariant["P4"] = "P4";
94
30
  TypographyVariant["L1"] = "L1";
95
31
  TypographyVariant["L2"] = "L2";
96
32
  TypographyVariant["L3"] = "L3";
97
33
  TypographyVariant["OVERLINE"] = "OVERLINE";
98
34
  TypographyVariant["TAG"] = "TAG";
35
+ TypographyVariant["M4BOLD"] = "M4BOLD";
36
+ TypographyVariant["WRAPPER"] = "WRAPPER";
99
37
  })(exports.TypographyVariant || (exports.TypographyVariant = {}));
100
38
  exports.TypographyColor = void 0;
101
39
  (function (TypographyColor) {
@@ -112,9 +50,20 @@
112
50
  TypographyColor["NEUTRAL"] = "neutral";
113
51
  TypographyColor["LINK2"] = "link2";
114
52
  TypographyColor["PRIMARY2"] = "primary2";
53
+ TypographyColor["SECONDARY2"] = "secondary2";
54
+ TypographyColor["GRAPETINI"] = "grapetini900";
55
+ TypographyColor["PINA_COLADA750"] = "pinacolada750";
56
+ TypographyColor["BRAND"] = "brand";
57
+ TypographyColor["ALERT500"] = "alert500";
58
+ TypographyColor["NEUTRAL50"] = "neutral50";
59
+ TypographyColor["MARGARITA750"] = "margarita750";
60
+ TypographyColor["GREEN100"] = "green100";
61
+ TypographyColor["RED100"] = "red100";
62
+ TypographyColor["CORALPINK"] = "coralpink";
63
+ TypographyColor["WARNING500"] = "warning500";
115
64
  })(exports.TypographyColor || (exports.TypographyColor = {}));
116
65
 
117
- var getTypographyVariant = function (theme, variant) {
66
+ const getTypographyVariant = (theme, variant) => {
118
67
  switch (variant) {
119
68
  case exports.TypographyVariant.HD1: {
120
69
  return {
@@ -232,6 +181,13 @@
232
181
  lineHeight: theme.typography.lineHeight[16],
233
182
  };
234
183
  }
184
+ case exports.TypographyVariant.P4: {
185
+ return {
186
+ fontSize: theme.typography.size[10],
187
+ fontWeight: theme.typography.weight.normal,
188
+ lineHeight: theme.typography.lineHeight[14],
189
+ };
190
+ }
235
191
  case exports.TypographyVariant.L1: {
236
192
  return {
237
193
  fontSize: theme.typography.size[16],
@@ -277,7 +233,7 @@
277
233
  }
278
234
  }
279
235
  };
280
- var getTypographyColor = function (theme, color) {
236
+ const getTypographyColor = (theme, color) => {
281
237
  switch (color) {
282
238
  case exports.TypographyColor.PRIMARY: {
283
239
  return theme.color.text.primary;
@@ -318,15 +274,37 @@
318
274
  case exports.TypographyColor.PRIMARY2: {
319
275
  return theme.color.text.primary2;
320
276
  }
277
+ case exports.TypographyColor.SECONDARY2: {
278
+ return theme.color.text.secondary2;
279
+ }
280
+ case exports.TypographyColor.GRAPETINI: {
281
+ return theme.color.text.grapetini900;
282
+ }
283
+ case exports.TypographyColor.PINA_COLADA750: {
284
+ return theme.color.text.pinaColada750;
285
+ }
286
+ case exports.TypographyColor.CORALPINK: {
287
+ return theme.color.text.coralpink;
288
+ }
289
+ case exports.TypographyColor.NEUTRAL50: {
290
+ return theme.color.text.neutral50;
291
+ }
292
+ case exports.TypographyColor.WARNING500:
293
+ case exports.TypographyColor.ALERT500: {
294
+ return theme.color.text.alert500;
295
+ }
296
+ case exports.TypographyColor.BRAND: {
297
+ return theme.color.text.brand;
298
+ }
321
299
  default: {
322
300
  return theme.color.text.primary;
323
301
  }
324
302
  }
325
303
  };
326
- var getLineClampStyles = function (lineClamp) {
304
+ const getLineClampStyles = (lineClamp) => {
327
305
  if (lineClamp) {
328
306
  return {
329
- display: '-webkit-box',
307
+ display: 'webkitBox',
330
308
  webkitLineClamp: lineClamp,
331
309
  webkitBoxOrient: 'vertical',
332
310
  overflow: 'hidden',
@@ -334,13 +312,1662 @@
334
312
  }
335
313
  return {};
336
314
  };
337
- var getTypographyStyles = function (_a) {
338
- var theme = _a.theme, variant = _a.variant, color = _a.color, isClickable = _a.isClickable, isStriked = _a.isStriked, colorCode = _a.colorCode, showInItalics = _a.showInItalics, lineClamp = _a.lineClamp, isDisabled = _a.isDisabled;
339
- return __assign(__assign(__assign({}, getTypographyVariant(theme, variant !== null && variant !== void 0 ? variant : exports.TypographyVariant.HM2)), getLineClampStyles(lineClamp)), { color: colorCode || getTypographyColor(theme, color !== null && color !== void 0 ? color : exports.TypographyColor.PRIMARY), textDecoration: isStriked ? 'line-through' : 'none', cursor: isDisabled ? 'not-allowed' : isClickable ? 'pointer' : 'auto', fontStyle: showInItalics ? 'italic' : 'none' });
315
+ const getTypographyStyles = ({ theme, variant, color, isStriked, colorCode, showInItalics, }) => {
316
+ const textDecorationLine = isStriked ? 'line-through' : 'none';
317
+ return Object.assign(Object.assign({}, getTypographyVariant(theme, variant !== null && variant !== void 0 ? variant : exports.TypographyVariant.HM2)), { color: colorCode || getTypographyColor(theme, color !== null && color !== void 0 ? color : exports.TypographyColor.PRIMARY), textDecorationLine, fontStyle: (showInItalics ? 'italic' : 'none') });
318
+ };
319
+
320
+ var isDevelopment$1 = false;
321
+
322
+ /*
323
+
324
+ Based off glamor's StyleSheet, thanks Sunil ❤️
325
+
326
+ high performance StyleSheet for css-in-js systems
327
+
328
+ - uses multiple style tags behind the scenes for millions of rules
329
+ - uses `insertRule` for appending in production for *much* faster performance
330
+
331
+ // usage
332
+
333
+ import { StyleSheet } from '@emotion/sheet'
334
+
335
+ let styleSheet = new StyleSheet({ key: '', container: document.head })
336
+
337
+ styleSheet.insert('#box { border: 1px solid red; }')
338
+ - appends a css rule into the stylesheet
339
+
340
+ styleSheet.flush()
341
+ - empties the stylesheet of all its contents
342
+
343
+ */
344
+
345
+ function sheetForTag(tag) {
346
+ if (tag.sheet) {
347
+ return tag.sheet;
348
+ } // this weirdness brought to you by firefox
349
+
350
+ /* istanbul ignore next */
351
+
352
+ for (var i = 0; i < document.styleSheets.length; i++) {
353
+ if (document.styleSheets[i].ownerNode === tag) {
354
+ return document.styleSheets[i];
355
+ }
356
+ } // this function should always return with a value
357
+ // TS can't understand it though so we make it stop complaining here
358
+
359
+ return undefined;
360
+ }
361
+ function createStyleElement(options) {
362
+ var tag = document.createElement('style');
363
+ tag.setAttribute('data-emotion', options.key);
364
+ if (options.nonce !== undefined) {
365
+ tag.setAttribute('nonce', options.nonce);
366
+ }
367
+ tag.appendChild(document.createTextNode(''));
368
+ tag.setAttribute('data-s', '');
369
+ return tag;
370
+ }
371
+ var StyleSheet = /*#__PURE__*/function () {
372
+ // Using Node instead of HTMLElement since container may be a ShadowRoot
373
+ function StyleSheet(options) {
374
+ var _this = this;
375
+ this._insertTag = function (tag) {
376
+ var before;
377
+ if (_this.tags.length === 0) {
378
+ if (_this.insertionPoint) {
379
+ before = _this.insertionPoint.nextSibling;
380
+ } else if (_this.prepend) {
381
+ before = _this.container.firstChild;
382
+ } else {
383
+ before = _this.before;
384
+ }
385
+ } else {
386
+ before = _this.tags[_this.tags.length - 1].nextSibling;
387
+ }
388
+ _this.container.insertBefore(tag, before);
389
+ _this.tags.push(tag);
390
+ };
391
+ this.isSpeedy = options.speedy === undefined ? !isDevelopment$1 : options.speedy;
392
+ this.tags = [];
393
+ this.ctr = 0;
394
+ this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
395
+
396
+ this.key = options.key;
397
+ this.container = options.container;
398
+ this.prepend = options.prepend;
399
+ this.insertionPoint = options.insertionPoint;
400
+ this.before = null;
401
+ }
402
+ var _proto = StyleSheet.prototype;
403
+ _proto.hydrate = function hydrate(nodes) {
404
+ nodes.forEach(this._insertTag);
405
+ };
406
+ _proto.insert = function insert(rule) {
407
+ // the max length is how many rules we have per style tag, it's 65000 in speedy mode
408
+ // it's 1 in dev because we insert source maps that map a single rule to a location
409
+ // and you can only have one source map per style tag
410
+ if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
411
+ this._insertTag(createStyleElement(this));
412
+ }
413
+ var tag = this.tags[this.tags.length - 1];
414
+ if (this.isSpeedy) {
415
+ var sheet = sheetForTag(tag);
416
+ try {
417
+ // this is the ultrafast version, works across browsers
418
+ // the big drawback is that the css won't be editable in devtools
419
+ sheet.insertRule(rule, sheet.cssRules.length);
420
+ } catch (e) {}
421
+ } else {
422
+ tag.appendChild(document.createTextNode(rule));
423
+ }
424
+ this.ctr++;
425
+ };
426
+ _proto.flush = function flush() {
427
+ this.tags.forEach(function (tag) {
428
+ var _tag$parentNode;
429
+ return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
430
+ });
431
+ this.tags = [];
432
+ this.ctr = 0;
433
+ };
434
+ return StyleSheet;
435
+ }();
436
+
437
+ var stylisExports = {};
438
+ var stylis = {
439
+ get exports(){ return stylisExports; },
440
+ set exports(v){ stylisExports = v; },
441
+ };
442
+
443
+ (function (module, exports) {
444
+ (function (e, r) {
445
+ r(exports) ;
446
+ })(this, function (e) {
447
+
448
+ var r = "-ms-";
449
+ var a = "-moz-";
450
+ var c = "-webkit-";
451
+ var n = "comm";
452
+ var t = "rule";
453
+ var s = "decl";
454
+ var i = "@page";
455
+ var u = "@media";
456
+ var o = "@import";
457
+ var f = "@charset";
458
+ var l = "@viewport";
459
+ var p = "@supports";
460
+ var h = "@document";
461
+ var v = "@namespace";
462
+ var d = "@keyframes";
463
+ var b = "@font-face";
464
+ var w = "@counter-style";
465
+ var m = "@font-feature-values";
466
+ var g = "@layer";
467
+ var k = Math.abs;
468
+ var $ = String.fromCharCode;
469
+ var x = Object.assign;
470
+ function E(e, r) {
471
+ return M(e, 0) ^ 45 ? (((r << 2 ^ M(e, 0)) << 2 ^ M(e, 1)) << 2 ^ M(e, 2)) << 2 ^ M(e, 3) : 0;
472
+ }
473
+ function y(e) {
474
+ return e.trim();
475
+ }
476
+ function T(e, r) {
477
+ return (e = r.exec(e)) ? e[0] : e;
478
+ }
479
+ function A(e, r, a) {
480
+ return e.replace(r, a);
481
+ }
482
+ function O(e, r) {
483
+ return e.indexOf(r);
484
+ }
485
+ function M(e, r) {
486
+ return e.charCodeAt(r) | 0;
487
+ }
488
+ function C(e, r, a) {
489
+ return e.slice(r, a);
490
+ }
491
+ function R(e) {
492
+ return e.length;
493
+ }
494
+ function S(e) {
495
+ return e.length;
496
+ }
497
+ function z(e, r) {
498
+ return r.push(e), e;
499
+ }
500
+ function N(e, r) {
501
+ return e.map(r).join("");
502
+ }
503
+ e.line = 1;
504
+ e.column = 1;
505
+ e.length = 0;
506
+ e.position = 0;
507
+ e.character = 0;
508
+ e.characters = "";
509
+ function P(r, a, c, n, t, s, i) {
510
+ return {
511
+ value: r,
512
+ root: a,
513
+ parent: c,
514
+ type: n,
515
+ props: t,
516
+ children: s,
517
+ line: e.line,
518
+ column: e.column,
519
+ length: i,
520
+ return: ""
521
+ };
522
+ }
523
+ function j(e, r) {
524
+ return x(P("", null, null, "", null, null, 0), e, {
525
+ length: -e.length
526
+ }, r);
527
+ }
528
+ function U() {
529
+ return e.character;
530
+ }
531
+ function _() {
532
+ e.character = e.position > 0 ? M(e.characters, --e.position) : 0;
533
+ if (e.column--, e.character === 10) e.column = 1, e.line--;
534
+ return e.character;
535
+ }
536
+ function F() {
537
+ e.character = e.position < e.length ? M(e.characters, e.position++) : 0;
538
+ if (e.column++, e.character === 10) e.column = 1, e.line++;
539
+ return e.character;
540
+ }
541
+ function I() {
542
+ return M(e.characters, e.position);
543
+ }
544
+ function L() {
545
+ return e.position;
546
+ }
547
+ function D(r, a) {
548
+ return C(e.characters, r, a);
549
+ }
550
+ function Y(e) {
551
+ switch (e) {
552
+ case 0:
553
+ case 9:
554
+ case 10:
555
+ case 13:
556
+ case 32:
557
+ return 5;
558
+ case 33:
559
+ case 43:
560
+ case 44:
561
+ case 47:
562
+ case 62:
563
+ case 64:
564
+ case 126:
565
+ case 59:
566
+ case 123:
567
+ case 125:
568
+ return 4;
569
+ case 58:
570
+ return 3;
571
+ case 34:
572
+ case 39:
573
+ case 40:
574
+ case 91:
575
+ return 2;
576
+ case 41:
577
+ case 93:
578
+ return 1;
579
+ }
580
+ return 0;
581
+ }
582
+ function K(r) {
583
+ return e.line = e.column = 1, e.length = R(e.characters = r), e.position = 0, [];
584
+ }
585
+ function V(r) {
586
+ return e.characters = "", r;
587
+ }
588
+ function W(r) {
589
+ return y(D(e.position - 1, q(r === 91 ? r + 2 : r === 40 ? r + 1 : r)));
590
+ }
591
+ function B(e) {
592
+ return V(H(K(e)));
593
+ }
594
+ function G(r) {
595
+ while (e.character = I()) if (e.character < 33) F();else break;
596
+ return Y(r) > 2 || Y(e.character) > 3 ? "" : " ";
597
+ }
598
+ function H(r) {
599
+ while (F()) switch (Y(e.character)) {
600
+ case 0:
601
+ z(Q(e.position - 1), r);
602
+ break;
603
+ case 2:
604
+ z(W(e.character), r);
605
+ break;
606
+ default:
607
+ z($(e.character), r);
608
+ }
609
+ return r;
610
+ }
611
+ function Z(r, a) {
612
+ while (--a && F()) if (e.character < 48 || e.character > 102 || e.character > 57 && e.character < 65 || e.character > 70 && e.character < 97) break;
613
+ return D(r, L() + (a < 6 && I() == 32 && F() == 32));
614
+ }
615
+ function q(r) {
616
+ while (F()) switch (e.character) {
617
+ case r:
618
+ return e.position;
619
+ case 34:
620
+ case 39:
621
+ if (r !== 34 && r !== 39) q(e.character);
622
+ break;
623
+ case 40:
624
+ if (r === 41) q(r);
625
+ break;
626
+ case 92:
627
+ F();
628
+ break;
629
+ }
630
+ return e.position;
631
+ }
632
+ function J(r, a) {
633
+ while (F()) if (r + e.character === 47 + 10) break;else if (r + e.character === 42 + 42 && I() === 47) break;
634
+ return "/*" + D(a, e.position - 1) + "*" + $(r === 47 ? r : F());
635
+ }
636
+ function Q(r) {
637
+ while (!Y(I())) F();
638
+ return D(r, e.position);
639
+ }
640
+ function X(e) {
641
+ return V(ee("", null, null, null, [""], e = K(e), 0, [0], e));
642
+ }
643
+ function ee(e, r, a, c, n, t, s, i, u) {
644
+ var o = 0;
645
+ var f = 0;
646
+ var l = s;
647
+ var p = 0;
648
+ var h = 0;
649
+ var v = 0;
650
+ var d = 1;
651
+ var b = 1;
652
+ var w = 1;
653
+ var m = 0;
654
+ var g = "";
655
+ var k = n;
656
+ var x = t;
657
+ var E = c;
658
+ var y = g;
659
+ while (b) switch (v = m, m = F()) {
660
+ case 40:
661
+ if (v != 108 && M(y, l - 1) == 58) {
662
+ if (O(y += A(W(m), "&", "&\f"), "&\f") != -1) w = -1;
663
+ break;
664
+ }
665
+ case 34:
666
+ case 39:
667
+ case 91:
668
+ y += W(m);
669
+ break;
670
+ case 9:
671
+ case 10:
672
+ case 13:
673
+ case 32:
674
+ y += G(v);
675
+ break;
676
+ case 92:
677
+ y += Z(L() - 1, 7);
678
+ continue;
679
+ case 47:
680
+ switch (I()) {
681
+ case 42:
682
+ case 47:
683
+ z(ae(J(F(), L()), r, a), u);
684
+ break;
685
+ default:
686
+ y += "/";
687
+ }
688
+ break;
689
+ case 123 * d:
690
+ i[o++] = R(y) * w;
691
+ case 125 * d:
692
+ case 59:
693
+ case 0:
694
+ switch (m) {
695
+ case 0:
696
+ case 125:
697
+ b = 0;
698
+ case 59 + f:
699
+ if (w == -1) y = A(y, /\f/g, "");
700
+ if (h > 0 && R(y) - l) z(h > 32 ? ce(y + ";", c, a, l - 1) : ce(A(y, " ", "") + ";", c, a, l - 2), u);
701
+ break;
702
+ case 59:
703
+ y += ";";
704
+ default:
705
+ z(E = re(y, r, a, o, f, n, i, g, k = [], x = [], l), t);
706
+ if (m === 123) if (f === 0) ee(y, r, E, E, k, t, l, i, x);else switch (p === 99 && M(y, 3) === 110 ? 100 : p) {
707
+ case 100:
708
+ case 108:
709
+ case 109:
710
+ case 115:
711
+ ee(e, E, E, c && z(re(e, E, E, 0, 0, n, i, g, n, k = [], l), x), n, x, l, i, c ? k : x);
712
+ break;
713
+ default:
714
+ ee(y, E, E, E, [""], x, 0, i, x);
715
+ }
716
+ }
717
+ o = f = h = 0, d = w = 1, g = y = "", l = s;
718
+ break;
719
+ case 58:
720
+ l = 1 + R(y), h = v;
721
+ default:
722
+ if (d < 1) if (m == 123) --d;else if (m == 125 && d++ == 0 && _() == 125) continue;
723
+ switch (y += $(m), m * d) {
724
+ case 38:
725
+ w = f > 0 ? 1 : (y += "\f", -1);
726
+ break;
727
+ case 44:
728
+ i[o++] = (R(y) - 1) * w, w = 1;
729
+ break;
730
+ case 64:
731
+ if (I() === 45) y += W(F());
732
+ p = I(), f = l = R(g = y += Q(L())), m++;
733
+ break;
734
+ case 45:
735
+ if (v === 45 && R(y) == 2) d = 0;
736
+ }
737
+ }
738
+ return t;
739
+ }
740
+ function re(e, r, a, c, n, s, i, u, o, f, l) {
741
+ var p = n - 1;
742
+ var h = n === 0 ? s : [""];
743
+ var v = S(h);
744
+ for (var d = 0, b = 0, w = 0; d < c; ++d) for (var m = 0, g = C(e, p + 1, p = k(b = i[d])), $ = e; m < v; ++m) if ($ = y(b > 0 ? h[m] + " " + g : A(g, /&\f/g, h[m]))) o[w++] = $;
745
+ return P(e, r, a, n === 0 ? t : u, o, f, l);
746
+ }
747
+ function ae(e, r, a) {
748
+ return P(e, r, a, n, $(U()), C(e, 2, -2), 0);
749
+ }
750
+ function ce(e, r, a, c) {
751
+ return P(e, r, a, s, C(e, 0, c), C(e, c + 1, -1), c);
752
+ }
753
+ function ne(e, n, t) {
754
+ switch (E(e, n)) {
755
+ case 5103:
756
+ return c + "print-" + e + e;
757
+ case 5737:
758
+ case 4201:
759
+ case 3177:
760
+ case 3433:
761
+ case 1641:
762
+ case 4457:
763
+ case 2921:
764
+ case 5572:
765
+ case 6356:
766
+ case 5844:
767
+ case 3191:
768
+ case 6645:
769
+ case 3005:
770
+ case 6391:
771
+ case 5879:
772
+ case 5623:
773
+ case 6135:
774
+ case 4599:
775
+ case 4855:
776
+ case 4215:
777
+ case 6389:
778
+ case 5109:
779
+ case 5365:
780
+ case 5621:
781
+ case 3829:
782
+ return c + e + e;
783
+ case 4789:
784
+ return a + e + e;
785
+ case 5349:
786
+ case 4246:
787
+ case 4810:
788
+ case 6968:
789
+ case 2756:
790
+ return c + e + a + e + r + e + e;
791
+ case 5936:
792
+ switch (M(e, n + 11)) {
793
+ case 114:
794
+ return c + e + r + A(e, /[svh]\w+-[tblr]{2}/, "tb") + e;
795
+ case 108:
796
+ return c + e + r + A(e, /[svh]\w+-[tblr]{2}/, "tb-rl") + e;
797
+ case 45:
798
+ return c + e + r + A(e, /[svh]\w+-[tblr]{2}/, "lr") + e;
799
+ }
800
+ case 6828:
801
+ case 4268:
802
+ case 2903:
803
+ return c + e + r + e + e;
804
+ case 6165:
805
+ return c + e + r + "flex-" + e + e;
806
+ case 5187:
807
+ return c + e + A(e, /(\w+).+(:[^]+)/, c + "box-$1$2" + r + "flex-$1$2") + e;
808
+ case 5443:
809
+ return c + e + r + "flex-item-" + A(e, /flex-|-self/g, "") + (!T(e, /flex-|baseline/) ? r + "grid-row-" + A(e, /flex-|-self/g, "") : "") + e;
810
+ case 4675:
811
+ return c + e + r + "flex-line-pack" + A(e, /align-content|flex-|-self/g, "") + e;
812
+ case 5548:
813
+ return c + e + r + A(e, "shrink", "negative") + e;
814
+ case 5292:
815
+ return c + e + r + A(e, "basis", "preferred-size") + e;
816
+ case 6060:
817
+ return c + "box-" + A(e, "-grow", "") + c + e + r + A(e, "grow", "positive") + e;
818
+ case 4554:
819
+ return c + A(e, /([^-])(transform)/g, "$1" + c + "$2") + e;
820
+ case 6187:
821
+ return A(A(A(e, /(zoom-|grab)/, c + "$1"), /(image-set)/, c + "$1"), e, "") + e;
822
+ case 5495:
823
+ case 3959:
824
+ return A(e, /(image-set\([^]*)/, c + "$1" + "$`$1");
825
+ case 4968:
826
+ return A(A(e, /(.+:)(flex-)?(.*)/, c + "box-pack:$3" + r + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + c + e + e;
827
+ case 4200:
828
+ if (!T(e, /flex-|baseline/)) return r + "grid-column-align" + C(e, n) + e;
829
+ break;
830
+ case 2592:
831
+ case 3360:
832
+ return r + A(e, "template-", "") + e;
833
+ case 4384:
834
+ case 3616:
835
+ if (t && t.some(function (e, r) {
836
+ return n = r, T(e.props, /grid-\w+-end/);
837
+ })) {
838
+ return ~O(e + (t = t[n].value), "span") ? e : r + A(e, "-start", "") + e + r + "grid-row-span:" + (~O(t, "span") ? T(t, /\d+/) : +T(t, /\d+/) - +T(e, /\d+/)) + ";";
839
+ }
840
+ return r + A(e, "-start", "") + e;
841
+ case 4896:
842
+ case 4128:
843
+ return t && t.some(function (e) {
844
+ return T(e.props, /grid-\w+-start/);
845
+ }) ? e : r + A(A(e, "-end", "-span"), "span ", "") + e;
846
+ case 4095:
847
+ case 3583:
848
+ case 4068:
849
+ case 2532:
850
+ return A(e, /(.+)-inline(.+)/, c + "$1$2") + e;
851
+ case 8116:
852
+ case 7059:
853
+ case 5753:
854
+ case 5535:
855
+ case 5445:
856
+ case 5701:
857
+ case 4933:
858
+ case 4677:
859
+ case 5533:
860
+ case 5789:
861
+ case 5021:
862
+ case 4765:
863
+ if (R(e) - 1 - n > 6) switch (M(e, n + 1)) {
864
+ case 109:
865
+ if (M(e, n + 4) !== 45) break;
866
+ case 102:
867
+ return A(e, /(.+:)(.+)-([^]+)/, "$1" + c + "$2-$3" + "$1" + a + (M(e, n + 3) == 108 ? "$3" : "$2-$3")) + e;
868
+ case 115:
869
+ return ~O(e, "stretch") ? ne(A(e, "stretch", "fill-available"), n, t) + e : e;
870
+ }
871
+ break;
872
+ case 5152:
873
+ case 5920:
874
+ return A(e, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function (a, c, n, t, s, i, u) {
875
+ return r + c + ":" + n + u + (t ? r + c + "-span:" + (s ? i : +i - +n) + u : "") + e;
876
+ });
877
+ case 4949:
878
+ if (M(e, n + 6) === 121) return A(e, ":", ":" + c) + e;
879
+ break;
880
+ case 6444:
881
+ switch (M(e, M(e, 14) === 45 ? 18 : 11)) {
882
+ case 120:
883
+ return A(e, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + c + (M(e, 14) === 45 ? "inline-" : "") + "box$3" + "$1" + c + "$2$3" + "$1" + r + "$2box$3") + e;
884
+ case 100:
885
+ return A(e, ":", ":" + r) + e;
886
+ }
887
+ break;
888
+ case 5719:
889
+ case 2647:
890
+ case 2135:
891
+ case 3927:
892
+ case 2391:
893
+ return A(e, "scroll-", "scroll-snap-") + e;
894
+ }
895
+ return e;
896
+ }
897
+ function te(e, r) {
898
+ var a = "";
899
+ var c = S(e);
900
+ for (var n = 0; n < c; n++) a += r(e[n], n, e, r) || "";
901
+ return a;
902
+ }
903
+ function se(e, r, a, c) {
904
+ switch (e.type) {
905
+ case g:
906
+ if (e.children.length) break;
907
+ case o:
908
+ case s:
909
+ return e.return = e.return || e.value;
910
+ case n:
911
+ return "";
912
+ case d:
913
+ return e.return = e.value + "{" + te(e.children, c) + "}";
914
+ case t:
915
+ e.value = e.props.join(",");
916
+ }
917
+ return R(a = te(e.children, c)) ? e.return = e.value + "{" + a + "}" : "";
918
+ }
919
+ function ie(e) {
920
+ var r = S(e);
921
+ return function (a, c, n, t) {
922
+ var s = "";
923
+ for (var i = 0; i < r; i++) s += e[i](a, c, n, t) || "";
924
+ return s;
925
+ };
926
+ }
927
+ function ue(e) {
928
+ return function (r) {
929
+ if (!r.root) if (r = r.return) e(r);
930
+ };
931
+ }
932
+ function oe(e, n, i, u) {
933
+ if (e.length > -1) if (!e.return) switch (e.type) {
934
+ case s:
935
+ e.return = ne(e.value, e.length, i);
936
+ return;
937
+ case d:
938
+ return te([j(e, {
939
+ value: A(e.value, "@", "@" + c)
940
+ })], u);
941
+ case t:
942
+ if (e.length) return N(e.props, function (n) {
943
+ switch (T(n, /(::plac\w+|:read-\w+)/)) {
944
+ case ":read-only":
945
+ case ":read-write":
946
+ return te([j(e, {
947
+ props: [A(n, /:(read-\w+)/, ":" + a + "$1")]
948
+ })], u);
949
+ case "::placeholder":
950
+ return te([j(e, {
951
+ props: [A(n, /:(plac\w+)/, ":" + c + "input-$1")]
952
+ }), j(e, {
953
+ props: [A(n, /:(plac\w+)/, ":" + a + "$1")]
954
+ }), j(e, {
955
+ props: [A(n, /:(plac\w+)/, r + "input-$1")]
956
+ })], u);
957
+ }
958
+ return "";
959
+ });
960
+ }
961
+ }
962
+ function fe(e) {
963
+ switch (e.type) {
964
+ case t:
965
+ e.props = e.props.map(function (r) {
966
+ return N(B(r), function (r, a, c) {
967
+ switch (M(r, 0)) {
968
+ case 12:
969
+ return C(r, 1, R(r));
970
+ case 0:
971
+ case 40:
972
+ case 43:
973
+ case 62:
974
+ case 126:
975
+ return r;
976
+ case 58:
977
+ if (c[++a] === "global") c[a] = "", c[++a] = "\f" + C(c[a], a = 1, -1);
978
+ case 32:
979
+ return a === 1 ? "" : r;
980
+ default:
981
+ switch (a) {
982
+ case 0:
983
+ e = r;
984
+ return S(c) > 1 ? "" : r;
985
+ case a = S(c) - 1:
986
+ case 2:
987
+ return a === 2 ? r + e + e : r + e;
988
+ default:
989
+ return r;
990
+ }
991
+ }
992
+ });
993
+ });
994
+ }
995
+ }
996
+ e.CHARSET = f;
997
+ e.COMMENT = n;
998
+ e.COUNTER_STYLE = w;
999
+ e.DECLARATION = s;
1000
+ e.DOCUMENT = h;
1001
+ e.FONT_FACE = b;
1002
+ e.FONT_FEATURE_VALUES = m;
1003
+ e.IMPORT = o;
1004
+ e.KEYFRAMES = d;
1005
+ e.LAYER = g;
1006
+ e.MEDIA = u;
1007
+ e.MOZ = a;
1008
+ e.MS = r;
1009
+ e.NAMESPACE = v;
1010
+ e.PAGE = i;
1011
+ e.RULESET = t;
1012
+ e.SUPPORTS = p;
1013
+ e.VIEWPORT = l;
1014
+ e.WEBKIT = c;
1015
+ e.abs = k;
1016
+ e.alloc = K;
1017
+ e.append = z;
1018
+ e.assign = x;
1019
+ e.caret = L;
1020
+ e.char = U;
1021
+ e.charat = M;
1022
+ e.combine = N;
1023
+ e.comment = ae;
1024
+ e.commenter = J;
1025
+ e.compile = X;
1026
+ e.copy = j;
1027
+ e.dealloc = V;
1028
+ e.declaration = ce;
1029
+ e.delimit = W;
1030
+ e.delimiter = q;
1031
+ e.escaping = Z;
1032
+ e.from = $;
1033
+ e.hash = E;
1034
+ e.identifier = Q;
1035
+ e.indexof = O;
1036
+ e.match = T;
1037
+ e.middleware = ie;
1038
+ e.namespace = fe;
1039
+ e.next = F;
1040
+ e.node = P;
1041
+ e.parse = ee;
1042
+ e.peek = I;
1043
+ e.prefix = ne;
1044
+ e.prefixer = oe;
1045
+ e.prev = _;
1046
+ e.replace = A;
1047
+ e.ruleset = re;
1048
+ e.rulesheet = ue;
1049
+ e.serialize = te;
1050
+ e.sizeof = S;
1051
+ e.slice = D;
1052
+ e.stringify = se;
1053
+ e.strlen = R;
1054
+ e.substr = C;
1055
+ e.token = Y;
1056
+ e.tokenize = B;
1057
+ e.tokenizer = H;
1058
+ e.trim = y;
1059
+ e.whitespace = G;
1060
+ Object.defineProperty(e, "__esModule", {
1061
+ value: true
1062
+ });
1063
+ });
1064
+ })(stylis, stylisExports);
1065
+
1066
+ var weakMemoize = function weakMemoize(func) {
1067
+ var cache = new WeakMap();
1068
+ return function (arg) {
1069
+ if (cache.has(arg)) {
1070
+ // Use non-null assertion because we just checked that the cache `has` it
1071
+ // This allows us to remove `undefined` from the return value
1072
+ return cache.get(arg);
1073
+ }
1074
+ var ret = func(arg);
1075
+ cache.set(arg, ret);
1076
+ return ret;
1077
+ };
1078
+ };
1079
+
1080
+ function memoize(fn) {
1081
+ var cache = Object.create(null);
1082
+ return function (arg) {
1083
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
1084
+ return cache[arg];
1085
+ };
1086
+ }
1087
+
1088
+ var isBrowser$1 = typeof document !== 'undefined';
1089
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
1090
+ var previous = 0;
1091
+ var character = 0;
1092
+ while (true) {
1093
+ previous = character;
1094
+ character = stylisExports.peek(); // &\f
1095
+
1096
+ if (previous === 38 && character === 12) {
1097
+ points[index] = 1;
1098
+ }
1099
+ if (stylisExports.token(character)) {
1100
+ break;
1101
+ }
1102
+ stylisExports.next();
1103
+ }
1104
+ return stylisExports.slice(begin, stylisExports.position);
1105
+ };
1106
+ var toRules = function toRules(parsed, points) {
1107
+ // pretend we've started with a comma
1108
+ var index = -1;
1109
+ var character = 44;
1110
+ do {
1111
+ switch (stylisExports.token(character)) {
1112
+ case 0:
1113
+ // &\f
1114
+ if (character === 38 && stylisExports.peek() === 12) {
1115
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
1116
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
1117
+ // and when it should just concatenate the outer and inner selectors
1118
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
1119
+ points[index] = 1;
1120
+ }
1121
+ parsed[index] += identifierWithPointTracking(stylisExports.position - 1, points, index);
1122
+ break;
1123
+ case 2:
1124
+ parsed[index] += stylisExports.delimit(character);
1125
+ break;
1126
+ case 4:
1127
+ // comma
1128
+ if (character === 44) {
1129
+ // colon
1130
+ parsed[++index] = stylisExports.peek() === 58 ? '&\f' : '';
1131
+ points[index] = parsed[index].length;
1132
+ break;
1133
+ }
1134
+
1135
+ // fallthrough
1136
+
1137
+ default:
1138
+ parsed[index] += stylisExports.from(character);
1139
+ }
1140
+ } while (character = stylisExports.next());
1141
+ return parsed;
1142
+ };
1143
+ var getRules = function getRules(value, points) {
1144
+ return stylisExports.dealloc(toRules(stylisExports.alloc(value), points));
1145
+ }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
1146
+
1147
+ var fixedElements = /* #__PURE__ */new WeakMap();
1148
+ var compat = function compat(element) {
1149
+ if (element.type !== 'rule' || !element.parent ||
1150
+ // positive .length indicates that this rule contains pseudo
1151
+ // negative .length indicates that this rule has been already prefixed
1152
+ element.length < 1) {
1153
+ return;
1154
+ }
1155
+ var value = element.value;
1156
+ var parent = element.parent;
1157
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
1158
+ while (parent.type !== 'rule') {
1159
+ parent = parent.parent;
1160
+ if (!parent) return;
1161
+ } // short-circuit for the simplest case
1162
+
1163
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
1164
+ /* colon */ && !fixedElements.get(parent)) {
1165
+ return;
1166
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
1167
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
1168
+
1169
+ if (isImplicitRule) {
1170
+ return;
1171
+ }
1172
+ fixedElements.set(element, true);
1173
+ var points = [];
1174
+ var rules = getRules(value, points);
1175
+ var parentRules = parent.props;
1176
+ for (var i = 0, k = 0; i < rules.length; i++) {
1177
+ for (var j = 0; j < parentRules.length; j++, k++) {
1178
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
1179
+ }
1180
+ }
1181
+ };
1182
+ var removeLabel = function removeLabel(element) {
1183
+ if (element.type === 'decl') {
1184
+ var value = element.value;
1185
+ if (
1186
+ // charcode for l
1187
+ value.charCodeAt(0) === 108 &&
1188
+ // charcode for b
1189
+ value.charCodeAt(2) === 98) {
1190
+ // this ignores label
1191
+ element["return"] = '';
1192
+ element.value = '';
1193
+ }
1194
+ }
1195
+ };
1196
+
1197
+ /* eslint-disable no-fallthrough */
1198
+
1199
+ function prefix(value, length) {
1200
+ switch (stylisExports.hash(value, length)) {
1201
+ // color-adjust
1202
+ case 5103:
1203
+ return stylisExports.WEBKIT + 'print-' + value + value;
1204
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
1205
+
1206
+ case 5737:
1207
+ case 4201:
1208
+ case 3177:
1209
+ case 3433:
1210
+ case 1641:
1211
+ case 4457:
1212
+ case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
1213
+
1214
+ case 5572:
1215
+ case 6356:
1216
+ case 5844:
1217
+ case 3191:
1218
+ case 6645:
1219
+ case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
1220
+
1221
+ case 6391:
1222
+ case 5879:
1223
+ case 5623:
1224
+ case 6135:
1225
+ case 4599:
1226
+ case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
1227
+
1228
+ case 4215:
1229
+ case 6389:
1230
+ case 5109:
1231
+ case 5365:
1232
+ case 5621:
1233
+ case 3829:
1234
+ return stylisExports.WEBKIT + value + value;
1235
+ // appearance, user-select, transform, hyphens, text-size-adjust
1236
+
1237
+ case 5349:
1238
+ case 4246:
1239
+ case 4810:
1240
+ case 6968:
1241
+ case 2756:
1242
+ return stylisExports.WEBKIT + value + stylisExports.MOZ + value + stylisExports.MS + value + value;
1243
+ // flex, flex-direction
1244
+
1245
+ case 6828:
1246
+ case 4268:
1247
+ return stylisExports.WEBKIT + value + stylisExports.MS + value + value;
1248
+ // order
1249
+
1250
+ case 6165:
1251
+ return stylisExports.WEBKIT + value + stylisExports.MS + 'flex-' + value + value;
1252
+ // align-items
1253
+
1254
+ case 5187:
1255
+ return stylisExports.WEBKIT + value + stylisExports.replace(value, /(\w+).+(:[^]+)/, stylisExports.WEBKIT + 'box-$1$2' + stylisExports.MS + 'flex-$1$2') + value;
1256
+ // align-self
1257
+
1258
+ case 5443:
1259
+ return stylisExports.WEBKIT + value + stylisExports.MS + 'flex-item-' + stylisExports.replace(value, /flex-|-self/, '') + value;
1260
+ // align-content
1261
+
1262
+ case 4675:
1263
+ return stylisExports.WEBKIT + value + stylisExports.MS + 'flex-line-pack' + stylisExports.replace(value, /align-content|flex-|-self/, '') + value;
1264
+ // flex-shrink
1265
+
1266
+ case 5548:
1267
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, 'shrink', 'negative') + value;
1268
+ // flex-basis
1269
+
1270
+ case 5292:
1271
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, 'basis', 'preferred-size') + value;
1272
+ // flex-grow
1273
+
1274
+ case 6060:
1275
+ return stylisExports.WEBKIT + 'box-' + stylisExports.replace(value, '-grow', '') + stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, 'grow', 'positive') + value;
1276
+ // transition
1277
+
1278
+ case 4554:
1279
+ return stylisExports.WEBKIT + stylisExports.replace(value, /([^-])(transform)/g, '$1' + stylisExports.WEBKIT + '$2') + value;
1280
+ // cursor
1281
+
1282
+ case 6187:
1283
+ return stylisExports.replace(stylisExports.replace(stylisExports.replace(value, /(zoom-|grab)/, stylisExports.WEBKIT + '$1'), /(image-set)/, stylisExports.WEBKIT + '$1'), value, '') + value;
1284
+ // background, background-image
1285
+
1286
+ case 5495:
1287
+ case 3959:
1288
+ return stylisExports.replace(value, /(image-set\([^]*)/, stylisExports.WEBKIT + '$1' + '$`$1');
1289
+ // justify-content
1290
+
1291
+ case 4968:
1292
+ return stylisExports.replace(stylisExports.replace(value, /(.+:)(flex-)?(.*)/, stylisExports.WEBKIT + 'box-pack:$3' + stylisExports.MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + stylisExports.WEBKIT + value + value;
1293
+ // (margin|padding)-inline-(start|end)
1294
+
1295
+ case 4095:
1296
+ case 3583:
1297
+ case 4068:
1298
+ case 2532:
1299
+ return stylisExports.replace(value, /(.+)-inline(.+)/, stylisExports.WEBKIT + '$1$2') + value;
1300
+ // (min|max)?(width|height|inline-size|block-size)
1301
+
1302
+ case 8116:
1303
+ case 7059:
1304
+ case 5753:
1305
+ case 5535:
1306
+ case 5445:
1307
+ case 5701:
1308
+ case 4933:
1309
+ case 4677:
1310
+ case 5533:
1311
+ case 5789:
1312
+ case 5021:
1313
+ case 4765:
1314
+ // stretch, max-content, min-content, fill-available
1315
+ if (stylisExports.strlen(value) - 1 - length > 6) switch (stylisExports.charat(value, length + 1)) {
1316
+ // (m)ax-content, (m)in-content
1317
+ case 109:
1318
+ // -
1319
+ if (stylisExports.charat(value, length + 4) !== 45) break;
1320
+ // (f)ill-available, (f)it-content
1321
+
1322
+ case 102:
1323
+ return stylisExports.replace(value, /(.+:)(.+)-([^]+)/, '$1' + stylisExports.WEBKIT + '$2-$3' + '$1' + stylisExports.MOZ + (stylisExports.charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
1324
+ // (s)tretch
1325
+
1326
+ case 115:
1327
+ return ~stylisExports.indexof(value, 'stretch') ? prefix(stylisExports.replace(value, 'stretch', 'fill-available'), length) + value : value;
1328
+ }
1329
+ break;
1330
+ // position: sticky
1331
+
1332
+ case 4949:
1333
+ // (s)ticky?
1334
+ if (stylisExports.charat(value, length + 1) !== 115) break;
1335
+ // display: (flex|inline-flex)
1336
+
1337
+ case 6444:
1338
+ switch (stylisExports.charat(value, stylisExports.strlen(value) - 3 - (~stylisExports.indexof(value, '!important') && 10))) {
1339
+ // stic(k)y
1340
+ case 107:
1341
+ return stylisExports.replace(value, ':', ':' + stylisExports.WEBKIT) + value;
1342
+ // (inline-)?fl(e)x
1343
+
1344
+ case 101:
1345
+ return stylisExports.replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + stylisExports.WEBKIT + (stylisExports.charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + stylisExports.WEBKIT + '$2$3' + '$1' + stylisExports.MS + '$2box$3') + value;
1346
+ }
1347
+ break;
1348
+ // writing-mode
1349
+
1350
+ case 5936:
1351
+ switch (stylisExports.charat(value, length + 11)) {
1352
+ // vertical-l(r)
1353
+ case 114:
1354
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
1355
+ // vertical-r(l)
1356
+
1357
+ case 108:
1358
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
1359
+ // horizontal(-)tb
1360
+
1361
+ case 45:
1362
+ return stylisExports.WEBKIT + value + stylisExports.MS + stylisExports.replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
1363
+ }
1364
+ return stylisExports.WEBKIT + value + stylisExports.MS + value + value;
1365
+ }
1366
+ return value;
1367
+ }
1368
+ var prefixer = function prefixer(element, index, children, callback) {
1369
+ if (element.length > -1) if (!element["return"]) switch (element.type) {
1370
+ case stylisExports.DECLARATION:
1371
+ element["return"] = prefix(element.value, element.length);
1372
+ break;
1373
+ case stylisExports.KEYFRAMES:
1374
+ return stylisExports.serialize([stylisExports.copy(element, {
1375
+ value: stylisExports.replace(element.value, '@', '@' + stylisExports.WEBKIT)
1376
+ })], callback);
1377
+ case stylisExports.RULESET:
1378
+ if (element.length) return stylisExports.combine(element.props, function (value) {
1379
+ switch (stylisExports.match(value, /(::plac\w+|:read-\w+)/)) {
1380
+ // :read-(only|write)
1381
+ case ':read-only':
1382
+ case ':read-write':
1383
+ return stylisExports.serialize([stylisExports.copy(element, {
1384
+ props: [stylisExports.replace(value, /:(read-\w+)/, ':' + stylisExports.MOZ + '$1')]
1385
+ })], callback);
1386
+ // :placeholder
1387
+
1388
+ case '::placeholder':
1389
+ return stylisExports.serialize([stylisExports.copy(element, {
1390
+ props: [stylisExports.replace(value, /:(plac\w+)/, ':' + stylisExports.WEBKIT + 'input-$1')]
1391
+ }), stylisExports.copy(element, {
1392
+ props: [stylisExports.replace(value, /:(plac\w+)/, ':' + stylisExports.MOZ + '$1')]
1393
+ }), stylisExports.copy(element, {
1394
+ props: [stylisExports.replace(value, /:(plac\w+)/, stylisExports.MS + 'input-$1')]
1395
+ })], callback);
1396
+ }
1397
+ return '';
1398
+ });
1399
+ }
1400
+ };
1401
+ var getServerStylisCache = isBrowser$1 ? undefined : weakMemoize(function () {
1402
+ return memoize(function () {
1403
+ return {};
1404
+ });
1405
+ });
1406
+ var defaultStylisPlugins = [prefixer];
1407
+ var createCache = function createCache(options) {
1408
+ var key = options.key;
1409
+ if (isBrowser$1 && key === 'css') {
1410
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
1411
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
1412
+ // note this very very intentionally targets all style elements regardless of the key to ensure
1413
+ // that creating a cache works inside of render of a React component
1414
+
1415
+ Array.prototype.forEach.call(ssrStyles, function (node) {
1416
+ // we want to only move elements which have a space in the data-emotion attribute value
1417
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
1418
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
1419
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
1420
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
1421
+ // will not result in the Emotion 10 styles being destroyed
1422
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
1423
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
1424
+ return;
1425
+ }
1426
+ document.head.appendChild(node);
1427
+ node.setAttribute('data-s', '');
1428
+ });
1429
+ }
1430
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
1431
+ var inserted = {};
1432
+ var container;
1433
+ var nodesToHydrate = [];
1434
+ if (isBrowser$1) {
1435
+ container = options.container || document.head;
1436
+ Array.prototype.forEach.call(
1437
+ // this means we will ignore elements which don't have a space in them which
1438
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
1439
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
1440
+ var attrib = node.getAttribute("data-emotion").split(' ');
1441
+ for (var i = 1; i < attrib.length; i++) {
1442
+ inserted[attrib[i]] = true;
1443
+ }
1444
+ nodesToHydrate.push(node);
1445
+ });
1446
+ }
1447
+ var _insert;
1448
+ var omnipresentPlugins = [compat, removeLabel];
1449
+ if (!getServerStylisCache) {
1450
+ var currentSheet;
1451
+ var finalizingPlugins = [stylisExports.stringify, stylisExports.rulesheet(function (rule) {
1452
+ currentSheet.insert(rule);
1453
+ })];
1454
+ var serializer = stylisExports.middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
1455
+ var stylis = function stylis(styles) {
1456
+ return stylisExports.serialize(stylisExports.compile(styles), serializer);
1457
+ };
1458
+ _insert = function insert(selector, serialized, sheet, shouldCache) {
1459
+ currentSheet = sheet;
1460
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1461
+ if (shouldCache) {
1462
+ cache.inserted[serialized.name] = true;
1463
+ }
1464
+ };
1465
+ } else {
1466
+ var _finalizingPlugins = [stylisExports.stringify];
1467
+ var _serializer = stylisExports.middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
1468
+ var _stylis = function _stylis(styles) {
1469
+ return stylisExports.serialize(stylisExports.compile(styles), _serializer);
1470
+ };
1471
+ var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
1472
+ var getRules = function getRules(selector, serialized) {
1473
+ var name = serialized.name;
1474
+ if (serverStylisCache[name] === undefined) {
1475
+ serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1476
+ }
1477
+ return serverStylisCache[name];
1478
+ };
1479
+ _insert = function _insert(selector, serialized, sheet, shouldCache) {
1480
+ var name = serialized.name;
1481
+ var rules = getRules(selector, serialized);
1482
+ if (cache.compat === undefined) {
1483
+ // in regular mode, we don't set the styles on the inserted cache
1484
+ // since we don't need to and that would be wasting memory
1485
+ // we return them so that they are rendered in a style tag
1486
+ if (shouldCache) {
1487
+ cache.inserted[name] = true;
1488
+ }
1489
+ return rules;
1490
+ } else {
1491
+ // in compat mode, we put the styles on the inserted cache so
1492
+ // that emotion-server can pull out the styles
1493
+ // except when we don't want to cache it which was in Global but now
1494
+ // is nowhere but we don't want to do a major right now
1495
+ // and just in case we're going to leave the case here
1496
+ // it's also not affecting client side bundle size
1497
+ // so it's really not a big deal
1498
+ if (shouldCache) {
1499
+ cache.inserted[name] = rules;
1500
+ } else {
1501
+ return rules;
1502
+ }
1503
+ }
1504
+ };
1505
+ }
1506
+ var cache = {
1507
+ key: key,
1508
+ sheet: new StyleSheet({
1509
+ key: key,
1510
+ container: container,
1511
+ nonce: options.nonce,
1512
+ speedy: options.speedy,
1513
+ prepend: options.prepend,
1514
+ insertionPoint: options.insertionPoint
1515
+ }),
1516
+ nonce: options.nonce,
1517
+ inserted: inserted,
1518
+ registered: {},
1519
+ insert: _insert
1520
+ };
1521
+ cache.sheet.hydrate(nodesToHydrate);
1522
+ return cache;
1523
+ };
1524
+
1525
+ /* eslint-disable */
1526
+ // Inspired by https://github.com/garycourt/murmurhash-js
1527
+ // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
1528
+ function murmur2(str) {
1529
+ // 'm' and 'r' are mixing constants generated offline.
1530
+ // They're not really 'magic', they just happen to work well.
1531
+ // const m = 0x5bd1e995;
1532
+ // const r = 24;
1533
+ // Initialize the hash
1534
+ var h = 0; // Mix 4 bytes at a time into the hash
1535
+
1536
+ var k,
1537
+ i = 0,
1538
+ len = str.length;
1539
+ for (; len >= 4; ++i, len -= 4) {
1540
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
1541
+ k = /* Math.imul(k, m): */
1542
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
1543
+ k ^= /* k >>> r: */
1544
+ k >>> 24;
1545
+ h = /* Math.imul(k, m): */
1546
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */
1547
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1548
+ } // Handle the last few bytes of the input array
1549
+
1550
+ switch (len) {
1551
+ case 3:
1552
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
1553
+ case 2:
1554
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
1555
+ case 1:
1556
+ h ^= str.charCodeAt(i) & 0xff;
1557
+ h = /* Math.imul(h, m): */
1558
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1559
+ } // Do a few final mixes of the hash to ensure the last few
1560
+ // bytes are well-incorporated.
1561
+
1562
+ h ^= h >>> 13;
1563
+ h = /* Math.imul(h, m): */
1564
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1565
+ return ((h ^ h >>> 15) >>> 0).toString(36);
1566
+ }
1567
+
1568
+ var unitlessKeys = {
1569
+ animationIterationCount: 1,
1570
+ aspectRatio: 1,
1571
+ borderImageOutset: 1,
1572
+ borderImageSlice: 1,
1573
+ borderImageWidth: 1,
1574
+ boxFlex: 1,
1575
+ boxFlexGroup: 1,
1576
+ boxOrdinalGroup: 1,
1577
+ columnCount: 1,
1578
+ columns: 1,
1579
+ flex: 1,
1580
+ flexGrow: 1,
1581
+ flexPositive: 1,
1582
+ flexShrink: 1,
1583
+ flexNegative: 1,
1584
+ flexOrder: 1,
1585
+ gridRow: 1,
1586
+ gridRowEnd: 1,
1587
+ gridRowSpan: 1,
1588
+ gridRowStart: 1,
1589
+ gridColumn: 1,
1590
+ gridColumnEnd: 1,
1591
+ gridColumnSpan: 1,
1592
+ gridColumnStart: 1,
1593
+ msGridRow: 1,
1594
+ msGridRowSpan: 1,
1595
+ msGridColumn: 1,
1596
+ msGridColumnSpan: 1,
1597
+ fontWeight: 1,
1598
+ lineHeight: 1,
1599
+ opacity: 1,
1600
+ order: 1,
1601
+ orphans: 1,
1602
+ scale: 1,
1603
+ tabSize: 1,
1604
+ widows: 1,
1605
+ zIndex: 1,
1606
+ zoom: 1,
1607
+ WebkitLineClamp: 1,
1608
+ // SVG-related properties
1609
+ fillOpacity: 1,
1610
+ floodOpacity: 1,
1611
+ stopOpacity: 1,
1612
+ strokeDasharray: 1,
1613
+ strokeDashoffset: 1,
1614
+ strokeMiterlimit: 1,
1615
+ strokeOpacity: 1,
1616
+ strokeWidth: 1
340
1617
  };
341
1618
 
342
- var getTextType = function (variant) {
343
- var variantMapper = {
1619
+ var isDevelopment = false;
1620
+ var hyphenateRegex = /[A-Z]|^ms/g;
1621
+ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
1622
+ var isCustomProperty = function isCustomProperty(property) {
1623
+ return property.charCodeAt(1) === 45;
1624
+ };
1625
+ var isProcessableValue = function isProcessableValue(value) {
1626
+ return value != null && typeof value !== 'boolean';
1627
+ };
1628
+ var processStyleName = /* #__PURE__ */memoize(function (styleName) {
1629
+ return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
1630
+ });
1631
+ var processStyleValue = function processStyleValue(key, value) {
1632
+ switch (key) {
1633
+ case 'animation':
1634
+ case 'animationName':
1635
+ {
1636
+ if (typeof value === 'string') {
1637
+ return value.replace(animationRegex, function (match, p1, p2) {
1638
+ cursor = {
1639
+ name: p1,
1640
+ styles: p2,
1641
+ next: cursor
1642
+ };
1643
+ return p1;
1644
+ });
1645
+ }
1646
+ }
1647
+ }
1648
+ if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
1649
+ return value + 'px';
1650
+ }
1651
+ return value;
1652
+ };
1653
+ var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
1654
+ function handleInterpolation(mergedProps, registered, interpolation) {
1655
+ if (interpolation == null) {
1656
+ return '';
1657
+ }
1658
+ var componentSelector = interpolation;
1659
+ if (componentSelector.__emotion_styles !== undefined) {
1660
+ return componentSelector;
1661
+ }
1662
+ switch (typeof interpolation) {
1663
+ case 'boolean':
1664
+ {
1665
+ return '';
1666
+ }
1667
+ case 'object':
1668
+ {
1669
+ var keyframes = interpolation;
1670
+ if (keyframes.anim === 1) {
1671
+ cursor = {
1672
+ name: keyframes.name,
1673
+ styles: keyframes.styles,
1674
+ next: cursor
1675
+ };
1676
+ return keyframes.name;
1677
+ }
1678
+ var serializedStyles = interpolation;
1679
+ if (serializedStyles.styles !== undefined) {
1680
+ var next = serializedStyles.next;
1681
+ if (next !== undefined) {
1682
+ // not the most efficient thing ever but this is a pretty rare case
1683
+ // and there will be very few iterations of this generally
1684
+ while (next !== undefined) {
1685
+ cursor = {
1686
+ name: next.name,
1687
+ styles: next.styles,
1688
+ next: cursor
1689
+ };
1690
+ next = next.next;
1691
+ }
1692
+ }
1693
+ var styles = serializedStyles.styles + ";";
1694
+ return styles;
1695
+ }
1696
+ return createStringFromObject(mergedProps, registered, interpolation);
1697
+ }
1698
+ case 'function':
1699
+ {
1700
+ if (mergedProps !== undefined) {
1701
+ var previousCursor = cursor;
1702
+ var result = interpolation(mergedProps);
1703
+ cursor = previousCursor;
1704
+ return handleInterpolation(mergedProps, registered, result);
1705
+ }
1706
+ break;
1707
+ }
1708
+ } // finalize string values (regular strings and functions interpolated into css calls)
1709
+
1710
+ var asString = interpolation;
1711
+ if (registered == null) {
1712
+ return asString;
1713
+ }
1714
+ var cached = registered[asString];
1715
+ return cached !== undefined ? cached : asString;
1716
+ }
1717
+ function createStringFromObject(mergedProps, registered, obj) {
1718
+ var string = '';
1719
+ if (Array.isArray(obj)) {
1720
+ for (var i = 0; i < obj.length; i++) {
1721
+ string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
1722
+ }
1723
+ } else {
1724
+ for (var key in obj) {
1725
+ var value = obj[key];
1726
+ if (typeof value !== 'object') {
1727
+ var asString = value;
1728
+ if (registered != null && registered[asString] !== undefined) {
1729
+ string += key + "{" + registered[asString] + "}";
1730
+ } else if (isProcessableValue(asString)) {
1731
+ string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
1732
+ }
1733
+ } else {
1734
+ if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {
1735
+ throw new Error(noComponentSelectorMessage);
1736
+ }
1737
+ if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
1738
+ for (var _i = 0; _i < value.length; _i++) {
1739
+ if (isProcessableValue(value[_i])) {
1740
+ string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
1741
+ }
1742
+ }
1743
+ } else {
1744
+ var interpolated = handleInterpolation(mergedProps, registered, value);
1745
+ switch (key) {
1746
+ case 'animation':
1747
+ case 'animationName':
1748
+ {
1749
+ string += processStyleName(key) + ":" + interpolated + ";";
1750
+ break;
1751
+ }
1752
+ default:
1753
+ {
1754
+ string += key + "{" + interpolated + "}";
1755
+ }
1756
+ }
1757
+ }
1758
+ }
1759
+ }
1760
+ }
1761
+ return string;
1762
+ }
1763
+ var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g; // this is the cursor for keyframes
1764
+ // keyframes are stored on the SerializedStyles object as a linked list
1765
+
1766
+ var cursor;
1767
+ function serializeStyles(args, registered, mergedProps) {
1768
+ if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
1769
+ return args[0];
1770
+ }
1771
+ var stringMode = true;
1772
+ var styles = '';
1773
+ cursor = undefined;
1774
+ var strings = args[0];
1775
+ if (strings == null || strings.raw === undefined) {
1776
+ stringMode = false;
1777
+ styles += handleInterpolation(mergedProps, registered, strings);
1778
+ } else {
1779
+ var asTemplateStringsArr = strings;
1780
+ styles += asTemplateStringsArr[0];
1781
+ } // we start at 1 since we've already handled the first arg
1782
+
1783
+ for (var i = 1; i < args.length; i++) {
1784
+ styles += handleInterpolation(mergedProps, registered, args[i]);
1785
+ if (stringMode) {
1786
+ var templateStringsArr = strings;
1787
+ styles += templateStringsArr[i];
1788
+ }
1789
+ } // using a global regex with .exec is stateful so lastIndex has to be reset each time
1790
+
1791
+ labelPattern.lastIndex = 0;
1792
+ var identifierName = '';
1793
+ var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
1794
+
1795
+ while ((match = labelPattern.exec(styles)) !== null) {
1796
+ identifierName += '-' + match[1];
1797
+ }
1798
+ var name = murmur2(styles) + identifierName;
1799
+ return {
1800
+ name: name,
1801
+ styles: styles,
1802
+ next: cursor
1803
+ };
1804
+ }
1805
+
1806
+ var isBrowser = typeof document !== 'undefined';
1807
+ function getRegisteredStyles(registered, registeredStyles, classNames) {
1808
+ var rawClassName = '';
1809
+ classNames.split(' ').forEach(function (className) {
1810
+ if (registered[className] !== undefined) {
1811
+ registeredStyles.push(registered[className] + ";");
1812
+ } else if (className) {
1813
+ rawClassName += className + " ";
1814
+ }
1815
+ });
1816
+ return rawClassName;
1817
+ }
1818
+ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
1819
+ var className = cache.key + "-" + serialized.name;
1820
+ if (
1821
+ // we only need to add the styles to the registered cache if the
1822
+ // class name could be used further down
1823
+ // the tree but if it's a string tag, we know it won't
1824
+ // so we don't have to add it to registered cache.
1825
+ // this improves memory usage since we can avoid storing the whole style string
1826
+ (isStringTag === false ||
1827
+ // we need to always store it if we're in compat mode and
1828
+ // in node since emotion-server relies on whether a style is in
1829
+ // the registered cache to know whether a style is global or not
1830
+ // also, note that this check will be dead code eliminated in the browser
1831
+ isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
1832
+ cache.registered[className] = serialized.styles;
1833
+ }
1834
+ };
1835
+ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
1836
+ registerStyles(cache, serialized, isStringTag);
1837
+ var className = cache.key + "-" + serialized.name;
1838
+ if (cache.inserted[serialized.name] === undefined) {
1839
+ var stylesForSSR = '';
1840
+ var current = serialized;
1841
+ do {
1842
+ var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
1843
+ if (!isBrowser && maybeStyles !== undefined) {
1844
+ stylesForSSR += maybeStyles;
1845
+ }
1846
+ current = current.next;
1847
+ } while (current !== undefined);
1848
+ if (!isBrowser && stylesForSSR.length !== 0) {
1849
+ return stylesForSSR;
1850
+ }
1851
+ }
1852
+ };
1853
+
1854
+ function insertWithoutScoping(cache, serialized) {
1855
+ if (cache.inserted[serialized.name] === undefined) {
1856
+ return cache.insert('', serialized, cache.sheet, true);
1857
+ }
1858
+ }
1859
+ function merge(registered, css, className) {
1860
+ var registeredStyles = [];
1861
+ var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
1862
+ if (registeredStyles.length < 2) {
1863
+ return className;
1864
+ }
1865
+ return rawClassName + css(registeredStyles);
1866
+ }
1867
+ var createEmotion = function createEmotion(options) {
1868
+ var cache = createCache(options);
1869
+ cache.sheet.speedy = function (value) {
1870
+ this.isSpeedy = value;
1871
+ };
1872
+ cache.compat = true;
1873
+ var css = function css() {
1874
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1875
+ args[_key] = arguments[_key];
1876
+ }
1877
+ var serialized = serializeStyles(args, cache.registered, undefined);
1878
+ insertStyles(cache, serialized, false);
1879
+ return cache.key + "-" + serialized.name;
1880
+ };
1881
+ var keyframes = function keyframes() {
1882
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
1883
+ args[_key2] = arguments[_key2];
1884
+ }
1885
+ var serialized = serializeStyles(args, cache.registered);
1886
+ var animation = "animation-" + serialized.name;
1887
+ insertWithoutScoping(cache, {
1888
+ name: serialized.name,
1889
+ styles: "@keyframes " + animation + "{" + serialized.styles + "}"
1890
+ });
1891
+ return animation;
1892
+ };
1893
+ var injectGlobal = function injectGlobal() {
1894
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
1895
+ args[_key3] = arguments[_key3];
1896
+ }
1897
+ var serialized = serializeStyles(args, cache.registered);
1898
+ insertWithoutScoping(cache, serialized);
1899
+ };
1900
+ var cx = function cx() {
1901
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
1902
+ args[_key4] = arguments[_key4];
1903
+ }
1904
+ return merge(cache.registered, css, classnames(args));
1905
+ };
1906
+ return {
1907
+ css: css,
1908
+ cx: cx,
1909
+ injectGlobal: injectGlobal,
1910
+ keyframes: keyframes,
1911
+ hydrate: function hydrate(ids) {
1912
+ ids.forEach(function (key) {
1913
+ cache.inserted[key] = true;
1914
+ });
1915
+ },
1916
+ flush: function flush() {
1917
+ cache.registered = {};
1918
+ cache.inserted = {};
1919
+ cache.sheet.flush();
1920
+ },
1921
+ sheet: cache.sheet,
1922
+ cache: cache,
1923
+ getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
1924
+ merge: merge.bind(null, cache.registered, css)
1925
+ };
1926
+ };
1927
+ var classnames = function classnames(args) {
1928
+ var cls = '';
1929
+ for (var i = 0; i < args.length; i++) {
1930
+ var arg = args[i];
1931
+ if (arg == null) continue;
1932
+ var toAdd = void 0;
1933
+ switch (typeof arg) {
1934
+ case 'boolean':
1935
+ break;
1936
+ case 'object':
1937
+ {
1938
+ if (Array.isArray(arg)) {
1939
+ toAdd = classnames(arg);
1940
+ } else {
1941
+ toAdd = '';
1942
+ for (var k in arg) {
1943
+ if (arg[k] && k) {
1944
+ toAdd && (toAdd += ' ');
1945
+ toAdd += k;
1946
+ }
1947
+ }
1948
+ }
1949
+ break;
1950
+ }
1951
+ default:
1952
+ {
1953
+ toAdd = arg;
1954
+ }
1955
+ }
1956
+ if (toAdd) {
1957
+ cls && (cls += ' ');
1958
+ cls += toAdd;
1959
+ }
1960
+ }
1961
+ return cls;
1962
+ };
1963
+
1964
+ var _createEmotion = createEmotion({
1965
+ key: 'css'
1966
+ }),
1967
+ css = _createEmotion.css;
1968
+
1969
+ const getTextType = (variant) => {
1970
+ const variantMapper = {
344
1971
  HD1: 'h1',
345
1972
  HD2: 'h2',
346
1973
  HD3: 'h3',
@@ -355,34 +1982,64 @@
355
1982
  P1: 'p',
356
1983
  P2: 'p',
357
1984
  P3: 'p',
1985
+ P4: 'p',
358
1986
  L1: 'p',
359
1987
  L2: 'p',
360
1988
  L3: 'p',
1989
+ B4CAPS: 'p',
361
1990
  OVERLINE: 'p',
1991
+ B3CAPS: 'p',
1992
+ M4BOLD: 'p',
1993
+ TAG: 'p',
362
1994
  };
363
1995
  return variantMapper[variant];
364
1996
  };
365
- var Typography = function (_a) {
366
- var _b = _a.children, children = _b === void 0 ? null : _b, variant = _a.variant, _c = _a.color, color = _c === void 0 ? exports.TypographyColor.PRIMARY : _c, _d = _a.isClickable, isClickable = _d === void 0 ? false : _d, _e = _a.isStriked, isStriked = _e === void 0 ? false : _e, _f = _a.onClick, onClick = _f === void 0 ? function () { } : _f, _g = _a.className, className = _g === void 0 ? '' : _g, _h = _a.colorCode, colorCode = _h === void 0 ? '' : _h, _j = _a.showInItalics, showInItalics = _j === void 0 ? false : _j, width = _a.width, lineClamp = _a.lineClamp, _k = _a.containerClassName, containerClassName = _k === void 0 ? '' : _k, componentNode = _a.componentNode, _l = _a.isDisabled, isDisabled = _l === void 0 ? false : _l, css = _a.css, _m = _a.styleConfig, styleConfig = _m === void 0 ? {} : _m, rest = __rest(_a, ["children", "variant", "color", "isClickable", "isStriked", "onClick", "className", "colorCode", "showInItalics", "width", "lineClamp", "containerClassName", "componentNode", "isDisabled", "css", "styleConfig"]);
367
- var theme = ctDesignTheme.useTheme();
368
- var _o = getTypographyStyles({
369
- theme: theme,
370
- variant: variant,
371
- color: color,
372
- isClickable: isClickable,
373
- isStriked: isStriked,
374
- colorCode: colorCode,
375
- showInItalics: showInItalics,
376
- lineClamp: lineClamp,
377
- isDisabled: isDisabled,
378
- }), typographyColor = _o.color, cursor = _o.cursor, textDecoration = _o.textDecoration, fontSize = _o.fontSize, fontWeight = _o.fontWeight, lineHeight = _o.lineHeight, fontStyle = _o.fontStyle, display = _o.display, webkitLineClamp = _o.webkitLineClamp, webkitBoxOrient = _o.webkitBoxOrient, overflow = _o.overflow, restStyles = __rest(_o, ["color", "cursor", "textDecoration", "fontSize", "fontWeight", "lineHeight", "fontStyle", "display", "webkitLineClamp", "webkitBoxOrient", "overflow"]);
379
- var classNameProps = styleConfig.className, styleCss = styleConfig.css, containerClassNameProps = styleConfig.containerClassName, containerCss = styleConfig.containerCss;
380
- var mappedAs = componentNode || getTextType(variant);
381
- return (jsxRuntime.jsx(ConditionalWrap__default.default, __assign({ condition: isClickable, wrap: function (children) { return (jsxRuntime.jsx(ctDesignContainer.Container, __assign({ onClick: onClick, className: containerClassNameProps || containerClassName, css: containerCss || css }, { children: children }))); } }, { children: jsxRuntime.jsx(StyledTypography, __assign({ as: mappedAs, color: typographyColor, cursor: cursor, textDecoration: textDecoration, fontSize: fontSize, fontStyle: fontStyle, lineHeight: lineHeight, fontWeight: fontWeight, className: classNameProps || className, width: width, display: display, webkitLineClamp: webkitLineClamp, webkitBoxOrient: webkitBoxOrient, overflow: overflow }, restStyles, { css: styleCss }, rest, { children: children })) })));
1997
+ const Typography = ({ children = null, variant, color = exports.TypographyColor.PRIMARY, isClickable, isStriked = false, isUnderlined = false, onClick, colorCode = '', showInItalics = false, lineClamp, componentNode, isDisabled = false, styleConfig = {}, }) => {
1998
+ const theme = ctDesignTheme.useTheme();
1999
+ const parsedIsClickable = typeof isClickable === 'boolean' ? isClickable : !!onClick;
2000
+ const typographyStyles = ctDesignStyleManager.useStyles((theme) => {
2001
+ return {
2002
+ root: getTypographyStyles({
2003
+ theme: theme,
2004
+ variant,
2005
+ color,
2006
+ isClickable: parsedIsClickable,
2007
+ isStriked,
2008
+ isUnderlined,
2009
+ colorCode,
2010
+ showInItalics,
2011
+ lineClamp,
2012
+ isDisabled,
2013
+ }),
2014
+ };
2015
+ }, [
2016
+ variant,
2017
+ color,
2018
+ parsedIsClickable,
2019
+ isStriked,
2020
+ isUnderlined,
2021
+ colorCode,
2022
+ showInItalics,
2023
+ lineClamp,
2024
+ isDisabled,
2025
+ theme,
2026
+ ]);
2027
+ const { root: customRootStyles = [], container: customContainerStyles = [] } = styleConfig || {};
2028
+ const clampClass = react.useMemo(() => {
2029
+ return css(getLineClampStyles(lineClamp));
2030
+ }, [lineClamp]);
2031
+ const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([typographyStyles.root, clampClass, ...customRootStyles], [typographyStyles.root, clampClass, customRootStyles]);
2032
+ const ComponentToRender = componentNode || getTextType(variant);
2033
+ const containerAsSupportedValues = ['p', 'main', 'section', 'article', 'div'];
2034
+ const containerAs = componentNode && containerAsSupportedValues.includes(componentNode)
2035
+ ? componentNode
2036
+ : 'div';
2037
+ return (jsxRuntime.jsx(ConditionalWrap__default.default, { condition: parsedIsClickable, wrap: (children) => (jsxRuntime.jsx(ctDesignContainer.Container, { onClick: onClick, styleConfig: { root: customContainerStyles }, as: containerAs, children: children })), children: jsxRuntime.jsx(ComponentToRender, { className: mergedRootStyles, children: children }) }));
382
2038
  };
383
2039
 
384
2040
  exports.Typography = Typography;
385
2041
  exports.getTypographyStyles = getTypographyStyles;
2042
+ exports.getTypographyVariant = getTypographyVariant;
386
2043
 
387
2044
  }));
388
2045
  //# sourceMappingURL=ct-design-typography.umd.js.map