td-plots 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Histogram.d.ts +2 -0
- package/dist/index.esm.js +707 -2579
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +708 -2580
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __spreadArray, __assign } from 'tslib';
|
|
2
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
+
import { lazy, useRef, useState, useMemo, Suspense } from 'react';
|
|
5
|
+
import emStyled from '@emotion/styled';
|
|
6
|
+
import { serializeStyles } from '@emotion/serialize';
|
|
7
|
+
import { css, keyframes } from '@emotion/react';
|
|
4
8
|
|
|
5
9
|
function styleInject(css, ref) {
|
|
6
10
|
if ( ref === void 0 ) ref = {};
|
|
@@ -32,49 +36,6 @@ function styleInject(css, ref) {
|
|
|
32
36
|
var css_248z = ".plot-container{height:100%;max-width:100%;min-height:300px;overflow:hidden!important;position:relative;width:100%}.plot-container>div{flex:1;height:100%!important;width:100%!important}.plot-container .main-svg{max-height:100%!important;max-width:100%!important}.plot-container .main-svg,.plot-container .plotly-graph-div,.plot-container svg.main-svg[height],.plot-container svg.main-svg[width]{height:100%!important;width:100%!important}.plot-container .point{border-radius:5px!important;overflow:hidden!important}.plot-container .cursor-ns-resize{height:0;width:0}.plot-container .cursor-ew-resize{fill:var(--selection-color,blue)!important;stroke:var(--selection-color,blue)!important}.plot-container .selectionlayer>path{stroke:var(--selection-color,blue)!important;stroke-dasharray:0!important;stroke-width:1px!important;opacity:.5!important}.plot-container .zoomlayer>path{stroke-dasharray:0!important;stroke:var(--selection-color,blue)!important;fill:var(--selection-color,blue)!important}.radial-histogram-container{aspect-ratio:1}.loading-overlay{align-items:center;background-color:hsla(0,0%,100%,.8);display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:300}";
|
|
33
37
|
styleInject(css_248z);
|
|
34
38
|
|
|
35
|
-
/******************************************************************************
|
|
36
|
-
Copyright (c) Microsoft Corporation.
|
|
37
|
-
|
|
38
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
39
|
-
purpose with or without fee is hereby granted.
|
|
40
|
-
|
|
41
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
42
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
43
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
44
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
45
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
46
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
47
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
48
|
-
***************************************************************************** */
|
|
49
|
-
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var __assign = function() {
|
|
53
|
-
__assign = Object.assign || function __assign(t) {
|
|
54
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
55
|
-
s = arguments[i];
|
|
56
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
57
|
-
}
|
|
58
|
-
return t;
|
|
59
|
-
};
|
|
60
|
-
return __assign.apply(this, arguments);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
function __spreadArray(to, from, pack) {
|
|
64
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
65
|
-
if (ar || !(i in from)) {
|
|
66
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
67
|
-
ar[i] = from[i];
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
74
|
-
var e = new Error(message);
|
|
75
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
39
|
// Utility functions for our components
|
|
79
40
|
// Type guard to check if array contains only numbers
|
|
80
41
|
var isNumberArray = function (arr) {
|
|
@@ -97,2233 +58,241 @@ function calculateMean(arr) {
|
|
|
97
58
|
}
|
|
98
59
|
}
|
|
99
60
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
white: '#fff'
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
const red = {
|
|
106
|
-
300: '#e57373',
|
|
107
|
-
400: '#ef5350',
|
|
108
|
-
500: '#f44336',
|
|
109
|
-
700: '#d32f2f',
|
|
110
|
-
800: '#c62828'};
|
|
111
|
-
|
|
112
|
-
const purple = {
|
|
113
|
-
50: '#f3e5f5',
|
|
114
|
-
200: '#ce93d8',
|
|
115
|
-
300: '#ba68c8',
|
|
116
|
-
400: '#ab47bc',
|
|
117
|
-
500: '#9c27b0',
|
|
118
|
-
700: '#7b1fa2'};
|
|
119
|
-
|
|
120
|
-
const blue = {
|
|
121
|
-
50: '#e3f2fd',
|
|
122
|
-
200: '#90caf9',
|
|
123
|
-
400: '#42a5f5',
|
|
124
|
-
700: '#1976d2',
|
|
125
|
-
800: '#1565c0'};
|
|
126
|
-
|
|
127
|
-
const lightBlue = {
|
|
128
|
-
300: '#4fc3f7',
|
|
129
|
-
400: '#29b6f6',
|
|
130
|
-
500: '#03a9f4',
|
|
131
|
-
700: '#0288d1',
|
|
132
|
-
900: '#01579b'};
|
|
133
|
-
|
|
134
|
-
const green = {
|
|
135
|
-
300: '#81c784',
|
|
136
|
-
400: '#66bb6a',
|
|
137
|
-
500: '#4caf50',
|
|
138
|
-
700: '#388e3c',
|
|
139
|
-
800: '#2e7d32',
|
|
140
|
-
900: '#1b5e20'};
|
|
141
|
-
|
|
142
|
-
const orange = {
|
|
143
|
-
300: '#ffb74d',
|
|
144
|
-
400: '#ffa726',
|
|
145
|
-
500: '#ff9800',
|
|
146
|
-
700: '#f57c00',
|
|
147
|
-
900: '#e65100'};
|
|
148
|
-
|
|
149
|
-
const grey = {
|
|
150
|
-
50: '#fafafa',
|
|
151
|
-
100: '#f5f5f5',
|
|
152
|
-
200: '#eeeeee',
|
|
153
|
-
300: '#e0e0e0',
|
|
154
|
-
400: '#bdbdbd',
|
|
155
|
-
500: '#9e9e9e',
|
|
156
|
-
600: '#757575',
|
|
157
|
-
700: '#616161',
|
|
158
|
-
800: '#424242',
|
|
159
|
-
900: '#212121',
|
|
160
|
-
A100: '#f5f5f5',
|
|
161
|
-
A200: '#eeeeee',
|
|
162
|
-
A400: '#bdbdbd',
|
|
163
|
-
A700: '#616161'
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* WARNING: Don't import this directly. It's imported by the code generated by
|
|
168
|
-
* `@mui/interal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`
|
|
169
|
-
* constructors to ensure the plugin works as expected. Supported patterns include:
|
|
170
|
-
* throw new Error('My message');
|
|
171
|
-
* throw new Error(`My message: ${foo}`);
|
|
172
|
-
* throw new Error(`My message: ${foo}` + 'another string');
|
|
173
|
-
* ...
|
|
174
|
-
* @param {number} code
|
|
175
|
-
*/
|
|
176
|
-
function formatMuiErrorMessage(code, ...args) {
|
|
177
|
-
const url = new URL(`https://mui.com/production-error/?code=${code}`);
|
|
178
|
-
args.forEach(arg => url.searchParams.append('args[]', arg));
|
|
179
|
-
return `Minified MUI error #${code}; visit ${url} for the full message.`;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var THEME_ID = '$$material';
|
|
183
|
-
|
|
184
|
-
function _extends() {
|
|
185
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
186
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
187
|
-
var t = arguments[e];
|
|
188
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
189
|
-
}
|
|
190
|
-
return n;
|
|
191
|
-
}, _extends.apply(null, arguments);
|
|
61
|
+
function getDefaultExportFromCjs (x) {
|
|
62
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
192
63
|
}
|
|
193
64
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
197
|
-
|
|
198
|
-
high performance StyleSheet for css-in-js systems
|
|
199
|
-
|
|
200
|
-
- uses multiple style tags behind the scenes for millions of rules
|
|
201
|
-
- uses `insertRule` for appending in production for *much* faster performance
|
|
202
|
-
|
|
203
|
-
// usage
|
|
204
|
-
|
|
205
|
-
import { StyleSheet } from '@emotion/sheet'
|
|
206
|
-
|
|
207
|
-
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
208
|
-
|
|
209
|
-
styleSheet.insert('#box { border: 1px solid red; }')
|
|
210
|
-
- appends a css rule into the stylesheet
|
|
211
|
-
|
|
212
|
-
styleSheet.flush()
|
|
213
|
-
- empties the stylesheet of all its contents
|
|
214
|
-
|
|
215
|
-
*/
|
|
216
|
-
|
|
217
|
-
function sheetForTag(tag) {
|
|
218
|
-
if (tag.sheet) {
|
|
219
|
-
return tag.sheet;
|
|
220
|
-
} // this weirdness brought to you by firefox
|
|
221
|
-
|
|
222
|
-
/* istanbul ignore next */
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
226
|
-
if (document.styleSheets[i].ownerNode === tag) {
|
|
227
|
-
return document.styleSheets[i];
|
|
228
|
-
}
|
|
229
|
-
} // this function should always return with a value
|
|
230
|
-
// TS can't understand it though so we make it stop complaining here
|
|
65
|
+
var propTypes = {exports: {}};
|
|
231
66
|
|
|
67
|
+
var reactIs$1 = {exports: {}};
|
|
232
68
|
|
|
233
|
-
|
|
234
|
-
}
|
|
69
|
+
var reactIs_production_min = {};
|
|
235
70
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
71
|
+
/** @license React v16.13.1
|
|
72
|
+
* react-is.production.min.js
|
|
73
|
+
*
|
|
74
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the MIT license found in the
|
|
77
|
+
* LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/
|
|
239
79
|
|
|
240
|
-
|
|
241
|
-
tag.setAttribute('nonce', options.nonce);
|
|
242
|
-
}
|
|
80
|
+
var hasRequiredReactIs_production_min;
|
|
243
81
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
82
|
+
function requireReactIs_production_min () {
|
|
83
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
84
|
+
hasRequiredReactIs_production_min = 1;
|
|
85
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
86
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
87
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
88
|
+
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
89
|
+
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
90
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
91
|
+
return reactIs_production_min;
|
|
247
92
|
}
|
|
248
93
|
|
|
249
|
-
var
|
|
250
|
-
// Using Node instead of HTMLElement since container may be a ShadowRoot
|
|
251
|
-
function StyleSheet(options) {
|
|
252
|
-
var _this = this;
|
|
253
|
-
|
|
254
|
-
this._insertTag = function (tag) {
|
|
255
|
-
var before;
|
|
256
|
-
|
|
257
|
-
if (_this.tags.length === 0) {
|
|
258
|
-
if (_this.insertionPoint) {
|
|
259
|
-
before = _this.insertionPoint.nextSibling;
|
|
260
|
-
} else if (_this.prepend) {
|
|
261
|
-
before = _this.container.firstChild;
|
|
262
|
-
} else {
|
|
263
|
-
before = _this.before;
|
|
264
|
-
}
|
|
265
|
-
} else {
|
|
266
|
-
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
_this.container.insertBefore(tag, before);
|
|
270
|
-
|
|
271
|
-
_this.tags.push(tag);
|
|
272
|
-
};
|
|
273
|
-
|
|
274
|
-
this.isSpeedy = options.speedy === undefined ? true : options.speedy;
|
|
275
|
-
this.tags = [];
|
|
276
|
-
this.ctr = 0;
|
|
277
|
-
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
278
|
-
|
|
279
|
-
this.key = options.key;
|
|
280
|
-
this.container = options.container;
|
|
281
|
-
this.prepend = options.prepend;
|
|
282
|
-
this.insertionPoint = options.insertionPoint;
|
|
283
|
-
this.before = null;
|
|
284
|
-
}
|
|
94
|
+
var reactIs_development$1 = {};
|
|
285
95
|
|
|
286
|
-
|
|
96
|
+
/** @license React v16.13.1
|
|
97
|
+
* react-is.development.js
|
|
98
|
+
*
|
|
99
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the MIT license found in the
|
|
102
|
+
* LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/
|
|
287
104
|
|
|
288
|
-
|
|
289
|
-
nodes.forEach(this._insertTag);
|
|
290
|
-
};
|
|
105
|
+
var hasRequiredReactIs_development$1;
|
|
291
106
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
// and you can only have one source map per style tag
|
|
296
|
-
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
297
|
-
this._insertTag(createStyleElement(this));
|
|
298
|
-
}
|
|
107
|
+
function requireReactIs_development$1 () {
|
|
108
|
+
if (hasRequiredReactIs_development$1) return reactIs_development$1;
|
|
109
|
+
hasRequiredReactIs_development$1 = 1;
|
|
299
110
|
|
|
300
|
-
var tag = this.tags[this.tags.length - 1];
|
|
301
111
|
|
|
302
|
-
if (this.isSpeedy) {
|
|
303
|
-
var sheet = sheetForTag(tag);
|
|
304
112
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
// the big drawback is that the css won't be editable in devtools
|
|
308
|
-
sheet.insertRule(rule, sheet.cssRules.length);
|
|
309
|
-
} catch (e) {
|
|
310
|
-
}
|
|
311
|
-
} else {
|
|
312
|
-
tag.appendChild(document.createTextNode(rule));
|
|
313
|
-
}
|
|
113
|
+
if (process.env.NODE_ENV !== "production") {
|
|
114
|
+
(function() {
|
|
314
115
|
|
|
315
|
-
|
|
316
|
-
|
|
116
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
117
|
+
// nor polyfill, then a plain number is used for performance.
|
|
118
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
119
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
120
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
121
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
122
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
123
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
124
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
125
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
126
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
317
127
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
128
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
129
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
130
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
131
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
132
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
133
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
134
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
135
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
136
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
137
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
138
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
321
139
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
};
|
|
140
|
+
function isValidElementType(type) {
|
|
141
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
142
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
143
|
+
}
|
|
327
144
|
|
|
328
|
-
|
|
329
|
-
|
|
145
|
+
function typeOf(object) {
|
|
146
|
+
if (typeof object === 'object' && object !== null) {
|
|
147
|
+
var $$typeof = object.$$typeof;
|
|
330
148
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
var
|
|
149
|
+
switch ($$typeof) {
|
|
150
|
+
case REACT_ELEMENT_TYPE:
|
|
151
|
+
var type = object.type;
|
|
334
152
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
153
|
+
switch (type) {
|
|
154
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
155
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
156
|
+
case REACT_FRAGMENT_TYPE:
|
|
157
|
+
case REACT_PROFILER_TYPE:
|
|
158
|
+
case REACT_STRICT_MODE_TYPE:
|
|
159
|
+
case REACT_SUSPENSE_TYPE:
|
|
160
|
+
return type;
|
|
341
161
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
* @return {number}
|
|
345
|
-
*/
|
|
346
|
-
var abs = Math.abs;
|
|
162
|
+
default:
|
|
163
|
+
var $$typeofType = type && type.$$typeof;
|
|
347
164
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
165
|
+
switch ($$typeofType) {
|
|
166
|
+
case REACT_CONTEXT_TYPE:
|
|
167
|
+
case REACT_FORWARD_REF_TYPE:
|
|
168
|
+
case REACT_LAZY_TYPE:
|
|
169
|
+
case REACT_MEMO_TYPE:
|
|
170
|
+
case REACT_PROVIDER_TYPE:
|
|
171
|
+
return $$typeofType;
|
|
353
172
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
*/
|
|
358
|
-
var assign = Object.assign;
|
|
173
|
+
default:
|
|
174
|
+
return $$typeof;
|
|
175
|
+
}
|
|
359
176
|
|
|
360
|
-
|
|
361
|
-
* @param {string} value
|
|
362
|
-
* @param {number} length
|
|
363
|
-
* @return {number}
|
|
364
|
-
*/
|
|
365
|
-
function hash (value, length) {
|
|
366
|
-
return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
|
|
367
|
-
}
|
|
177
|
+
}
|
|
368
178
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
function trim (value) {
|
|
374
|
-
return value.trim()
|
|
375
|
-
}
|
|
179
|
+
case REACT_PORTAL_TYPE:
|
|
180
|
+
return $$typeof;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
376
183
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
* @param {RegExp} pattern
|
|
380
|
-
* @return {string?}
|
|
381
|
-
*/
|
|
382
|
-
function match (value, pattern) {
|
|
383
|
-
return (value = pattern.exec(value)) ? value[0] : value
|
|
384
|
-
}
|
|
184
|
+
return undefined;
|
|
185
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
385
186
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
187
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
188
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
189
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
190
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
191
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
192
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
193
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
194
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
195
|
+
var Memo = REACT_MEMO_TYPE;
|
|
196
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
197
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
198
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
199
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
200
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
395
201
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
*/
|
|
401
|
-
function indexof (value, search) {
|
|
402
|
-
return value.indexOf(search)
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* @param {string} value
|
|
407
|
-
* @param {number} index
|
|
408
|
-
* @return {number}
|
|
409
|
-
*/
|
|
410
|
-
function charat (value, index) {
|
|
411
|
-
return value.charCodeAt(index) | 0
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* @param {string} value
|
|
416
|
-
* @param {number} begin
|
|
417
|
-
* @param {number} end
|
|
418
|
-
* @return {string}
|
|
419
|
-
*/
|
|
420
|
-
function substr (value, begin, end) {
|
|
421
|
-
return value.slice(begin, end)
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* @param {string} value
|
|
426
|
-
* @return {number}
|
|
427
|
-
*/
|
|
428
|
-
function strlen (value) {
|
|
429
|
-
return value.length
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* @param {any[]} value
|
|
434
|
-
* @return {number}
|
|
435
|
-
*/
|
|
436
|
-
function sizeof (value) {
|
|
437
|
-
return value.length
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* @param {any} value
|
|
442
|
-
* @param {any[]} array
|
|
443
|
-
* @return {any}
|
|
444
|
-
*/
|
|
445
|
-
function append (value, array) {
|
|
446
|
-
return array.push(value), value
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* @param {string[]} array
|
|
451
|
-
* @param {function} callback
|
|
452
|
-
* @return {string}
|
|
453
|
-
*/
|
|
454
|
-
function combine (array, callback) {
|
|
455
|
-
return array.map(callback).join('')
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
var line = 1;
|
|
459
|
-
var column = 1;
|
|
460
|
-
var length = 0;
|
|
461
|
-
var position = 0;
|
|
462
|
-
var character = 0;
|
|
463
|
-
var characters = '';
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* @param {string} value
|
|
467
|
-
* @param {object | null} root
|
|
468
|
-
* @param {object | null} parent
|
|
469
|
-
* @param {string} type
|
|
470
|
-
* @param {string[] | string} props
|
|
471
|
-
* @param {object[] | string} children
|
|
472
|
-
* @param {number} length
|
|
473
|
-
*/
|
|
474
|
-
function node (value, root, parent, type, props, children, length) {
|
|
475
|
-
return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* @param {object} root
|
|
480
|
-
* @param {object} props
|
|
481
|
-
* @return {object}
|
|
482
|
-
*/
|
|
483
|
-
function copy (root, props) {
|
|
484
|
-
return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* @return {number}
|
|
489
|
-
*/
|
|
490
|
-
function char () {
|
|
491
|
-
return character
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* @return {number}
|
|
496
|
-
*/
|
|
497
|
-
function prev () {
|
|
498
|
-
character = position > 0 ? charat(characters, --position) : 0;
|
|
499
|
-
|
|
500
|
-
if (column--, character === 10)
|
|
501
|
-
column = 1, line--;
|
|
502
|
-
|
|
503
|
-
return character
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* @return {number}
|
|
508
|
-
*/
|
|
509
|
-
function next () {
|
|
510
|
-
character = position < length ? charat(characters, position++) : 0;
|
|
511
|
-
|
|
512
|
-
if (column++, character === 10)
|
|
513
|
-
column = 1, line++;
|
|
514
|
-
|
|
515
|
-
return character
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* @return {number}
|
|
520
|
-
*/
|
|
521
|
-
function peek () {
|
|
522
|
-
return charat(characters, position)
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
* @return {number}
|
|
527
|
-
*/
|
|
528
|
-
function caret () {
|
|
529
|
-
return position
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
/**
|
|
533
|
-
* @param {number} begin
|
|
534
|
-
* @param {number} end
|
|
535
|
-
* @return {string}
|
|
536
|
-
*/
|
|
537
|
-
function slice (begin, end) {
|
|
538
|
-
return substr(characters, begin, end)
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
/**
|
|
542
|
-
* @param {number} type
|
|
543
|
-
* @return {number}
|
|
544
|
-
*/
|
|
545
|
-
function token (type) {
|
|
546
|
-
switch (type) {
|
|
547
|
-
// \0 \t \n \r \s whitespace token
|
|
548
|
-
case 0: case 9: case 10: case 13: case 32:
|
|
549
|
-
return 5
|
|
550
|
-
// ! + , / > @ ~ isolate token
|
|
551
|
-
case 33: case 43: case 44: case 47: case 62: case 64: case 126:
|
|
552
|
-
// ; { } breakpoint token
|
|
553
|
-
case 59: case 123: case 125:
|
|
554
|
-
return 4
|
|
555
|
-
// : accompanied token
|
|
556
|
-
case 58:
|
|
557
|
-
return 3
|
|
558
|
-
// " ' ( [ opening delimit token
|
|
559
|
-
case 34: case 39: case 40: case 91:
|
|
560
|
-
return 2
|
|
561
|
-
// ) ] closing delimit token
|
|
562
|
-
case 41: case 93:
|
|
563
|
-
return 1
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
return 0
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* @param {string} value
|
|
571
|
-
* @return {any[]}
|
|
572
|
-
*/
|
|
573
|
-
function alloc (value) {
|
|
574
|
-
return line = column = 1, length = strlen(characters = value), position = 0, []
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
/**
|
|
578
|
-
* @param {any} value
|
|
579
|
-
* @return {any}
|
|
580
|
-
*/
|
|
581
|
-
function dealloc (value) {
|
|
582
|
-
return characters = '', value
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
/**
|
|
586
|
-
* @param {number} type
|
|
587
|
-
* @return {string}
|
|
588
|
-
*/
|
|
589
|
-
function delimit (type) {
|
|
590
|
-
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
/**
|
|
594
|
-
* @param {number} type
|
|
595
|
-
* @return {string}
|
|
596
|
-
*/
|
|
597
|
-
function whitespace (type) {
|
|
598
|
-
while (character = peek())
|
|
599
|
-
if (character < 33)
|
|
600
|
-
next();
|
|
601
|
-
else
|
|
602
|
-
break
|
|
603
|
-
|
|
604
|
-
return token(type) > 2 || token(character) > 3 ? '' : ' '
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* @param {number} index
|
|
609
|
-
* @param {number} count
|
|
610
|
-
* @return {string}
|
|
611
|
-
*/
|
|
612
|
-
function escaping (index, count) {
|
|
613
|
-
while (--count && next())
|
|
614
|
-
// not 0-9 A-F a-f
|
|
615
|
-
if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
|
|
616
|
-
break
|
|
617
|
-
|
|
618
|
-
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* @param {number} type
|
|
623
|
-
* @return {number}
|
|
624
|
-
*/
|
|
625
|
-
function delimiter (type) {
|
|
626
|
-
while (next())
|
|
627
|
-
switch (character) {
|
|
628
|
-
// ] ) " '
|
|
629
|
-
case type:
|
|
630
|
-
return position
|
|
631
|
-
// " '
|
|
632
|
-
case 34: case 39:
|
|
633
|
-
if (type !== 34 && type !== 39)
|
|
634
|
-
delimiter(character);
|
|
635
|
-
break
|
|
636
|
-
// (
|
|
637
|
-
case 40:
|
|
638
|
-
if (type === 41)
|
|
639
|
-
delimiter(type);
|
|
640
|
-
break
|
|
641
|
-
// \
|
|
642
|
-
case 92:
|
|
643
|
-
next();
|
|
644
|
-
break
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
return position
|
|
648
|
-
}
|
|
649
|
-
|
|
650
|
-
/**
|
|
651
|
-
* @param {number} type
|
|
652
|
-
* @param {number} index
|
|
653
|
-
* @return {number}
|
|
654
|
-
*/
|
|
655
|
-
function commenter (type, index) {
|
|
656
|
-
while (next())
|
|
657
|
-
// //
|
|
658
|
-
if (type + character === 47 + 10)
|
|
659
|
-
break
|
|
660
|
-
// /*
|
|
661
|
-
else if (type + character === 42 + 42 && peek() === 47)
|
|
662
|
-
break
|
|
663
|
-
|
|
664
|
-
return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
/**
|
|
668
|
-
* @param {number} index
|
|
669
|
-
* @return {string}
|
|
670
|
-
*/
|
|
671
|
-
function identifier (index) {
|
|
672
|
-
while (!token(peek()))
|
|
673
|
-
next();
|
|
674
|
-
|
|
675
|
-
return slice(index, position)
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* @param {string} value
|
|
680
|
-
* @return {object[]}
|
|
681
|
-
*/
|
|
682
|
-
function compile (value) {
|
|
683
|
-
return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
/**
|
|
687
|
-
* @param {string} value
|
|
688
|
-
* @param {object} root
|
|
689
|
-
* @param {object?} parent
|
|
690
|
-
* @param {string[]} rule
|
|
691
|
-
* @param {string[]} rules
|
|
692
|
-
* @param {string[]} rulesets
|
|
693
|
-
* @param {number[]} pseudo
|
|
694
|
-
* @param {number[]} points
|
|
695
|
-
* @param {string[]} declarations
|
|
696
|
-
* @return {object}
|
|
697
|
-
*/
|
|
698
|
-
function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
699
|
-
var index = 0;
|
|
700
|
-
var offset = 0;
|
|
701
|
-
var length = pseudo;
|
|
702
|
-
var atrule = 0;
|
|
703
|
-
var property = 0;
|
|
704
|
-
var previous = 0;
|
|
705
|
-
var variable = 1;
|
|
706
|
-
var scanning = 1;
|
|
707
|
-
var ampersand = 1;
|
|
708
|
-
var character = 0;
|
|
709
|
-
var type = '';
|
|
710
|
-
var props = rules;
|
|
711
|
-
var children = rulesets;
|
|
712
|
-
var reference = rule;
|
|
713
|
-
var characters = type;
|
|
714
|
-
|
|
715
|
-
while (scanning)
|
|
716
|
-
switch (previous = character, character = next()) {
|
|
717
|
-
// (
|
|
718
|
-
case 40:
|
|
719
|
-
if (previous != 108 && charat(characters, length - 1) == 58) {
|
|
720
|
-
if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
|
|
721
|
-
ampersand = -1;
|
|
722
|
-
break
|
|
723
|
-
}
|
|
724
|
-
// " ' [
|
|
725
|
-
case 34: case 39: case 91:
|
|
726
|
-
characters += delimit(character);
|
|
727
|
-
break
|
|
728
|
-
// \t \n \r \s
|
|
729
|
-
case 9: case 10: case 13: case 32:
|
|
730
|
-
characters += whitespace(previous);
|
|
731
|
-
break
|
|
732
|
-
// \
|
|
733
|
-
case 92:
|
|
734
|
-
characters += escaping(caret() - 1, 7);
|
|
735
|
-
continue
|
|
736
|
-
// /
|
|
737
|
-
case 47:
|
|
738
|
-
switch (peek()) {
|
|
739
|
-
case 42: case 47:
|
|
740
|
-
append(comment(commenter(next(), caret()), root, parent), declarations);
|
|
741
|
-
break
|
|
742
|
-
default:
|
|
743
|
-
characters += '/';
|
|
744
|
-
}
|
|
745
|
-
break
|
|
746
|
-
// {
|
|
747
|
-
case 123 * variable:
|
|
748
|
-
points[index++] = strlen(characters) * ampersand;
|
|
749
|
-
// } ; \0
|
|
750
|
-
case 125 * variable: case 59: case 0:
|
|
751
|
-
switch (character) {
|
|
752
|
-
// \0 }
|
|
753
|
-
case 0: case 125: scanning = 0;
|
|
754
|
-
// ;
|
|
755
|
-
case 59 + offset: if (ampersand == -1) characters = replace(characters, /\f/g, '');
|
|
756
|
-
if (property > 0 && (strlen(characters) - length))
|
|
757
|
-
append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
|
|
758
|
-
break
|
|
759
|
-
// @ ;
|
|
760
|
-
case 59: characters += ';';
|
|
761
|
-
// { rule/at-rule
|
|
762
|
-
default:
|
|
763
|
-
append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
|
|
764
|
-
|
|
765
|
-
if (character === 123)
|
|
766
|
-
if (offset === 0)
|
|
767
|
-
parse(characters, root, reference, reference, props, rulesets, length, points, children);
|
|
768
|
-
else
|
|
769
|
-
switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
|
|
770
|
-
// d l m s
|
|
771
|
-
case 100: case 108: case 109: case 115:
|
|
772
|
-
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children);
|
|
773
|
-
break
|
|
774
|
-
default:
|
|
775
|
-
parse(characters, reference, reference, reference, [''], children, 0, points, children);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
|
|
780
|
-
break
|
|
781
|
-
// :
|
|
782
|
-
case 58:
|
|
783
|
-
length = 1 + strlen(characters), property = previous;
|
|
784
|
-
default:
|
|
785
|
-
if (variable < 1)
|
|
786
|
-
if (character == 123)
|
|
787
|
-
--variable;
|
|
788
|
-
else if (character == 125 && variable++ == 0 && prev() == 125)
|
|
789
|
-
continue
|
|
790
|
-
|
|
791
|
-
switch (characters += from(character), character * variable) {
|
|
792
|
-
// &
|
|
793
|
-
case 38:
|
|
794
|
-
ampersand = offset > 0 ? 1 : (characters += '\f', -1);
|
|
795
|
-
break
|
|
796
|
-
// ,
|
|
797
|
-
case 44:
|
|
798
|
-
points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
|
|
799
|
-
break
|
|
800
|
-
// @
|
|
801
|
-
case 64:
|
|
802
|
-
// -
|
|
803
|
-
if (peek() === 45)
|
|
804
|
-
characters += delimit(next());
|
|
805
|
-
|
|
806
|
-
atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
|
|
807
|
-
break
|
|
808
|
-
// -
|
|
809
|
-
case 45:
|
|
810
|
-
if (previous === 45 && strlen(characters) == 2)
|
|
811
|
-
variable = 0;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
return rulesets
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
/**
|
|
819
|
-
* @param {string} value
|
|
820
|
-
* @param {object} root
|
|
821
|
-
* @param {object?} parent
|
|
822
|
-
* @param {number} index
|
|
823
|
-
* @param {number} offset
|
|
824
|
-
* @param {string[]} rules
|
|
825
|
-
* @param {number[]} points
|
|
826
|
-
* @param {string} type
|
|
827
|
-
* @param {string[]} props
|
|
828
|
-
* @param {string[]} children
|
|
829
|
-
* @param {number} length
|
|
830
|
-
* @return {object}
|
|
831
|
-
*/
|
|
832
|
-
function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
|
|
833
|
-
var post = offset - 1;
|
|
834
|
-
var rule = offset === 0 ? rules : [''];
|
|
835
|
-
var size = sizeof(rule);
|
|
836
|
-
|
|
837
|
-
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
838
|
-
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
839
|
-
if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
|
|
840
|
-
props[k++] = z;
|
|
841
|
-
|
|
842
|
-
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
/**
|
|
846
|
-
* @param {number} value
|
|
847
|
-
* @param {object} root
|
|
848
|
-
* @param {object?} parent
|
|
849
|
-
* @return {object}
|
|
850
|
-
*/
|
|
851
|
-
function comment (value, root, parent) {
|
|
852
|
-
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
/**
|
|
856
|
-
* @param {string} value
|
|
857
|
-
* @param {object} root
|
|
858
|
-
* @param {object?} parent
|
|
859
|
-
* @param {number} length
|
|
860
|
-
* @return {object}
|
|
861
|
-
*/
|
|
862
|
-
function declaration (value, root, parent, length) {
|
|
863
|
-
return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
/**
|
|
867
|
-
* @param {object[]} children
|
|
868
|
-
* @param {function} callback
|
|
869
|
-
* @return {string}
|
|
870
|
-
*/
|
|
871
|
-
function serialize (children, callback) {
|
|
872
|
-
var output = '';
|
|
873
|
-
var length = sizeof(children);
|
|
874
|
-
|
|
875
|
-
for (var i = 0; i < length; i++)
|
|
876
|
-
output += callback(children[i], i, children, callback) || '';
|
|
877
|
-
|
|
878
|
-
return output
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
/**
|
|
882
|
-
* @param {object} element
|
|
883
|
-
* @param {number} index
|
|
884
|
-
* @param {object[]} children
|
|
885
|
-
* @param {function} callback
|
|
886
|
-
* @return {string}
|
|
887
|
-
*/
|
|
888
|
-
function stringify (element, index, children, callback) {
|
|
889
|
-
switch (element.type) {
|
|
890
|
-
case LAYER: if (element.children.length) break
|
|
891
|
-
case IMPORT: case DECLARATION: return element.return = element.return || element.value
|
|
892
|
-
case COMMENT: return ''
|
|
893
|
-
case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
|
|
894
|
-
case RULESET: element.value = element.props.join(',');
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
|
|
898
|
-
}
|
|
899
|
-
|
|
900
|
-
/**
|
|
901
|
-
* @param {function[]} collection
|
|
902
|
-
* @return {function}
|
|
903
|
-
*/
|
|
904
|
-
function middleware (collection) {
|
|
905
|
-
var length = sizeof(collection);
|
|
906
|
-
|
|
907
|
-
return function (element, index, children, callback) {
|
|
908
|
-
var output = '';
|
|
909
|
-
|
|
910
|
-
for (var i = 0; i < length; i++)
|
|
911
|
-
output += collection[i](element, index, children, callback) || '';
|
|
912
|
-
|
|
913
|
-
return output
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
/**
|
|
918
|
-
* @param {function} callback
|
|
919
|
-
* @return {function}
|
|
920
|
-
*/
|
|
921
|
-
function rulesheet (callback) {
|
|
922
|
-
return function (element) {
|
|
923
|
-
if (!element.root)
|
|
924
|
-
if (element = element.return)
|
|
925
|
-
callback(element);
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
function memoize$1(fn) {
|
|
930
|
-
var cache = Object.create(null);
|
|
931
|
-
return function (arg) {
|
|
932
|
-
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
933
|
-
return cache[arg];
|
|
934
|
-
};
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
938
|
-
var previous = 0;
|
|
939
|
-
var character = 0;
|
|
940
|
-
|
|
941
|
-
while (true) {
|
|
942
|
-
previous = character;
|
|
943
|
-
character = peek(); // &\f
|
|
944
|
-
|
|
945
|
-
if (previous === 38 && character === 12) {
|
|
946
|
-
points[index] = 1;
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
if (token(character)) {
|
|
950
|
-
break;
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
next();
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
return slice(begin, position);
|
|
957
|
-
};
|
|
958
|
-
|
|
959
|
-
var toRules = function toRules(parsed, points) {
|
|
960
|
-
// pretend we've started with a comma
|
|
961
|
-
var index = -1;
|
|
962
|
-
var character = 44;
|
|
963
|
-
|
|
964
|
-
do {
|
|
965
|
-
switch (token(character)) {
|
|
966
|
-
case 0:
|
|
967
|
-
// &\f
|
|
968
|
-
if (character === 38 && peek() === 12) {
|
|
969
|
-
// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
|
|
970
|
-
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
|
|
971
|
-
// and when it should just concatenate the outer and inner selectors
|
|
972
|
-
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
|
|
973
|
-
points[index] = 1;
|
|
974
|
-
}
|
|
975
|
-
|
|
976
|
-
parsed[index] += identifierWithPointTracking(position - 1, points, index);
|
|
977
|
-
break;
|
|
978
|
-
|
|
979
|
-
case 2:
|
|
980
|
-
parsed[index] += delimit(character);
|
|
981
|
-
break;
|
|
982
|
-
|
|
983
|
-
case 4:
|
|
984
|
-
// comma
|
|
985
|
-
if (character === 44) {
|
|
986
|
-
// colon
|
|
987
|
-
parsed[++index] = peek() === 58 ? '&\f' : '';
|
|
988
|
-
points[index] = parsed[index].length;
|
|
989
|
-
break;
|
|
990
|
-
}
|
|
991
|
-
|
|
992
|
-
// fallthrough
|
|
993
|
-
|
|
994
|
-
default:
|
|
995
|
-
parsed[index] += from(character);
|
|
996
|
-
}
|
|
997
|
-
} while (character = next());
|
|
998
|
-
|
|
999
|
-
return parsed;
|
|
1000
|
-
};
|
|
1001
|
-
|
|
1002
|
-
var getRules = function getRules(value, points) {
|
|
1003
|
-
return dealloc(toRules(alloc(value), points));
|
|
1004
|
-
}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
var fixedElements = /* #__PURE__ */new WeakMap();
|
|
1008
|
-
var compat = function compat(element) {
|
|
1009
|
-
if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
|
|
1010
|
-
// negative .length indicates that this rule has been already prefixed
|
|
1011
|
-
element.length < 1) {
|
|
1012
|
-
return;
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
var value = element.value;
|
|
1016
|
-
var parent = element.parent;
|
|
1017
|
-
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
1018
|
-
|
|
1019
|
-
while (parent.type !== 'rule') {
|
|
1020
|
-
parent = parent.parent;
|
|
1021
|
-
if (!parent) return;
|
|
1022
|
-
} // short-circuit for the simplest case
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
if (element.props.length === 1 && value.charCodeAt(0) !== 58
|
|
1026
|
-
/* colon */
|
|
1027
|
-
&& !fixedElements.get(parent)) {
|
|
1028
|
-
return;
|
|
1029
|
-
} // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
|
|
1030
|
-
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
if (isImplicitRule) {
|
|
1034
|
-
return;
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
fixedElements.set(element, true);
|
|
1038
|
-
var points = [];
|
|
1039
|
-
var rules = getRules(value, points);
|
|
1040
|
-
var parentRules = parent.props;
|
|
1041
|
-
|
|
1042
|
-
for (var i = 0, k = 0; i < rules.length; i++) {
|
|
1043
|
-
for (var j = 0; j < parentRules.length; j++, k++) {
|
|
1044
|
-
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
};
|
|
1048
|
-
var removeLabel = function removeLabel(element) {
|
|
1049
|
-
if (element.type === 'decl') {
|
|
1050
|
-
var value = element.value;
|
|
1051
|
-
|
|
1052
|
-
if ( // charcode for l
|
|
1053
|
-
value.charCodeAt(0) === 108 && // charcode for b
|
|
1054
|
-
value.charCodeAt(2) === 98) {
|
|
1055
|
-
// this ignores label
|
|
1056
|
-
element["return"] = '';
|
|
1057
|
-
element.value = '';
|
|
1058
|
-
}
|
|
1059
|
-
}
|
|
1060
|
-
};
|
|
1061
|
-
|
|
1062
|
-
/* eslint-disable no-fallthrough */
|
|
1063
|
-
|
|
1064
|
-
function prefix(value, length) {
|
|
1065
|
-
switch (hash(value, length)) {
|
|
1066
|
-
// color-adjust
|
|
1067
|
-
case 5103:
|
|
1068
|
-
return WEBKIT + 'print-' + value + value;
|
|
1069
|
-
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
1070
|
-
|
|
1071
|
-
case 5737:
|
|
1072
|
-
case 4201:
|
|
1073
|
-
case 3177:
|
|
1074
|
-
case 3433:
|
|
1075
|
-
case 1641:
|
|
1076
|
-
case 4457:
|
|
1077
|
-
case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
1078
|
-
|
|
1079
|
-
case 5572:
|
|
1080
|
-
case 6356:
|
|
1081
|
-
case 5844:
|
|
1082
|
-
case 3191:
|
|
1083
|
-
case 6645:
|
|
1084
|
-
case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
1085
|
-
|
|
1086
|
-
case 6391:
|
|
1087
|
-
case 5879:
|
|
1088
|
-
case 5623:
|
|
1089
|
-
case 6135:
|
|
1090
|
-
case 4599:
|
|
1091
|
-
case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
1092
|
-
|
|
1093
|
-
case 4215:
|
|
1094
|
-
case 6389:
|
|
1095
|
-
case 5109:
|
|
1096
|
-
case 5365:
|
|
1097
|
-
case 5621:
|
|
1098
|
-
case 3829:
|
|
1099
|
-
return WEBKIT + value + value;
|
|
1100
|
-
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
1101
|
-
|
|
1102
|
-
case 5349:
|
|
1103
|
-
case 4246:
|
|
1104
|
-
case 4810:
|
|
1105
|
-
case 6968:
|
|
1106
|
-
case 2756:
|
|
1107
|
-
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
1108
|
-
// flex, flex-direction
|
|
1109
|
-
|
|
1110
|
-
case 6828:
|
|
1111
|
-
case 4268:
|
|
1112
|
-
return WEBKIT + value + MS + value + value;
|
|
1113
|
-
// order
|
|
1114
|
-
|
|
1115
|
-
case 6165:
|
|
1116
|
-
return WEBKIT + value + MS + 'flex-' + value + value;
|
|
1117
|
-
// align-items
|
|
1118
|
-
|
|
1119
|
-
case 5187:
|
|
1120
|
-
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
|
|
1121
|
-
// align-self
|
|
1122
|
-
|
|
1123
|
-
case 5443:
|
|
1124
|
-
return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
|
|
1125
|
-
// align-content
|
|
1126
|
-
|
|
1127
|
-
case 4675:
|
|
1128
|
-
return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
|
|
1129
|
-
// flex-shrink
|
|
1130
|
-
|
|
1131
|
-
case 5548:
|
|
1132
|
-
return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
|
|
1133
|
-
// flex-basis
|
|
1134
|
-
|
|
1135
|
-
case 5292:
|
|
1136
|
-
return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
|
|
1137
|
-
// flex-grow
|
|
1138
|
-
|
|
1139
|
-
case 6060:
|
|
1140
|
-
return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
|
|
1141
|
-
// transition
|
|
1142
|
-
|
|
1143
|
-
case 4554:
|
|
1144
|
-
return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
|
|
1145
|
-
// cursor
|
|
1146
|
-
|
|
1147
|
-
case 6187:
|
|
1148
|
-
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
|
|
1149
|
-
// background, background-image
|
|
1150
|
-
|
|
1151
|
-
case 5495:
|
|
1152
|
-
case 3959:
|
|
1153
|
-
return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
|
|
1154
|
-
// justify-content
|
|
1155
|
-
|
|
1156
|
-
case 4968:
|
|
1157
|
-
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
|
|
1158
|
-
// (margin|padding)-inline-(start|end)
|
|
1159
|
-
|
|
1160
|
-
case 4095:
|
|
1161
|
-
case 3583:
|
|
1162
|
-
case 4068:
|
|
1163
|
-
case 2532:
|
|
1164
|
-
return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
|
|
1165
|
-
// (min|max)?(width|height|inline-size|block-size)
|
|
1166
|
-
|
|
1167
|
-
case 8116:
|
|
1168
|
-
case 7059:
|
|
1169
|
-
case 5753:
|
|
1170
|
-
case 5535:
|
|
1171
|
-
case 5445:
|
|
1172
|
-
case 5701:
|
|
1173
|
-
case 4933:
|
|
1174
|
-
case 4677:
|
|
1175
|
-
case 5533:
|
|
1176
|
-
case 5789:
|
|
1177
|
-
case 5021:
|
|
1178
|
-
case 4765:
|
|
1179
|
-
// stretch, max-content, min-content, fill-available
|
|
1180
|
-
if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
|
|
1181
|
-
// (m)ax-content, (m)in-content
|
|
1182
|
-
case 109:
|
|
1183
|
-
// -
|
|
1184
|
-
if (charat(value, length + 4) !== 45) break;
|
|
1185
|
-
// (f)ill-available, (f)it-content
|
|
1186
|
-
|
|
1187
|
-
case 102:
|
|
1188
|
-
return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
|
|
1189
|
-
// (s)tretch
|
|
1190
|
-
|
|
1191
|
-
case 115:
|
|
1192
|
-
return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
|
|
1193
|
-
}
|
|
1194
|
-
break;
|
|
1195
|
-
// position: sticky
|
|
1196
|
-
|
|
1197
|
-
case 4949:
|
|
1198
|
-
// (s)ticky?
|
|
1199
|
-
if (charat(value, length + 1) !== 115) break;
|
|
1200
|
-
// display: (flex|inline-flex)
|
|
1201
|
-
|
|
1202
|
-
case 6444:
|
|
1203
|
-
switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
|
|
1204
|
-
// stic(k)y
|
|
1205
|
-
case 107:
|
|
1206
|
-
return replace(value, ':', ':' + WEBKIT) + value;
|
|
1207
|
-
// (inline-)?fl(e)x
|
|
1208
|
-
|
|
1209
|
-
case 101:
|
|
1210
|
-
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
|
-
break;
|
|
1214
|
-
// writing-mode
|
|
1215
|
-
|
|
1216
|
-
case 5936:
|
|
1217
|
-
switch (charat(value, length + 11)) {
|
|
1218
|
-
// vertical-l(r)
|
|
1219
|
-
case 114:
|
|
1220
|
-
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
|
|
1221
|
-
// vertical-r(l)
|
|
1222
|
-
|
|
1223
|
-
case 108:
|
|
1224
|
-
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
|
|
1225
|
-
// horizontal(-)tb
|
|
1226
|
-
|
|
1227
|
-
case 45:
|
|
1228
|
-
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
|
|
1229
|
-
}
|
|
1230
|
-
|
|
1231
|
-
return WEBKIT + value + MS + value + value;
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
return value;
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
var prefixer = function prefixer(element, index, children, callback) {
|
|
1238
|
-
if (element.length > -1) if (!element["return"]) switch (element.type) {
|
|
1239
|
-
case DECLARATION:
|
|
1240
|
-
element["return"] = prefix(element.value, element.length);
|
|
1241
|
-
break;
|
|
1242
|
-
|
|
1243
|
-
case KEYFRAMES:
|
|
1244
|
-
return serialize([copy(element, {
|
|
1245
|
-
value: replace(element.value, '@', '@' + WEBKIT)
|
|
1246
|
-
})], callback);
|
|
1247
|
-
|
|
1248
|
-
case RULESET:
|
|
1249
|
-
if (element.length) return combine(element.props, function (value) {
|
|
1250
|
-
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
1251
|
-
// :read-(only|write)
|
|
1252
|
-
case ':read-only':
|
|
1253
|
-
case ':read-write':
|
|
1254
|
-
return serialize([copy(element, {
|
|
1255
|
-
props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
|
|
1256
|
-
})], callback);
|
|
1257
|
-
// :placeholder
|
|
1258
|
-
|
|
1259
|
-
case '::placeholder':
|
|
1260
|
-
return serialize([copy(element, {
|
|
1261
|
-
props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
|
|
1262
|
-
}), copy(element, {
|
|
1263
|
-
props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
|
|
1264
|
-
}), copy(element, {
|
|
1265
|
-
props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
|
|
1266
|
-
})], callback);
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
return '';
|
|
1270
|
-
});
|
|
1271
|
-
}
|
|
1272
|
-
};
|
|
1273
|
-
|
|
1274
|
-
var defaultStylisPlugins = [prefixer];
|
|
1275
|
-
|
|
1276
|
-
var createCache = function createCache(options) {
|
|
1277
|
-
var key = options.key;
|
|
1278
|
-
|
|
1279
|
-
if (key === 'css') {
|
|
1280
|
-
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
|
|
1281
|
-
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
|
|
1282
|
-
// note this very very intentionally targets all style elements regardless of the key to ensure
|
|
1283
|
-
// that creating a cache works inside of render of a React component
|
|
1284
|
-
|
|
1285
|
-
Array.prototype.forEach.call(ssrStyles, function (node) {
|
|
1286
|
-
// we want to only move elements which have a space in the data-emotion attribute value
|
|
1287
|
-
// because that indicates that it is an Emotion 11 server-side rendered style elements
|
|
1288
|
-
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
|
|
1289
|
-
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
|
|
1290
|
-
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
|
|
1291
|
-
// will not result in the Emotion 10 styles being destroyed
|
|
1292
|
-
var dataEmotionAttribute = node.getAttribute('data-emotion');
|
|
1293
|
-
|
|
1294
|
-
if (dataEmotionAttribute.indexOf(' ') === -1) {
|
|
1295
|
-
return;
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
document.head.appendChild(node);
|
|
1299
|
-
node.setAttribute('data-s', '');
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
1304
|
-
|
|
1305
|
-
var inserted = {};
|
|
1306
|
-
var container;
|
|
1307
|
-
var nodesToHydrate = [];
|
|
1308
|
-
|
|
1309
|
-
{
|
|
1310
|
-
container = options.container || document.head;
|
|
1311
|
-
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
|
|
1312
|
-
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
1313
|
-
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
|
|
1314
|
-
var attrib = node.getAttribute("data-emotion").split(' ');
|
|
1315
|
-
|
|
1316
|
-
for (var i = 1; i < attrib.length; i++) {
|
|
1317
|
-
inserted[attrib[i]] = true;
|
|
1318
|
-
}
|
|
1319
|
-
|
|
1320
|
-
nodesToHydrate.push(node);
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
var _insert;
|
|
1325
|
-
|
|
1326
|
-
var omnipresentPlugins = [compat, removeLabel];
|
|
1327
|
-
|
|
1328
|
-
{
|
|
1329
|
-
var currentSheet;
|
|
1330
|
-
var finalizingPlugins = [stringify, rulesheet(function (rule) {
|
|
1331
|
-
currentSheet.insert(rule);
|
|
1332
|
-
})];
|
|
1333
|
-
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
1334
|
-
|
|
1335
|
-
var stylis = function stylis(styles) {
|
|
1336
|
-
return serialize(compile(styles), serializer);
|
|
1337
|
-
};
|
|
1338
|
-
|
|
1339
|
-
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
1340
|
-
currentSheet = sheet;
|
|
1341
|
-
|
|
1342
|
-
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
1343
|
-
|
|
1344
|
-
if (shouldCache) {
|
|
1345
|
-
cache.inserted[serialized.name] = true;
|
|
1346
|
-
}
|
|
1347
|
-
};
|
|
1348
|
-
}
|
|
1349
|
-
|
|
1350
|
-
var cache = {
|
|
1351
|
-
key: key,
|
|
1352
|
-
sheet: new StyleSheet({
|
|
1353
|
-
key: key,
|
|
1354
|
-
container: container,
|
|
1355
|
-
nonce: options.nonce,
|
|
1356
|
-
speedy: options.speedy,
|
|
1357
|
-
prepend: options.prepend,
|
|
1358
|
-
insertionPoint: options.insertionPoint
|
|
1359
|
-
}),
|
|
1360
|
-
nonce: options.nonce,
|
|
1361
|
-
inserted: inserted,
|
|
1362
|
-
registered: {},
|
|
1363
|
-
insert: _insert
|
|
1364
|
-
};
|
|
1365
|
-
cache.sheet.hydrate(nodesToHydrate);
|
|
1366
|
-
return cache;
|
|
1367
|
-
};
|
|
1368
|
-
|
|
1369
|
-
function getDefaultExportFromCjs (x) {
|
|
1370
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
var reactIs$2 = {exports: {}};
|
|
1374
|
-
|
|
1375
|
-
var reactIs_production_min = {};
|
|
1376
|
-
|
|
1377
|
-
/** @license React v16.13.1
|
|
1378
|
-
* react-is.production.min.js
|
|
1379
|
-
*
|
|
1380
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1381
|
-
*
|
|
1382
|
-
* This source code is licensed under the MIT license found in the
|
|
1383
|
-
* LICENSE file in the root directory of this source tree.
|
|
1384
|
-
*/
|
|
1385
|
-
|
|
1386
|
-
var hasRequiredReactIs_production_min;
|
|
1387
|
-
|
|
1388
|
-
function requireReactIs_production_min () {
|
|
1389
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
1390
|
-
hasRequiredReactIs_production_min = 1;
|
|
1391
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
1392
|
-
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
1393
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
1394
|
-
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
1395
|
-
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
1396
|
-
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
1397
|
-
return reactIs_production_min;
|
|
1398
|
-
}
|
|
1399
|
-
|
|
1400
|
-
var reactIs_development$1 = {};
|
|
1401
|
-
|
|
1402
|
-
/** @license React v16.13.1
|
|
1403
|
-
* react-is.development.js
|
|
1404
|
-
*
|
|
1405
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
1406
|
-
*
|
|
1407
|
-
* This source code is licensed under the MIT license found in the
|
|
1408
|
-
* LICENSE file in the root directory of this source tree.
|
|
1409
|
-
*/
|
|
1410
|
-
|
|
1411
|
-
var hasRequiredReactIs_development$1;
|
|
1412
|
-
|
|
1413
|
-
function requireReactIs_development$1 () {
|
|
1414
|
-
if (hasRequiredReactIs_development$1) return reactIs_development$1;
|
|
1415
|
-
hasRequiredReactIs_development$1 = 1;
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1420
|
-
(function() {
|
|
1421
|
-
|
|
1422
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
1423
|
-
// nor polyfill, then a plain number is used for performance.
|
|
1424
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
1425
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
1426
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
1427
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
1428
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
1429
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
1430
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
1431
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
1432
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
1433
|
-
|
|
1434
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
1435
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
1436
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
1437
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
1438
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
1439
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
1440
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
1441
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
1442
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
1443
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
1444
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
1445
|
-
|
|
1446
|
-
function isValidElementType(type) {
|
|
1447
|
-
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
1448
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
function typeOf(object) {
|
|
1452
|
-
if (typeof object === 'object' && object !== null) {
|
|
1453
|
-
var $$typeof = object.$$typeof;
|
|
1454
|
-
|
|
1455
|
-
switch ($$typeof) {
|
|
1456
|
-
case REACT_ELEMENT_TYPE:
|
|
1457
|
-
var type = object.type;
|
|
1458
|
-
|
|
1459
|
-
switch (type) {
|
|
1460
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
1461
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
1462
|
-
case REACT_FRAGMENT_TYPE:
|
|
1463
|
-
case REACT_PROFILER_TYPE:
|
|
1464
|
-
case REACT_STRICT_MODE_TYPE:
|
|
1465
|
-
case REACT_SUSPENSE_TYPE:
|
|
1466
|
-
return type;
|
|
1467
|
-
|
|
1468
|
-
default:
|
|
1469
|
-
var $$typeofType = type && type.$$typeof;
|
|
1470
|
-
|
|
1471
|
-
switch ($$typeofType) {
|
|
1472
|
-
case REACT_CONTEXT_TYPE:
|
|
1473
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1474
|
-
case REACT_LAZY_TYPE:
|
|
1475
|
-
case REACT_MEMO_TYPE:
|
|
1476
|
-
case REACT_PROVIDER_TYPE:
|
|
1477
|
-
return $$typeofType;
|
|
1478
|
-
|
|
1479
|
-
default:
|
|
1480
|
-
return $$typeof;
|
|
1481
|
-
}
|
|
1482
|
-
|
|
1483
|
-
}
|
|
1484
|
-
|
|
1485
|
-
case REACT_PORTAL_TYPE:
|
|
1486
|
-
return $$typeof;
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
|
|
1490
|
-
return undefined;
|
|
1491
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
1492
|
-
|
|
1493
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
1494
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
1495
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
1496
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
1497
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
1498
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
1499
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
1500
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
1501
|
-
var Memo = REACT_MEMO_TYPE;
|
|
1502
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
1503
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
1504
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1505
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
1506
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
1507
|
-
|
|
1508
|
-
function isAsyncMode(object) {
|
|
1509
|
-
{
|
|
1510
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
1511
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1512
|
-
|
|
1513
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
1518
|
-
}
|
|
1519
|
-
function isConcurrentMode(object) {
|
|
1520
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
1521
|
-
}
|
|
1522
|
-
function isContextConsumer(object) {
|
|
1523
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
1524
|
-
}
|
|
1525
|
-
function isContextProvider(object) {
|
|
1526
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
1527
|
-
}
|
|
1528
|
-
function isElement(object) {
|
|
1529
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1530
|
-
}
|
|
1531
|
-
function isForwardRef(object) {
|
|
1532
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
1533
|
-
}
|
|
1534
|
-
function isFragment(object) {
|
|
1535
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
1536
|
-
}
|
|
1537
|
-
function isLazy(object) {
|
|
1538
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
1539
|
-
}
|
|
1540
|
-
function isMemo(object) {
|
|
1541
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
1542
|
-
}
|
|
1543
|
-
function isPortal(object) {
|
|
1544
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
1545
|
-
}
|
|
1546
|
-
function isProfiler(object) {
|
|
1547
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
1548
|
-
}
|
|
1549
|
-
function isStrictMode(object) {
|
|
1550
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
1551
|
-
}
|
|
1552
|
-
function isSuspense(object) {
|
|
1553
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
reactIs_development$1.AsyncMode = AsyncMode;
|
|
1557
|
-
reactIs_development$1.ConcurrentMode = ConcurrentMode;
|
|
1558
|
-
reactIs_development$1.ContextConsumer = ContextConsumer;
|
|
1559
|
-
reactIs_development$1.ContextProvider = ContextProvider;
|
|
1560
|
-
reactIs_development$1.Element = Element;
|
|
1561
|
-
reactIs_development$1.ForwardRef = ForwardRef;
|
|
1562
|
-
reactIs_development$1.Fragment = Fragment;
|
|
1563
|
-
reactIs_development$1.Lazy = Lazy;
|
|
1564
|
-
reactIs_development$1.Memo = Memo;
|
|
1565
|
-
reactIs_development$1.Portal = Portal;
|
|
1566
|
-
reactIs_development$1.Profiler = Profiler;
|
|
1567
|
-
reactIs_development$1.StrictMode = StrictMode;
|
|
1568
|
-
reactIs_development$1.Suspense = Suspense;
|
|
1569
|
-
reactIs_development$1.isAsyncMode = isAsyncMode;
|
|
1570
|
-
reactIs_development$1.isConcurrentMode = isConcurrentMode;
|
|
1571
|
-
reactIs_development$1.isContextConsumer = isContextConsumer;
|
|
1572
|
-
reactIs_development$1.isContextProvider = isContextProvider;
|
|
1573
|
-
reactIs_development$1.isElement = isElement;
|
|
1574
|
-
reactIs_development$1.isForwardRef = isForwardRef;
|
|
1575
|
-
reactIs_development$1.isFragment = isFragment;
|
|
1576
|
-
reactIs_development$1.isLazy = isLazy;
|
|
1577
|
-
reactIs_development$1.isMemo = isMemo;
|
|
1578
|
-
reactIs_development$1.isPortal = isPortal;
|
|
1579
|
-
reactIs_development$1.isProfiler = isProfiler;
|
|
1580
|
-
reactIs_development$1.isStrictMode = isStrictMode;
|
|
1581
|
-
reactIs_development$1.isSuspense = isSuspense;
|
|
1582
|
-
reactIs_development$1.isValidElementType = isValidElementType;
|
|
1583
|
-
reactIs_development$1.typeOf = typeOf;
|
|
1584
|
-
})();
|
|
1585
|
-
}
|
|
1586
|
-
return reactIs_development$1;
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
var hasRequiredReactIs;
|
|
1590
|
-
|
|
1591
|
-
function requireReactIs () {
|
|
1592
|
-
if (hasRequiredReactIs) return reactIs$2.exports;
|
|
1593
|
-
hasRequiredReactIs = 1;
|
|
1594
|
-
|
|
1595
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1596
|
-
reactIs$2.exports = requireReactIs_production_min();
|
|
1597
|
-
} else {
|
|
1598
|
-
reactIs$2.exports = requireReactIs_development$1();
|
|
1599
|
-
}
|
|
1600
|
-
return reactIs$2.exports;
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
var reactIs$1 = requireReactIs();
|
|
1604
|
-
var FORWARD_REF_STATICS = {
|
|
1605
|
-
'$$typeof': true,
|
|
1606
|
-
render: true,
|
|
1607
|
-
defaultProps: true,
|
|
1608
|
-
displayName: true,
|
|
1609
|
-
propTypes: true
|
|
1610
|
-
};
|
|
1611
|
-
var MEMO_STATICS = {
|
|
1612
|
-
'$$typeof': true,
|
|
1613
|
-
compare: true,
|
|
1614
|
-
defaultProps: true,
|
|
1615
|
-
displayName: true,
|
|
1616
|
-
propTypes: true,
|
|
1617
|
-
type: true
|
|
1618
|
-
};
|
|
1619
|
-
var TYPE_STATICS = {};
|
|
1620
|
-
TYPE_STATICS[reactIs$1.ForwardRef] = FORWARD_REF_STATICS;
|
|
1621
|
-
TYPE_STATICS[reactIs$1.Memo] = MEMO_STATICS;
|
|
1622
|
-
|
|
1623
|
-
var isBrowser = true;
|
|
1624
|
-
|
|
1625
|
-
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
1626
|
-
var rawClassName = '';
|
|
1627
|
-
classNames.split(' ').forEach(function (className) {
|
|
1628
|
-
if (registered[className] !== undefined) {
|
|
1629
|
-
registeredStyles.push(registered[className] + ";");
|
|
1630
|
-
} else if (className) {
|
|
1631
|
-
rawClassName += className + " ";
|
|
1632
|
-
}
|
|
1633
|
-
});
|
|
1634
|
-
return rawClassName;
|
|
1635
|
-
}
|
|
1636
|
-
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
1637
|
-
var className = cache.key + "-" + serialized.name;
|
|
1638
|
-
|
|
1639
|
-
if ( // we only need to add the styles to the registered cache if the
|
|
1640
|
-
// class name could be used further down
|
|
1641
|
-
// the tree but if it's a string tag, we know it won't
|
|
1642
|
-
// so we don't have to add it to registered cache.
|
|
1643
|
-
// this improves memory usage since we can avoid storing the whole style string
|
|
1644
|
-
(isStringTag === false || // we need to always store it if we're in compat mode and
|
|
1645
|
-
// in node since emotion-server relies on whether a style is in
|
|
1646
|
-
// the registered cache to know whether a style is global or not
|
|
1647
|
-
// also, note that this check will be dead code eliminated in the browser
|
|
1648
|
-
isBrowser === false ) && cache.registered[className] === undefined) {
|
|
1649
|
-
cache.registered[className] = serialized.styles;
|
|
1650
|
-
}
|
|
1651
|
-
};
|
|
1652
|
-
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
1653
|
-
registerStyles(cache, serialized, isStringTag);
|
|
1654
|
-
var className = cache.key + "-" + serialized.name;
|
|
1655
|
-
|
|
1656
|
-
if (cache.inserted[serialized.name] === undefined) {
|
|
1657
|
-
var current = serialized;
|
|
1658
|
-
|
|
1659
|
-
do {
|
|
1660
|
-
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
1661
|
-
|
|
1662
|
-
current = current.next;
|
|
1663
|
-
} while (current !== undefined);
|
|
1664
|
-
}
|
|
1665
|
-
};
|
|
1666
|
-
|
|
1667
|
-
/* eslint-disable */
|
|
1668
|
-
// Inspired by https://github.com/garycourt/murmurhash-js
|
|
1669
|
-
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
|
|
1670
|
-
function murmur2(str) {
|
|
1671
|
-
// 'm' and 'r' are mixing constants generated offline.
|
|
1672
|
-
// They're not really 'magic', they just happen to work well.
|
|
1673
|
-
// const m = 0x5bd1e995;
|
|
1674
|
-
// const r = 24;
|
|
1675
|
-
// Initialize the hash
|
|
1676
|
-
var h = 0; // Mix 4 bytes at a time into the hash
|
|
1677
|
-
|
|
1678
|
-
var k,
|
|
1679
|
-
i = 0,
|
|
1680
|
-
len = str.length;
|
|
1681
|
-
|
|
1682
|
-
for (; len >= 4; ++i, len -= 4) {
|
|
1683
|
-
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
|
|
1684
|
-
k =
|
|
1685
|
-
/* Math.imul(k, m): */
|
|
1686
|
-
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
|
|
1687
|
-
k ^=
|
|
1688
|
-
/* k >>> r: */
|
|
1689
|
-
k >>> 24;
|
|
1690
|
-
h =
|
|
1691
|
-
/* Math.imul(k, m): */
|
|
1692
|
-
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
|
|
1693
|
-
/* Math.imul(h, m): */
|
|
1694
|
-
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
1695
|
-
} // Handle the last few bytes of the input array
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
switch (len) {
|
|
1699
|
-
case 3:
|
|
1700
|
-
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
|
|
1701
|
-
|
|
1702
|
-
case 2:
|
|
1703
|
-
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
|
|
1704
|
-
|
|
1705
|
-
case 1:
|
|
1706
|
-
h ^= str.charCodeAt(i) & 0xff;
|
|
1707
|
-
h =
|
|
1708
|
-
/* Math.imul(h, m): */
|
|
1709
|
-
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
1710
|
-
} // Do a few final mixes of the hash to ensure the last few
|
|
1711
|
-
// bytes are well-incorporated.
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
h ^= h >>> 13;
|
|
1715
|
-
h =
|
|
1716
|
-
/* Math.imul(h, m): */
|
|
1717
|
-
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
|
|
1718
|
-
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
var unitlessKeys = {
|
|
1722
|
-
animationIterationCount: 1,
|
|
1723
|
-
aspectRatio: 1,
|
|
1724
|
-
borderImageOutset: 1,
|
|
1725
|
-
borderImageSlice: 1,
|
|
1726
|
-
borderImageWidth: 1,
|
|
1727
|
-
boxFlex: 1,
|
|
1728
|
-
boxFlexGroup: 1,
|
|
1729
|
-
boxOrdinalGroup: 1,
|
|
1730
|
-
columnCount: 1,
|
|
1731
|
-
columns: 1,
|
|
1732
|
-
flex: 1,
|
|
1733
|
-
flexGrow: 1,
|
|
1734
|
-
flexPositive: 1,
|
|
1735
|
-
flexShrink: 1,
|
|
1736
|
-
flexNegative: 1,
|
|
1737
|
-
flexOrder: 1,
|
|
1738
|
-
gridRow: 1,
|
|
1739
|
-
gridRowEnd: 1,
|
|
1740
|
-
gridRowSpan: 1,
|
|
1741
|
-
gridRowStart: 1,
|
|
1742
|
-
gridColumn: 1,
|
|
1743
|
-
gridColumnEnd: 1,
|
|
1744
|
-
gridColumnSpan: 1,
|
|
1745
|
-
gridColumnStart: 1,
|
|
1746
|
-
msGridRow: 1,
|
|
1747
|
-
msGridRowSpan: 1,
|
|
1748
|
-
msGridColumn: 1,
|
|
1749
|
-
msGridColumnSpan: 1,
|
|
1750
|
-
fontWeight: 1,
|
|
1751
|
-
lineHeight: 1,
|
|
1752
|
-
opacity: 1,
|
|
1753
|
-
order: 1,
|
|
1754
|
-
orphans: 1,
|
|
1755
|
-
scale: 1,
|
|
1756
|
-
tabSize: 1,
|
|
1757
|
-
widows: 1,
|
|
1758
|
-
zIndex: 1,
|
|
1759
|
-
zoom: 1,
|
|
1760
|
-
WebkitLineClamp: 1,
|
|
1761
|
-
// SVG-related properties
|
|
1762
|
-
fillOpacity: 1,
|
|
1763
|
-
floodOpacity: 1,
|
|
1764
|
-
stopOpacity: 1,
|
|
1765
|
-
strokeDasharray: 1,
|
|
1766
|
-
strokeDashoffset: 1,
|
|
1767
|
-
strokeMiterlimit: 1,
|
|
1768
|
-
strokeOpacity: 1,
|
|
1769
|
-
strokeWidth: 1
|
|
1770
|
-
};
|
|
1771
|
-
|
|
1772
|
-
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
1773
|
-
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
1774
|
-
|
|
1775
|
-
var isCustomProperty = function isCustomProperty(property) {
|
|
1776
|
-
return property.charCodeAt(1) === 45;
|
|
1777
|
-
};
|
|
1778
|
-
|
|
1779
|
-
var isProcessableValue = function isProcessableValue(value) {
|
|
1780
|
-
return value != null && typeof value !== 'boolean';
|
|
1781
|
-
};
|
|
1782
|
-
|
|
1783
|
-
var processStyleName = /* #__PURE__ */memoize$1(function (styleName) {
|
|
1784
|
-
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
|
|
1785
|
-
});
|
|
1786
|
-
|
|
1787
|
-
var processStyleValue = function processStyleValue(key, value) {
|
|
1788
|
-
switch (key) {
|
|
1789
|
-
case 'animation':
|
|
1790
|
-
case 'animationName':
|
|
1791
|
-
{
|
|
1792
|
-
if (typeof value === 'string') {
|
|
1793
|
-
return value.replace(animationRegex, function (match, p1, p2) {
|
|
1794
|
-
cursor = {
|
|
1795
|
-
name: p1,
|
|
1796
|
-
styles: p2,
|
|
1797
|
-
next: cursor
|
|
1798
|
-
};
|
|
1799
|
-
return p1;
|
|
1800
|
-
});
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
|
|
1806
|
-
return value + 'px';
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
|
-
return value;
|
|
1810
|
-
};
|
|
1811
|
-
|
|
1812
|
-
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
1813
|
-
if (interpolation == null) {
|
|
1814
|
-
return '';
|
|
1815
|
-
}
|
|
1816
|
-
|
|
1817
|
-
var componentSelector = interpolation;
|
|
1818
|
-
|
|
1819
|
-
if (componentSelector.__emotion_styles !== undefined) {
|
|
1820
|
-
|
|
1821
|
-
return componentSelector;
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
|
-
switch (typeof interpolation) {
|
|
1825
|
-
case 'boolean':
|
|
1826
|
-
{
|
|
1827
|
-
return '';
|
|
1828
|
-
}
|
|
1829
|
-
|
|
1830
|
-
case 'object':
|
|
1831
|
-
{
|
|
1832
|
-
var keyframes = interpolation;
|
|
1833
|
-
|
|
1834
|
-
if (keyframes.anim === 1) {
|
|
1835
|
-
cursor = {
|
|
1836
|
-
name: keyframes.name,
|
|
1837
|
-
styles: keyframes.styles,
|
|
1838
|
-
next: cursor
|
|
1839
|
-
};
|
|
1840
|
-
return keyframes.name;
|
|
1841
|
-
}
|
|
1842
|
-
|
|
1843
|
-
var serializedStyles = interpolation;
|
|
1844
|
-
|
|
1845
|
-
if (serializedStyles.styles !== undefined) {
|
|
1846
|
-
var next = serializedStyles.next;
|
|
1847
|
-
|
|
1848
|
-
if (next !== undefined) {
|
|
1849
|
-
// not the most efficient thing ever but this is a pretty rare case
|
|
1850
|
-
// and there will be very few iterations of this generally
|
|
1851
|
-
while (next !== undefined) {
|
|
1852
|
-
cursor = {
|
|
1853
|
-
name: next.name,
|
|
1854
|
-
styles: next.styles,
|
|
1855
|
-
next: cursor
|
|
1856
|
-
};
|
|
1857
|
-
next = next.next;
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
|
-
|
|
1861
|
-
var styles = serializedStyles.styles + ";";
|
|
1862
|
-
return styles;
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
return createStringFromObject(mergedProps, registered, interpolation);
|
|
1866
|
-
}
|
|
1867
|
-
|
|
1868
|
-
case 'function':
|
|
1869
|
-
{
|
|
1870
|
-
if (mergedProps !== undefined) {
|
|
1871
|
-
var previousCursor = cursor;
|
|
1872
|
-
var result = interpolation(mergedProps);
|
|
1873
|
-
cursor = previousCursor;
|
|
1874
|
-
return handleInterpolation(mergedProps, registered, result);
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
break;
|
|
1878
|
-
}
|
|
1879
|
-
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
var asString = interpolation;
|
|
1883
|
-
|
|
1884
|
-
if (registered == null) {
|
|
1885
|
-
return asString;
|
|
1886
|
-
}
|
|
1887
|
-
|
|
1888
|
-
var cached = registered[asString];
|
|
1889
|
-
return cached !== undefined ? cached : asString;
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
function createStringFromObject(mergedProps, registered, obj) {
|
|
1893
|
-
var string = '';
|
|
1894
|
-
|
|
1895
|
-
if (Array.isArray(obj)) {
|
|
1896
|
-
for (var i = 0; i < obj.length; i++) {
|
|
1897
|
-
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
|
|
1898
|
-
}
|
|
1899
|
-
} else {
|
|
1900
|
-
for (var key in obj) {
|
|
1901
|
-
var value = obj[key];
|
|
1902
|
-
|
|
1903
|
-
if (typeof value !== 'object') {
|
|
1904
|
-
var asString = value;
|
|
1905
|
-
|
|
1906
|
-
if (registered != null && registered[asString] !== undefined) {
|
|
1907
|
-
string += key + "{" + registered[asString] + "}";
|
|
1908
|
-
} else if (isProcessableValue(asString)) {
|
|
1909
|
-
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
1910
|
-
}
|
|
1911
|
-
} else {
|
|
1912
|
-
|
|
1913
|
-
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
|
1914
|
-
for (var _i = 0; _i < value.length; _i++) {
|
|
1915
|
-
if (isProcessableValue(value[_i])) {
|
|
1916
|
-
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
} else {
|
|
1920
|
-
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
1921
|
-
|
|
1922
|
-
switch (key) {
|
|
1923
|
-
case 'animation':
|
|
1924
|
-
case 'animationName':
|
|
1925
|
-
{
|
|
1926
|
-
string += processStyleName(key) + ":" + interpolated + ";";
|
|
1927
|
-
break;
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
default:
|
|
1931
|
-
{
|
|
1932
|
-
|
|
1933
|
-
string += key + "{" + interpolated + "}";
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
}
|
|
1937
|
-
}
|
|
1938
|
-
}
|
|
1939
|
-
}
|
|
1940
|
-
|
|
1941
|
-
return string;
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
var labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g; // this is the cursor for keyframes
|
|
1945
|
-
// keyframes are stored on the SerializedStyles object as a linked list
|
|
1946
|
-
|
|
1947
|
-
var cursor;
|
|
1948
|
-
function serializeStyles(args, registered, mergedProps) {
|
|
1949
|
-
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
|
|
1950
|
-
return args[0];
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
var stringMode = true;
|
|
1954
|
-
var styles = '';
|
|
1955
|
-
cursor = undefined;
|
|
1956
|
-
var strings = args[0];
|
|
1957
|
-
|
|
1958
|
-
if (strings == null || strings.raw === undefined) {
|
|
1959
|
-
stringMode = false;
|
|
1960
|
-
styles += handleInterpolation(mergedProps, registered, strings);
|
|
1961
|
-
} else {
|
|
1962
|
-
var asTemplateStringsArr = strings;
|
|
1963
|
-
|
|
1964
|
-
styles += asTemplateStringsArr[0];
|
|
1965
|
-
} // we start at 1 since we've already handled the first arg
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
for (var i = 1; i < args.length; i++) {
|
|
1969
|
-
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
1970
|
-
|
|
1971
|
-
if (stringMode) {
|
|
1972
|
-
var templateStringsArr = strings;
|
|
1973
|
-
|
|
1974
|
-
styles += templateStringsArr[i];
|
|
1975
|
-
}
|
|
1976
|
-
} // using a global regex with .exec is stateful so lastIndex has to be reset each time
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
labelPattern.lastIndex = 0;
|
|
1980
|
-
var identifierName = '';
|
|
1981
|
-
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
|
|
1982
|
-
|
|
1983
|
-
while ((match = labelPattern.exec(styles)) !== null) {
|
|
1984
|
-
identifierName += '-' + match[1];
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
var name = murmur2(styles) + identifierName;
|
|
1988
|
-
|
|
1989
|
-
return {
|
|
1990
|
-
name: name,
|
|
1991
|
-
styles: styles,
|
|
1992
|
-
next: cursor
|
|
1993
|
-
};
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
var syncFallback = function syncFallback(create) {
|
|
1997
|
-
return create();
|
|
1998
|
-
};
|
|
1999
|
-
|
|
2000
|
-
var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;
|
|
2001
|
-
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
|
|
2002
|
-
|
|
2003
|
-
var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
2004
|
-
// because this module is primarily intended for the browser and node
|
|
2005
|
-
// but it's also required in react native and similar environments sometimes
|
|
2006
|
-
// and we could have a special build just for that
|
|
2007
|
-
// but this is much easier and the native packages
|
|
2008
|
-
// might use a different theme context in the future anyway
|
|
2009
|
-
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
2010
|
-
key: 'css'
|
|
2011
|
-
}) : null);
|
|
2012
|
-
|
|
2013
|
-
EmotionCacheContext.Provider;
|
|
2014
|
-
|
|
2015
|
-
var withEmotionCache = function withEmotionCache(func) {
|
|
2016
|
-
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
2017
|
-
// the cache will never be null in the browser
|
|
2018
|
-
var cache = useContext(EmotionCacheContext);
|
|
2019
|
-
return func(props, cache, ref);
|
|
2020
|
-
});
|
|
2021
|
-
};
|
|
2022
|
-
|
|
2023
|
-
var ThemeContext = /* #__PURE__ */React.createContext({});
|
|
2024
|
-
|
|
2025
|
-
var hasOwn = {}.hasOwnProperty;
|
|
2026
|
-
|
|
2027
|
-
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
|
|
2028
|
-
var createEmotionProps = function createEmotionProps(type, props) {
|
|
2029
|
-
|
|
2030
|
-
var newProps = {};
|
|
2031
|
-
|
|
2032
|
-
for (var _key in props) {
|
|
2033
|
-
if (hasOwn.call(props, _key)) {
|
|
2034
|
-
newProps[_key] = props[_key];
|
|
2035
|
-
}
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2038
|
-
newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:
|
|
2039
|
-
|
|
2040
|
-
return newProps;
|
|
2041
|
-
};
|
|
2042
|
-
|
|
2043
|
-
var Insertion$1 = function Insertion(_ref) {
|
|
2044
|
-
var cache = _ref.cache,
|
|
2045
|
-
serialized = _ref.serialized,
|
|
2046
|
-
isStringTag = _ref.isStringTag;
|
|
2047
|
-
registerStyles(cache, serialized, isStringTag);
|
|
2048
|
-
useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
2049
|
-
return insertStyles(cache, serialized, isStringTag);
|
|
2050
|
-
});
|
|
2051
|
-
|
|
2052
|
-
return null;
|
|
2053
|
-
};
|
|
2054
|
-
|
|
2055
|
-
var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
2056
|
-
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
|
|
2057
|
-
// not passing the registered cache to serializeStyles because it would
|
|
2058
|
-
// make certain babel optimisations not possible
|
|
2059
|
-
|
|
2060
|
-
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
|
|
2061
|
-
cssProp = cache.registered[cssProp];
|
|
2062
|
-
}
|
|
2063
|
-
|
|
2064
|
-
var WrappedComponent = props[typePropName];
|
|
2065
|
-
var registeredStyles = [cssProp];
|
|
2066
|
-
var className = '';
|
|
2067
|
-
|
|
2068
|
-
if (typeof props.className === 'string') {
|
|
2069
|
-
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
|
|
2070
|
-
} else if (props.className != null) {
|
|
2071
|
-
className = props.className + " ";
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));
|
|
2075
|
-
|
|
2076
|
-
className += cache.key + "-" + serialized.name;
|
|
2077
|
-
var newProps = {};
|
|
2078
|
-
|
|
2079
|
-
for (var _key2 in props) {
|
|
2080
|
-
if (hasOwn.call(props, _key2) && _key2 !== 'css' && _key2 !== typePropName && (true )) {
|
|
2081
|
-
newProps[_key2] = props[_key2];
|
|
2082
|
-
}
|
|
2083
|
-
}
|
|
2084
|
-
|
|
2085
|
-
newProps.className = className;
|
|
2086
|
-
|
|
2087
|
-
if (ref) {
|
|
2088
|
-
newProps.ref = ref;
|
|
2089
|
-
}
|
|
2090
|
-
|
|
2091
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion$1, {
|
|
2092
|
-
cache: cache,
|
|
2093
|
-
serialized: serialized,
|
|
2094
|
-
isStringTag: typeof WrappedComponent === 'string'
|
|
2095
|
-
}), /*#__PURE__*/React.createElement(WrappedComponent, newProps));
|
|
2096
|
-
});
|
|
2097
|
-
|
|
2098
|
-
var Emotion$1 = Emotion;
|
|
2099
|
-
|
|
2100
|
-
var jsx = function jsx(type, props) {
|
|
2101
|
-
// eslint-disable-next-line prefer-rest-params
|
|
2102
|
-
var args = arguments;
|
|
2103
|
-
|
|
2104
|
-
if (props == null || !hasOwn.call(props, 'css')) {
|
|
2105
|
-
return React.createElement.apply(undefined, args);
|
|
2106
|
-
}
|
|
2107
|
-
|
|
2108
|
-
var argsLength = args.length;
|
|
2109
|
-
var createElementArgArray = new Array(argsLength);
|
|
2110
|
-
createElementArgArray[0] = Emotion$1;
|
|
2111
|
-
createElementArgArray[1] = createEmotionProps(type, props);
|
|
2112
|
-
|
|
2113
|
-
for (var i = 2; i < argsLength; i++) {
|
|
2114
|
-
createElementArgArray[i] = args[i];
|
|
2115
|
-
}
|
|
2116
|
-
|
|
2117
|
-
return React.createElement.apply(null, createElementArgArray);
|
|
2118
|
-
};
|
|
2119
|
-
|
|
2120
|
-
(function (_jsx) {
|
|
2121
|
-
var JSX;
|
|
2122
|
-
|
|
2123
|
-
(function (_JSX) {})(JSX || (JSX = _jsx.JSX || (_jsx.JSX = {})));
|
|
2124
|
-
})(jsx || (jsx = {}));
|
|
2125
|
-
|
|
2126
|
-
function css() {
|
|
2127
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2128
|
-
args[_key] = arguments[_key];
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
return serializeStyles(args);
|
|
2132
|
-
}
|
|
2133
|
-
|
|
2134
|
-
function keyframes() {
|
|
2135
|
-
var insertable = css.apply(void 0, arguments);
|
|
2136
|
-
var name = "animation-" + insertable.name;
|
|
2137
|
-
return {
|
|
2138
|
-
name: name,
|
|
2139
|
-
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
|
2140
|
-
anim: 1,
|
|
2141
|
-
toString: function toString() {
|
|
2142
|
-
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
|
|
2143
|
-
}
|
|
2144
|
-
};
|
|
2145
|
-
}
|
|
2146
|
-
|
|
2147
|
-
// eslint-disable-next-line no-undef
|
|
2148
|
-
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
|
2149
|
-
|
|
2150
|
-
var isPropValid = /* #__PURE__ */memoize$1(function (prop) {
|
|
2151
|
-
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
|
2152
|
-
/* o */
|
|
2153
|
-
&& prop.charCodeAt(1) === 110
|
|
2154
|
-
/* n */
|
|
2155
|
-
&& prop.charCodeAt(2) < 91;
|
|
2156
|
-
}
|
|
2157
|
-
/* Z+1 */
|
|
2158
|
-
);
|
|
2159
|
-
|
|
2160
|
-
var testOmitPropsOnStringTag = isPropValid;
|
|
2161
|
-
|
|
2162
|
-
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
|
|
2163
|
-
return key !== 'theme';
|
|
2164
|
-
};
|
|
2165
|
-
|
|
2166
|
-
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
|
|
2167
|
-
return typeof tag === 'string' && // 96 is one less than the char code
|
|
2168
|
-
// for "a" so this is checking that
|
|
2169
|
-
// it's a lowercase character
|
|
2170
|
-
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
|
2171
|
-
};
|
|
2172
|
-
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
|
|
2173
|
-
var shouldForwardProp;
|
|
2174
|
-
|
|
2175
|
-
if (options) {
|
|
2176
|
-
var optionsShouldForwardProp = options.shouldForwardProp;
|
|
2177
|
-
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
|
|
2178
|
-
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
|
|
2179
|
-
} : optionsShouldForwardProp;
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
if (typeof shouldForwardProp !== 'function' && isReal) {
|
|
2183
|
-
shouldForwardProp = tag.__emotion_forwardProp;
|
|
2184
|
-
}
|
|
2185
|
-
|
|
2186
|
-
return shouldForwardProp;
|
|
2187
|
-
};
|
|
2188
|
-
|
|
2189
|
-
var Insertion = function Insertion(_ref) {
|
|
2190
|
-
var cache = _ref.cache,
|
|
2191
|
-
serialized = _ref.serialized,
|
|
2192
|
-
isStringTag = _ref.isStringTag;
|
|
2193
|
-
registerStyles(cache, serialized, isStringTag);
|
|
2194
|
-
useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
2195
|
-
return insertStyles(cache, serialized, isStringTag);
|
|
2196
|
-
});
|
|
2197
|
-
|
|
2198
|
-
return null;
|
|
2199
|
-
};
|
|
2200
|
-
|
|
2201
|
-
var createStyled$1 = function createStyled(tag, options) {
|
|
2202
|
-
|
|
2203
|
-
var isReal = tag.__emotion_real === tag;
|
|
2204
|
-
var baseTag = isReal && tag.__emotion_base || tag;
|
|
2205
|
-
var identifierName;
|
|
2206
|
-
var targetClassName;
|
|
2207
|
-
|
|
2208
|
-
if (options !== undefined) {
|
|
2209
|
-
identifierName = options.label;
|
|
2210
|
-
targetClassName = options.target;
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2213
|
-
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
|
|
2214
|
-
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
|
|
2215
|
-
var shouldUseAs = !defaultShouldForwardProp('as');
|
|
2216
|
-
return function () {
|
|
2217
|
-
// eslint-disable-next-line prefer-rest-params
|
|
2218
|
-
var args = arguments;
|
|
2219
|
-
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
|
|
2220
|
-
|
|
2221
|
-
if (identifierName !== undefined) {
|
|
2222
|
-
styles.push("label:" + identifierName + ";");
|
|
2223
|
-
}
|
|
2224
|
-
|
|
2225
|
-
if (args[0] == null || args[0].raw === undefined) {
|
|
2226
|
-
// eslint-disable-next-line prefer-spread
|
|
2227
|
-
styles.push.apply(styles, args);
|
|
2228
|
-
} else {
|
|
2229
|
-
var templateStringsArr = args[0];
|
|
2230
|
-
|
|
2231
|
-
styles.push(templateStringsArr[0]);
|
|
2232
|
-
var len = args.length;
|
|
2233
|
-
var i = 1;
|
|
2234
|
-
|
|
2235
|
-
for (; i < len; i++) {
|
|
2236
|
-
|
|
2237
|
-
styles.push(args[i], templateStringsArr[i]);
|
|
2238
|
-
}
|
|
2239
|
-
}
|
|
2240
|
-
|
|
2241
|
-
var Styled = withEmotionCache(function (props, cache, ref) {
|
|
2242
|
-
var FinalTag = shouldUseAs && props.as || baseTag;
|
|
2243
|
-
var className = '';
|
|
2244
|
-
var classInterpolations = [];
|
|
2245
|
-
var mergedProps = props;
|
|
2246
|
-
|
|
2247
|
-
if (props.theme == null) {
|
|
2248
|
-
mergedProps = {};
|
|
2249
|
-
|
|
2250
|
-
for (var key in props) {
|
|
2251
|
-
mergedProps[key] = props[key];
|
|
2252
|
-
}
|
|
2253
|
-
|
|
2254
|
-
mergedProps.theme = React.useContext(ThemeContext);
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
|
-
if (typeof props.className === 'string') {
|
|
2258
|
-
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
|
|
2259
|
-
} else if (props.className != null) {
|
|
2260
|
-
className = props.className + " ";
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
|
-
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
|
|
2264
|
-
className += cache.key + "-" + serialized.name;
|
|
2265
|
-
|
|
2266
|
-
if (targetClassName !== undefined) {
|
|
2267
|
-
className += " " + targetClassName;
|
|
2268
|
-
}
|
|
2269
|
-
|
|
2270
|
-
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
|
|
2271
|
-
var newProps = {};
|
|
2272
|
-
|
|
2273
|
-
for (var _key in props) {
|
|
2274
|
-
if (shouldUseAs && _key === 'as') continue;
|
|
2275
|
-
|
|
2276
|
-
if (finalShouldForwardProp(_key)) {
|
|
2277
|
-
newProps[_key] = props[_key];
|
|
2278
|
-
}
|
|
2279
|
-
}
|
|
2280
|
-
|
|
2281
|
-
newProps.className = className;
|
|
2282
|
-
|
|
2283
|
-
if (ref) {
|
|
2284
|
-
newProps.ref = ref;
|
|
2285
|
-
}
|
|
2286
|
-
|
|
2287
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
|
|
2288
|
-
cache: cache,
|
|
2289
|
-
serialized: serialized,
|
|
2290
|
-
isStringTag: typeof FinalTag === 'string'
|
|
2291
|
-
}), /*#__PURE__*/React.createElement(FinalTag, newProps));
|
|
2292
|
-
});
|
|
2293
|
-
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
|
|
2294
|
-
Styled.defaultProps = tag.defaultProps;
|
|
2295
|
-
Styled.__emotion_real = Styled;
|
|
2296
|
-
Styled.__emotion_base = baseTag;
|
|
2297
|
-
Styled.__emotion_styles = styles;
|
|
2298
|
-
Styled.__emotion_forwardProp = shouldForwardProp;
|
|
2299
|
-
Object.defineProperty(Styled, 'toString', {
|
|
2300
|
-
value: function value() {
|
|
2301
|
-
|
|
2302
|
-
return "." + targetClassName;
|
|
2303
|
-
}
|
|
2304
|
-
});
|
|
202
|
+
function isAsyncMode(object) {
|
|
203
|
+
{
|
|
204
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
205
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
2305
206
|
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
}));
|
|
2310
|
-
return newStyled.apply(void 0, styles);
|
|
2311
|
-
};
|
|
207
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
208
|
+
}
|
|
209
|
+
}
|
|
2312
210
|
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
211
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
212
|
+
}
|
|
213
|
+
function isConcurrentMode(object) {
|
|
214
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
215
|
+
}
|
|
216
|
+
function isContextConsumer(object) {
|
|
217
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
218
|
+
}
|
|
219
|
+
function isContextProvider(object) {
|
|
220
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
221
|
+
}
|
|
222
|
+
function isElement(object) {
|
|
223
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
224
|
+
}
|
|
225
|
+
function isForwardRef(object) {
|
|
226
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
227
|
+
}
|
|
228
|
+
function isFragment(object) {
|
|
229
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
230
|
+
}
|
|
231
|
+
function isLazy(object) {
|
|
232
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
233
|
+
}
|
|
234
|
+
function isMemo(object) {
|
|
235
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
236
|
+
}
|
|
237
|
+
function isPortal(object) {
|
|
238
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
239
|
+
}
|
|
240
|
+
function isProfiler(object) {
|
|
241
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
242
|
+
}
|
|
243
|
+
function isStrictMode(object) {
|
|
244
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
245
|
+
}
|
|
246
|
+
function isSuspense(object) {
|
|
247
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
reactIs_development$1.AsyncMode = AsyncMode;
|
|
251
|
+
reactIs_development$1.ConcurrentMode = ConcurrentMode;
|
|
252
|
+
reactIs_development$1.ContextConsumer = ContextConsumer;
|
|
253
|
+
reactIs_development$1.ContextProvider = ContextProvider;
|
|
254
|
+
reactIs_development$1.Element = Element;
|
|
255
|
+
reactIs_development$1.ForwardRef = ForwardRef;
|
|
256
|
+
reactIs_development$1.Fragment = Fragment;
|
|
257
|
+
reactIs_development$1.Lazy = Lazy;
|
|
258
|
+
reactIs_development$1.Memo = Memo;
|
|
259
|
+
reactIs_development$1.Portal = Portal;
|
|
260
|
+
reactIs_development$1.Profiler = Profiler;
|
|
261
|
+
reactIs_development$1.StrictMode = StrictMode;
|
|
262
|
+
reactIs_development$1.Suspense = Suspense;
|
|
263
|
+
reactIs_development$1.isAsyncMode = isAsyncMode;
|
|
264
|
+
reactIs_development$1.isConcurrentMode = isConcurrentMode;
|
|
265
|
+
reactIs_development$1.isContextConsumer = isContextConsumer;
|
|
266
|
+
reactIs_development$1.isContextProvider = isContextProvider;
|
|
267
|
+
reactIs_development$1.isElement = isElement;
|
|
268
|
+
reactIs_development$1.isForwardRef = isForwardRef;
|
|
269
|
+
reactIs_development$1.isFragment = isFragment;
|
|
270
|
+
reactIs_development$1.isLazy = isLazy;
|
|
271
|
+
reactIs_development$1.isMemo = isMemo;
|
|
272
|
+
reactIs_development$1.isPortal = isPortal;
|
|
273
|
+
reactIs_development$1.isProfiler = isProfiler;
|
|
274
|
+
reactIs_development$1.isStrictMode = isStrictMode;
|
|
275
|
+
reactIs_development$1.isSuspense = isSuspense;
|
|
276
|
+
reactIs_development$1.isValidElementType = isValidElementType;
|
|
277
|
+
reactIs_development$1.typeOf = typeOf;
|
|
278
|
+
})();
|
|
279
|
+
}
|
|
280
|
+
return reactIs_development$1;
|
|
281
|
+
}
|
|
2316
282
|
|
|
2317
|
-
var
|
|
2318
|
-
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
|
|
283
|
+
var hasRequiredReactIs;
|
|
2319
284
|
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
styled$2[tagName] = styled$2(tagName);
|
|
2324
|
-
});
|
|
285
|
+
function requireReactIs () {
|
|
286
|
+
if (hasRequiredReactIs) return reactIs$1.exports;
|
|
287
|
+
hasRequiredReactIs = 1;
|
|
2325
288
|
|
|
2326
|
-
|
|
289
|
+
if (process.env.NODE_ENV === 'production') {
|
|
290
|
+
reactIs$1.exports = requireReactIs_production_min();
|
|
291
|
+
} else {
|
|
292
|
+
reactIs$1.exports = requireReactIs_development$1();
|
|
293
|
+
}
|
|
294
|
+
return reactIs$1.exports;
|
|
295
|
+
}
|
|
2327
296
|
|
|
2328
297
|
/*
|
|
2329
298
|
object-assign
|
|
@@ -3276,44 +1245,96 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
3276
1245
|
var propTypesExports = propTypes.exports;
|
|
3277
1246
|
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
3278
1247
|
|
|
1248
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
1249
|
+
|
|
1250
|
+
function chainPropTypes(propType1, propType2) {
|
|
1251
|
+
if (process.env.NODE_ENV === 'production') {
|
|
1252
|
+
return () => null;
|
|
1253
|
+
}
|
|
1254
|
+
return function validate(...args) {
|
|
1255
|
+
return propType1(...args) || propType2(...args);
|
|
1256
|
+
};
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/* eslint no-restricted-syntax: 0, prefer-template: 0, guard-for-in: 0
|
|
1260
|
+
---
|
|
1261
|
+
These rules are preventing the performance optimizations below.
|
|
1262
|
+
*/
|
|
1263
|
+
|
|
3279
1264
|
/**
|
|
3280
|
-
*
|
|
1265
|
+
* Compose classes from multiple sources.
|
|
3281
1266
|
*
|
|
3282
|
-
* @
|
|
3283
|
-
*
|
|
3284
|
-
*
|
|
1267
|
+
* @example
|
|
1268
|
+
* ```tsx
|
|
1269
|
+
* const slots = {
|
|
1270
|
+
* root: ['root', 'primary'],
|
|
1271
|
+
* label: ['label'],
|
|
1272
|
+
* };
|
|
1273
|
+
*
|
|
1274
|
+
* const getUtilityClass = (slot) => `MuiButton-${slot}`;
|
|
1275
|
+
*
|
|
1276
|
+
* const classes = {
|
|
1277
|
+
* root: 'my-root-class',
|
|
1278
|
+
* };
|
|
1279
|
+
*
|
|
1280
|
+
* const output = composeClasses(slots, getUtilityClass, classes);
|
|
1281
|
+
* // {
|
|
1282
|
+
* // root: 'MuiButton-root MuiButton-primary my-root-class',
|
|
1283
|
+
* // label: 'MuiButton-label',
|
|
1284
|
+
* // }
|
|
1285
|
+
* ```
|
|
1286
|
+
*
|
|
1287
|
+
* @param slots a list of classes for each possible slot
|
|
1288
|
+
* @param getUtilityClass a function to resolve the class based on the slot name
|
|
1289
|
+
* @param classes the input classes from props
|
|
1290
|
+
* @returns the resolved classes for all slots
|
|
3285
1291
|
*/
|
|
3286
|
-
function
|
|
3287
|
-
const
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
1292
|
+
function composeClasses(slots, getUtilityClass, classes = undefined) {
|
|
1293
|
+
const output = {};
|
|
1294
|
+
for (const slotName in slots) {
|
|
1295
|
+
const slot = slots[slotName];
|
|
1296
|
+
let buffer = '';
|
|
1297
|
+
let start = true;
|
|
1298
|
+
for (let i = 0; i < slot.length; i += 1) {
|
|
1299
|
+
const value = slot[i];
|
|
1300
|
+
if (value) {
|
|
1301
|
+
buffer += (start === true ? '' : ' ') + getUtilityClass(value);
|
|
1302
|
+
start = false;
|
|
1303
|
+
if (classes && classes[value]) {
|
|
1304
|
+
buffer += ' ' + classes[value];
|
|
1305
|
+
}
|
|
3295
1306
|
}
|
|
3296
|
-
|
|
3297
|
-
|
|
1307
|
+
}
|
|
1308
|
+
output[slotName] = buffer;
|
|
3298
1309
|
}
|
|
3299
|
-
return
|
|
1310
|
+
return output;
|
|
3300
1311
|
}
|
|
3301
1312
|
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
1313
|
+
/**
|
|
1314
|
+
* WARNING: Don't import this directly. It's imported by the code generated by
|
|
1315
|
+
* `@mui/interal-babel-plugin-minify-errors`. Make sure to always use string literals in `Error`
|
|
1316
|
+
* constructors to ensure the plugin works as expected. Supported patterns include:
|
|
1317
|
+
* throw new Error('My message');
|
|
1318
|
+
* throw new Error(`My message: ${foo}`);
|
|
1319
|
+
* throw new Error(`My message: ${foo}` + 'another string');
|
|
1320
|
+
* ...
|
|
1321
|
+
* @param {number} code
|
|
1322
|
+
*/
|
|
1323
|
+
function formatMuiErrorMessage(code, ...args) {
|
|
1324
|
+
const url = new URL(`https://mui.com/production-error/?code=${code}`);
|
|
1325
|
+
args.forEach(arg => url.searchParams.append('args[]', arg));
|
|
1326
|
+
return `Minified MUI error #${code}; visit ${url} for the full message.`;
|
|
3309
1327
|
}
|
|
3310
1328
|
|
|
3311
|
-
//
|
|
3312
|
-
|
|
3313
|
-
//
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
1329
|
+
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
|
|
1330
|
+
//
|
|
1331
|
+
// A strict capitalization should uppercase the first letter of each word in the sentence.
|
|
1332
|
+
// We only handle the first word.
|
|
1333
|
+
function capitalize(string) {
|
|
1334
|
+
if (typeof string !== 'string') {
|
|
1335
|
+
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `capitalize(string)` expects a string argument.' : formatMuiErrorMessage(7));
|
|
1336
|
+
}
|
|
1337
|
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
3317
1338
|
}
|
|
3318
1339
|
|
|
3319
1340
|
var reactIs = {exports: {}};
|
|
@@ -3662,92 +1683,22 @@ function deepmerge(target, source, options = {
|
|
|
3662
1683
|
} else {
|
|
3663
1684
|
output[key] = source[key];
|
|
3664
1685
|
}
|
|
3665
|
-
});
|
|
3666
|
-
}
|
|
3667
|
-
return output;
|
|
3668
|
-
}
|
|
3669
|
-
|
|
3670
|
-
// Sorted ASC by size. That's important.
|
|
3671
|
-
// It can't be configured as it's used statically for propTypes.
|
|
3672
|
-
const sortBreakpointsValues = values => {
|
|
3673
|
-
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
3674
|
-
key,
|
|
3675
|
-
val: values[key]
|
|
3676
|
-
})) || [];
|
|
3677
|
-
// Sort in ascending order
|
|
3678
|
-
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
3679
|
-
return breakpointsAsArray.reduce((acc, obj) => {
|
|
3680
|
-
return {
|
|
3681
|
-
...acc,
|
|
3682
|
-
[obj.key]: obj.val
|
|
3683
|
-
};
|
|
3684
|
-
}, {});
|
|
3685
|
-
};
|
|
3686
|
-
|
|
3687
|
-
// Keep in mind that @media is inclusive by the CSS specification.
|
|
3688
|
-
function createBreakpoints(breakpoints) {
|
|
3689
|
-
const {
|
|
3690
|
-
// The breakpoint **start** at this value.
|
|
3691
|
-
// For instance with the first breakpoint xs: [xs, sm).
|
|
3692
|
-
values = {
|
|
3693
|
-
xs: 0,
|
|
3694
|
-
// phone
|
|
3695
|
-
sm: 600,
|
|
3696
|
-
// tablet
|
|
3697
|
-
md: 900,
|
|
3698
|
-
// small laptop
|
|
3699
|
-
lg: 1200,
|
|
3700
|
-
// desktop
|
|
3701
|
-
xl: 1536 // large screen
|
|
3702
|
-
},
|
|
3703
|
-
unit = 'px',
|
|
3704
|
-
step = 5,
|
|
3705
|
-
...other
|
|
3706
|
-
} = breakpoints;
|
|
3707
|
-
const sortedValues = sortBreakpointsValues(values);
|
|
3708
|
-
const keys = Object.keys(sortedValues);
|
|
3709
|
-
function up(key) {
|
|
3710
|
-
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
3711
|
-
return `@media (min-width:${value}${unit})`;
|
|
3712
|
-
}
|
|
3713
|
-
function down(key) {
|
|
3714
|
-
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
3715
|
-
return `@media (max-width:${value - step / 100}${unit})`;
|
|
3716
|
-
}
|
|
3717
|
-
function between(start, end) {
|
|
3718
|
-
const endIndex = keys.indexOf(end);
|
|
3719
|
-
return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;
|
|
3720
|
-
}
|
|
3721
|
-
function only(key) {
|
|
3722
|
-
if (keys.indexOf(key) + 1 < keys.length) {
|
|
3723
|
-
return between(key, keys[keys.indexOf(key) + 1]);
|
|
3724
|
-
}
|
|
3725
|
-
return up(key);
|
|
1686
|
+
});
|
|
3726
1687
|
}
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
if (keyIndex === keys.length - 1) {
|
|
3734
|
-
return down(keys[keyIndex]);
|
|
3735
|
-
}
|
|
3736
|
-
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
1688
|
+
return output;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
function merge(acc, item) {
|
|
1692
|
+
if (!item) {
|
|
1693
|
+
return acc;
|
|
3737
1694
|
}
|
|
3738
|
-
return {
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
up,
|
|
3742
|
-
down,
|
|
3743
|
-
between,
|
|
3744
|
-
only,
|
|
3745
|
-
not,
|
|
3746
|
-
unit,
|
|
3747
|
-
...other
|
|
3748
|
-
};
|
|
1695
|
+
return deepmerge(acc, item, {
|
|
1696
|
+
clone: false // No need to clone deep, it's way faster.
|
|
1697
|
+
});
|
|
3749
1698
|
}
|
|
3750
1699
|
|
|
1700
|
+
const responsivePropType = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) : {};
|
|
1701
|
+
|
|
3751
1702
|
/**
|
|
3752
1703
|
* For using in `sx` prop to sort the breakpoint from low to high.
|
|
3753
1704
|
* Note: this function does not work and will not support multiple units.
|
|
@@ -3817,21 +1768,6 @@ function cssContainerQueries(themeInput) {
|
|
|
3817
1768
|
};
|
|
3818
1769
|
}
|
|
3819
1770
|
|
|
3820
|
-
const shape = {
|
|
3821
|
-
borderRadius: 4
|
|
3822
|
-
};
|
|
3823
|
-
|
|
3824
|
-
const responsivePropType = process.env.NODE_ENV !== 'production' ? PropTypes.oneOfType([PropTypes.number, PropTypes.string, PropTypes.object, PropTypes.array]) : {};
|
|
3825
|
-
|
|
3826
|
-
function merge(acc, item) {
|
|
3827
|
-
if (!item) {
|
|
3828
|
-
return acc;
|
|
3829
|
-
}
|
|
3830
|
-
return deepmerge(acc, item, {
|
|
3831
|
-
clone: false // No need to clone deep, it's way faster.
|
|
3832
|
-
});
|
|
3833
|
-
}
|
|
3834
|
-
|
|
3835
1771
|
// The breakpoint **start** at this value.
|
|
3836
1772
|
// For instance with the first breakpoint xs: [xs, sm[.
|
|
3837
1773
|
const values = {
|
|
@@ -3913,17 +1849,6 @@ function removeUnusedBreakpoints(breakpointKeys, style) {
|
|
|
3913
1849
|
}, style);
|
|
3914
1850
|
}
|
|
3915
1851
|
|
|
3916
|
-
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
|
|
3917
|
-
//
|
|
3918
|
-
// A strict capitalization should uppercase the first letter of each word in the sentence.
|
|
3919
|
-
// We only handle the first word.
|
|
3920
|
-
function capitalize(string) {
|
|
3921
|
-
if (typeof string !== 'string') {
|
|
3922
|
-
throw new Error(process.env.NODE_ENV !== "production" ? 'MUI: `capitalize(string)` expects a string argument.' : formatMuiErrorMessage(7));
|
|
3923
|
-
}
|
|
3924
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
3925
|
-
}
|
|
3926
|
-
|
|
3927
1852
|
function getPath(obj, path, checkVars = true) {
|
|
3928
1853
|
if (!path || typeof path !== 'string') {
|
|
3929
1854
|
return null;
|
|
@@ -4154,36 +2079,6 @@ process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {
|
|
|
4154
2079
|
return obj;
|
|
4155
2080
|
}, {}) : {};
|
|
4156
2081
|
|
|
4157
|
-
// The different signatures imply different meaning for their arguments that can't be expressed structurally.
|
|
4158
|
-
// We express the difference with variable names.
|
|
4159
|
-
|
|
4160
|
-
function createSpacing(spacingInput = 8,
|
|
4161
|
-
// Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.
|
|
4162
|
-
// Smaller components, such as icons, can align to a 4dp grid.
|
|
4163
|
-
// https://m2.material.io/design/layout/understanding-layout.html
|
|
4164
|
-
transform = createUnarySpacing({
|
|
4165
|
-
spacing: spacingInput
|
|
4166
|
-
})) {
|
|
4167
|
-
// Already transformed.
|
|
4168
|
-
if (spacingInput.mui) {
|
|
4169
|
-
return spacingInput;
|
|
4170
|
-
}
|
|
4171
|
-
const spacing = (...argsInput) => {
|
|
4172
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
4173
|
-
if (!(argsInput.length <= 4)) {
|
|
4174
|
-
console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
|
|
4175
|
-
}
|
|
4176
|
-
}
|
|
4177
|
-
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
4178
|
-
return args.map(argument => {
|
|
4179
|
-
const output = transform(argument);
|
|
4180
|
-
return typeof output === 'number' ? `${output}px` : output;
|
|
4181
|
-
}).join(' ');
|
|
4182
|
-
};
|
|
4183
|
-
spacing.mui = true;
|
|
4184
|
-
return spacing;
|
|
4185
|
-
}
|
|
4186
|
-
|
|
4187
2082
|
function compose(...styles) {
|
|
4188
2083
|
const handlers = styles.reduce((acc, style) => {
|
|
4189
2084
|
style.filterProps.forEach(prop => {
|
|
@@ -4772,65 +2667,220 @@ function unstable_createStyleFunctionSx() {
|
|
|
4772
2667
|
}
|
|
4773
2668
|
const config = theme.unstable_sxConfig ?? defaultSxConfig;
|
|
4774
2669
|
|
|
4775
|
-
/*
|
|
4776
|
-
* Receive `sxInput` as object or callback
|
|
4777
|
-
* and then recursively check keys & values to create media query object styles.
|
|
4778
|
-
* (the result will be used in `styled`)
|
|
4779
|
-
*/
|
|
4780
|
-
function traverse(sxInput) {
|
|
4781
|
-
let sxObject = sxInput;
|
|
4782
|
-
if (typeof sxInput === 'function') {
|
|
4783
|
-
sxObject = sxInput(theme);
|
|
4784
|
-
} else if (typeof sxInput !== 'object') {
|
|
4785
|
-
// value
|
|
4786
|
-
return sxInput;
|
|
4787
|
-
}
|
|
4788
|
-
if (!sxObject) {
|
|
4789
|
-
return null;
|
|
4790
|
-
}
|
|
4791
|
-
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
4792
|
-
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
4793
|
-
let css = emptyBreakpoints;
|
|
4794
|
-
Object.keys(sxObject).forEach(styleKey => {
|
|
4795
|
-
const value = callIfFn(sxObject[styleKey], theme);
|
|
4796
|
-
if (value !== null && value !== undefined) {
|
|
4797
|
-
if (typeof value === 'object') {
|
|
4798
|
-
if (config[styleKey]) {
|
|
4799
|
-
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
4800
|
-
} else {
|
|
4801
|
-
const breakpointsValues = handleBreakpoints({
|
|
4802
|
-
theme
|
|
4803
|
-
}, value, x => ({
|
|
4804
|
-
[styleKey]: x
|
|
4805
|
-
}));
|
|
4806
|
-
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
4807
|
-
css[styleKey] = styleFunctionSx({
|
|
4808
|
-
sx: value,
|
|
4809
|
-
theme,
|
|
4810
|
-
nested: true
|
|
4811
|
-
});
|
|
4812
|
-
} else {
|
|
4813
|
-
css = merge(css, breakpointsValues);
|
|
4814
|
-
}
|
|
4815
|
-
}
|
|
4816
|
-
} else {
|
|
4817
|
-
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
4818
|
-
}
|
|
4819
|
-
}
|
|
4820
|
-
});
|
|
4821
|
-
if (!nested && theme.modularCssLayers) {
|
|
4822
|
-
return {
|
|
4823
|
-
'@layer sx': sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css))
|
|
4824
|
-
};
|
|
2670
|
+
/*
|
|
2671
|
+
* Receive `sxInput` as object or callback
|
|
2672
|
+
* and then recursively check keys & values to create media query object styles.
|
|
2673
|
+
* (the result will be used in `styled`)
|
|
2674
|
+
*/
|
|
2675
|
+
function traverse(sxInput) {
|
|
2676
|
+
let sxObject = sxInput;
|
|
2677
|
+
if (typeof sxInput === 'function') {
|
|
2678
|
+
sxObject = sxInput(theme);
|
|
2679
|
+
} else if (typeof sxInput !== 'object') {
|
|
2680
|
+
// value
|
|
2681
|
+
return sxInput;
|
|
2682
|
+
}
|
|
2683
|
+
if (!sxObject) {
|
|
2684
|
+
return null;
|
|
2685
|
+
}
|
|
2686
|
+
const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);
|
|
2687
|
+
const breakpointsKeys = Object.keys(emptyBreakpoints);
|
|
2688
|
+
let css = emptyBreakpoints;
|
|
2689
|
+
Object.keys(sxObject).forEach(styleKey => {
|
|
2690
|
+
const value = callIfFn(sxObject[styleKey], theme);
|
|
2691
|
+
if (value !== null && value !== undefined) {
|
|
2692
|
+
if (typeof value === 'object') {
|
|
2693
|
+
if (config[styleKey]) {
|
|
2694
|
+
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
2695
|
+
} else {
|
|
2696
|
+
const breakpointsValues = handleBreakpoints({
|
|
2697
|
+
theme
|
|
2698
|
+
}, value, x => ({
|
|
2699
|
+
[styleKey]: x
|
|
2700
|
+
}));
|
|
2701
|
+
if (objectsHaveSameKeys(breakpointsValues, value)) {
|
|
2702
|
+
css[styleKey] = styleFunctionSx({
|
|
2703
|
+
sx: value,
|
|
2704
|
+
theme,
|
|
2705
|
+
nested: true
|
|
2706
|
+
});
|
|
2707
|
+
} else {
|
|
2708
|
+
css = merge(css, breakpointsValues);
|
|
2709
|
+
}
|
|
2710
|
+
}
|
|
2711
|
+
} else {
|
|
2712
|
+
css = merge(css, getThemeValue(styleKey, value, theme, config));
|
|
2713
|
+
}
|
|
2714
|
+
}
|
|
2715
|
+
});
|
|
2716
|
+
if (!nested && theme.modularCssLayers) {
|
|
2717
|
+
return {
|
|
2718
|
+
'@layer sx': sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css))
|
|
2719
|
+
};
|
|
2720
|
+
}
|
|
2721
|
+
return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css));
|
|
2722
|
+
}
|
|
2723
|
+
return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);
|
|
2724
|
+
}
|
|
2725
|
+
return styleFunctionSx;
|
|
2726
|
+
}
|
|
2727
|
+
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
2728
|
+
styleFunctionSx.filterProps = ['sx'];
|
|
2729
|
+
|
|
2730
|
+
/**
|
|
2731
|
+
* @mui/styled-engine v7.2.0
|
|
2732
|
+
*
|
|
2733
|
+
* @license MIT
|
|
2734
|
+
* This source code is licensed under the MIT license found in the
|
|
2735
|
+
* LICENSE file in the root directory of this source tree.
|
|
2736
|
+
*/
|
|
2737
|
+
function styled$1(tag, options) {
|
|
2738
|
+
const stylesFactory = emStyled(tag, options);
|
|
2739
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2740
|
+
return (...styles) => {
|
|
2741
|
+
const component = typeof tag === 'string' ? `"${tag}"` : 'component';
|
|
2742
|
+
if (styles.length === 0) {
|
|
2743
|
+
console.error([`MUI: Seems like you called \`styled(${component})()\` without a \`style\` argument.`, 'You must provide a `styles` argument: `styled("div")(styleYouForgotToPass)`.'].join('\n'));
|
|
2744
|
+
} else if (styles.some(style => style === undefined)) {
|
|
2745
|
+
console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);
|
|
2746
|
+
}
|
|
2747
|
+
return stylesFactory(...styles);
|
|
2748
|
+
};
|
|
2749
|
+
}
|
|
2750
|
+
return stylesFactory;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2754
|
+
function internal_mutateStyles(tag, processor) {
|
|
2755
|
+
// Emotion attaches all the styles as `__emotion_styles`.
|
|
2756
|
+
// Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186
|
|
2757
|
+
if (Array.isArray(tag.__emotion_styles)) {
|
|
2758
|
+
tag.__emotion_styles = processor(tag.__emotion_styles);
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
// Emotion only accepts an array, but we want to avoid allocations
|
|
2763
|
+
const wrapper = [];
|
|
2764
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
2765
|
+
function internal_serializeStyles(styles) {
|
|
2766
|
+
wrapper[0] = styles;
|
|
2767
|
+
return serializeStyles(wrapper);
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
// Sorted ASC by size. That's important.
|
|
2771
|
+
// It can't be configured as it's used statically for propTypes.
|
|
2772
|
+
const sortBreakpointsValues = values => {
|
|
2773
|
+
const breakpointsAsArray = Object.keys(values).map(key => ({
|
|
2774
|
+
key,
|
|
2775
|
+
val: values[key]
|
|
2776
|
+
})) || [];
|
|
2777
|
+
// Sort in ascending order
|
|
2778
|
+
breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);
|
|
2779
|
+
return breakpointsAsArray.reduce((acc, obj) => {
|
|
2780
|
+
return {
|
|
2781
|
+
...acc,
|
|
2782
|
+
[obj.key]: obj.val
|
|
2783
|
+
};
|
|
2784
|
+
}, {});
|
|
2785
|
+
};
|
|
2786
|
+
|
|
2787
|
+
// Keep in mind that @media is inclusive by the CSS specification.
|
|
2788
|
+
function createBreakpoints(breakpoints) {
|
|
2789
|
+
const {
|
|
2790
|
+
// The breakpoint **start** at this value.
|
|
2791
|
+
// For instance with the first breakpoint xs: [xs, sm).
|
|
2792
|
+
values = {
|
|
2793
|
+
xs: 0,
|
|
2794
|
+
// phone
|
|
2795
|
+
sm: 600,
|
|
2796
|
+
// tablet
|
|
2797
|
+
md: 900,
|
|
2798
|
+
// small laptop
|
|
2799
|
+
lg: 1200,
|
|
2800
|
+
// desktop
|
|
2801
|
+
xl: 1536 // large screen
|
|
2802
|
+
},
|
|
2803
|
+
unit = 'px',
|
|
2804
|
+
step = 5,
|
|
2805
|
+
...other
|
|
2806
|
+
} = breakpoints;
|
|
2807
|
+
const sortedValues = sortBreakpointsValues(values);
|
|
2808
|
+
const keys = Object.keys(sortedValues);
|
|
2809
|
+
function up(key) {
|
|
2810
|
+
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
2811
|
+
return `@media (min-width:${value}${unit})`;
|
|
2812
|
+
}
|
|
2813
|
+
function down(key) {
|
|
2814
|
+
const value = typeof values[key] === 'number' ? values[key] : key;
|
|
2815
|
+
return `@media (max-width:${value - step / 100}${unit})`;
|
|
2816
|
+
}
|
|
2817
|
+
function between(start, end) {
|
|
2818
|
+
const endIndex = keys.indexOf(end);
|
|
2819
|
+
return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;
|
|
2820
|
+
}
|
|
2821
|
+
function only(key) {
|
|
2822
|
+
if (keys.indexOf(key) + 1 < keys.length) {
|
|
2823
|
+
return between(key, keys[keys.indexOf(key) + 1]);
|
|
2824
|
+
}
|
|
2825
|
+
return up(key);
|
|
2826
|
+
}
|
|
2827
|
+
function not(key) {
|
|
2828
|
+
// handle first and last key separately, for better readability
|
|
2829
|
+
const keyIndex = keys.indexOf(key);
|
|
2830
|
+
if (keyIndex === 0) {
|
|
2831
|
+
return up(keys[1]);
|
|
2832
|
+
}
|
|
2833
|
+
if (keyIndex === keys.length - 1) {
|
|
2834
|
+
return down(keys[keyIndex]);
|
|
2835
|
+
}
|
|
2836
|
+
return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');
|
|
2837
|
+
}
|
|
2838
|
+
return {
|
|
2839
|
+
keys,
|
|
2840
|
+
values: sortedValues,
|
|
2841
|
+
up,
|
|
2842
|
+
down,
|
|
2843
|
+
between,
|
|
2844
|
+
only,
|
|
2845
|
+
not,
|
|
2846
|
+
unit,
|
|
2847
|
+
...other
|
|
2848
|
+
};
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
const shape = {
|
|
2852
|
+
borderRadius: 4
|
|
2853
|
+
};
|
|
2854
|
+
|
|
2855
|
+
// The different signatures imply different meaning for their arguments that can't be expressed structurally.
|
|
2856
|
+
// We express the difference with variable names.
|
|
2857
|
+
|
|
2858
|
+
function createSpacing(spacingInput = 8,
|
|
2859
|
+
// Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.
|
|
2860
|
+
// Smaller components, such as icons, can align to a 4dp grid.
|
|
2861
|
+
// https://m2.material.io/design/layout/understanding-layout.html
|
|
2862
|
+
transform = createUnarySpacing({
|
|
2863
|
+
spacing: spacingInput
|
|
2864
|
+
})) {
|
|
2865
|
+
// Already transformed.
|
|
2866
|
+
if (spacingInput.mui) {
|
|
2867
|
+
return spacingInput;
|
|
2868
|
+
}
|
|
2869
|
+
const spacing = (...argsInput) => {
|
|
2870
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2871
|
+
if (!(argsInput.length <= 4)) {
|
|
2872
|
+
console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);
|
|
4825
2873
|
}
|
|
4826
|
-
return sortContainerQueries(theme, removeUnusedBreakpoints(breakpointsKeys, css));
|
|
4827
2874
|
}
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
2875
|
+
const args = argsInput.length === 0 ? [1] : argsInput;
|
|
2876
|
+
return args.map(argument => {
|
|
2877
|
+
const output = transform(argument);
|
|
2878
|
+
return typeof output === 'number' ? `${output}px` : output;
|
|
2879
|
+
}).join(' ');
|
|
2880
|
+
};
|
|
2881
|
+
spacing.mui = true;
|
|
2882
|
+
return spacing;
|
|
4831
2883
|
}
|
|
4832
|
-
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
4833
|
-
styleFunctionSx.filterProps = ['sx'];
|
|
4834
2884
|
|
|
4835
2885
|
/**
|
|
4836
2886
|
* A universal utility to style components with multiple color modes. Always use it from the theme object.
|
|
@@ -4978,8 +3028,6 @@ const createClassNameGenerator = () => {
|
|
|
4978
3028
|
};
|
|
4979
3029
|
const ClassNameGenerator = createClassNameGenerator();
|
|
4980
3030
|
|
|
4981
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
4982
|
-
|
|
4983
3031
|
const globalStateClasses = {
|
|
4984
3032
|
active: 'active',
|
|
4985
3033
|
checked: 'checked',
|
|
@@ -6112,59 +4160,71 @@ function createGetColorSchemeSelector(selector) {
|
|
|
6112
4160
|
};
|
|
6113
4161
|
}
|
|
6114
4162
|
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
4163
|
+
const common = {
|
|
4164
|
+
black: '#000',
|
|
4165
|
+
white: '#fff'
|
|
4166
|
+
};
|
|
6119
4167
|
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
4168
|
+
const grey = {
|
|
4169
|
+
50: '#fafafa',
|
|
4170
|
+
100: '#f5f5f5',
|
|
4171
|
+
200: '#eeeeee',
|
|
4172
|
+
300: '#e0e0e0',
|
|
4173
|
+
400: '#bdbdbd',
|
|
4174
|
+
500: '#9e9e9e',
|
|
4175
|
+
600: '#757575',
|
|
4176
|
+
700: '#616161',
|
|
4177
|
+
800: '#424242',
|
|
4178
|
+
900: '#212121',
|
|
4179
|
+
A100: '#f5f5f5',
|
|
4180
|
+
A200: '#eeeeee',
|
|
4181
|
+
A400: '#bdbdbd',
|
|
4182
|
+
A700: '#616161'
|
|
4183
|
+
};
|
|
4184
|
+
|
|
4185
|
+
const purple = {
|
|
4186
|
+
50: '#f3e5f5',
|
|
4187
|
+
200: '#ce93d8',
|
|
4188
|
+
300: '#ba68c8',
|
|
4189
|
+
400: '#ab47bc',
|
|
4190
|
+
500: '#9c27b0',
|
|
4191
|
+
700: '#7b1fa2'};
|
|
4192
|
+
|
|
4193
|
+
const red = {
|
|
4194
|
+
300: '#e57373',
|
|
4195
|
+
400: '#ef5350',
|
|
4196
|
+
500: '#f44336',
|
|
4197
|
+
700: '#d32f2f',
|
|
4198
|
+
800: '#c62828'};
|
|
4199
|
+
|
|
4200
|
+
const orange = {
|
|
4201
|
+
300: '#ffb74d',
|
|
4202
|
+
400: '#ffa726',
|
|
4203
|
+
500: '#ff9800',
|
|
4204
|
+
700: '#f57c00',
|
|
4205
|
+
900: '#e65100'};
|
|
4206
|
+
|
|
4207
|
+
const blue = {
|
|
4208
|
+
50: '#e3f2fd',
|
|
4209
|
+
200: '#90caf9',
|
|
4210
|
+
400: '#42a5f5',
|
|
4211
|
+
700: '#1976d2',
|
|
4212
|
+
800: '#1565c0'};
|
|
4213
|
+
|
|
4214
|
+
const lightBlue = {
|
|
4215
|
+
300: '#4fc3f7',
|
|
4216
|
+
400: '#29b6f6',
|
|
4217
|
+
500: '#03a9f4',
|
|
4218
|
+
700: '#0288d1',
|
|
4219
|
+
900: '#01579b'};
|
|
4220
|
+
|
|
4221
|
+
const green = {
|
|
4222
|
+
300: '#81c784',
|
|
4223
|
+
400: '#66bb6a',
|
|
4224
|
+
500: '#4caf50',
|
|
4225
|
+
700: '#388e3c',
|
|
4226
|
+
800: '#2e7d32',
|
|
4227
|
+
900: '#1b5e20'};
|
|
6168
4228
|
|
|
6169
4229
|
function getLight() {
|
|
6170
4230
|
return {
|
|
@@ -7420,6 +5480,8 @@ function createTheme(options = {},
|
|
|
7420
5480
|
|
|
7421
5481
|
const defaultTheme = createTheme();
|
|
7422
5482
|
|
|
5483
|
+
var THEME_ID = '$$material';
|
|
5484
|
+
|
|
7423
5485
|
// copied from @mui/system/createStyled
|
|
7424
5486
|
function slotShouldForwardProp(prop) {
|
|
7425
5487
|
return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';
|
|
@@ -7453,15 +5515,6 @@ function useDefaultProps(params) {
|
|
|
7453
5515
|
return useDefaultProps$1(params);
|
|
7454
5516
|
}
|
|
7455
5517
|
|
|
7456
|
-
function chainPropTypes(propType1, propType2) {
|
|
7457
|
-
if (process.env.NODE_ENV === 'production') {
|
|
7458
|
-
return () => null;
|
|
7459
|
-
}
|
|
7460
|
-
return function validate(...args) {
|
|
7461
|
-
return propType1(...args) || propType2(...args);
|
|
7462
|
-
};
|
|
7463
|
-
}
|
|
7464
|
-
|
|
7465
5518
|
/**
|
|
7466
5519
|
* Type guard to check if the object has a "main" property of type string.
|
|
7467
5520
|
*
|
|
@@ -7684,7 +5737,7 @@ const CircularProgress = /*#__PURE__*/React.forwardRef(function CircularProgress
|
|
|
7684
5737
|
circleStyle.strokeDashoffset = `${((100 - value) / 100 * circumference).toFixed(3)}px`;
|
|
7685
5738
|
rootStyle.transform = 'rotate(-90deg)';
|
|
7686
5739
|
}
|
|
7687
|
-
return /*#__PURE__*/jsx
|
|
5740
|
+
return /*#__PURE__*/jsx(CircularProgressRoot, {
|
|
7688
5741
|
className: clsx(classes.root, className),
|
|
7689
5742
|
style: {
|
|
7690
5743
|
width: size,
|
|
@@ -7697,11 +5750,11 @@ const CircularProgress = /*#__PURE__*/React.forwardRef(function CircularProgress
|
|
|
7697
5750
|
role: "progressbar",
|
|
7698
5751
|
...rootProps,
|
|
7699
5752
|
...other,
|
|
7700
|
-
children: /*#__PURE__*/jsx
|
|
5753
|
+
children: /*#__PURE__*/jsx(CircularProgressSVG, {
|
|
7701
5754
|
className: classes.svg,
|
|
7702
5755
|
ownerState: ownerState,
|
|
7703
5756
|
viewBox: `${SIZE / 2} ${SIZE / 2} ${SIZE} ${SIZE}`,
|
|
7704
|
-
children: /*#__PURE__*/jsx
|
|
5757
|
+
children: /*#__PURE__*/jsx(CircularProgressCircle, {
|
|
7705
5758
|
className: classes.circle,
|
|
7706
5759
|
style: circleStyle,
|
|
7707
5760
|
ownerState: ownerState,
|
|
@@ -7781,19 +5834,43 @@ process.env.NODE_ENV !== "production" ? CircularProgress.propTypes /* remove-pro
|
|
|
7781
5834
|
|
|
7782
5835
|
// Loading component renders a circular spinner above an element (usually a plot)
|
|
7783
5836
|
var Loading = function () {
|
|
7784
|
-
return (jsx
|
|
5837
|
+
return (jsx("div", { className: "loading-overlay", children: jsx(CircularProgress, {}) }));
|
|
7785
5838
|
};
|
|
7786
5839
|
|
|
7787
5840
|
var Plot$2 = lazy(function () { return import('react-plotly.js'); });
|
|
7788
5841
|
var HistogramPlot = function (props) {
|
|
7789
|
-
var _a;
|
|
7790
|
-
var data = props.data, title = props.title, xAxisTitle = props.xAxisTitle,
|
|
5842
|
+
var _a, _b;
|
|
5843
|
+
var data = props.data, title = props.title, xAxisTitle = props.xAxisTitle, _c = props.barColor, barColor = _c === void 0 ? 'rgb(72, 72, 74)' : _c, _d = props.unselectedBarColor, unselectedBarColor = _d === void 0 ? 'rgba(203, 195, 195, 0.88)' : _d, _e = props.selectorsColor, selectorsColor = _e === void 0 ? 'black' : _e, _f = props.showMeanLine, showMeanLine = _f === void 0 ? true : _f, _g = props.showAllDataMeanLine, showAllDataMeanLine = _g === void 0 ? true : _g, containerStyleOverrides = props.containerStyleOverrides, _h = props.unselectedData, unselectedData = _h === void 0 ? [] : _h, _j = props.handleClickOrSelection, handleClickOrSelection = _j === void 0 ? function () { } : _j, _k = props.onDeselect, onDeselect = _k === void 0 ? function () { } : _k, plotId = props.plotId, _l = props.selectByBin, selectByBin = _l === void 0 ? false : _l;
|
|
7791
5844
|
// Ref for plot container
|
|
7792
5845
|
var containerRef = useRef(null);
|
|
7793
5846
|
// Track any selections made in this plot so we can style the selection box.
|
|
7794
|
-
var
|
|
5847
|
+
var _m = useState(null), selectedRange = _m[0], setSelectedRange = _m[1];
|
|
7795
5848
|
// Set the bins based on the entire data set.
|
|
7796
5849
|
var nBins = Math.ceil(Math.sqrt(data.length + unselectedData.length));
|
|
5850
|
+
// Plotly determines "nice" bins which consequently means it internally decides the axis range. We need
|
|
5851
|
+
// to access that information once the plot has been initialized so that we can prevent the
|
|
5852
|
+
// axis range from changing during interaction. Dates use strings.
|
|
5853
|
+
var _o = useState(undefined), fixedXAxisRange = _o[0], setFixedXAxisRange = _o[1];
|
|
5854
|
+
// Once the plot is drawn, record the initial axis range so we can keep it fixed.
|
|
5855
|
+
// figure should be Readonly<Plotly.Figure> but react-plotly.js doesn't expose that type, so we use any.
|
|
5856
|
+
var handlePlotUpdate = function (figure, graphDiv) {
|
|
5857
|
+
var _a;
|
|
5858
|
+
if (!fixedXAxisRange) {
|
|
5859
|
+
var currentLayout = graphDiv._fullLayout;
|
|
5860
|
+
if ((_a = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.xaxis) === null || _a === void 0 ? void 0 : _a.range) {
|
|
5861
|
+
var range = currentLayout.xaxis.range;
|
|
5862
|
+
// Skip temporary [-1, 1] range
|
|
5863
|
+
if (range[0] === -1 && range[1] === 1) {
|
|
5864
|
+
return;
|
|
5865
|
+
}
|
|
5866
|
+
var computedRange = typeof (range[0]) === 'string'
|
|
5867
|
+
? [new Date(range[0]), new Date(range[1])]
|
|
5868
|
+
: [range[0], range[1]];
|
|
5869
|
+
console.log('Captured range from onUpdate:', computedRange);
|
|
5870
|
+
setFixedXAxisRange(computedRange);
|
|
5871
|
+
}
|
|
5872
|
+
}
|
|
5873
|
+
};
|
|
7797
5874
|
// Create handler for click event that can use event data to update the plot if desired.
|
|
7798
5875
|
var handleClick = function (event) {
|
|
7799
5876
|
if (!event || !event.points || event.points.length === 0) {
|
|
@@ -7860,18 +5937,68 @@ var HistogramPlot = function (props) {
|
|
|
7860
5937
|
var minValue;
|
|
7861
5938
|
var maxValue;
|
|
7862
5939
|
if (typeof event.range.x[0] === 'string' && typeof event.range.x[1] === 'string') {
|
|
7863
|
-
// Then we must be dealing with dates
|
|
7864
|
-
|
|
7865
|
-
|
|
7866
|
-
|
|
5940
|
+
// Then we are must be dealing with dates
|
|
5941
|
+
if (selectByBin) {
|
|
5942
|
+
// Set selected range to include the whole bin if at least half the bin is within the explicit range
|
|
5943
|
+
// Plotly already tells us which bins were selected based on this logic. These are the points in the event.
|
|
5944
|
+
if (event.points && event.points.length > 0) {
|
|
5945
|
+
// Means at least one bin has been selected
|
|
5946
|
+
var firstBinMidPoint = new Date(event.points[0].x).getTime();
|
|
5947
|
+
var lastBinMidPoint = new Date(event.points[event.points.length - 1].x).getTime();
|
|
5948
|
+
var binSize = event.points[0].data.xbins.size;
|
|
5949
|
+
minValue = new Date(firstBinMidPoint - binSize / 2);
|
|
5950
|
+
maxValue = new Date(lastBinMidPoint + binSize / 2);
|
|
5951
|
+
}
|
|
5952
|
+
else {
|
|
5953
|
+
// No bins selected, so the range should be empty.
|
|
5954
|
+
minValue = new Date(event.range.x[0]);
|
|
5955
|
+
maxValue = minValue;
|
|
5956
|
+
}
|
|
5957
|
+
}
|
|
5958
|
+
else {
|
|
5959
|
+
// Set the range based on the explicit selection boundaries
|
|
5960
|
+
minValue = new Date(event.range.x[0]);
|
|
5961
|
+
maxValue = new Date(event.range.x[1]);
|
|
5962
|
+
}
|
|
7867
5963
|
}
|
|
7868
5964
|
else {
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
|
|
5965
|
+
// Handle selection for numbers
|
|
5966
|
+
if (selectByBin) {
|
|
5967
|
+
// Set the range based on the bins selected. Plotly will include a bin in event.points if
|
|
5968
|
+
// at least half of it is selected.
|
|
5969
|
+
if (event.points && event.points.length > 0) {
|
|
5970
|
+
var firstBinMidPoint = event.points[0].x;
|
|
5971
|
+
var lastBinMidPoint = event.points[event.points.length - 1].x;
|
|
5972
|
+
var binSize = event.points[0].data.xbins.size;
|
|
5973
|
+
var roundedMinValue = firstBinMidPoint - binSize / 2;
|
|
5974
|
+
var roundedMaxValue = lastBinMidPoint + binSize / 2;
|
|
5975
|
+
minValue = roundedMinValue;
|
|
5976
|
+
maxValue = roundedMaxValue;
|
|
5977
|
+
}
|
|
5978
|
+
else {
|
|
5979
|
+
// No bins selected, so set the range to be empty.
|
|
5980
|
+
minValue = event.range.x[0];
|
|
5981
|
+
maxValue = minValue;
|
|
5982
|
+
}
|
|
5983
|
+
}
|
|
5984
|
+
else {
|
|
5985
|
+
// Set the range based on the explicit selection boundaries
|
|
5986
|
+
minValue = event.range.x[0];
|
|
5987
|
+
maxValue = event.range.x[1];
|
|
5988
|
+
}
|
|
5989
|
+
}
|
|
5990
|
+
if (minValue !== undefined && maxValue !== undefined) {
|
|
5991
|
+
// Update selected range. Have to be strict about types.
|
|
5992
|
+
if (typeof minValue === 'number' && typeof maxValue === 'number') {
|
|
5993
|
+
setSelectedRange([minValue, maxValue]);
|
|
5994
|
+
}
|
|
5995
|
+
else if (minValue instanceof Date && maxValue instanceof Date) {
|
|
5996
|
+
setSelectedRange([minValue, maxValue]);
|
|
5997
|
+
}
|
|
5998
|
+
handleClickOrSelection(minValue, maxValue);
|
|
7872
5999
|
}
|
|
7873
|
-
handleClickOrSelection(minValue, maxValue);
|
|
7874
6000
|
};
|
|
6001
|
+
console.log('fixed range', fixedXAxisRange);
|
|
7875
6002
|
// Create the selected range box
|
|
7876
6003
|
var selectedRangeBox = useMemo(function () {
|
|
7877
6004
|
if (!selectedRange)
|
|
@@ -7928,34 +6055,36 @@ var HistogramPlot = function (props) {
|
|
|
7928
6055
|
},
|
|
7929
6056
|
unselectedTrace,
|
|
7930
6057
|
];
|
|
7931
|
-
// Calculate the mean using normalized data
|
|
6058
|
+
// Calculate the mean of the selected data using normalized data
|
|
7932
6059
|
var meanValue = (_a = calculateMean(data)) !== null && _a !== void 0 ? _a : 0; // Default to 0 if no data
|
|
7933
|
-
// Calculate fixed x-axis range based on all data (selected + unselected) to prevent axis jumping
|
|
7934
|
-
var allData = __spreadArray(__spreadArray([], data, true), unselectedData, true);
|
|
7935
|
-
var dataMin = allData.length > 0 ? Math.min.apply(Math, (isDateArray(allData) ? allData.map(function (d) { return d.getTime(); }) : allData)) : 0;
|
|
7936
|
-
var dataMax = allData.length > 0 ? Math.max.apply(Math, (isDateArray(allData) ? allData.map(function (d) { return d.getTime(); }) : allData)) : 0;
|
|
7937
|
-
// Add some padding to the range so the plot isn't so squished
|
|
7938
|
-
var range = dataMax - dataMin;
|
|
7939
|
-
var padding = range * 0.02;
|
|
7940
|
-
var fixedXAxisRange = [
|
|
7941
|
-
isDateArray(allData) ? new Date(dataMin - padding) : dataMin - padding,
|
|
7942
|
-
isDateArray(allData) ? new Date(dataMax + padding) : dataMax + padding
|
|
7943
|
-
];
|
|
7944
6060
|
var meanLineRadius = 0.01; // distance from the top of the y axis to the top/bottom end of the mean line
|
|
7945
|
-
var meanLine = showMeanLine ? {
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
// Draw
|
|
7958
|
-
var
|
|
6061
|
+
var meanLine = showMeanLine ? [{
|
|
6062
|
+
type: 'line',
|
|
6063
|
+
x0: meanValue,
|
|
6064
|
+
y0: 1 - meanLineRadius,
|
|
6065
|
+
x1: meanValue,
|
|
6066
|
+
yref: 'paper',
|
|
6067
|
+
y1: 1 + meanLineRadius + 0.04, // Add extra length above to make the line look centered on the y-axis top.
|
|
6068
|
+
line: {
|
|
6069
|
+
color: barColor,
|
|
6070
|
+
width: 1.5,
|
|
6071
|
+
}
|
|
6072
|
+
}] : [];
|
|
6073
|
+
// Draw mean line for all data
|
|
6074
|
+
var allData = __spreadArray(__spreadArray([], data, true), unselectedData, true);
|
|
6075
|
+
var allDataMeanValue = (_b = calculateMean(allData)) !== null && _b !== void 0 ? _b : 0;
|
|
6076
|
+
var allDataMeanLine = (showAllDataMeanLine && unselectedData.length > 0) ? [{
|
|
6077
|
+
type: 'line',
|
|
6078
|
+
x0: allDataMeanValue,
|
|
6079
|
+
y0: 1 - meanLineRadius,
|
|
6080
|
+
x1: allDataMeanValue,
|
|
6081
|
+
yref: 'paper',
|
|
6082
|
+
y1: 1 + meanLineRadius + 0.04, // Add extra length above to make the line look centered on the y-axis top.
|
|
6083
|
+
line: {
|
|
6084
|
+
color: unselectedBarColor,
|
|
6085
|
+
width: 1.5,
|
|
6086
|
+
}
|
|
6087
|
+
}] : [];
|
|
7959
6088
|
var layout = {
|
|
7960
6089
|
title: {
|
|
7961
6090
|
text: title,
|
|
@@ -7967,7 +6096,7 @@ var HistogramPlot = function (props) {
|
|
|
7967
6096
|
height: undefined, // Let autosize handle height
|
|
7968
6097
|
margin: {
|
|
7969
6098
|
l: 50,
|
|
7970
|
-
r:
|
|
6099
|
+
r: 35, // Balance between ensuring the mean annotation doesn't get cut off and having too much margin.
|
|
7971
6100
|
t: title ? 80 : 30,
|
|
7972
6101
|
b: 50,
|
|
7973
6102
|
pad: 4
|
|
@@ -8012,19 +6141,18 @@ var HistogramPlot = function (props) {
|
|
|
8012
6141
|
bargap: 0.03, // Gap between bars
|
|
8013
6142
|
dragmode: 'select', // Enable drag to select
|
|
8014
6143
|
selectdirection: 'h', // User can select in horizontal direction only
|
|
8015
|
-
shapes: __spreadArray([
|
|
6144
|
+
shapes: __spreadArray(__spreadArray(__spreadArray([], allDataMeanLine, true), meanLine, true), selectedRangeBox, true), // Add the mean line and selection box
|
|
8016
6145
|
annotations: (showMeanLine && meanLine) ? [{
|
|
8017
6146
|
x: meanValue,
|
|
8018
|
-
y: 1 + meanLineRadius + 0.
|
|
6147
|
+
y: 1 + meanLineRadius + 0.04, // Position above the mean line. Value set with respect to the paper coordinates.
|
|
8019
6148
|
yref: 'paper',
|
|
8020
|
-
text: "
|
|
8021
|
-
month: '
|
|
6149
|
+
text: "<span style=\"font-weight:300\">AVG </span><span style=\"font-weight:600\">".concat(isDateArray(data) ? new Date(meanValue).toLocaleDateString('en-US', {
|
|
6150
|
+
month: '2-digit',
|
|
8022
6151
|
day: '2-digit',
|
|
8023
|
-
year: '
|
|
8024
|
-
}) : meanValue.toFixed(2)),
|
|
8025
|
-
xanchor:
|
|
8026
|
-
yanchor: '
|
|
8027
|
-
xshift: drawMeanAnnotationOnRight ? -3 : 3,
|
|
6152
|
+
year: '2-digit'
|
|
6153
|
+
}) : meanValue.toFixed(2), "</span>"),
|
|
6154
|
+
xanchor: 'center',
|
|
6155
|
+
yanchor: 'bottom',
|
|
8028
6156
|
showarrow: false,
|
|
8029
6157
|
font: {
|
|
8030
6158
|
color: barColor,
|
|
@@ -8040,10 +6168,10 @@ var HistogramPlot = function (props) {
|
|
|
8040
6168
|
staticPlot: false, // Enable interactivity
|
|
8041
6169
|
};
|
|
8042
6170
|
var containerStyles = __assign({ width: "100%", height: "100%", position: "relative" }, containerStyleOverrides);
|
|
8043
|
-
return (jsx
|
|
6171
|
+
return (jsx("div", { ref: containerRef, className: "plot-container ".concat(plotId), style: __assign({ '--selection-color': selectorsColor }, containerStyles), children: jsx(Suspense, { fallback: jsx(Loading, {}), children: jsx(Fragment, { children: jsx(Plot$2, { data: plotlyData, layout: layout, config: config, onSelected: handleSelection, onClick: handleClick, onDeselect: function () {
|
|
8044
6172
|
onDeselect();
|
|
8045
6173
|
setSelectedRange(null); // Remove selected box
|
|
8046
|
-
}, useResizeHandler: true, style: {
|
|
6174
|
+
}, onUpdate: handlePlotUpdate, useResizeHandler: true, style: {
|
|
8047
6175
|
width: "100%",
|
|
8048
6176
|
height: "100%",
|
|
8049
6177
|
display: "block"
|
|
@@ -8149,7 +6277,7 @@ var RadialHistogramPlot = function (props) {
|
|
|
8149
6277
|
staticPlot: false,
|
|
8150
6278
|
};
|
|
8151
6279
|
var containerStyles = __assign({ width: "100%", height: "100%", position: "relative" }, containerStyleOverrides);
|
|
8152
|
-
return (jsx
|
|
6280
|
+
return (jsx("div", { ref: containerRef, className: "plot-container radial-histogram-container", style: __assign({ '--selection-color': selectorsColor }, containerStyles), children: jsx(Suspense, { fallback: jsx(Loading, {}), children: jsx(Plot$1, { data: plotlyData, layout: layout, config: config, onSelected: onSelected, onClick: onClick, useResizeHandler: true, style: {
|
|
8153
6281
|
width: "100%",
|
|
8154
6282
|
height: "100%",
|
|
8155
6283
|
display: "block"
|
|
@@ -8172,7 +6300,7 @@ var TestPlot = function (props) {
|
|
|
8172
6300
|
xaxis: { title: { text: (_a = props.xaxisTitle) !== null && _a !== void 0 ? _a : 'X Axis' } },
|
|
8173
6301
|
yaxis: { title: { text: (_b = props.yaxisTitle) !== null && _b !== void 0 ? _b : 'Y Axis' } },
|
|
8174
6302
|
};
|
|
8175
|
-
return jsx
|
|
6303
|
+
return jsx(Plot, { data: data, layout: layout });
|
|
8176
6304
|
};
|
|
8177
6305
|
|
|
8178
6306
|
export { HistogramPlot, RadialHistogramPlot, TestPlot };
|