Commit 09dda261 by extdoanh

Intial Base

parents
NODE_ENV=development
SNOWPACK_PUBLIC_TIMEOUT = 60000
SNOWPACK_PUBLIC_BASE_URL = 'https://avinor-apim-dev.azure-api.net/dev/public/'
SNOWPACK_PUBLIC_SUBSCRIPTION_KEY = '855a06968b9742eebd1dc71c745f5198'
\ No newline at end of file
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore
# Node artifact files
node_modules/
dist/
.next/
# Compiled Java class files
*.class
# Compiled Python bytecode
*.py[cod]
# Log files
*.log
# Package files
*.jar
# Maven
target/
dist/
# JetBrains IDE
.idea/
# Unit test reports
TEST*.xml
# Generated by MacOS
.DS_Store
# Generated by Windows
Thumbs.db
# Applications
*.app
*.exe
*.war
# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv
# Avinor community
A news article website
\ No newline at end of file
export const MODE = "production";
export const NODE_ENV = "production";
export const SSR = false;
\ No newline at end of file
import { r as react } from '../common/index-57a74e37.js';
import { _ as _extends } from '../common/_index-4fa100fd.js';
import { c as createCommonjsModule } from '../common/_commonjsHelpers-8c19dec8.js';
import '../common/hoist-non-react-statics.cjs-43de917e.js';
/*
Based off glamor's StyleSheet, thanks Sunil ❤️
high performance StyleSheet for css-in-js systems
- uses multiple style tags behind the scenes for millions of rules
- uses `insertRule` for appending in production for *much* faster performance
// usage
import { StyleSheet } from '@emotion/sheet'
let styleSheet = new StyleSheet({ key: '', container: document.head })
styleSheet.insert('#box { border: 1px solid red; }')
- appends a css rule into the stylesheet
styleSheet.flush()
- empties the stylesheet of all its contents
*/
// $FlowFixMe
function sheetForTag(tag) {
if (tag.sheet) {
// $FlowFixMe
return tag.sheet;
} // this weirdness brought to you by firefox
/* istanbul ignore next */
for (var i = 0; i < document.styleSheets.length; i++) {
if (document.styleSheets[i].ownerNode === tag) {
// $FlowFixMe
return document.styleSheets[i];
}
}
}
function createStyleElement(options) {
var tag = document.createElement('style');
tag.setAttribute('data-emotion', options.key);
if (options.nonce !== undefined) {
tag.setAttribute('nonce', options.nonce);
}
tag.appendChild(document.createTextNode(''));
tag.setAttribute('data-s', '');
return tag;
}
var StyleSheet = /*#__PURE__*/function () {
function StyleSheet(options) {
var _this = this;
this._insertTag = function (tag) {
var before;
if (_this.tags.length === 0) {
before = _this.prepend ? _this.container.firstChild : _this.before;
} else {
before = _this.tags[_this.tags.length - 1].nextSibling;
}
_this.container.insertBefore(tag, before);
_this.tags.push(tag);
};
this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy;
this.tags = [];
this.ctr = 0;
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
this.key = options.key;
this.container = options.container;
this.prepend = options.prepend;
this.before = null;
}
var _proto = StyleSheet.prototype;
_proto.hydrate = function hydrate(nodes) {
nodes.forEach(this._insertTag);
};
_proto.insert = function insert(rule) {
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
// it's 1 in dev because we insert source maps that map a single rule to a location
// and you can only have one source map per style tag
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
this._insertTag(createStyleElement(this));
}
var tag = this.tags[this.tags.length - 1];
if (this.isSpeedy) {
var sheet = sheetForTag(tag);
try {
// this is the ultrafast version, works across browsers
// the big drawback is that the css won't be editable in devtools
sheet.insertRule(rule, sheet.cssRules.length);
} catch (e) {
}
} else {
tag.appendChild(document.createTextNode(rule));
}
this.ctr++;
};
_proto.flush = function flush() {
// $FlowFixMe
this.tags.forEach(function (tag) {
return tag.parentNode.removeChild(tag);
});
this.tags = [];
this.ctr = 0;
};
return StyleSheet;
}();
var e="-ms-";var r="-moz-";var a="-webkit-";var c="comm";var n="rule";var t="decl";var i="@import";var p="@keyframes";var k=Math.abs;var d=String.fromCharCode;function m(e,r){return (((r<<2^z(e,0))<<2^z(e,1))<<2^z(e,2))<<2^z(e,3)}function g(e){return e.trim()}function x(e,r){return (e=r.exec(e))?e[0]:e}function y(e,r,a){return e.replace(r,a)}function j(e,r){return e.indexOf(r)}function z(e,r){return e.charCodeAt(r)|0}function C(e,r,a){return e.slice(r,a)}function A(e){return e.length}function M(e){return e.length}function O(e,r){return r.push(e),e}function S(e,r){return e.map(r).join("")}var q=1;var B=1;var D=0;var E=0;var F=0;var G="";function H(e,r,a,c,n,t,s){return {value:e,root:r,parent:a,type:c,props:n,children:t,line:q,column:B,length:s,return:""}}function I(e,r,a){return H(e,r.root,r.parent,a,r.props,r.children,0)}function J(){return F}function K(){F=E<D?z(G,E++):0;if(B++,F===10)B=1,q++;return F}function L(){return z(G,E)}function N(){return E}function P(e,r){return C(G,e,r)}function Q(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function R(e){return q=B=1,D=A(G=e),E=0,[]}function T(e){return G="",e}function U(e){return g(P(E-1,Y(e===91?e+2:e===40?e+1:e)))}function W(e){while(F=L())if(F<33)K();else break;return Q(e)>2||Q(F)>3?"":" "}function Y(e){while(K())switch(F){case e:return E;case 34:case 39:return Y(e===34||e===39?e:F);case 40:if(e===41)Y(e);break;case 92:K();break}return E}function Z(e,r){while(K())if(e+F===47+10)break;else if(e+F===42+42&&L()===47)break;return "/*"+P(r,E-1)+"*"+d(e===47?e:K())}function _(e){while(!Q(L()))K();return P(e,E)}function ee(e){return T(re("",null,null,null,[""],e=R(e),0,[0],e))}function re(e,r,a,c,n,t,s,u,i){var f=0;var o=0;var l=s;var v=0;var h=0;var p=0;var w=1;var b=1;var $=1;var k=0;var m="";var g=n;var x=t;var j=c;var z=m;while(b)switch(p=k,k=K()){case 34:case 39:case 91:case 40:z+=U(k);break;case 9:case 10:case 13:case 32:z+=W(p);break;case 47:switch(L()){case 42:case 47:O(ce(Z(K(),N()),r,a),i);break;default:z+="/";}break;case 123*w:u[f++]=A(z)*$;case 125*w:case 59:case 0:switch(k){case 0:case 125:b=0;case 59+o:if(h>0&&A(z)-l)O(h>32?ne(z+";",c,a,l-1):ne(y(z," ","")+";",c,a,l-2),i);break;case 59:z+=";";default:O(j=ae(z,r,a,f,o,n,u,m,g=[],x=[],l),t);if(k===123)if(o===0)re(z,r,j,j,g,t,l,u,x);else switch(v){case 100:case 109:case 115:re(e,j,j,c&&O(ae(e,j,j,0,0,n,u,m,n,g=[],l),x),n,x,l,u,c?g:x);break;default:re(z,j,j,j,[""],x,l,u,x);}}f=o=h=0,w=$=1,m=z="",l=s;break;case 58:l=1+A(z),h=p;default:switch(z+=d(k),k*w){case 38:$=o>0?1:(z+="\f",-1);break;case 44:u[f++]=(A(z)-1)*$,$=1;break;case 64:if(L()===45)z+=U(K());v=L(),o=A(m=z+=_(N())),k++;break;case 45:if(p===45&&A(z)==2)w=0;}}return t}function ae(e,r,a,c,t,s,u,i,f,o,l){var v=t-1;var h=t===0?s:[""];var p=M(h);for(var w=0,b=0,$=0;w<c;++w)for(var d=0,m=C(e,v+1,v=k(b=u[w])),x=e;d<p;++d)if(x=g(b>0?h[d]+" "+m:y(m,/&\f/g,h[d])))f[$++]=x;return H(e,r,a,t===0?n:i,f,o,l)}function ce(e,r,a){return H(e,r,a,c,d(J()),C(e,2,-2),0)}function ne(e,r,a,c){return H(e,r,a,t,C(e,0,c),C(e,c+1,-1),c)}function te(c,n){switch(m(c,n)){case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return a+c+c;case 5349:case 4246:case 4810:case 6968:case 2756:return a+c+r+c+e+c+c;case 6828:case 4268:return a+c+e+c+c;case 6165:return a+c+e+"flex-"+c+c;case 5187:return a+c+y(c,/(\w+).+(:[^]+)/,a+"box-$1$2"+e+"flex-$1$2")+c;case 5443:return a+c+e+"flex-item-"+y(c,/flex-|-self/,"")+c;case 4675:return a+c+e+"flex-line-pack"+y(c,/align-content|flex-|-self/,"")+c;case 5548:return a+c+e+y(c,"shrink","negative")+c;case 5292:return a+c+e+y(c,"basis","preferred-size")+c;case 6060:return a+"box-"+y(c,"-grow","")+a+c+e+y(c,"grow","positive")+c;case 4554:return a+y(c,/([^-])(transform)/g,"$1"+a+"$2")+c;case 6187:return y(y(y(c,/(zoom-|grab)/,a+"$1"),/(image-set)/,a+"$1"),c,"")+c;case 5495:case 3959:return y(c,/(image-set\([^]*)/,a+"$1"+"$`$1");case 4968:return y(y(c,/(.+:)(flex-)?(.*)/,a+"box-pack:$3"+e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+a+c+c;case 4095:case 3583:case 4068:case 2532:return y(c,/(.+)-inline(.+)/,a+"$1$2")+c;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(A(c)-1-n>6)switch(z(c,n+1)){case 102:n=z(c,n+3);case 109:return y(c,/(.+:)(.+)-([^]+)/,"$1"+a+"$2-$3"+"$1"+r+(n==108?"$3":"$2-$3"))+c;case 115:return ~j(c,"stretch")?te(y(c,"stretch","fill-available"),n)+c:c}break;case 4949:if(z(c,n+1)!==115)break;case 6444:switch(z(c,A(c)-3-(~j(c,"!important")&&10))){case 107:case 111:return y(c,c,a+c)+c;case 101:return y(c,/(.+:)([^;!]+)(;|!.+)?/,"$1"+a+(z(c,14)===45?"inline-":"")+"box$3"+"$1"+a+"$2$3"+"$1"+e+"$2box$3")+c}break;case 5936:switch(z(c,n+11)){case 114:return a+c+e+y(c,/[svh]\w+-[tblr]{2}/,"tb")+c;case 108:return a+c+e+y(c,/[svh]\w+-[tblr]{2}/,"tb-rl")+c;case 45:return a+c+e+y(c,/[svh]\w+-[tblr]{2}/,"lr")+c}return a+c+e+c+c}return c}function se(e,r){var a="";var c=M(e);for(var n=0;n<c;n++)a+=r(e[n],n,e,r)||"";return a}function ue(e,r,a,s){switch(e.type){case i:case t:return e.return=e.return||e.value;case c:return "";case n:e.value=e.props.join(",");}return A(a=se(e.children,s))?e.return=e.value+"{"+a+"}":""}function ie(e){var r=M(e);return function(a,c,n,t){var s="";for(var u=0;u<r;u++)s+=e[u](a,c,n,t)||"";return s}}function fe(e){return function(r){if(!r.root)if(r=r.return)e(r);}}function oe(c,s,u,i){if(!c.return)switch(c.type){case t:c.return=te(c.value,c.length);break;case p:return se([I(y(c.value,"@","@"+a),c,"")],i);case n:if(c.length)return S(c.props,(function(n){switch(x(n,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return se([I(y(n,/:(read-\w+)/,":"+r+"$1"),c,"")],i);case"::placeholder":return se([I(y(n,/:(plac\w+)/,":"+a+"input-$1"),c,""),I(y(n,/:(plac\w+)/,":"+r+"$1"),c,""),I(y(n,/:(plac\w+)/,e+"input-$1"),c,"")],i)}return ""}))}}
var weakMemoize = function weakMemoize(func) {
// $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
var cache = new WeakMap();
return function (arg) {
if (cache.has(arg)) {
// $FlowFixMe
return cache.get(arg);
}
var ret = func(arg);
cache.set(arg, ret);
return ret;
};
};
function memoize(fn) {
var cache = Object.create(null);
return function (arg) {
if (cache[arg] === undefined) cache[arg] = fn(arg);
return cache[arg];
};
}
var toRules = function toRules(parsed, points) {
// pretend we've started with a comma
var index = -1;
var character = 44;
do {
switch (Q(character)) {
case 0:
// &\f
if (character === 38 && L() === 12) {
// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
// and when it should just concatenate the outer and inner selectors
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
points[index] = 1;
}
parsed[index] += _(E - 1);
break;
case 2:
parsed[index] += U(character);
break;
case 4:
// comma
if (character === 44) {
// colon
parsed[++index] = L() === 58 ? '&\f' : '';
points[index] = parsed[index].length;
break;
}
// fallthrough
default:
parsed[index] += d(character);
}
} while (character = K());
return parsed;
};
var getRules = function getRules(value, points) {
return T(toRules(R(value), points));
}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
var fixedElements = /* #__PURE__ */new WeakMap();
var compat = function compat(element) {
if (element.type !== 'rule' || !element.parent || // .length indicates if this rule contains pseudo or not
!element.length) {
return;
}
var value = element.value,
parent = element.parent;
var isImplicitRule = element.column === parent.column && element.line === parent.line;
while (parent.type !== 'rule') {
parent = parent.parent;
if (!parent) return;
} // short-circuit for the simplest case
if (element.props.length === 1 && value.charCodeAt(0) !== 58
/* colon */
&& !fixedElements.get(parent)) {
return;
} // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
if (isImplicitRule) {
return;
}
fixedElements.set(element, true);
var points = [];
var rules = getRules(value, points);
var parentRules = parent.props;
for (var i = 0, k = 0; i < rules.length; i++) {
for (var j = 0; j < parentRules.length; j++, k++) {
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
}
}
};
var removeLabel = function removeLabel(element) {
if (element.type === 'decl') {
var value = element.value;
if ( // charcode for l
value.charCodeAt(0) === 108 && // charcode for b
value.charCodeAt(2) === 98) {
// this ignores label
element["return"] = '';
element.value = '';
}
}
};
var defaultStylisPlugins = [oe];
var createCache = function createCache(options) {
var key = options.key;
if ( key === 'css') {
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
// document.head is a safe place to move them to
Array.prototype.forEach.call(ssrStyles, function (node) {
document.head.appendChild(node);
node.setAttribute('data-s', '');
});
}
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
var inserted = {}; // $FlowFixMe
var container;
var nodesToHydrate = [];
{
container = options.container || document.head;
Array.prototype.forEach.call(document.querySelectorAll("style[data-emotion]"), function (node) {
var attrib = node.getAttribute("data-emotion").split(' ');
if (attrib[0] !== key) {
return;
} // $FlowFixMe
for (var i = 1; i < attrib.length; i++) {
inserted[attrib[i]] = true;
}
nodesToHydrate.push(node);
});
}
var _insert;
var omnipresentPlugins = [compat, removeLabel];
{
var currentSheet;
var finalizingPlugins = [ue, fe(function (rule) {
currentSheet.insert(rule);
})];
var serializer = ie(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
var stylis = function stylis(styles) {
return se(ee(styles), serializer);
};
_insert = function insert(selector, serialized, sheet, shouldCache) {
currentSheet = sheet;
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
if (shouldCache) {
cache.inserted[serialized.name] = true;
}
};
}
var cache = {
key: key,
sheet: new StyleSheet({
key: key,
container: container,
nonce: options.nonce,
speedy: options.speedy,
prepend: options.prepend
}),
nonce: options.nonce,
inserted: inserted,
registered: {},
insert: _insert
};
cache.sheet.hydrate(nodesToHydrate);
return cache;
};
var isBrowser = "object" !== 'undefined';
function getRegisteredStyles(registered, registeredStyles, classNames) {
var rawClassName = '';
classNames.split(' ').forEach(function (className) {
if (registered[className] !== undefined) {
registeredStyles.push(registered[className] + ";");
} else {
rawClassName += className + " ";
}
});
return rawClassName;
}
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
var className = cache.key + "-" + serialized.name;
if ( // we only need to add the styles to the registered cache if the
// class name could be used further down
// the tree but if it's a string tag, we know it won't
// so we don't have to add it to registered cache.
// this improves memory usage since we can avoid storing the whole style string
(isStringTag === false || // we need to always store it if we're in compat mode and
// in node since emotion-server relies on whether a style is in
// the registered cache to know whether a style is global or not
// also, note that this check will be dead code eliminated in the browser
isBrowser === false ) && cache.registered[className] === undefined) {
cache.registered[className] = serialized.styles;
}
if (cache.inserted[serialized.name] === undefined) {
var current = serialized;
do {
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
current = current.next;
} while (current !== undefined);
}
};
/* eslint-disable */
// Inspired by https://github.com/garycourt/murmurhash-js
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
function murmur2(str) {
// 'm' and 'r' are mixing constants generated offline.
// They're not really 'magic', they just happen to work well.
// const m = 0x5bd1e995;
// const r = 24;
// Initialize the hash
var h = 0; // Mix 4 bytes at a time into the hash
var k,
i = 0,
len = str.length;
for (; len >= 4; ++i, len -= 4) {
k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
k =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
k ^=
/* k >>> r: */
k >>> 24;
h =
/* Math.imul(k, m): */
(k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Handle the last few bytes of the input array
switch (len) {
case 3:
h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
case 2:
h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
case 1:
h ^= str.charCodeAt(i) & 0xff;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
} // Do a few final mixes of the hash to ensure the last few
// bytes are well-incorporated.
h ^= h >>> 13;
h =
/* Math.imul(h, m): */
(h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
return ((h ^ h >>> 15) >>> 0).toString(36);
}
var unitlessKeys = {
animationIterationCount: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
var hyphenateRegex = /[A-Z]|^ms/g;
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
var isCustomProperty = function isCustomProperty(property) {
return property.charCodeAt(1) === 45;
};
var isProcessableValue = function isProcessableValue(value) {
return value != null && typeof value !== 'boolean';
};
var processStyleName = /* #__PURE__ */memoize(function (styleName) {
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
});
var processStyleValue = function processStyleValue(key, value) {
switch (key) {
case 'animation':
case 'animationName':
{
if (typeof value === 'string') {
return value.replace(animationRegex, function (match, p1, p2) {
cursor = {
name: p1,
styles: p2,
next: cursor
};
return p1;
});
}
}
}
if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
return value + 'px';
}
return value;
};
function handleInterpolation(mergedProps, registered, interpolation) {
if (interpolation == null) {
return '';
}
if (interpolation.__emotion_styles !== undefined) {
return interpolation;
}
switch (typeof interpolation) {
case 'boolean':
{
return '';
}
case 'object':
{
if (interpolation.anim === 1) {
cursor = {
name: interpolation.name,
styles: interpolation.styles,
next: cursor
};
return interpolation.name;
}
if (interpolation.styles !== undefined) {
var next = interpolation.next;
if (next !== undefined) {
// not the most efficient thing ever but this is a pretty rare case
// and there will be very few iterations of this generally
while (next !== undefined) {
cursor = {
name: next.name,
styles: next.styles,
next: cursor
};
next = next.next;
}
}
var styles = interpolation.styles + ";";
return styles;
}
return createStringFromObject(mergedProps, registered, interpolation);
}
case 'function':
{
if (mergedProps !== undefined) {
var previousCursor = cursor;
var result = interpolation(mergedProps);
cursor = previousCursor;
return handleInterpolation(mergedProps, registered, result);
}
break;
}
} // finalize string values (regular strings and functions interpolated into css calls)
if (registered == null) {
return interpolation;
}
var cached = registered[interpolation];
return cached !== undefined ? cached : interpolation;
}
function createStringFromObject(mergedProps, registered, obj) {
var string = '';
if (Array.isArray(obj)) {
for (var i = 0; i < obj.length; i++) {
string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
}
} else {
for (var _key in obj) {
var value = obj[_key];
if (typeof value !== 'object') {
if (registered != null && registered[value] !== undefined) {
string += _key + "{" + registered[value] + "}";
} else if (isProcessableValue(value)) {
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
}
} else {
if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {
throw new Error('Component selectors can only be used in conjunction with @emotion/babel-plugin.');
}
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
for (var _i = 0; _i < value.length; _i++) {
if (isProcessableValue(value[_i])) {
string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
}
}
} else {
var interpolated = handleInterpolation(mergedProps, registered, value);
switch (_key) {
case 'animation':
case 'animationName':
{
string += processStyleName(_key) + ":" + interpolated + ";";
break;
}
default:
{
string += _key + "{" + interpolated + "}";
}
}
}
}
}
}
return string;
}
var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g;
// keyframes are stored on the SerializedStyles object as a linked list
var cursor;
var serializeStyles = function serializeStyles(args, registered, mergedProps) {
if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
return args[0];
}
var stringMode = true;
var styles = '';
cursor = undefined;
var strings = args[0];
if (strings == null || strings.raw === undefined) {
stringMode = false;
styles += handleInterpolation(mergedProps, registered, strings);
} else {
styles += strings[0];
} // we start at 1 since we've already handled the first arg
for (var i = 1; i < args.length; i++) {
styles += handleInterpolation(mergedProps, registered, args[i]);
if (stringMode) {
styles += strings[i];
}
}
labelPattern.lastIndex = 0;
var identifierName = '';
var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
while ((match = labelPattern.exec(styles)) !== null) {
identifierName += '-' + // $FlowFixMe we know it's not null
match[1];
}
var name = murmur2(styles) + identifierName;
return {
name: name,
styles: styles,
next: cursor
};
};
var hasOwnProperty = Object.prototype.hasOwnProperty;
var EmotionCacheContext = /* #__PURE__ */react.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
// because this module is primarily intended for the browser and node
// but it's also required in react native and similar environments sometimes
// and we could have a special build just for that
// but this is much easier and the native packages
// might use a different theme context in the future anyway
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
key: 'css'
}) : null);
EmotionCacheContext.Provider;
var withEmotionCache = function withEmotionCache(func) {
// $FlowFixMe
return /*#__PURE__*/react.forwardRef(function (props, ref) {
// the cache will never be null in the browser
var cache = react.useContext(EmotionCacheContext);
return func(props, cache, ref);
});
};
var ThemeContext = /* #__PURE__ */react.createContext({});
var getTheme = function getTheme(outerTheme, theme) {
if (typeof theme === 'function') {
var mergedTheme = theme(outerTheme);
return mergedTheme;
}
return _extends({}, outerTheme, {}, theme);
};
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
return weakMemoize(function (theme) {
return getTheme(outerTheme, theme);
});
});
var ThemeProvider = function ThemeProvider(props) {
var theme = react.useContext(ThemeContext);
if (props.theme !== theme) {
theme = createCacheWithTheme(theme)(props.theme);
}
return /*#__PURE__*/react.createElement(ThemeContext.Provider, {
value: theme
}, props.children);
};
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
var createEmotionProps = function createEmotionProps(type, props) {
var newProps = {};
for (var key in props) {
if (hasOwnProperty.call(props, key)) {
newProps[key] = props[key];
}
}
newProps[typePropName] = type;
return newProps;
};
var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
// not passing the registered cache to serializeStyles because it would
// make certain babel optimisations not possible
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
cssProp = cache.registered[cssProp];
}
var type = props[typePropName];
var registeredStyles = [cssProp];
var className = '';
if (typeof props.className === 'string') {
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(registeredStyles, undefined, typeof cssProp === 'function' || Array.isArray(cssProp) ? react.useContext(ThemeContext) : undefined);
insertStyles(cache, serialized, typeof type === 'string');
className += cache.key + "-" + serialized.name;
var newProps = {};
for (var key in props) {
if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ("production" === 'production' )) {
newProps[key] = props[key];
}
}
newProps.ref = ref;
newProps.className = className;
var ele = /*#__PURE__*/react.createElement(type, newProps);
return ele;
});
createCommonjsModule(function (module) {
function _extends() {
module.exports = _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
return _extends.apply(this, arguments);
}
module.exports = _extends;
module.exports["default"] = module.exports, module.exports.__esModule = true;
});
var jsx = function jsx(type, props) {
var args = arguments;
if (props == null || !hasOwnProperty.call(props, 'css')) {
// $FlowFixMe
return react.createElement.apply(undefined, args);
}
var argsLength = args.length;
var createElementArgArray = new Array(argsLength);
createElementArgArray[0] = Emotion;
createElementArgArray[1] = createEmotionProps(type, props);
for (var i = 2; i < argsLength; i++) {
createElementArgArray[i] = args[i];
} // $FlowFixMe
return react.createElement.apply(null, createElementArgArray);
};
function css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return serializeStyles(args);
}
export { ThemeProvider, css, jsx };
import { _ as _extends } from '../common/_index-4fa100fd.js';
import { m as makeStyles$1, d as defaultTheme, w as withStyles, c as clsx, g as getThemeProps } from '../common/withStyles-a5c0f177.js';
import { _ as _unsupportedIterableToArray, u as useTheme$1, a as _objectWithoutProperties, f as fade, d as duration, b as _createClass, c as _toConsumableArray, z as zIndex, e as _defineProperty } from '../common/StylesProvider-c4f38318.js';
import { r as react } from '../common/index-57a74e37.js';
import { _ as _inheritsLoose, a as _objectWithoutPropertiesLoose } from '../common/_index-aecdce4e.js';
import { c as capitalize } from '../common/capitalize-46480bf1.js';
import { T as TransitionGroupContext, B as ButtonBase } from '../common/ButtonBase-36493559.js';
import { r as reactDom } from '../common/index-8dbeb7e4.js';
import { o as ownerDocument, a as ownerWindow, c as createChainedFunction, d as debounce } from '../common/ownerWindow-14b71efa.js';
import { u as useForkRef, s as setRef, a as useEventCallback } from '../common/useIsFocusVisible-e5c1f5cc.js';
export { T as Typography } from '../common/Typography-0032d134.js';
import '../common/hoist-non-react-statics.cjs-43de917e.js';
import '../common/_commonjsHelpers-8c19dec8.js';
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArrayLimit(arr, i) {
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function makeStyles(stylesOrCreator) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return makeStyles$1(stylesOrCreator, _extends({
defaultTheme: defaultTheme
}, options));
}
function useTheme() {
var theme = useTheme$1() || defaultTheme;
return theme;
}
var config = {
disabled: false
};
var UNMOUNTED = 'unmounted';
var EXITED = 'exited';
var ENTERING = 'entering';
var ENTERED = 'entered';
var EXITING = 'exiting';
/**
* The Transition component lets you describe a transition from one component
* state to another _over time_ with a simple declarative API. Most commonly
* it's used to animate the mounting and unmounting of a component, but can also
* be used to describe in-place transition states as well.
*
* ---
*
* **Note**: `Transition` is a platform-agnostic base component. If you're using
* transitions in CSS, you'll probably want to use
* [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)
* instead. It inherits all the features of `Transition`, but contains
* additional features necessary to play nice with CSS transitions (hence the
* name of the component).
*
* ---
*
* By default the `Transition` component does not alter the behavior of the
* component it renders, it only tracks "enter" and "exit" states for the
* components. It's up to you to give meaning and effect to those states. For
* example we can add styles to a component when it enters or exits:
*
* ```jsx
* import { Transition } from 'react-transition-group';
*
* const duration = 300;
*
* const defaultStyle = {
* transition: `opacity ${duration}ms ease-in-out`,
* opacity: 0,
* }
*
* const transitionStyles = {
* entering: { opacity: 1 },
* entered: { opacity: 1 },
* exiting: { opacity: 0 },
* exited: { opacity: 0 },
* };
*
* const Fade = ({ in: inProp }) => (
* <Transition in={inProp} timeout={duration}>
* {state => (
* <div style={{
* ...defaultStyle,
* ...transitionStyles[state]
* }}>
* I'm a fade Transition!
* </div>
* )}
* </Transition>
* );
* ```
*
* There are 4 main states a Transition can be in:
* - `'entering'`
* - `'entered'`
* - `'exiting'`
* - `'exited'`
*
* Transition state is toggled via the `in` prop. When `true` the component
* begins the "Enter" stage. During this stage, the component will shift from
* its current transition state, to `'entering'` for the duration of the
* transition and then to the `'entered'` stage once it's complete. Let's take
* the following example (we'll use the
* [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):
*
* ```jsx
* function App() {
* const [inProp, setInProp] = useState(false);
* return (
* <div>
* <Transition in={inProp} timeout={500}>
* {state => (
* // ...
* )}
* </Transition>
* <button onClick={() => setInProp(true)}>
* Click to Enter
* </button>
* </div>
* );
* }
* ```
*
* When the button is clicked the component will shift to the `'entering'` state
* and stay there for 500ms (the value of `timeout`) before it finally switches
* to `'entered'`.
*
* When `in` is `false` the same thing happens except the state moves from
* `'exiting'` to `'exited'`.
*/
var Transition = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(Transition, _React$Component);
function Transition(props, context) {
var _this;
_this = _React$Component.call(this, props, context) || this;
var parentGroup = context; // In the context of a TransitionGroup all enters are really appears
var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;
var initialStatus;
_this.appearStatus = null;
if (props.in) {
if (appear) {
initialStatus = EXITED;
_this.appearStatus = ENTERING;
} else {
initialStatus = ENTERED;
}
} else {
if (props.unmountOnExit || props.mountOnEnter) {
initialStatus = UNMOUNTED;
} else {
initialStatus = EXITED;
}
}
_this.state = {
status: initialStatus
};
_this.nextCallback = null;
return _this;
}
Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {
var nextIn = _ref.in;
if (nextIn && prevState.status === UNMOUNTED) {
return {
status: EXITED
};
}
return null;
} // getSnapshotBeforeUpdate(prevProps) {
// let nextStatus = null
// if (prevProps !== this.props) {
// const { status } = this.state
// if (this.props.in) {
// if (status !== ENTERING && status !== ENTERED) {
// nextStatus = ENTERING
// }
// } else {
// if (status === ENTERING || status === ENTERED) {
// nextStatus = EXITING
// }
// }
// }
// return { nextStatus }
// }
;
var _proto = Transition.prototype;
_proto.componentDidMount = function componentDidMount() {
this.updateStatus(true, this.appearStatus);
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
var nextStatus = null;
if (prevProps !== this.props) {
var status = this.state.status;
if (this.props.in) {
if (status !== ENTERING && status !== ENTERED) {
nextStatus = ENTERING;
}
} else {
if (status === ENTERING || status === ENTERED) {
nextStatus = EXITING;
}
}
}
this.updateStatus(false, nextStatus);
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.cancelNextCallback();
};
_proto.getTimeouts = function getTimeouts() {
var timeout = this.props.timeout;
var exit, enter, appear;
exit = enter = appear = timeout;
if (timeout != null && typeof timeout !== 'number') {
exit = timeout.exit;
enter = timeout.enter; // TODO: remove fallback for next major
appear = timeout.appear !== undefined ? timeout.appear : enter;
}
return {
exit: exit,
enter: enter,
appear: appear
};
};
_proto.updateStatus = function updateStatus(mounting, nextStatus) {
if (mounting === void 0) {
mounting = false;
}
if (nextStatus !== null) {
// nextStatus will always be ENTERING or EXITING.
this.cancelNextCallback();
if (nextStatus === ENTERING) {
this.performEnter(mounting);
} else {
this.performExit();
}
} else if (this.props.unmountOnExit && this.state.status === EXITED) {
this.setState({
status: UNMOUNTED
});
}
};
_proto.performEnter = function performEnter(mounting) {
var _this2 = this;
var enter = this.props.enter;
var appearing = this.context ? this.context.isMounting : mounting;
var _ref2 = this.props.nodeRef ? [appearing] : [reactDom.findDOMNode(this), appearing],
maybeNode = _ref2[0],
maybeAppearing = _ref2[1];
var timeouts = this.getTimeouts();
var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED
// if we are mounting and running this it means appear _must_ be set
if (!mounting && !enter || config.disabled) {
this.safeSetState({
status: ENTERED
}, function () {
_this2.props.onEntered(maybeNode);
});
return;
}
this.props.onEnter(maybeNode, maybeAppearing);
this.safeSetState({
status: ENTERING
}, function () {
_this2.props.onEntering(maybeNode, maybeAppearing);
_this2.onTransitionEnd(enterTimeout, function () {
_this2.safeSetState({
status: ENTERED
}, function () {
_this2.props.onEntered(maybeNode, maybeAppearing);
});
});
});
};
_proto.performExit = function performExit() {
var _this3 = this;
var exit = this.props.exit;
var timeouts = this.getTimeouts();
var maybeNode = this.props.nodeRef ? undefined : reactDom.findDOMNode(this); // no exit animation skip right to EXITED
if (!exit || config.disabled) {
this.safeSetState({
status: EXITED
}, function () {
_this3.props.onExited(maybeNode);
});
return;
}
this.props.onExit(maybeNode);
this.safeSetState({
status: EXITING
}, function () {
_this3.props.onExiting(maybeNode);
_this3.onTransitionEnd(timeouts.exit, function () {
_this3.safeSetState({
status: EXITED
}, function () {
_this3.props.onExited(maybeNode);
});
});
});
};
_proto.cancelNextCallback = function cancelNextCallback() {
if (this.nextCallback !== null) {
this.nextCallback.cancel();
this.nextCallback = null;
}
};
_proto.safeSetState = function safeSetState(nextState, callback) {
// This shouldn't be necessary, but there are weird race conditions with
// setState callbacks and unmounting in testing, so always make sure that
// we can cancel any pending setState callbacks after we unmount.
callback = this.setNextCallback(callback);
this.setState(nextState, callback);
};
_proto.setNextCallback = function setNextCallback(callback) {
var _this4 = this;
var active = true;
this.nextCallback = function (event) {
if (active) {
active = false;
_this4.nextCallback = null;
callback(event);
}
};
this.nextCallback.cancel = function () {
active = false;
};
return this.nextCallback;
};
_proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {
this.setNextCallback(handler);
var node = this.props.nodeRef ? this.props.nodeRef.current : reactDom.findDOMNode(this);
var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;
if (!node || doesNotHaveTimeoutOrListener) {
setTimeout(this.nextCallback, 0);
return;
}
if (this.props.addEndListener) {
var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],
maybeNode = _ref3[0],
maybeNextCallback = _ref3[1];
this.props.addEndListener(maybeNode, maybeNextCallback);
}
if (timeout != null) {
setTimeout(this.nextCallback, timeout);
}
};
_proto.render = function render() {
var status = this.state.status;
if (status === UNMOUNTED) {
return null;
}
var _this$props = this.props,
children = _this$props.children;
_this$props.in;
_this$props.mountOnEnter;
_this$props.unmountOnExit;
_this$props.appear;
_this$props.enter;
_this$props.exit;
_this$props.timeout;
_this$props.addEndListener;
_this$props.onEnter;
_this$props.onEntering;
_this$props.onEntered;
_this$props.onExit;
_this$props.onExiting;
_this$props.onExited;
_this$props.nodeRef;
var childProps = _objectWithoutPropertiesLoose(_this$props, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
return (
/*#__PURE__*/
// allows for nested Transitions
react.createElement(TransitionGroupContext.Provider, {
value: null
}, typeof children === 'function' ? children(status, childProps) : react.cloneElement(react.Children.only(children), childProps))
);
};
return Transition;
}(react.Component);
Transition.contextType = TransitionGroupContext;
Transition.propTypes = {}; // Name the function so it is clearer in the documentation
function noop() {}
Transition.defaultProps = {
in: false,
mountOnEnter: false,
unmountOnExit: false,
appear: false,
enter: true,
exit: true,
onEnter: noop,
onEntering: noop,
onEntered: noop,
onExit: noop,
onExiting: noop,
onExited: noop
};
Transition.UNMOUNTED = UNMOUNTED;
Transition.EXITED = EXITED;
Transition.ENTERING = ENTERING;
Transition.ENTERED = ENTERED;
Transition.EXITING = EXITING;
var reflow = function reflow(node) {
return node.scrollTop;
};
function getTransitionProps(props, options) {
var timeout = props.timeout,
_props$style = props.style,
style = _props$style === void 0 ? {} : _props$style;
return {
duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,
delay: style.transitionDelay
};
}
var styles$9 = function styles(theme) {
var elevations = {};
theme.shadows.forEach(function (shadow, index) {
elevations["elevation".concat(index)] = {
boxShadow: shadow
};
});
return _extends({
/* Styles applied to the root element. */
root: {
backgroundColor: theme.palette.background.paper,
color: theme.palette.text.primary,
transition: theme.transitions.create('box-shadow')
},
/* Styles applied to the root element if `square={false}`. */
rounded: {
borderRadius: theme.shape.borderRadius
},
/* Styles applied to the root element if `variant="outlined"`. */
outlined: {
border: "1px solid ".concat(theme.palette.divider)
}
}, elevations);
};
var Paper = /*#__PURE__*/react.forwardRef(function Paper(props, ref) {
var classes = props.classes,
className = props.className,
_props$component = props.component,
Component = _props$component === void 0 ? 'div' : _props$component,
_props$square = props.square,
square = _props$square === void 0 ? false : _props$square,
_props$elevation = props.elevation,
elevation = _props$elevation === void 0 ? 1 : _props$elevation,
_props$variant = props.variant,
variant = _props$variant === void 0 ? 'elevation' : _props$variant,
other = _objectWithoutProperties(props, ["classes", "className", "component", "square", "elevation", "variant"]);
return /*#__PURE__*/react.createElement(Component, _extends({
className: clsx(classes.root, className, variant === 'outlined' ? classes.outlined : classes["elevation".concat(elevation)], !square && classes.rounded),
ref: ref
}, other));
});
var Paper$1 = withStyles(styles$9, {
name: 'MuiPaper'
})(Paper);
var styles$8 = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
textAlign: 'center',
flex: '0 0 auto',
fontSize: theme.typography.pxToRem(24),
padding: 12,
borderRadius: '50%',
overflow: 'visible',
// Explicitly set the default value to solve a bug on IE 11.
color: theme.palette.action.active,
transition: theme.transitions.create('background-color', {
duration: theme.transitions.duration.shortest
}),
'&:hover': {
backgroundColor: fade(theme.palette.action.active, theme.palette.action.hoverOpacity),
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent'
}
},
'&$disabled': {
backgroundColor: 'transparent',
color: theme.palette.action.disabled
}
},
/* Styles applied to the root element if `edge="start"`. */
edgeStart: {
marginLeft: -12,
'$sizeSmall&': {
marginLeft: -3
}
},
/* Styles applied to the root element if `edge="end"`. */
edgeEnd: {
marginRight: -12,
'$sizeSmall&': {
marginRight: -3
}
},
/* Styles applied to the root element if `color="inherit"`. */
colorInherit: {
color: 'inherit'
},
/* Styles applied to the root element if `color="primary"`. */
colorPrimary: {
color: theme.palette.primary.main,
'&:hover': {
backgroundColor: fade(theme.palette.primary.main, theme.palette.action.hoverOpacity),
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent'
}
}
},
/* Styles applied to the root element if `color="secondary"`. */
colorSecondary: {
color: theme.palette.secondary.main,
'&:hover': {
backgroundColor: fade(theme.palette.secondary.main, theme.palette.action.hoverOpacity),
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent'
}
}
},
/* Pseudo-class applied to the root element if `disabled={true}`. */
disabled: {},
/* Styles applied to the root element if `size="small"`. */
sizeSmall: {
padding: 3,
fontSize: theme.typography.pxToRem(18)
},
/* Styles applied to the children container element. */
label: {
width: '100%',
display: 'flex',
alignItems: 'inherit',
justifyContent: 'inherit'
}
};
};
/**
* Refer to the [Icons](/components/icons/) section of the documentation
* regarding the available icon options.
*/
var IconButton = /*#__PURE__*/react.forwardRef(function IconButton(props, ref) {
var _props$edge = props.edge,
edge = _props$edge === void 0 ? false : _props$edge,
children = props.children,
classes = props.classes,
className = props.className,
_props$color = props.color,
color = _props$color === void 0 ? 'default' : _props$color,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
_props$disableFocusRi = props.disableFocusRipple,
disableFocusRipple = _props$disableFocusRi === void 0 ? false : _props$disableFocusRi,
_props$size = props.size,
size = _props$size === void 0 ? 'medium' : _props$size,
other = _objectWithoutProperties(props, ["edge", "children", "classes", "className", "color", "disabled", "disableFocusRipple", "size"]);
return /*#__PURE__*/react.createElement(ButtonBase, _extends({
className: clsx(classes.root, className, color !== 'default' && classes["color".concat(capitalize(color))], disabled && classes.disabled, size === "small" && classes["size".concat(capitalize(size))], {
'start': classes.edgeStart,
'end': classes.edgeEnd
}[edge]),
centerRipple: true,
focusRipple: !disableFocusRipple,
disabled: disabled,
ref: ref
}, other), /*#__PURE__*/react.createElement("span", {
className: classes.label
}, children));
});
var IconButton$1 = withStyles(styles$8, {
name: 'MuiIconButton'
})(IconButton);
var styles$7 = function styles(theme) {
var backgroundColorDefault = theme.palette.type === 'light' ? theme.palette.grey[100] : theme.palette.grey[900];
return {
/* Styles applied to the root element. */
root: {
display: 'flex',
flexDirection: 'column',
width: '100%',
boxSizing: 'border-box',
// Prevent padding issue with the Modal and fixed positioned AppBar.
zIndex: theme.zIndex.appBar,
flexShrink: 0
},
/* Styles applied to the root element if `position="fixed"`. */
positionFixed: {
position: 'fixed',
top: 0,
left: 'auto',
right: 0,
'@media print': {
// Prevent the app bar to be visible on each printed page.
position: 'absolute'
}
},
/* Styles applied to the root element if `position="absolute"`. */
positionAbsolute: {
position: 'absolute',
top: 0,
left: 'auto',
right: 0
},
/* Styles applied to the root element if `position="sticky"`. */
positionSticky: {
// ⚠️ sticky is not supported by IE 11.
position: 'sticky',
top: 0,
left: 'auto',
right: 0
},
/* Styles applied to the root element if `position="static"`. */
positionStatic: {
position: 'static'
},
/* Styles applied to the root element if `position="relative"`. */
positionRelative: {
position: 'relative'
},
/* Styles applied to the root element if `color="default"`. */
colorDefault: {
backgroundColor: backgroundColorDefault,
color: theme.palette.getContrastText(backgroundColorDefault)
},
/* Styles applied to the root element if `color="primary"`. */
colorPrimary: {
backgroundColor: theme.palette.primary.main,
color: theme.palette.primary.contrastText
},
/* Styles applied to the root element if `color="secondary"`. */
colorSecondary: {
backgroundColor: theme.palette.secondary.main,
color: theme.palette.secondary.contrastText
},
/* Styles applied to the root element if `color="inherit"`. */
colorInherit: {
color: 'inherit'
},
/* Styles applied to the root element if `color="transparent"`. */
colorTransparent: {
backgroundColor: 'transparent',
color: 'inherit'
}
};
};
var AppBar = /*#__PURE__*/react.forwardRef(function AppBar(props, ref) {
var classes = props.classes,
className = props.className,
_props$color = props.color,
color = _props$color === void 0 ? 'primary' : _props$color,
_props$position = props.position,
position = _props$position === void 0 ? 'fixed' : _props$position,
other = _objectWithoutProperties(props, ["classes", "className", "color", "position"]);
return /*#__PURE__*/react.createElement(Paper$1, _extends({
square: true,
component: "header",
elevation: 4,
className: clsx(classes.root, classes["position".concat(capitalize(position))], classes["color".concat(capitalize(color))], className, position === 'fixed' && 'mui-fixed'),
ref: ref
}, other));
});
var AppBar$1 = withStyles(styles$7, {
name: 'MuiAppBar'
})(AppBar);
var styles$6 = {
entering: {
opacity: 1
},
entered: {
opacity: 1
}
};
var defaultTimeout$1 = {
enter: duration.enteringScreen,
exit: duration.leavingScreen
};
/**
* The Fade transition is used by the [Modal](/components/modal/) component.
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
*/
var Fade = /*#__PURE__*/react.forwardRef(function Fade(props, ref) {
var children = props.children,
_props$disableStrictM = props.disableStrictModeCompat,
disableStrictModeCompat = _props$disableStrictM === void 0 ? false : _props$disableStrictM,
inProp = props.in,
onEnter = props.onEnter,
onEntered = props.onEntered,
onEntering = props.onEntering,
onExit = props.onExit,
onExited = props.onExited,
onExiting = props.onExiting,
style = props.style,
_props$TransitionComp = props.TransitionComponent,
TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp,
_props$timeout = props.timeout,
timeout = _props$timeout === void 0 ? defaultTimeout$1 : _props$timeout,
other = _objectWithoutProperties(props, ["children", "disableStrictModeCompat", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "TransitionComponent", "timeout"]);
var theme = useTheme();
var enableStrictModeCompat = theme.unstable_strictMode && !disableStrictModeCompat;
var nodeRef = react.useRef(null);
var foreignRef = useForkRef(children.ref, ref);
var handleRef = useForkRef(enableStrictModeCompat ? nodeRef : undefined, foreignRef);
var normalizedTransitionCallback = function normalizedTransitionCallback(callback) {
return function (nodeOrAppearing, maybeAppearing) {
if (callback) {
var _ref = enableStrictModeCompat ? [nodeRef.current, nodeOrAppearing] : [nodeOrAppearing, maybeAppearing],
_ref2 = _slicedToArray(_ref, 2),
node = _ref2[0],
isAppearing = _ref2[1]; // onEnterXxx and onExitXxx callbacks have a different arguments.length value.
if (isAppearing === undefined) {
callback(node);
} else {
callback(node, isAppearing);
}
}
};
};
var handleEntering = normalizedTransitionCallback(onEntering);
var handleEnter = normalizedTransitionCallback(function (node, isAppearing) {
reflow(node); // So the animation always start from the start.
var transitionProps = getTransitionProps({
style: style,
timeout: timeout
}, {
mode: 'enter'
});
node.style.webkitTransition = theme.transitions.create('opacity', transitionProps);
node.style.transition = theme.transitions.create('opacity', transitionProps);
if (onEnter) {
onEnter(node, isAppearing);
}
});
var handleEntered = normalizedTransitionCallback(onEntered);
var handleExiting = normalizedTransitionCallback(onExiting);
var handleExit = normalizedTransitionCallback(function (node) {
var transitionProps = getTransitionProps({
style: style,
timeout: timeout
}, {
mode: 'exit'
});
node.style.webkitTransition = theme.transitions.create('opacity', transitionProps);
node.style.transition = theme.transitions.create('opacity', transitionProps);
if (onExit) {
onExit(node);
}
});
var handleExited = normalizedTransitionCallback(onExited);
return /*#__PURE__*/react.createElement(TransitionComponent, _extends({
appear: true,
in: inProp,
nodeRef: enableStrictModeCompat ? nodeRef : undefined,
onEnter: handleEnter,
onEntered: handleEntered,
onEntering: handleEntering,
onExit: handleExit,
onExited: handleExited,
onExiting: handleExiting,
timeout: timeout
}, other), function (state, childProps) {
return /*#__PURE__*/react.cloneElement(children, _extends({
style: _extends({
opacity: 0,
visibility: state === 'exited' && !inProp ? 'hidden' : undefined
}, styles$6[state], style, children.props.style),
ref: handleRef
}, childProps));
});
});
var styles$5 = {
/* Styles applied to the root element. */
root: {
// Improve scrollable dialog support.
zIndex: -1,
position: 'fixed',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
right: 0,
bottom: 0,
top: 0,
left: 0,
backgroundColor: 'rgba(0, 0, 0, 0.5)',
WebkitTapHighlightColor: 'transparent'
},
/* Styles applied to the root element if `invisible={true}`. */
invisible: {
backgroundColor: 'transparent'
}
};
var Backdrop = /*#__PURE__*/react.forwardRef(function Backdrop(props, ref) {
var children = props.children,
classes = props.classes,
className = props.className,
_props$invisible = props.invisible,
invisible = _props$invisible === void 0 ? false : _props$invisible,
open = props.open,
transitionDuration = props.transitionDuration,
_props$TransitionComp = props.TransitionComponent,
TransitionComponent = _props$TransitionComp === void 0 ? Fade : _props$TransitionComp,
other = _objectWithoutProperties(props, ["children", "classes", "className", "invisible", "open", "transitionDuration", "TransitionComponent"]);
return /*#__PURE__*/react.createElement(TransitionComponent, _extends({
in: open,
timeout: transitionDuration
}, other), /*#__PURE__*/react.createElement("div", {
className: clsx(classes.root, className, invisible && classes.invisible),
"aria-hidden": true,
ref: ref
}, children));
});
var Backdrop$1 = withStyles(styles$5, {
name: 'MuiBackdrop'
})(Backdrop);
var html = {
WebkitFontSmoothing: 'antialiased',
// Antialiasing.
MozOsxFontSmoothing: 'grayscale',
// Antialiasing.
// Change from `box-sizing: content-box` so that `width`
// is not affected by `padding` or `border`.
boxSizing: 'border-box'
};
var body = function body(theme) {
return _extends({
color: theme.palette.text.primary
}, theme.typography.body2, {
backgroundColor: theme.palette.background.default,
'@media print': {
// Save printer ink.
backgroundColor: theme.palette.common.white
}
});
};
var styles$4 = function styles(theme) {
return {
'@global': {
html: html,
'*, *::before, *::after': {
boxSizing: 'inherit'
},
'strong, b': {
fontWeight: theme.typography.fontWeightBold
},
body: _extends({
margin: 0
}, body(theme), {
// Add support for document.body.requestFullScreen().
// Other elements, if background transparent, are not supported.
'&::backdrop': {
backgroundColor: theme.palette.background.default
}
})
}
};
};
/**
* Kickstart an elegant, consistent, and simple baseline to build upon.
*/
function CssBaseline(props) {
/* eslint-disable no-unused-vars */
var _props$children = props.children,
children = _props$children === void 0 ? null : _props$children;
props.classes;
/* eslint-enable no-unused-vars */
return /*#__PURE__*/react.createElement(react.Fragment, null, children);
}
var CssBaseline$1 = withStyles(styles$4, {
name: 'MuiCssBaseline'
})(CssBaseline);
function getContainer$1(container) {
container = typeof container === 'function' ? container() : container; // #StrictMode ready
return reactDom.findDOMNode(container);
}
var useEnhancedEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
/**
* Portals provide a first-class way to render children into a DOM node
* that exists outside the DOM hierarchy of the parent component.
*/
var Portal = /*#__PURE__*/react.forwardRef(function Portal(props, ref) {
var children = props.children,
container = props.container,
_props$disablePortal = props.disablePortal,
disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,
onRendered = props.onRendered;
var _React$useState = react.useState(null),
mountNode = _React$useState[0],
setMountNode = _React$useState[1];
var handleRef = useForkRef( /*#__PURE__*/react.isValidElement(children) ? children.ref : null, ref);
useEnhancedEffect(function () {
if (!disablePortal) {
setMountNode(getContainer$1(container) || document.body);
}
}, [container, disablePortal]);
useEnhancedEffect(function () {
if (mountNode && !disablePortal) {
setRef(ref, mountNode);
return function () {
setRef(ref, null);
};
}
return undefined;
}, [ref, mountNode, disablePortal]);
useEnhancedEffect(function () {
if (onRendered && (mountNode || disablePortal)) {
onRendered();
}
}, [onRendered, mountNode, disablePortal]);
if (disablePortal) {
if ( /*#__PURE__*/react.isValidElement(children)) {
return /*#__PURE__*/react.cloneElement(children, {
ref: handleRef
});
}
return children;
}
return mountNode ? /*#__PURE__*/reactDom.createPortal(children, mountNode) : mountNode;
});
// A change of the browser zoom change the scrollbar size.
// Credit https://github.com/twbs/bootstrap/blob/3ffe3a5d82f6f561b82ff78d82b32a7d14aed558/js/src/modal.js#L512-L519
function getScrollbarSize() {
var scrollDiv = document.createElement('div');
scrollDiv.style.width = '99px';
scrollDiv.style.height = '99px';
scrollDiv.style.position = 'absolute';
scrollDiv.style.top = '-9999px';
scrollDiv.style.overflow = 'scroll';
document.body.appendChild(scrollDiv);
var scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
return scrollbarSize;
}
function isOverflowing(container) {
var doc = ownerDocument(container);
if (doc.body === container) {
return ownerWindow(doc).innerWidth > doc.documentElement.clientWidth;
}
return container.scrollHeight > container.clientHeight;
}
function ariaHidden(node, show) {
if (show) {
node.setAttribute('aria-hidden', 'true');
} else {
node.removeAttribute('aria-hidden');
}
}
function getPaddingRight(node) {
return parseInt(window.getComputedStyle(node)['padding-right'], 10) || 0;
}
function ariaHiddenSiblings(container, mountNode, currentNode) {
var nodesToExclude = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
var show = arguments.length > 4 ? arguments[4] : undefined;
var blacklist = [mountNode, currentNode].concat(_toConsumableArray(nodesToExclude));
var blacklistTagNames = ['TEMPLATE', 'SCRIPT', 'STYLE'];
[].forEach.call(container.children, function (node) {
if (node.nodeType === 1 && blacklist.indexOf(node) === -1 && blacklistTagNames.indexOf(node.tagName) === -1) {
ariaHidden(node, show);
}
});
}
function findIndexOf(containerInfo, callback) {
var idx = -1;
containerInfo.some(function (item, index) {
if (callback(item)) {
idx = index;
return true;
}
return false;
});
return idx;
}
function handleContainer(containerInfo, props) {
var restoreStyle = [];
var restorePaddings = [];
var container = containerInfo.container;
var fixedNodes;
if (!props.disableScrollLock) {
if (isOverflowing(container)) {
// Compute the size before applying overflow hidden to avoid any scroll jumps.
var scrollbarSize = getScrollbarSize();
restoreStyle.push({
value: container.style.paddingRight,
key: 'padding-right',
el: container
}); // Use computed style, here to get the real padding to add our scrollbar width.
container.style['padding-right'] = "".concat(getPaddingRight(container) + scrollbarSize, "px"); // .mui-fixed is a global helper.
fixedNodes = ownerDocument(container).querySelectorAll('.mui-fixed');
[].forEach.call(fixedNodes, function (node) {
restorePaddings.push(node.style.paddingRight);
node.style.paddingRight = "".concat(getPaddingRight(node) + scrollbarSize, "px");
});
} // Improve Gatsby support
// https://css-tricks.com/snippets/css/force-vertical-scrollbar/
var parent = container.parentElement;
var scrollContainer = parent.nodeName === 'HTML' && window.getComputedStyle(parent)['overflow-y'] === 'scroll' ? parent : container; // Block the scroll even if no scrollbar is visible to account for mobile keyboard
// screensize shrink.
restoreStyle.push({
value: scrollContainer.style.overflow,
key: 'overflow',
el: scrollContainer
});
scrollContainer.style.overflow = 'hidden';
}
var restore = function restore() {
if (fixedNodes) {
[].forEach.call(fixedNodes, function (node, i) {
if (restorePaddings[i]) {
node.style.paddingRight = restorePaddings[i];
} else {
node.style.removeProperty('padding-right');
}
});
}
restoreStyle.forEach(function (_ref) {
var value = _ref.value,
el = _ref.el,
key = _ref.key;
if (value) {
el.style.setProperty(key, value);
} else {
el.style.removeProperty(key);
}
});
};
return restore;
}
function getHiddenSiblings(container) {
var hiddenSiblings = [];
[].forEach.call(container.children, function (node) {
if (node.getAttribute && node.getAttribute('aria-hidden') === 'true') {
hiddenSiblings.push(node);
}
});
return hiddenSiblings;
}
/**
* @ignore - do not document.
*
* Proper state management for containers and the modals in those containers.
* Simplified, but inspired by react-overlay's ModalManager class.
* Used by the Modal to ensure proper styling of containers.
*/
var ModalManager = /*#__PURE__*/function () {
function ModalManager() {
_classCallCheck(this, ModalManager);
// this.modals[modalIndex] = modal
this.modals = []; // this.containers[containerIndex] = {
// modals: [],
// container,
// restore: null,
// }
this.containers = [];
}
_createClass(ModalManager, [{
key: "add",
value: function add(modal, container) {
var modalIndex = this.modals.indexOf(modal);
if (modalIndex !== -1) {
return modalIndex;
}
modalIndex = this.modals.length;
this.modals.push(modal); // If the modal we are adding is already in the DOM.
if (modal.modalRef) {
ariaHidden(modal.modalRef, false);
}
var hiddenSiblingNodes = getHiddenSiblings(container);
ariaHiddenSiblings(container, modal.mountNode, modal.modalRef, hiddenSiblingNodes, true);
var containerIndex = findIndexOf(this.containers, function (item) {
return item.container === container;
});
if (containerIndex !== -1) {
this.containers[containerIndex].modals.push(modal);
return modalIndex;
}
this.containers.push({
modals: [modal],
container: container,
restore: null,
hiddenSiblingNodes: hiddenSiblingNodes
});
return modalIndex;
}
}, {
key: "mount",
value: function mount(modal, props) {
var containerIndex = findIndexOf(this.containers, function (item) {
return item.modals.indexOf(modal) !== -1;
});
var containerInfo = this.containers[containerIndex];
if (!containerInfo.restore) {
containerInfo.restore = handleContainer(containerInfo, props);
}
}
}, {
key: "remove",
value: function remove(modal) {
var modalIndex = this.modals.indexOf(modal);
if (modalIndex === -1) {
return modalIndex;
}
var containerIndex = findIndexOf(this.containers, function (item) {
return item.modals.indexOf(modal) !== -1;
});
var containerInfo = this.containers[containerIndex];
containerInfo.modals.splice(containerInfo.modals.indexOf(modal), 1);
this.modals.splice(modalIndex, 1); // If that was the last modal in a container, clean up the container.
if (containerInfo.modals.length === 0) {
// The modal might be closed before it had the chance to be mounted in the DOM.
if (containerInfo.restore) {
containerInfo.restore();
}
if (modal.modalRef) {
// In case the modal wasn't in the DOM yet.
ariaHidden(modal.modalRef, true);
}
ariaHiddenSiblings(containerInfo.container, modal.mountNode, modal.modalRef, containerInfo.hiddenSiblingNodes, false);
this.containers.splice(containerIndex, 1);
} else {
// Otherwise make sure the next top modal is visible to a screen reader.
var nextTop = containerInfo.modals[containerInfo.modals.length - 1]; // as soon as a modal is adding its modalRef is undefined. it can't set
// aria-hidden because the dom element doesn't exist either
// when modal was unmounted before modalRef gets null
if (nextTop.modalRef) {
ariaHidden(nextTop.modalRef, false);
}
}
return modalIndex;
}
}, {
key: "isTopModal",
value: function isTopModal(modal) {
return this.modals.length > 0 && this.modals[this.modals.length - 1] === modal;
}
}]);
return ModalManager;
}();
/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex, camelcase */
/**
* Utility component that locks focus inside the component.
*/
function Unstable_TrapFocus(props) {
var children = props.children,
_props$disableAutoFoc = props.disableAutoFocus,
disableAutoFocus = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc,
_props$disableEnforce = props.disableEnforceFocus,
disableEnforceFocus = _props$disableEnforce === void 0 ? false : _props$disableEnforce,
_props$disableRestore = props.disableRestoreFocus,
disableRestoreFocus = _props$disableRestore === void 0 ? false : _props$disableRestore,
getDoc = props.getDoc,
isEnabled = props.isEnabled,
open = props.open;
var ignoreNextEnforceFocus = react.useRef();
var sentinelStart = react.useRef(null);
var sentinelEnd = react.useRef(null);
var nodeToRestore = react.useRef();
var rootRef = react.useRef(null); // can be removed once we drop support for non ref forwarding class components
var handleOwnRef = react.useCallback(function (instance) {
// #StrictMode ready
rootRef.current = reactDom.findDOMNode(instance);
}, []);
var handleRef = useForkRef(children.ref, handleOwnRef);
var prevOpenRef = react.useRef();
react.useEffect(function () {
prevOpenRef.current = open;
}, [open]);
if (!prevOpenRef.current && open && typeof window !== 'undefined') {
// WARNING: Potentially unsafe in concurrent mode.
// The way the read on `nodeToRestore` is setup could make this actually safe.
// Say we render `open={false}` -> `open={true}` but never commit.
// We have now written a state that wasn't committed. But no committed effect
// will read this wrong value. We only read from `nodeToRestore` in effects
// that were committed on `open={true}`
// WARNING: Prevents the instance from being garbage collected. Should only
// hold a weak ref.
nodeToRestore.current = getDoc().activeElement;
}
react.useEffect(function () {
if (!open) {
return;
}
var doc = ownerDocument(rootRef.current); // We might render an empty child.
if (!disableAutoFocus && rootRef.current && !rootRef.current.contains(doc.activeElement)) {
if (!rootRef.current.hasAttribute('tabIndex')) {
rootRef.current.setAttribute('tabIndex', -1);
}
rootRef.current.focus();
}
var contain = function contain() {
var rootElement = rootRef.current; // Cleanup functions are executed lazily in React 17.
// Contain can be called between the component being unmounted and its cleanup function being run.
if (rootElement === null) {
return;
}
if (!doc.hasFocus() || disableEnforceFocus || !isEnabled() || ignoreNextEnforceFocus.current) {
ignoreNextEnforceFocus.current = false;
return;
}
if (rootRef.current && !rootRef.current.contains(doc.activeElement)) {
rootRef.current.focus();
}
};
var loopFocus = function loopFocus(event) {
// 9 = Tab
if (disableEnforceFocus || !isEnabled() || event.keyCode !== 9) {
return;
} // Make sure the next tab starts from the right place.
if (doc.activeElement === rootRef.current) {
// We need to ignore the next contain as
// it will try to move the focus back to the rootRef element.
ignoreNextEnforceFocus.current = true;
if (event.shiftKey) {
sentinelEnd.current.focus();
} else {
sentinelStart.current.focus();
}
}
};
doc.addEventListener('focus', contain, true);
doc.addEventListener('keydown', loopFocus, true); // With Edge, Safari and Firefox, no focus related events are fired when the focused area stops being a focused area
// e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=559561.
//
// The whatwg spec defines how the browser should behave but does not explicitly mention any events:
// https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule.
var interval = setInterval(function () {
contain();
}, 50);
return function () {
clearInterval(interval);
doc.removeEventListener('focus', contain, true);
doc.removeEventListener('keydown', loopFocus, true); // restoreLastFocus()
if (!disableRestoreFocus) {
// In IE 11 it is possible for document.activeElement to be null resulting
// in nodeToRestore.current being null.
// Not all elements in IE 11 have a focus method.
// Once IE 11 support is dropped the focus() call can be unconditional.
if (nodeToRestore.current && nodeToRestore.current.focus) {
nodeToRestore.current.focus();
}
nodeToRestore.current = null;
}
};
}, [disableAutoFocus, disableEnforceFocus, disableRestoreFocus, isEnabled, open]);
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("div", {
tabIndex: 0,
ref: sentinelStart,
"data-test": "sentinelStart"
}), /*#__PURE__*/react.cloneElement(children, {
ref: handleRef
}), /*#__PURE__*/react.createElement("div", {
tabIndex: 0,
ref: sentinelEnd,
"data-test": "sentinelEnd"
}));
}
var styles$3 = {
/* Styles applied to the root element. */
root: {
zIndex: -1,
position: 'fixed',
right: 0,
bottom: 0,
top: 0,
left: 0,
backgroundColor: 'rgba(0, 0, 0, 0.5)',
WebkitTapHighlightColor: 'transparent'
},
/* Styles applied to the root element if `invisible={true}`. */
invisible: {
backgroundColor: 'transparent'
}
};
/**
* @ignore - internal component.
*/
var SimpleBackdrop = /*#__PURE__*/react.forwardRef(function SimpleBackdrop(props, ref) {
var _props$invisible = props.invisible,
invisible = _props$invisible === void 0 ? false : _props$invisible,
open = props.open,
other = _objectWithoutProperties(props, ["invisible", "open"]);
return open ? /*#__PURE__*/react.createElement("div", _extends({
"aria-hidden": true,
ref: ref
}, other, {
style: _extends({}, styles$3.root, invisible ? styles$3.invisible : {}, other.style)
})) : null;
});
function getContainer(container) {
container = typeof container === 'function' ? container() : container;
return reactDom.findDOMNode(container);
}
function getHasTransition(props) {
return props.children ? props.children.props.hasOwnProperty('in') : false;
} // A modal manager used to track and manage the state of open Modals.
// Modals don't open on the server so this won't conflict with concurrent requests.
var defaultManager = new ModalManager();
var styles$2 = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
position: 'fixed',
zIndex: theme.zIndex.modal,
right: 0,
bottom: 0,
top: 0,
left: 0
},
/* Styles applied to the root element if the `Modal` has exited. */
hidden: {
visibility: 'hidden'
}
};
};
/**
* Modal is a lower-level construct that is leveraged by the following components:
*
* - [Dialog](/api/dialog/)
* - [Drawer](/api/drawer/)
* - [Menu](/api/menu/)
* - [Popover](/api/popover/)
*
* If you are creating a modal dialog, you probably want to use the [Dialog](/api/dialog/) component
* rather than directly using Modal.
*
* This component shares many concepts with [react-overlays](https://react-bootstrap.github.io/react-overlays/#modals).
*/
var Modal = /*#__PURE__*/react.forwardRef(function Modal(inProps, ref) {
var theme = useTheme$1();
var props = getThemeProps({
name: 'MuiModal',
props: _extends({}, inProps),
theme: theme
});
var _props$BackdropCompon = props.BackdropComponent,
BackdropComponent = _props$BackdropCompon === void 0 ? SimpleBackdrop : _props$BackdropCompon,
BackdropProps = props.BackdropProps,
children = props.children,
_props$closeAfterTran = props.closeAfterTransition,
closeAfterTransition = _props$closeAfterTran === void 0 ? false : _props$closeAfterTran,
container = props.container,
_props$disableAutoFoc = props.disableAutoFocus,
disableAutoFocus = _props$disableAutoFoc === void 0 ? false : _props$disableAutoFoc,
_props$disableBackdro = props.disableBackdropClick,
disableBackdropClick = _props$disableBackdro === void 0 ? false : _props$disableBackdro,
_props$disableEnforce = props.disableEnforceFocus,
disableEnforceFocus = _props$disableEnforce === void 0 ? false : _props$disableEnforce,
_props$disableEscapeK = props.disableEscapeKeyDown,
disableEscapeKeyDown = _props$disableEscapeK === void 0 ? false : _props$disableEscapeK,
_props$disablePortal = props.disablePortal,
disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,
_props$disableRestore = props.disableRestoreFocus,
disableRestoreFocus = _props$disableRestore === void 0 ? false : _props$disableRestore,
_props$disableScrollL = props.disableScrollLock,
disableScrollLock = _props$disableScrollL === void 0 ? false : _props$disableScrollL,
_props$hideBackdrop = props.hideBackdrop,
hideBackdrop = _props$hideBackdrop === void 0 ? false : _props$hideBackdrop,
_props$keepMounted = props.keepMounted,
keepMounted = _props$keepMounted === void 0 ? false : _props$keepMounted,
_props$manager = props.manager,
manager = _props$manager === void 0 ? defaultManager : _props$manager,
onBackdropClick = props.onBackdropClick,
onClose = props.onClose,
onEscapeKeyDown = props.onEscapeKeyDown,
onRendered = props.onRendered,
open = props.open,
other = _objectWithoutProperties(props, ["BackdropComponent", "BackdropProps", "children", "closeAfterTransition", "container", "disableAutoFocus", "disableBackdropClick", "disableEnforceFocus", "disableEscapeKeyDown", "disablePortal", "disableRestoreFocus", "disableScrollLock", "hideBackdrop", "keepMounted", "manager", "onBackdropClick", "onClose", "onEscapeKeyDown", "onRendered", "open"]);
var _React$useState = react.useState(true),
exited = _React$useState[0],
setExited = _React$useState[1];
var modal = react.useRef({});
var mountNodeRef = react.useRef(null);
var modalRef = react.useRef(null);
var handleRef = useForkRef(modalRef, ref);
var hasTransition = getHasTransition(props);
var getDoc = function getDoc() {
return ownerDocument(mountNodeRef.current);
};
var getModal = function getModal() {
modal.current.modalRef = modalRef.current;
modal.current.mountNode = mountNodeRef.current;
return modal.current;
};
var handleMounted = function handleMounted() {
manager.mount(getModal(), {
disableScrollLock: disableScrollLock
}); // Fix a bug on Chrome where the scroll isn't initially 0.
modalRef.current.scrollTop = 0;
};
var handleOpen = useEventCallback(function () {
var resolvedContainer = getContainer(container) || getDoc().body;
manager.add(getModal(), resolvedContainer); // The element was already mounted.
if (modalRef.current) {
handleMounted();
}
});
var isTopModal = react.useCallback(function () {
return manager.isTopModal(getModal());
}, [manager]);
var handlePortalRef = useEventCallback(function (node) {
mountNodeRef.current = node;
if (!node) {
return;
}
if (onRendered) {
onRendered();
}
if (open && isTopModal()) {
handleMounted();
} else {
ariaHidden(modalRef.current, true);
}
});
var handleClose = react.useCallback(function () {
manager.remove(getModal());
}, [manager]);
react.useEffect(function () {
return function () {
handleClose();
};
}, [handleClose]);
react.useEffect(function () {
if (open) {
handleOpen();
} else if (!hasTransition || !closeAfterTransition) {
handleClose();
}
}, [open, handleClose, hasTransition, closeAfterTransition, handleOpen]);
if (!keepMounted && !open && (!hasTransition || exited)) {
return null;
}
var handleEnter = function handleEnter() {
setExited(false);
};
var handleExited = function handleExited() {
setExited(true);
if (closeAfterTransition) {
handleClose();
}
};
var handleBackdropClick = function handleBackdropClick(event) {
if (event.target !== event.currentTarget) {
return;
}
if (onBackdropClick) {
onBackdropClick(event);
}
if (!disableBackdropClick && onClose) {
onClose(event, 'backdropClick');
}
};
var handleKeyDown = function handleKeyDown(event) {
// The handler doesn't take event.defaultPrevented into account:
//
// event.preventDefault() is meant to stop default behaviours like
// clicking a checkbox to check it, hitting a button to submit a form,
// and hitting left arrow to move the cursor in a text input etc.
// Only special HTML elements have these default behaviors.
if (event.key !== 'Escape' || !isTopModal()) {
return;
}
if (onEscapeKeyDown) {
onEscapeKeyDown(event);
}
if (!disableEscapeKeyDown) {
// Swallow the event, in case someone is listening for the escape key on the body.
event.stopPropagation();
if (onClose) {
onClose(event, 'escapeKeyDown');
}
}
};
var inlineStyle = styles$2(theme || {
zIndex: zIndex
});
var childProps = {};
if (children.props.tabIndex === undefined) {
childProps.tabIndex = children.props.tabIndex || '-1';
} // It's a Transition like component
if (hasTransition) {
childProps.onEnter = createChainedFunction(handleEnter, children.props.onEnter);
childProps.onExited = createChainedFunction(handleExited, children.props.onExited);
}
return /*#__PURE__*/react.createElement(Portal, {
ref: handlePortalRef,
container: container,
disablePortal: disablePortal
}, /*#__PURE__*/react.createElement("div", _extends({
ref: handleRef,
onKeyDown: handleKeyDown,
role: "presentation"
}, other, {
style: _extends({}, inlineStyle.root, !open && exited ? inlineStyle.hidden : {}, other.style)
}), hideBackdrop ? null : /*#__PURE__*/react.createElement(BackdropComponent, _extends({
open: open,
onClick: handleBackdropClick
}, BackdropProps)), /*#__PURE__*/react.createElement(Unstable_TrapFocus, {
disableEnforceFocus: disableEnforceFocus,
disableAutoFocus: disableAutoFocus,
disableRestoreFocus: disableRestoreFocus,
getDoc: getDoc,
isEnabled: isTopModal,
open: open
}, /*#__PURE__*/react.cloneElement(children, childProps))));
});
// Later, we gonna translate back the node to his original location
// with `none`.`
function getTranslateValue(direction, node) {
var rect = node.getBoundingClientRect();
var transform;
if (node.fakeTransform) {
transform = node.fakeTransform;
} else {
var computedStyle = window.getComputedStyle(node);
transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');
}
var offsetX = 0;
var offsetY = 0;
if (transform && transform !== 'none' && typeof transform === 'string') {
var transformValues = transform.split('(')[1].split(')')[0].split(',');
offsetX = parseInt(transformValues[4], 10);
offsetY = parseInt(transformValues[5], 10);
}
if (direction === 'left') {
return "translateX(".concat(window.innerWidth, "px) translateX(").concat(offsetX - rect.left, "px)");
}
if (direction === 'right') {
return "translateX(-".concat(rect.left + rect.width - offsetX, "px)");
}
if (direction === 'up') {
return "translateY(".concat(window.innerHeight, "px) translateY(").concat(offsetY - rect.top, "px)");
} // direction === 'down'
return "translateY(-".concat(rect.top + rect.height - offsetY, "px)");
}
function setTranslateValue(direction, node) {
var transform = getTranslateValue(direction, node);
if (transform) {
node.style.webkitTransform = transform;
node.style.transform = transform;
}
}
var defaultTimeout = {
enter: duration.enteringScreen,
exit: duration.leavingScreen
};
/**
* The Slide transition is used by the [Drawer](/components/drawers/) component.
* It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.
*/
var Slide = /*#__PURE__*/react.forwardRef(function Slide(props, ref) {
var children = props.children,
_props$direction = props.direction,
direction = _props$direction === void 0 ? 'down' : _props$direction,
inProp = props.in,
onEnter = props.onEnter,
onEntered = props.onEntered,
onEntering = props.onEntering,
onExit = props.onExit,
onExited = props.onExited,
onExiting = props.onExiting,
style = props.style,
_props$timeout = props.timeout,
timeout = _props$timeout === void 0 ? defaultTimeout : _props$timeout,
_props$TransitionComp = props.TransitionComponent,
TransitionComponent = _props$TransitionComp === void 0 ? Transition : _props$TransitionComp,
other = _objectWithoutProperties(props, ["children", "direction", "in", "onEnter", "onEntered", "onEntering", "onExit", "onExited", "onExiting", "style", "timeout", "TransitionComponent"]);
var theme = useTheme();
var childrenRef = react.useRef(null);
/**
* used in cloneElement(children, { ref: handleRef })
*/
var handleOwnRef = react.useCallback(function (instance) {
// #StrictMode ready
childrenRef.current = reactDom.findDOMNode(instance);
}, []);
var handleRefIntermediary = useForkRef(children.ref, handleOwnRef);
var handleRef = useForkRef(handleRefIntermediary, ref);
var normalizedTransitionCallback = function normalizedTransitionCallback(callback) {
return function (isAppearing) {
if (callback) {
// onEnterXxx and onExitXxx callbacks have a different arguments.length value.
if (isAppearing === undefined) {
callback(childrenRef.current);
} else {
callback(childrenRef.current, isAppearing);
}
}
};
};
var handleEnter = normalizedTransitionCallback(function (node, isAppearing) {
setTranslateValue(direction, node);
reflow(node);
if (onEnter) {
onEnter(node, isAppearing);
}
});
var handleEntering = normalizedTransitionCallback(function (node, isAppearing) {
var transitionProps = getTransitionProps({
timeout: timeout,
style: style
}, {
mode: 'enter'
});
node.style.webkitTransition = theme.transitions.create('-webkit-transform', _extends({}, transitionProps, {
easing: theme.transitions.easing.easeOut
}));
node.style.transition = theme.transitions.create('transform', _extends({}, transitionProps, {
easing: theme.transitions.easing.easeOut
}));
node.style.webkitTransform = 'none';
node.style.transform = 'none';
if (onEntering) {
onEntering(node, isAppearing);
}
});
var handleEntered = normalizedTransitionCallback(onEntered);
var handleExiting = normalizedTransitionCallback(onExiting);
var handleExit = normalizedTransitionCallback(function (node) {
var transitionProps = getTransitionProps({
timeout: timeout,
style: style
}, {
mode: 'exit'
});
node.style.webkitTransition = theme.transitions.create('-webkit-transform', _extends({}, transitionProps, {
easing: theme.transitions.easing.sharp
}));
node.style.transition = theme.transitions.create('transform', _extends({}, transitionProps, {
easing: theme.transitions.easing.sharp
}));
setTranslateValue(direction, node);
if (onExit) {
onExit(node);
}
});
var handleExited = normalizedTransitionCallback(function (node) {
// No need for transitions when the component is hidden
node.style.webkitTransition = '';
node.style.transition = '';
if (onExited) {
onExited(node);
}
});
var updatePosition = react.useCallback(function () {
if (childrenRef.current) {
setTranslateValue(direction, childrenRef.current);
}
}, [direction]);
react.useEffect(function () {
// Skip configuration where the position is screen size invariant.
if (inProp || direction === 'down' || direction === 'right') {
return undefined;
}
var handleResize = debounce(function () {
if (childrenRef.current) {
setTranslateValue(direction, childrenRef.current);
}
});
window.addEventListener('resize', handleResize);
return function () {
handleResize.clear();
window.removeEventListener('resize', handleResize);
};
}, [direction, inProp]);
react.useEffect(function () {
if (!inProp) {
// We need to update the position of the drawer when the direction change and
// when it's hidden.
updatePosition();
}
}, [inProp, updatePosition]);
return /*#__PURE__*/react.createElement(TransitionComponent, _extends({
nodeRef: childrenRef,
onEnter: handleEnter,
onEntered: handleEntered,
onEntering: handleEntering,
onExit: handleExit,
onExited: handleExited,
onExiting: handleExiting,
appear: true,
in: inProp,
timeout: timeout
}, other), function (state, childProps) {
return /*#__PURE__*/react.cloneElement(children, _extends({
ref: handleRef,
style: _extends({
visibility: state === 'exited' && !inProp ? 'hidden' : undefined
}, style, children.props.style)
}, childProps));
});
});
var styles$1 = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {},
/* Styles applied to the root element if `variant="permanent or persistent"`. */
docked: {
flex: '0 0 auto'
},
/* Styles applied to the `Paper` component. */
paper: {
overflowY: 'auto',
display: 'flex',
flexDirection: 'column',
height: '100%',
flex: '1 0 auto',
zIndex: theme.zIndex.drawer,
WebkitOverflowScrolling: 'touch',
// Add iOS momentum scrolling.
// temporary style
position: 'fixed',
top: 0,
// We disable the focus ring for mouse, touch and keyboard users.
// At some point, it would be better to keep it for keyboard users.
// :focus-ring CSS pseudo-class will help.
outline: 0
},
/* Styles applied to the `Paper` component if `anchor="left"`. */
paperAnchorLeft: {
left: 0,
right: 'auto'
},
/* Styles applied to the `Paper` component if `anchor="right"`. */
paperAnchorRight: {
left: 'auto',
right: 0
},
/* Styles applied to the `Paper` component if `anchor="top"`. */
paperAnchorTop: {
top: 0,
left: 0,
bottom: 'auto',
right: 0,
height: 'auto',
maxHeight: '100%'
},
/* Styles applied to the `Paper` component if `anchor="bottom"`. */
paperAnchorBottom: {
top: 'auto',
left: 0,
bottom: 0,
right: 0,
height: 'auto',
maxHeight: '100%'
},
/* Styles applied to the `Paper` component if `anchor="left"` and `variant` is not "temporary". */
paperAnchorDockedLeft: {
borderRight: "1px solid ".concat(theme.palette.divider)
},
/* Styles applied to the `Paper` component if `anchor="top"` and `variant` is not "temporary". */
paperAnchorDockedTop: {
borderBottom: "1px solid ".concat(theme.palette.divider)
},
/* Styles applied to the `Paper` component if `anchor="right"` and `variant` is not "temporary". */
paperAnchorDockedRight: {
borderLeft: "1px solid ".concat(theme.palette.divider)
},
/* Styles applied to the `Paper` component if `anchor="bottom"` and `variant` is not "temporary". */
paperAnchorDockedBottom: {
borderTop: "1px solid ".concat(theme.palette.divider)
},
/* Styles applied to the `Modal` component. */
modal: {}
};
};
var oppositeDirection = {
left: 'right',
right: 'left',
top: 'down',
bottom: 'up'
};
function isHorizontal(anchor) {
return ['left', 'right'].indexOf(anchor) !== -1;
}
function getAnchor(theme, anchor) {
return theme.direction === 'rtl' && isHorizontal(anchor) ? oppositeDirection[anchor] : anchor;
}
var defaultTransitionDuration = {
enter: duration.enteringScreen,
exit: duration.leavingScreen
};
/**
* The props of the [Modal](/api/modal/) component are available
* when `variant="temporary"` is set.
*/
var Drawer = /*#__PURE__*/react.forwardRef(function Drawer(props, ref) {
var _props$anchor = props.anchor,
anchorProp = _props$anchor === void 0 ? 'left' : _props$anchor,
BackdropProps = props.BackdropProps,
children = props.children,
classes = props.classes,
className = props.className,
_props$elevation = props.elevation,
elevation = _props$elevation === void 0 ? 16 : _props$elevation,
_props$ModalProps = props.ModalProps;
_props$ModalProps = _props$ModalProps === void 0 ? {} : _props$ModalProps;
var BackdropPropsProp = _props$ModalProps.BackdropProps,
ModalProps = _objectWithoutProperties(_props$ModalProps, ["BackdropProps"]),
onClose = props.onClose,
_props$open = props.open,
open = _props$open === void 0 ? false : _props$open,
_props$PaperProps = props.PaperProps,
PaperProps = _props$PaperProps === void 0 ? {} : _props$PaperProps,
SlideProps = props.SlideProps,
_props$TransitionComp = props.TransitionComponent,
TransitionComponent = _props$TransitionComp === void 0 ? Slide : _props$TransitionComp,
_props$transitionDura = props.transitionDuration,
transitionDuration = _props$transitionDura === void 0 ? defaultTransitionDuration : _props$transitionDura,
_props$variant = props.variant,
variant = _props$variant === void 0 ? 'temporary' : _props$variant,
other = _objectWithoutProperties(props, ["anchor", "BackdropProps", "children", "classes", "className", "elevation", "ModalProps", "onClose", "open", "PaperProps", "SlideProps", "TransitionComponent", "transitionDuration", "variant"]);
var theme = useTheme(); // Let's assume that the Drawer will always be rendered on user space.
// We use this state is order to skip the appear transition during the
// initial mount of the component.
var mounted = react.useRef(false);
react.useEffect(function () {
mounted.current = true;
}, []);
var anchor = getAnchor(theme, anchorProp);
var drawer = /*#__PURE__*/react.createElement(Paper$1, _extends({
elevation: variant === 'temporary' ? elevation : 0,
square: true
}, PaperProps, {
className: clsx(classes.paper, classes["paperAnchor".concat(capitalize(anchor))], PaperProps.className, variant !== 'temporary' && classes["paperAnchorDocked".concat(capitalize(anchor))])
}), children);
if (variant === 'permanent') {
return /*#__PURE__*/react.createElement("div", _extends({
className: clsx(classes.root, classes.docked, className),
ref: ref
}, other), drawer);
}
var slidingDrawer = /*#__PURE__*/react.createElement(TransitionComponent, _extends({
in: open,
direction: oppositeDirection[anchor],
timeout: transitionDuration,
appear: mounted.current
}, SlideProps), drawer);
if (variant === 'persistent') {
return /*#__PURE__*/react.createElement("div", _extends({
className: clsx(classes.root, classes.docked, className),
ref: ref
}, other), slidingDrawer);
} // variant === temporary
return /*#__PURE__*/react.createElement(Modal, _extends({
BackdropProps: _extends({}, BackdropProps, BackdropPropsProp, {
transitionDuration: transitionDuration
}),
BackdropComponent: Backdrop$1,
className: clsx(classes.root, classes.modal, className),
open: open,
onClose: onClose,
ref: ref
}, other, ModalProps), slidingDrawer);
});
var Drawer$1 = withStyles(styles$1, {
name: 'MuiDrawer',
flip: false
})(Drawer);
var styles = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
position: 'relative',
display: 'flex',
alignItems: 'center'
},
/* Styles applied to the root element if `disableGutters={false}`. */
gutters: _defineProperty({
paddingLeft: theme.spacing(2),
paddingRight: theme.spacing(2)
}, theme.breakpoints.up('sm'), {
paddingLeft: theme.spacing(3),
paddingRight: theme.spacing(3)
}),
/* Styles applied to the root element if `variant="regular"`. */
regular: theme.mixins.toolbar,
/* Styles applied to the root element if `variant="dense"`. */
dense: {
minHeight: 48
}
};
};
var Toolbar = /*#__PURE__*/react.forwardRef(function Toolbar(props, ref) {
var classes = props.classes,
className = props.className,
_props$component = props.component,
Component = _props$component === void 0 ? 'div' : _props$component,
_props$disableGutters = props.disableGutters,
disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters,
_props$variant = props.variant,
variant = _props$variant === void 0 ? 'regular' : _props$variant,
other = _objectWithoutProperties(props, ["classes", "className", "component", "disableGutters", "variant"]);
return /*#__PURE__*/react.createElement(Component, _extends({
className: clsx(classes.root, classes[variant], className, !disableGutters && classes.gutters),
ref: ref
}, other));
});
var Toolbar$1 = withStyles(styles, {
name: 'MuiToolbar'
})(Toolbar);
export { AppBar$1 as AppBar, CssBaseline$1 as CssBaseline, Drawer$1 as Drawer, IconButton$1 as IconButton, Toolbar$1 as Toolbar, makeStyles };
import { _ as _extends } from '../../common/_index-4fa100fd.js';
import { a as _objectWithoutProperties } from '../../common/StylesProvider-c4f38318.js';
import { r as react } from '../../common/index-57a74e37.js';
import '../../common/_index-aecdce4e.js';
import { w as withStyles, c as clsx } from '../../common/withStyles-a5c0f177.js';
import { c as capitalize } from '../../common/capitalize-46480bf1.js';
import '../../common/_commonjsHelpers-8c19dec8.js';
import '../../common/hoist-non-react-statics.cjs-43de917e.js';
var SIZE = 44;
var styles = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
display: 'inline-block'
},
/* Styles applied to the root element if `variant="static"`. */
static: {
transition: theme.transitions.create('transform')
},
/* Styles applied to the root element if `variant="indeterminate"`. */
indeterminate: {
animation: '$circular-rotate 1.4s linear infinite'
},
/* Styles applied to the root element if `variant="determinate"`. */
determinate: {
transition: theme.transitions.create('transform')
},
/* Styles applied to the root element if `color="primary"`. */
colorPrimary: {
color: theme.palette.primary.main
},
/* Styles applied to the root element if `color="secondary"`. */
colorSecondary: {
color: theme.palette.secondary.main
},
/* Styles applied to the `svg` element. */
svg: {
display: 'block' // Keeps the progress centered
},
/* Styles applied to the `circle` svg path. */
circle: {
stroke: 'currentColor' // Use butt to follow the specification, by chance, it's already the default CSS value.
// strokeLinecap: 'butt',
},
/* Styles applied to the `circle` svg path if `variant="static"`. */
circleStatic: {
transition: theme.transitions.create('stroke-dashoffset')
},
/* Styles applied to the `circle` svg path if `variant="indeterminate"`. */
circleIndeterminate: {
animation: '$circular-dash 1.4s ease-in-out infinite',
// Some default value that looks fine waiting for the animation to kicks in.
strokeDasharray: '80px, 200px',
strokeDashoffset: '0px' // Add the unit to fix a Edge 16 and below bug.
},
/* Styles applied to the `circle` svg path if `variant="determinate"`. */
circleDeterminate: {
transition: theme.transitions.create('stroke-dashoffset')
},
'@keyframes circular-rotate': {
'0%': {
// Fix IE 11 wobbly
transformOrigin: '50% 50%'
},
'100%': {
transform: 'rotate(360deg)'
}
},
'@keyframes circular-dash': {
'0%': {
strokeDasharray: '1px, 200px',
strokeDashoffset: '0px'
},
'50%': {
strokeDasharray: '100px, 200px',
strokeDashoffset: '-15px'
},
'100%': {
strokeDasharray: '100px, 200px',
strokeDashoffset: '-125px'
}
},
/* Styles applied to the `circle` svg path if `disableShrink={true}`. */
circleDisableShrink: {
animation: 'none'
}
};
};
/**
* ## ARIA
*
* If the progress bar is describing the loading progress of a particular region of a page,
* you should use `aria-describedby` to point to the progress bar, and set the `aria-busy`
* attribute to `true` on that region until it has finished loading.
*/
var CircularProgress = /*#__PURE__*/react.forwardRef(function CircularProgress(props, ref) {
var classes = props.classes,
className = props.className,
_props$color = props.color,
color = _props$color === void 0 ? 'primary' : _props$color,
_props$disableShrink = props.disableShrink,
disableShrink = _props$disableShrink === void 0 ? false : _props$disableShrink,
_props$size = props.size,
size = _props$size === void 0 ? 40 : _props$size,
style = props.style,
_props$thickness = props.thickness,
thickness = _props$thickness === void 0 ? 3.6 : _props$thickness,
_props$value = props.value,
value = _props$value === void 0 ? 0 : _props$value,
_props$variant = props.variant,
variant = _props$variant === void 0 ? 'indeterminate' : _props$variant,
other = _objectWithoutProperties(props, ["classes", "className", "color", "disableShrink", "size", "style", "thickness", "value", "variant"]);
var circleStyle = {};
var rootStyle = {};
var rootProps = {};
if (variant === 'determinate' || variant === 'static') {
var circumference = 2 * Math.PI * ((SIZE - thickness) / 2);
circleStyle.strokeDasharray = circumference.toFixed(3);
rootProps['aria-valuenow'] = Math.round(value);
circleStyle.strokeDashoffset = "".concat(((100 - value) / 100 * circumference).toFixed(3), "px");
rootStyle.transform = 'rotate(-90deg)';
}
return /*#__PURE__*/react.createElement("div", _extends({
className: clsx(classes.root, className, color !== 'inherit' && classes["color".concat(capitalize(color))], {
'determinate': classes.determinate,
'indeterminate': classes.indeterminate,
'static': classes.static
}[variant]),
style: _extends({
width: size,
height: size
}, rootStyle, style),
ref: ref,
role: "progressbar"
}, rootProps, other), /*#__PURE__*/react.createElement("svg", {
className: classes.svg,
viewBox: "".concat(SIZE / 2, " ").concat(SIZE / 2, " ").concat(SIZE, " ").concat(SIZE)
}, /*#__PURE__*/react.createElement("circle", {
className: clsx(classes.circle, disableShrink && classes.circleDisableShrink, {
'determinate': classes.circleDeterminate,
'indeterminate': classes.circleIndeterminate,
'static': classes.circleStatic
}[variant]),
style: circleStyle,
cx: SIZE,
cy: SIZE,
r: (SIZE - thickness) / 2,
fill: "none",
strokeWidth: thickness
})));
});
var __pika_web_default_export_for_treeshaking__ = withStyles(styles, {
name: 'MuiCircularProgress',
flip: false
})(CircularProgress);
export default __pika_web_default_export_for_treeshaking__;
import { a as _objectWithoutProperties } from '../../common/StylesProvider-c4f38318.js';
import { _ as _extends } from '../../common/_index-4fa100fd.js';
import { r as react } from '../../common/index-57a74e37.js';
import '../../common/_index-aecdce4e.js';
import { w as withStyles, c as clsx } from '../../common/withStyles-a5c0f177.js';
import '../../common/_commonjsHelpers-8c19dec8.js';
import '../../common/hoist-non-react-statics.cjs-43de917e.js';
var SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
function generateGrid(globalStyles, theme, breakpoint) {
var styles = {};
GRID_SIZES.forEach(function (size) {
var key = "grid-".concat(breakpoint, "-").concat(size);
if (size === true) {
// For the auto layouting
styles[key] = {
flexBasis: 0,
flexGrow: 1,
maxWidth: '100%'
};
return;
}
if (size === 'auto') {
styles[key] = {
flexBasis: 'auto',
flexGrow: 0,
maxWidth: 'none'
};
return;
} // Keep 7 significant numbers.
var width = "".concat(Math.round(size / 12 * 10e7) / 10e5, "%"); // Close to the bootstrap implementation:
// https://github.com/twbs/bootstrap/blob/8fccaa2439e97ec72a4b7dc42ccc1f649790adb0/scss/mixins/_grid.scss#L41
styles[key] = {
flexBasis: width,
flexGrow: 0,
maxWidth: width
};
}); // No need for a media query for the first size.
if (breakpoint === 'xs') {
_extends(globalStyles, styles);
} else {
globalStyles[theme.breakpoints.up(breakpoint)] = styles;
}
}
function getOffset(val) {
var div = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
var parse = parseFloat(val);
return "".concat(parse / div).concat(String(val).replace(String(parse), '') || 'px');
}
function generateGutter(theme, breakpoint) {
var styles = {};
SPACINGS.forEach(function (spacing) {
var themeSpacing = theme.spacing(spacing);
if (themeSpacing === 0) {
return;
}
styles["spacing-".concat(breakpoint, "-").concat(spacing)] = {
margin: "-".concat(getOffset(themeSpacing, 2)),
width: "calc(100% + ".concat(getOffset(themeSpacing), ")"),
'& > $item': {
padding: getOffset(themeSpacing, 2)
}
};
});
return styles;
} // Default CSS values
// flex: '0 1 auto',
// flexDirection: 'row',
// alignItems: 'flex-start',
// flexWrap: 'nowrap',
// justifyContent: 'flex-start',
var styles = function styles(theme) {
return _extends({
/* Styles applied to the root element. */
root: {},
/* Styles applied to the root element if `container={true}`. */
container: {
boxSizing: 'border-box',
display: 'flex',
flexWrap: 'wrap',
width: '100%'
},
/* Styles applied to the root element if `item={true}`. */
item: {
boxSizing: 'border-box',
margin: '0' // For instance, it's useful when used with a `figure` element.
},
/* Styles applied to the root element if `zeroMinWidth={true}`. */
zeroMinWidth: {
minWidth: 0
},
/* Styles applied to the root element if `direction="column"`. */
'direction-xs-column': {
flexDirection: 'column'
},
/* Styles applied to the root element if `direction="column-reverse"`. */
'direction-xs-column-reverse': {
flexDirection: 'column-reverse'
},
/* Styles applied to the root element if `direction="row-reverse"`. */
'direction-xs-row-reverse': {
flexDirection: 'row-reverse'
},
/* Styles applied to the root element if `wrap="nowrap"`. */
'wrap-xs-nowrap': {
flexWrap: 'nowrap'
},
/* Styles applied to the root element if `wrap="reverse"`. */
'wrap-xs-wrap-reverse': {
flexWrap: 'wrap-reverse'
},
/* Styles applied to the root element if `alignItems="center"`. */
'align-items-xs-center': {
alignItems: 'center'
},
/* Styles applied to the root element if `alignItems="flex-start"`. */
'align-items-xs-flex-start': {
alignItems: 'flex-start'
},
/* Styles applied to the root element if `alignItems="flex-end"`. */
'align-items-xs-flex-end': {
alignItems: 'flex-end'
},
/* Styles applied to the root element if `alignItems="baseline"`. */
'align-items-xs-baseline': {
alignItems: 'baseline'
},
/* Styles applied to the root element if `alignContent="center"`. */
'align-content-xs-center': {
alignContent: 'center'
},
/* Styles applied to the root element if `alignContent="flex-start"`. */
'align-content-xs-flex-start': {
alignContent: 'flex-start'
},
/* Styles applied to the root element if `alignContent="flex-end"`. */
'align-content-xs-flex-end': {
alignContent: 'flex-end'
},
/* Styles applied to the root element if `alignContent="space-between"`. */
'align-content-xs-space-between': {
alignContent: 'space-between'
},
/* Styles applied to the root element if `alignContent="space-around"`. */
'align-content-xs-space-around': {
alignContent: 'space-around'
},
/* Styles applied to the root element if `justify="center"`. */
'justify-xs-center': {
justifyContent: 'center'
},
/* Styles applied to the root element if `justify="flex-end"`. */
'justify-xs-flex-end': {
justifyContent: 'flex-end'
},
/* Styles applied to the root element if `justify="space-between"`. */
'justify-xs-space-between': {
justifyContent: 'space-between'
},
/* Styles applied to the root element if `justify="space-around"`. */
'justify-xs-space-around': {
justifyContent: 'space-around'
},
/* Styles applied to the root element if `justify="space-evenly"`. */
'justify-xs-space-evenly': {
justifyContent: 'space-evenly'
}
}, generateGutter(theme, 'xs'), theme.breakpoints.keys.reduce(function (accumulator, key) {
// Use side effect over immutability for better performance.
generateGrid(accumulator, theme, key);
return accumulator;
}, {}));
};
var Grid = /*#__PURE__*/react.forwardRef(function Grid(props, ref) {
var _props$alignContent = props.alignContent,
alignContent = _props$alignContent === void 0 ? 'stretch' : _props$alignContent,
_props$alignItems = props.alignItems,
alignItems = _props$alignItems === void 0 ? 'stretch' : _props$alignItems,
classes = props.classes,
classNameProp = props.className,
_props$component = props.component,
Component = _props$component === void 0 ? 'div' : _props$component,
_props$container = props.container,
container = _props$container === void 0 ? false : _props$container,
_props$direction = props.direction,
direction = _props$direction === void 0 ? 'row' : _props$direction,
_props$item = props.item,
item = _props$item === void 0 ? false : _props$item,
_props$justify = props.justify,
justify = _props$justify === void 0 ? 'flex-start' : _props$justify,
_props$lg = props.lg,
lg = _props$lg === void 0 ? false : _props$lg,
_props$md = props.md,
md = _props$md === void 0 ? false : _props$md,
_props$sm = props.sm,
sm = _props$sm === void 0 ? false : _props$sm,
_props$spacing = props.spacing,
spacing = _props$spacing === void 0 ? 0 : _props$spacing,
_props$wrap = props.wrap,
wrap = _props$wrap === void 0 ? 'wrap' : _props$wrap,
_props$xl = props.xl,
xl = _props$xl === void 0 ? false : _props$xl,
_props$xs = props.xs,
xs = _props$xs === void 0 ? false : _props$xs,
_props$zeroMinWidth = props.zeroMinWidth,
zeroMinWidth = _props$zeroMinWidth === void 0 ? false : _props$zeroMinWidth,
other = _objectWithoutProperties(props, ["alignContent", "alignItems", "classes", "className", "component", "container", "direction", "item", "justify", "lg", "md", "sm", "spacing", "wrap", "xl", "xs", "zeroMinWidth"]);
var className = clsx(classes.root, classNameProp, container && [classes.container, spacing !== 0 && classes["spacing-xs-".concat(String(spacing))]], item && classes.item, zeroMinWidth && classes.zeroMinWidth, direction !== 'row' && classes["direction-xs-".concat(String(direction))], wrap !== 'wrap' && classes["wrap-xs-".concat(String(wrap))], alignItems !== 'stretch' && classes["align-items-xs-".concat(String(alignItems))], alignContent !== 'stretch' && classes["align-content-xs-".concat(String(alignContent))], justify !== 'flex-start' && classes["justify-xs-".concat(String(justify))], xs !== false && classes["grid-xs-".concat(String(xs))], sm !== false && classes["grid-sm-".concat(String(sm))], md !== false && classes["grid-md-".concat(String(md))], lg !== false && classes["grid-lg-".concat(String(lg))], xl !== false && classes["grid-xl-".concat(String(xl))]);
return /*#__PURE__*/react.createElement(Component, _extends({
className: className,
ref: ref
}, other));
});
var StyledGrid = withStyles(styles, {
name: 'MuiGrid'
})(Grid);
export default StyledGrid;
import { _ as _extends } from '../../common/_index-4fa100fd.js';
import { a as _objectWithoutProperties } from '../../common/StylesProvider-c4f38318.js';
import { r as react } from '../../common/index-57a74e37.js';
import '../../common/_index-aecdce4e.js';
import { w as withStyles, c as clsx } from '../../common/withStyles-a5c0f177.js';
import { L as ListContext } from '../../common/ListContext-3115f135.js';
import '../../common/_commonjsHelpers-8c19dec8.js';
import '../../common/hoist-non-react-statics.cjs-43de917e.js';
var styles = {
/* Styles applied to the root element. */
root: {
listStyle: 'none',
margin: 0,
padding: 0,
position: 'relative'
},
/* Styles applied to the root element if `disablePadding={false}`. */
padding: {
paddingTop: 8,
paddingBottom: 8
},
/* Styles applied to the root element if dense. */
dense: {},
/* Styles applied to the root element if a `subheader` is provided. */
subheader: {
paddingTop: 0
}
};
var List = /*#__PURE__*/react.forwardRef(function List(props, ref) {
var children = props.children,
classes = props.classes,
className = props.className,
_props$component = props.component,
Component = _props$component === void 0 ? 'ul' : _props$component,
_props$dense = props.dense,
dense = _props$dense === void 0 ? false : _props$dense,
_props$disablePadding = props.disablePadding,
disablePadding = _props$disablePadding === void 0 ? false : _props$disablePadding,
subheader = props.subheader,
other = _objectWithoutProperties(props, ["children", "classes", "className", "component", "dense", "disablePadding", "subheader"]);
var context = react.useMemo(function () {
return {
dense: dense
};
}, [dense]);
return /*#__PURE__*/react.createElement(ListContext.Provider, {
value: context
}, /*#__PURE__*/react.createElement(Component, _extends({
className: clsx(classes.root, className, dense && classes.dense, !disablePadding && classes.padding, subheader && classes.subheader),
ref: ref
}, other), subheader, children));
});
var __pika_web_default_export_for_treeshaking__ = withStyles(styles, {
name: 'MuiList'
})(List);
export default __pika_web_default_export_for_treeshaking__;
import { _ as _extends } from '../../common/_index-4fa100fd.js';
import { a as _objectWithoutProperties } from '../../common/StylesProvider-c4f38318.js';
import { r as react } from '../../common/index-57a74e37.js';
import '../../common/_index-aecdce4e.js';
import { w as withStyles, c as clsx } from '../../common/withStyles-a5c0f177.js';
import { i as isMuiElement } from '../../common/isMuiElement-81ae803d.js';
import { u as useForkRef } from '../../common/useIsFocusVisible-e5c1f5cc.js';
import { L as ListContext } from '../../common/ListContext-3115f135.js';
import { r as reactDom } from '../../common/index-8dbeb7e4.js';
import { B as ButtonBase } from '../../common/ButtonBase-36493559.js';
import '../../common/_commonjsHelpers-8c19dec8.js';
import '../../common/hoist-non-react-statics.cjs-43de917e.js';
var styles = function styles(theme) {
return {
/* Styles applied to the (normally root) `component` element. May be wrapped by a `container`. */
root: {
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center',
position: 'relative',
textDecoration: 'none',
width: '100%',
boxSizing: 'border-box',
textAlign: 'left',
paddingTop: 8,
paddingBottom: 8,
'&$focusVisible': {
backgroundColor: theme.palette.action.selected
},
'&$selected, &$selected:hover': {
backgroundColor: theme.palette.action.selected
},
'&$disabled': {
opacity: 0.5
}
},
/* Styles applied to the `container` element if `children` includes `ListItemSecondaryAction`. */
container: {
position: 'relative'
},
/* Pseudo-class applied to the `component`'s `focusVisibleClassName` prop if `button={true}`. */
focusVisible: {},
/* Styles applied to the `component` element if dense. */
dense: {
paddingTop: 4,
paddingBottom: 4
},
/* Styles applied to the `component` element if `alignItems="flex-start"`. */
alignItemsFlexStart: {
alignItems: 'flex-start'
},
/* Pseudo-class applied to the inner `component` element if `disabled={true}`. */
disabled: {},
/* Styles applied to the inner `component` element if `divider={true}`. */
divider: {
borderBottom: "1px solid ".concat(theme.palette.divider),
backgroundClip: 'padding-box'
},
/* Styles applied to the inner `component` element if `disableGutters={false}`. */
gutters: {
paddingLeft: 16,
paddingRight: 16
},
/* Styles applied to the inner `component` element if `button={true}`. */
button: {
transition: theme.transitions.create('background-color', {
duration: theme.transitions.duration.shortest
}),
'&:hover': {
textDecoration: 'none',
backgroundColor: theme.palette.action.hover,
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
backgroundColor: 'transparent'
}
}
},
/* Styles applied to the `component` element if `children` includes `ListItemSecondaryAction`. */
secondaryAction: {
// Add some space to avoid collision as `ListItemSecondaryAction`
// is absolutely positioned.
paddingRight: 48
},
/* Pseudo-class applied to the root element if `selected={true}`. */
selected: {}
};
};
var useEnhancedEffect = typeof window === 'undefined' ? react.useEffect : react.useLayoutEffect;
/**
* Uses an additional container component if `ListItemSecondaryAction` is the last child.
*/
var ListItem = /*#__PURE__*/react.forwardRef(function ListItem(props, ref) {
var _props$alignItems = props.alignItems,
alignItems = _props$alignItems === void 0 ? 'center' : _props$alignItems,
_props$autoFocus = props.autoFocus,
autoFocus = _props$autoFocus === void 0 ? false : _props$autoFocus,
_props$button = props.button,
button = _props$button === void 0 ? false : _props$button,
childrenProp = props.children,
classes = props.classes,
className = props.className,
componentProp = props.component,
_props$ContainerCompo = props.ContainerComponent,
ContainerComponent = _props$ContainerCompo === void 0 ? 'li' : _props$ContainerCompo,
_props$ContainerProps = props.ContainerProps;
_props$ContainerProps = _props$ContainerProps === void 0 ? {} : _props$ContainerProps;
var ContainerClassName = _props$ContainerProps.className,
ContainerProps = _objectWithoutProperties(_props$ContainerProps, ["className"]),
_props$dense = props.dense,
dense = _props$dense === void 0 ? false : _props$dense,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
_props$disableGutters = props.disableGutters,
disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters,
_props$divider = props.divider,
divider = _props$divider === void 0 ? false : _props$divider,
focusVisibleClassName = props.focusVisibleClassName,
_props$selected = props.selected,
selected = _props$selected === void 0 ? false : _props$selected,
other = _objectWithoutProperties(props, ["alignItems", "autoFocus", "button", "children", "classes", "className", "component", "ContainerComponent", "ContainerProps", "dense", "disabled", "disableGutters", "divider", "focusVisibleClassName", "selected"]);
var context = react.useContext(ListContext);
var childContext = {
dense: dense || context.dense || false,
alignItems: alignItems
};
var listItemRef = react.useRef(null);
useEnhancedEffect(function () {
if (autoFocus) {
if (listItemRef.current) {
listItemRef.current.focus();
}
}
}, [autoFocus]);
var children = react.Children.toArray(childrenProp);
var hasSecondaryAction = children.length && isMuiElement(children[children.length - 1], ['ListItemSecondaryAction']);
var handleOwnRef = react.useCallback(function (instance) {
// #StrictMode ready
listItemRef.current = reactDom.findDOMNode(instance);
}, []);
var handleRef = useForkRef(handleOwnRef, ref);
var componentProps = _extends({
className: clsx(classes.root, className, childContext.dense && classes.dense, !disableGutters && classes.gutters, divider && classes.divider, disabled && classes.disabled, button && classes.button, alignItems !== "center" && classes.alignItemsFlexStart, hasSecondaryAction && classes.secondaryAction, selected && classes.selected),
disabled: disabled
}, other);
var Component = componentProp || 'li';
if (button) {
componentProps.component = componentProp || 'div';
componentProps.focusVisibleClassName = clsx(classes.focusVisible, focusVisibleClassName);
Component = ButtonBase;
}
if (hasSecondaryAction) {
// Use div by default.
Component = !componentProps.component && !componentProp ? 'div' : Component; // Avoid nesting of li > li.
if (ContainerComponent === 'li') {
if (Component === 'li') {
Component = 'div';
} else if (componentProps.component === 'li') {
componentProps.component = 'div';
}
}
return /*#__PURE__*/react.createElement(ListContext.Provider, {
value: childContext
}, /*#__PURE__*/react.createElement(ContainerComponent, _extends({
className: clsx(classes.container, ContainerClassName),
ref: handleRef
}, ContainerProps), /*#__PURE__*/react.createElement(Component, componentProps, children), children.pop()));
}
return /*#__PURE__*/react.createElement(ListContext.Provider, {
value: childContext
}, /*#__PURE__*/react.createElement(Component, _extends({
ref: handleRef
}, componentProps), children));
});
var __pika_web_default_export_for_treeshaking__ = withStyles(styles, {
name: 'MuiListItem'
})(ListItem);
export default __pika_web_default_export_for_treeshaking__;
import { _ as _extends } from '../../common/_index-4fa100fd.js';
import { a as _objectWithoutProperties } from '../../common/StylesProvider-c4f38318.js';
import { r as react } from '../../common/index-57a74e37.js';
import '../../common/_index-aecdce4e.js';
import { w as withStyles, c as clsx } from '../../common/withStyles-a5c0f177.js';
import { L as ListContext } from '../../common/ListContext-3115f135.js';
import '../../common/_commonjsHelpers-8c19dec8.js';
import '../../common/hoist-non-react-statics.cjs-43de917e.js';
var styles = {
/* Styles applied to the root element. */
root: {
minWidth: 56,
flexShrink: 0
},
/* Styles applied to the root element when the parent `ListItem` uses `alignItems="flex-start"`. */
alignItemsFlexStart: {
marginTop: 8
}
};
/**
* A simple wrapper to apply `List` styles to an `Avatar`.
*/
var ListItemAvatar = /*#__PURE__*/react.forwardRef(function ListItemAvatar(props, ref) {
var classes = props.classes,
className = props.className,
other = _objectWithoutProperties(props, ["classes", "className"]);
var context = react.useContext(ListContext);
return /*#__PURE__*/react.createElement("div", _extends({
className: clsx(classes.root, className, context.alignItems === 'flex-start' && classes.alignItemsFlexStart),
ref: ref
}, other));
});
var __pika_web_default_export_for_treeshaking__ = withStyles(styles, {
name: 'MuiListItemAvatar'
})(ListItemAvatar);
export default __pika_web_default_export_for_treeshaking__;
import { _ as _extends } from '../../common/_index-4fa100fd.js';
import { a as _objectWithoutProperties } from '../../common/StylesProvider-c4f38318.js';
import { r as react } from '../../common/index-57a74e37.js';
import '../../common/_index-aecdce4e.js';
import { w as withStyles, c as clsx } from '../../common/withStyles-a5c0f177.js';
import { L as ListContext } from '../../common/ListContext-3115f135.js';
import { T as Typography } from '../../common/Typography-0032d134.js';
import '../../common/_commonjsHelpers-8c19dec8.js';
import '../../common/hoist-non-react-statics.cjs-43de917e.js';
import '../../common/capitalize-46480bf1.js';
var styles = {
/* Styles applied to the root element. */
root: {
flex: '1 1 auto',
minWidth: 0,
marginTop: 4,
marginBottom: 4
},
/* Styles applied to the `Typography` components if primary and secondary are set. */
multiline: {
marginTop: 6,
marginBottom: 6
},
/* Styles applied to the `Typography` components if dense. */
dense: {},
/* Styles applied to the root element if `inset={true}`. */
inset: {
paddingLeft: 56
},
/* Styles applied to the primary `Typography` component. */
primary: {},
/* Styles applied to the secondary `Typography` component. */
secondary: {}
};
var ListItemText = /*#__PURE__*/react.forwardRef(function ListItemText(props, ref) {
var children = props.children,
classes = props.classes,
className = props.className,
_props$disableTypogra = props.disableTypography,
disableTypography = _props$disableTypogra === void 0 ? false : _props$disableTypogra,
_props$inset = props.inset,
inset = _props$inset === void 0 ? false : _props$inset,
primaryProp = props.primary,
primaryTypographyProps = props.primaryTypographyProps,
secondaryProp = props.secondary,
secondaryTypographyProps = props.secondaryTypographyProps,
other = _objectWithoutProperties(props, ["children", "classes", "className", "disableTypography", "inset", "primary", "primaryTypographyProps", "secondary", "secondaryTypographyProps"]);
var _React$useContext = react.useContext(ListContext),
dense = _React$useContext.dense;
var primary = primaryProp != null ? primaryProp : children;
if (primary != null && primary.type !== Typography && !disableTypography) {
primary = /*#__PURE__*/react.createElement(Typography, _extends({
variant: dense ? 'body2' : 'body1',
className: classes.primary,
component: "span",
display: "block"
}, primaryTypographyProps), primary);
}
var secondary = secondaryProp;
if (secondary != null && secondary.type !== Typography && !disableTypography) {
secondary = /*#__PURE__*/react.createElement(Typography, _extends({
variant: "body2",
className: classes.secondary,
color: "textSecondary",
display: "block"
}, secondaryTypographyProps), secondary);
}
return /*#__PURE__*/react.createElement("div", _extends({
className: clsx(classes.root, className, dense && classes.dense, inset && classes.inset, primary && secondary && classes.multiline),
ref: ref
}, other), primary, secondary);
});
var __pika_web_default_export_for_treeshaking__ = withStyles(styles, {
name: 'MuiListItemText'
})(ListItemText);
export default __pika_web_default_export_for_treeshaking__;
import { u as useTheme, n as nested, T as ThemeContext } from '../../common/StylesProvider-c4f38318.js';
export { l as StylesProvider, i as createMuiTheme } from '../../common/StylesProvider-c4f38318.js';
import { _ as _extends } from '../../common/_index-4fa100fd.js';
import { r as react } from '../../common/index-57a74e37.js';
import '../../common/_index-aecdce4e.js';
import '../../common/_commonjsHelpers-8c19dec8.js';
function mergeOuterLocalTheme(outerTheme, localTheme) {
if (typeof localTheme === 'function') {
var mergedTheme = localTheme(outerTheme);
return mergedTheme;
}
return _extends({}, outerTheme, localTheme);
}
/**
* This component takes a `theme` prop.
* It makes the `theme` available down the React tree thanks to React context.
* This component should preferably be used at **the root of your component tree**.
*/
function ThemeProvider(props) {
var children = props.children,
localTheme = props.theme;
var outerTheme = useTheme();
var theme = react.useMemo(function () {
var output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);
if (output != null) {
output[nested] = outerTheme !== null;
}
return output;
}, [localTheme, outerTheme]);
return /*#__PURE__*/react.createElement(ThemeContext.Provider, {
value: theme
}, children);
}
export { ThemeProvider };
import { g as getDefaultExportFromCjs, c as createCommonjsModule } from '../../common/_commonjsHelpers-8c19dec8.js';
import { i as interopRequireWildcard, a as interopRequireDefault, c as createSvgIcon } from '../../common/createSvgIcon-adb3aa0c.js';
import { r as react } from '../../common/index-57a74e37.js';
import '../../common/capitalize-46480bf1.js';
import '../../common/StylesProvider-c4f38318.js';
import '../../common/_index-4fa100fd.js';
import '../../common/_index-aecdce4e.js';
import '../../common/ownerWindow-14b71efa.js';
import '../../common/withStyles-a5c0f177.js';
import '../../common/hoist-non-react-statics.cjs-43de917e.js';
import '../../common/isMuiElement-81ae803d.js';
import '../../common/useIsFocusVisible-e5c1f5cc.js';
import '../../common/index-8dbeb7e4.js';
var MailOutline = createCommonjsModule(function (module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = interopRequireWildcard(react);
var _createSvgIcon = interopRequireDefault(createSvgIcon);
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement("path", {
d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"
}), 'MailOutline');
exports.default = _default;
});
var __pika_web_default_export_for_treeshaking__ = /*@__PURE__*/getDefaultExportFromCjs(MailOutline);
export default __pika_web_default_export_for_treeshaking__;
import { g as getDefaultExportFromCjs, c as createCommonjsModule } from '../../common/_commonjsHelpers-8c19dec8.js';
import { i as interopRequireWildcard, a as interopRequireDefault, c as createSvgIcon } from '../../common/createSvgIcon-adb3aa0c.js';
import { r as react } from '../../common/index-57a74e37.js';
import '../../common/capitalize-46480bf1.js';
import '../../common/StylesProvider-c4f38318.js';
import '../../common/_index-4fa100fd.js';
import '../../common/_index-aecdce4e.js';
import '../../common/ownerWindow-14b71efa.js';
import '../../common/withStyles-a5c0f177.js';
import '../../common/hoist-non-react-statics.cjs-43de917e.js';
import '../../common/isMuiElement-81ae803d.js';
import '../../common/useIsFocusVisible-e5c1f5cc.js';
import '../../common/index-8dbeb7e4.js';
var Menu = createCommonjsModule(function (module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var React = interopRequireWildcard(react);
var _createSvgIcon = interopRequireDefault(createSvgIcon);
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement("path", {
d: "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"
}), 'Menu');
exports.default = _default;
});
var __pika_web_default_export_for_treeshaking__ = /*@__PURE__*/getDefaultExportFromCjs(Menu);
export default __pika_web_default_export_for_treeshaking__;
var bind = function bind(fn, thisArg) {
return function wrap() {
var args = new Array(arguments.length);
for (var i = 0; i < args.length; i++) {
args[i] = arguments[i];
}
return fn.apply(thisArg, args);
};
};
/*global toString:true*/
// utils is a library of generic helper functions non-specific to axios
var toString = Object.prototype.toString;
/**
* Determine if a value is an Array
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Array, otherwise false
*/
function isArray(val) {
return toString.call(val) === '[object Array]';
}
/**
* Determine if a value is undefined
*
* @param {Object} val The value to test
* @returns {boolean} True if the value is undefined, otherwise false
*/
function isUndefined(val) {
return typeof val === 'undefined';
}
/**
* Determine if a value is a Buffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Buffer, otherwise false
*/
function isBuffer(val) {
return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
&& typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
}
/**
* Determine if a value is an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an ArrayBuffer, otherwise false
*/
function isArrayBuffer(val) {
return toString.call(val) === '[object ArrayBuffer]';
}
/**
* Determine if a value is a FormData
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an FormData, otherwise false
*/
function isFormData(val) {
return (typeof FormData !== 'undefined') && (val instanceof FormData);
}
/**
* Determine if a value is a view on an ArrayBuffer
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
*/
function isArrayBufferView(val) {
var result;
if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
result = ArrayBuffer.isView(val);
} else {
result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
}
return result;
}
/**
* Determine if a value is a String
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a String, otherwise false
*/
function isString(val) {
return typeof val === 'string';
}
/**
* Determine if a value is a Number
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Number, otherwise false
*/
function isNumber(val) {
return typeof val === 'number';
}
/**
* Determine if a value is an Object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is an Object, otherwise false
*/
function isObject(val) {
return val !== null && typeof val === 'object';
}
/**
* Determine if a value is a plain Object
*
* @param {Object} val The value to test
* @return {boolean} True if value is a plain Object, otherwise false
*/
function isPlainObject(val) {
if (toString.call(val) !== '[object Object]') {
return false;
}
var prototype = Object.getPrototypeOf(val);
return prototype === null || prototype === Object.prototype;
}
/**
* Determine if a value is a Date
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Date, otherwise false
*/
function isDate(val) {
return toString.call(val) === '[object Date]';
}
/**
* Determine if a value is a File
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a File, otherwise false
*/
function isFile(val) {
return toString.call(val) === '[object File]';
}
/**
* Determine if a value is a Blob
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Blob, otherwise false
*/
function isBlob(val) {
return toString.call(val) === '[object Blob]';
}
/**
* Determine if a value is a Function
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Function, otherwise false
*/
function isFunction(val) {
return toString.call(val) === '[object Function]';
}
/**
* Determine if a value is a Stream
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a Stream, otherwise false
*/
function isStream(val) {
return isObject(val) && isFunction(val.pipe);
}
/**
* Determine if a value is a URLSearchParams object
*
* @param {Object} val The value to test
* @returns {boolean} True if value is a URLSearchParams object, otherwise false
*/
function isURLSearchParams(val) {
return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
}
/**
* Trim excess whitespace off the beginning and end of a string
*
* @param {String} str The String to trim
* @returns {String} The String freed of excess whitespace
*/
function trim(str) {
return str.replace(/^\s*/, '').replace(/\s*$/, '');
}
/**
* Determine if we're running in a standard browser environment
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
*
* web workers:
* typeof window -> undefined
* typeof document -> undefined
*
* react-native:
* navigator.product -> 'ReactNative'
* nativescript
* navigator.product -> 'NativeScript' or 'NS'
*/
function isStandardBrowserEnv() {
if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
navigator.product === 'NativeScript' ||
navigator.product === 'NS')) {
return false;
}
return (
typeof window !== 'undefined' &&
typeof document !== 'undefined'
);
}
/**
* Iterate over an Array or an Object invoking a function for each item.
*
* If `obj` is an Array callback will be called passing
* the value, index, and complete array for each item.
*
* If 'obj' is an Object callback will be called passing
* the value, key, and complete object for each property.
*
* @param {Object|Array} obj The object to iterate
* @param {Function} fn The callback to invoke for each item
*/
function forEach(obj, fn) {
// Don't bother if no value provided
if (obj === null || typeof obj === 'undefined') {
return;
}
// Force an array if not already something iterable
if (typeof obj !== 'object') {
/*eslint no-param-reassign:0*/
obj = [obj];
}
if (isArray(obj)) {
// Iterate over array values
for (var i = 0, l = obj.length; i < l; i++) {
fn.call(null, obj[i], i, obj);
}
} else {
// Iterate over object keys
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
fn.call(null, obj[key], key, obj);
}
}
}
}
/**
* Accepts varargs expecting each argument to be an object, then
* immutably merges the properties of each object and returns result.
*
* When multiple objects contain the same key the later object in
* the arguments list will take precedence.
*
* Example:
*
* ```js
* var result = merge({foo: 123}, {foo: 456});
* console.log(result.foo); // outputs 456
* ```
*
* @param {Object} obj1 Object to merge
* @returns {Object} Result of all merge properties
*/
function merge(/* obj1, obj2, obj3, ... */) {
var result = {};
function assignValue(val, key) {
if (isPlainObject(result[key]) && isPlainObject(val)) {
result[key] = merge(result[key], val);
} else if (isPlainObject(val)) {
result[key] = merge({}, val);
} else if (isArray(val)) {
result[key] = val.slice();
} else {
result[key] = val;
}
}
for (var i = 0, l = arguments.length; i < l; i++) {
forEach(arguments[i], assignValue);
}
return result;
}
/**
* Extends object a by mutably adding to it the properties of object b.
*
* @param {Object} a The object to be extended
* @param {Object} b The object to copy properties from
* @param {Object} thisArg The object to bind function to
* @return {Object} The resulting value of object a
*/
function extend(a, b, thisArg) {
forEach(b, function assignValue(val, key) {
if (thisArg && typeof val === 'function') {
a[key] = bind(val, thisArg);
} else {
a[key] = val;
}
});
return a;
}
/**
* Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
*
* @param {string} content with BOM
* @return {string} content value without BOM
*/
function stripBOM(content) {
if (content.charCodeAt(0) === 0xFEFF) {
content = content.slice(1);
}
return content;
}
var utils = {
isArray: isArray,
isArrayBuffer: isArrayBuffer,
isBuffer: isBuffer,
isFormData: isFormData,
isArrayBufferView: isArrayBufferView,
isString: isString,
isNumber: isNumber,
isObject: isObject,
isPlainObject: isPlainObject,
isUndefined: isUndefined,
isDate: isDate,
isFile: isFile,
isBlob: isBlob,
isFunction: isFunction,
isStream: isStream,
isURLSearchParams: isURLSearchParams,
isStandardBrowserEnv: isStandardBrowserEnv,
forEach: forEach,
merge: merge,
extend: extend,
trim: trim,
stripBOM: stripBOM
};
function encode(val) {
return encodeURIComponent(val).
replace(/%3A/gi, ':').
replace(/%24/g, '$').
replace(/%2C/gi, ',').
replace(/%20/g, '+').
replace(/%5B/gi, '[').
replace(/%5D/gi, ']');
}
/**
* Build a URL by appending params to the end
*
* @param {string} url The base of the url (e.g., http://www.google.com)
* @param {object} [params] The params to be appended
* @returns {string} The formatted url
*/
var buildURL = function buildURL(url, params, paramsSerializer) {
/*eslint no-param-reassign:0*/
if (!params) {
return url;
}
var serializedParams;
if (paramsSerializer) {
serializedParams = paramsSerializer(params);
} else if (utils.isURLSearchParams(params)) {
serializedParams = params.toString();
} else {
var parts = [];
utils.forEach(params, function serialize(val, key) {
if (val === null || typeof val === 'undefined') {
return;
}
if (utils.isArray(val)) {
key = key + '[]';
} else {
val = [val];
}
utils.forEach(val, function parseValue(v) {
if (utils.isDate(v)) {
v = v.toISOString();
} else if (utils.isObject(v)) {
v = JSON.stringify(v);
}
parts.push(encode(key) + '=' + encode(v));
});
});
serializedParams = parts.join('&');
}
if (serializedParams) {
var hashmarkIndex = url.indexOf('#');
if (hashmarkIndex !== -1) {
url = url.slice(0, hashmarkIndex);
}
url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
}
return url;
};
function InterceptorManager() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
this.handlers.push({
fulfilled: fulfilled,
rejected: rejected
});
return this.handlers.length - 1;
};
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*/
InterceptorManager.prototype.eject = function eject(id) {
if (this.handlers[id]) {
this.handlers[id] = null;
}
};
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*/
InterceptorManager.prototype.forEach = function forEach(fn) {
utils.forEach(this.handlers, function forEachHandler(h) {
if (h !== null) {
fn(h);
}
});
};
var InterceptorManager_1 = InterceptorManager;
/**
* Transform the data for a request or a response
*
* @param {Object|String} data The data to be transformed
* @param {Array} headers The headers for the request or response
* @param {Array|Function} fns A single function or Array of functions
* @returns {*} The resulting transformed data
*/
var transformData = function transformData(data, headers, fns) {
/*eslint no-param-reassign:0*/
utils.forEach(fns, function transform(fn) {
data = fn(data, headers);
});
return data;
};
var isCancel = function isCancel(value) {
return !!(value && value.__CANCEL__);
};
/* SNOWPACK PROCESS POLYFILL (based on https://github.com/calvinmetcalf/node-process-es6) */
function defaultSetTimout() {
throw new Error('setTimeout has not been defined');
}
function defaultClearTimeout () {
throw new Error('clearTimeout has not been defined');
}
var cachedSetTimeout = defaultSetTimout;
var cachedClearTimeout = defaultClearTimeout;
var globalContext;
if (typeof window !== 'undefined') {
globalContext = window;
} else if (typeof self !== 'undefined') {
globalContext = self;
} else {
globalContext = {};
}
if (typeof globalContext.setTimeout === 'function') {
cachedSetTimeout = setTimeout;
}
if (typeof globalContext.clearTimeout === 'function') {
cachedClearTimeout = clearTimeout;
}
function runTimeout(fun) {
if (cachedSetTimeout === setTimeout) {
//normal enviroments in sane situations
return setTimeout(fun, 0);
}
// if setTimeout wasn't available but was latter defined
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
cachedSetTimeout = setTimeout;
return setTimeout(fun, 0);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout(fun, 0);
} catch(e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout.call(null, fun, 0);
} catch(e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout.call(this, fun, 0);
}
}
}
function runClearTimeout(marker) {
if (cachedClearTimeout === clearTimeout) {
//normal enviroments in sane situations
return clearTimeout(marker);
}
// if clearTimeout wasn't available but was latter defined
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
cachedClearTimeout = clearTimeout;
return clearTimeout(marker);
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout(marker);
} catch (e){
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout.call(null, marker);
} catch (e){
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout.call(this, marker);
}
}
}
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = runTimeout(cleanUpNextTick);
draining = true;
var len = queue.length;
while(len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
currentQueue[queueIndex].run();
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
runClearTimeout(timeout);
}
function nextTick(fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push(new Item(fun, args));
if (queue.length === 1 && !draining) {
runTimeout(drainQueue);
}
}
// v8 likes predictible objects
function Item(fun, array) {
this.fun = fun;
this.array = array;
}
Item.prototype.run = function () {
this.fun.apply(null, this.array);
};
var title = 'browser';
var platform = 'browser';
var browser = true;
var argv = [];
var version = ''; // empty string to avoid regexp issues
var versions = {};
var release = {};
var config = {};
function noop() {}
var on = noop;
var addListener = noop;
var once = noop;
var off = noop;
var removeListener = noop;
var removeAllListeners = noop;
var emit = noop;
function binding(name) {
throw new Error('process.binding is not supported');
}
function cwd () { return '/' }
function chdir (dir) {
throw new Error('process.chdir is not supported');
}function umask() { return 0; }
// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
var performance = globalContext.performance || {};
var performanceNow =
performance.now ||
performance.mozNow ||
performance.msNow ||
performance.oNow ||
performance.webkitNow ||
function(){ return (new Date()).getTime() };
// generate timestamp or delta
// see http://nodejs.org/api/process.html#process_process_hrtime
function hrtime(previousTimestamp){
var clocktime = performanceNow.call(performance)*1e-3;
var seconds = Math.floor(clocktime);
var nanoseconds = Math.floor((clocktime%1)*1e9);
if (previousTimestamp) {
seconds = seconds - previousTimestamp[0];
nanoseconds = nanoseconds - previousTimestamp[1];
if (nanoseconds<0) {
seconds--;
nanoseconds += 1e9;
}
}
return [seconds,nanoseconds]
}
var startTime = new Date();
function uptime() {
var currentTime = new Date();
var dif = currentTime - startTime;
return dif / 1000;
}
var process = {
nextTick: nextTick,
title: title,
browser: browser,
env: {"NODE_ENV":"production"},
argv: argv,
version: version,
versions: versions,
on: on,
addListener: addListener,
once: once,
off: off,
removeListener: removeListener,
removeAllListeners: removeAllListeners,
emit: emit,
binding: binding,
cwd: cwd,
chdir: chdir,
umask: umask,
hrtime: hrtime,
platform: platform,
release: release,
config: config,
uptime: uptime
};
var normalizeHeaderName = function normalizeHeaderName(headers, normalizedName) {
utils.forEach(headers, function processHeader(value, name) {
if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
headers[normalizedName] = value;
delete headers[name];
}
});
};
/**
* Update an Error with the specified config, error code, and response.
*
* @param {Error} error The error to update.
* @param {Object} config The config.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
* @param {Object} [request] The request.
* @param {Object} [response] The response.
* @returns {Error} The error.
*/
var enhanceError = function enhanceError(error, config, code, request, response) {
error.config = config;
if (code) {
error.code = code;
}
error.request = request;
error.response = response;
error.isAxiosError = true;
error.toJSON = function toJSON() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: this.config,
code: this.code
};
};
return error;
};
/**
* Create an Error with the specified message, config, error code, request and response.
*
* @param {string} message The error message.
* @param {Object} config The config.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
* @param {Object} [request] The request.
* @param {Object} [response] The response.
* @returns {Error} The created error.
*/
var createError = function createError(message, config, code, request, response) {
var error = new Error(message);
return enhanceError(error, config, code, request, response);
};
/**
* Resolve or reject a Promise based on response status.
*
* @param {Function} resolve A function that resolves the promise.
* @param {Function} reject A function that rejects the promise.
* @param {object} response The response.
*/
var settle = function settle(resolve, reject, response) {
var validateStatus = response.config.validateStatus;
if (!response.status || !validateStatus || validateStatus(response.status)) {
resolve(response);
} else {
reject(createError(
'Request failed with status code ' + response.status,
response.config,
null,
response.request,
response
));
}
};
var cookies = (
utils.isStandardBrowserEnv() ?
// Standard browser envs support document.cookie
(function standardBrowserEnv() {
return {
write: function write(name, value, expires, path, domain, secure) {
var cookie = [];
cookie.push(name + '=' + encodeURIComponent(value));
if (utils.isNumber(expires)) {
cookie.push('expires=' + new Date(expires).toGMTString());
}
if (utils.isString(path)) {
cookie.push('path=' + path);
}
if (utils.isString(domain)) {
cookie.push('domain=' + domain);
}
if (secure === true) {
cookie.push('secure');
}
document.cookie = cookie.join('; ');
},
read: function read(name) {
var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
},
remove: function remove(name) {
this.write(name, '', Date.now() - 86400000);
}
};
})() :
// Non standard browser env (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return {
write: function write() {},
read: function read() { return null; },
remove: function remove() {}
};
})()
);
/**
* Determines whether the specified URL is absolute
*
* @param {string} url The URL to test
* @returns {boolean} True if the specified URL is absolute, otherwise false
*/
var isAbsoluteURL = function isAbsoluteURL(url) {
// A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
// RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
// by any combination of letters, digits, plus, period, or hyphen.
return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
};
/**
* Creates a new URL by combining the specified URLs
*
* @param {string} baseURL The base URL
* @param {string} relativeURL The relative URL
* @returns {string} The combined URL
*/
var combineURLs = function combineURLs(baseURL, relativeURL) {
return relativeURL
? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
: baseURL;
};
/**
* Creates a new URL by combining the baseURL with the requestedURL,
* only when the requestedURL is not already an absolute URL.
* If the requestURL is absolute, this function returns the requestedURL untouched.
*
* @param {string} baseURL The base URL
* @param {string} requestedURL Absolute or relative URL to combine
* @returns {string} The combined full path
*/
var buildFullPath = function buildFullPath(baseURL, requestedURL) {
if (baseURL && !isAbsoluteURL(requestedURL)) {
return combineURLs(baseURL, requestedURL);
}
return requestedURL;
};
// Headers whose duplicates are ignored by node
// c.f. https://nodejs.org/api/http.html#http_message_headers
var ignoreDuplicateOf = [
'age', 'authorization', 'content-length', 'content-type', 'etag',
'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
'last-modified', 'location', 'max-forwards', 'proxy-authorization',
'referer', 'retry-after', 'user-agent'
];
/**
* Parse headers into an object
*
* ```
* Date: Wed, 27 Aug 2014 08:58:49 GMT
* Content-Type: application/json
* Connection: keep-alive
* Transfer-Encoding: chunked
* ```
*
* @param {String} headers Headers needing to be parsed
* @returns {Object} Headers parsed into an object
*/
var parseHeaders = function parseHeaders(headers) {
var parsed = {};
var key;
var val;
var i;
if (!headers) { return parsed; }
utils.forEach(headers.split('\n'), function parser(line) {
i = line.indexOf(':');
key = utils.trim(line.substr(0, i)).toLowerCase();
val = utils.trim(line.substr(i + 1));
if (key) {
if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
return;
}
if (key === 'set-cookie') {
parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
} else {
parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
}
}
});
return parsed;
};
var isURLSameOrigin = (
utils.isStandardBrowserEnv() ?
// Standard browser envs have full support of the APIs needed to test
// whether the request URL is of the same origin as current location.
(function standardBrowserEnv() {
var msie = /(msie|trident)/i.test(navigator.userAgent);
var urlParsingNode = document.createElement('a');
var originURL;
/**
* Parse a URL to discover it's components
*
* @param {String} url The URL to be parsed
* @returns {Object}
*/
function resolveURL(url) {
var href = url;
if (msie) {
// IE needs attribute set twice to normalize properties
urlParsingNode.setAttribute('href', href);
href = urlParsingNode.href;
}
urlParsingNode.setAttribute('href', href);
// urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
return {
href: urlParsingNode.href,
protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
host: urlParsingNode.host,
search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
hostname: urlParsingNode.hostname,
port: urlParsingNode.port,
pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
urlParsingNode.pathname :
'/' + urlParsingNode.pathname
};
}
originURL = resolveURL(window.location.href);
/**
* Determine if a URL shares the same origin as the current location
*
* @param {String} requestURL The URL to test
* @returns {boolean} True if URL shares the same origin, otherwise false
*/
return function isURLSameOrigin(requestURL) {
var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
return (parsed.protocol === originURL.protocol &&
parsed.host === originURL.host);
};
})() :
// Non standard browser envs (web workers, react-native) lack needed support.
(function nonStandardBrowserEnv() {
return function isURLSameOrigin() {
return true;
};
})()
);
var xhr = function xhrAdapter(config) {
return new Promise(function dispatchXhrRequest(resolve, reject) {
var requestData = config.data;
var requestHeaders = config.headers;
if (utils.isFormData(requestData)) {
delete requestHeaders['Content-Type']; // Let the browser set it
}
var request = new XMLHttpRequest();
// HTTP basic authentication
if (config.auth) {
var username = config.auth.username || '';
var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
}
var fullPath = buildFullPath(config.baseURL, config.url);
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
// Set the request timeout in MS
request.timeout = config.timeout;
// Listen for ready state
request.onreadystatechange = function handleLoad() {
if (!request || request.readyState !== 4) {
return;
}
// The request errored out and we didn't get a response, this will be
// handled by onerror instead
// With one exception: request that using file: protocol, most browsers
// will return status as 0 even though it's a successful request
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
return;
}
// Prepare the response
var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
var response = {
data: responseData,
status: request.status,
statusText: request.statusText,
headers: responseHeaders,
config: config,
request: request
};
settle(resolve, reject, response);
// Clean up request
request = null;
};
// Handle browser request cancellation (as opposed to a manual cancellation)
request.onabort = function handleAbort() {
if (!request) {
return;
}
reject(createError('Request aborted', config, 'ECONNABORTED', request));
// Clean up request
request = null;
};
// Handle low level network errors
request.onerror = function handleError() {
// Real errors are hidden from us by the browser
// onerror should only fire if it's a network error
reject(createError('Network Error', config, null, request));
// Clean up request
request = null;
};
// Handle timeout
request.ontimeout = function handleTimeout() {
var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
if (config.timeoutErrorMessage) {
timeoutErrorMessage = config.timeoutErrorMessage;
}
reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
request));
// Clean up request
request = null;
};
// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if (utils.isStandardBrowserEnv()) {
// Add xsrf header
var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
cookies.read(config.xsrfCookieName) :
undefined;
if (xsrfValue) {
requestHeaders[config.xsrfHeaderName] = xsrfValue;
}
}
// Add headers to the request
if ('setRequestHeader' in request) {
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
// Remove Content-Type if data is undefined
delete requestHeaders[key];
} else {
// Otherwise add header to the request
request.setRequestHeader(key, val);
}
});
}
// Add withCredentials to request if needed
if (!utils.isUndefined(config.withCredentials)) {
request.withCredentials = !!config.withCredentials;
}
// Add responseType to request if needed
if (config.responseType) {
try {
request.responseType = config.responseType;
} catch (e) {
// Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
// But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
if (config.responseType !== 'json') {
throw e;
}
}
}
// Handle progress if needed
if (typeof config.onDownloadProgress === 'function') {
request.addEventListener('progress', config.onDownloadProgress);
}
// Not all browsers support upload events
if (typeof config.onUploadProgress === 'function' && request.upload) {
request.upload.addEventListener('progress', config.onUploadProgress);
}
if (config.cancelToken) {
// Handle cancellation
config.cancelToken.promise.then(function onCanceled(cancel) {
if (!request) {
return;
}
request.abort();
reject(cancel);
// Clean up request
request = null;
});
}
if (!requestData) {
requestData = null;
}
// Send the request
request.send(requestData);
});
};
var DEFAULT_CONTENT_TYPE = {
'Content-Type': 'application/x-www-form-urlencoded'
};
function setContentTypeIfUnset(headers, value) {
if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
headers['Content-Type'] = value;
}
}
function getDefaultAdapter() {
var adapter;
if (typeof XMLHttpRequest !== 'undefined') {
// For browsers use XHR adapter
adapter = xhr;
} else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
// For node use HTTP adapter
adapter = xhr;
}
return adapter;
}
var defaults = {
adapter: getDefaultAdapter(),
transformRequest: [function transformRequest(data, headers) {
normalizeHeaderName(headers, 'Accept');
normalizeHeaderName(headers, 'Content-Type');
if (utils.isFormData(data) ||
utils.isArrayBuffer(data) ||
utils.isBuffer(data) ||
utils.isStream(data) ||
utils.isFile(data) ||
utils.isBlob(data)
) {
return data;
}
if (utils.isArrayBufferView(data)) {
return data.buffer;
}
if (utils.isURLSearchParams(data)) {
setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
return data.toString();
}
if (utils.isObject(data)) {
setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
return JSON.stringify(data);
}
return data;
}],
transformResponse: [function transformResponse(data) {
/*eslint no-param-reassign:0*/
if (typeof data === 'string') {
try {
data = JSON.parse(data);
} catch (e) { /* Ignore */ }
}
return data;
}],
/**
* A timeout in milliseconds to abort a request. If set to 0 (default) a
* timeout is not created.
*/
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: function validateStatus(status) {
return status >= 200 && status < 300;
}
};
defaults.headers = {
common: {
'Accept': 'application/json, text/plain, */*'
}
};
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
defaults.headers[method] = {};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
});
var defaults_1 = defaults;
/**
* Throws a `Cancel` if cancellation has been requested.
*/
function throwIfCancellationRequested(config) {
if (config.cancelToken) {
config.cancelToken.throwIfRequested();
}
}
/**
* Dispatch a request to the server using the configured adapter.
*
* @param {object} config The config that is to be used for the request
* @returns {Promise} The Promise to be fulfilled
*/
var dispatchRequest = function dispatchRequest(config) {
throwIfCancellationRequested(config);
// Ensure headers exist
config.headers = config.headers || {};
// Transform request data
config.data = transformData(
config.data,
config.headers,
config.transformRequest
);
// Flatten headers
config.headers = utils.merge(
config.headers.common || {},
config.headers[config.method] || {},
config.headers
);
utils.forEach(
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
function cleanHeaderConfig(method) {
delete config.headers[method];
}
);
var adapter = config.adapter || defaults_1.adapter;
return adapter(config).then(function onAdapterResolution(response) {
throwIfCancellationRequested(config);
// Transform response data
response.data = transformData(
response.data,
response.headers,
config.transformResponse
);
return response;
}, function onAdapterRejection(reason) {
if (!isCancel(reason)) {
throwIfCancellationRequested(config);
// Transform response data
if (reason && reason.response) {
reason.response.data = transformData(
reason.response.data,
reason.response.headers,
config.transformResponse
);
}
}
return Promise.reject(reason);
});
};
/**
* Config-specific merge-function which creates a new config-object
* by merging two configuration objects together.
*
* @param {Object} config1
* @param {Object} config2
* @returns {Object} New object resulting from merging config2 to config1
*/
var mergeConfig = function mergeConfig(config1, config2) {
// eslint-disable-next-line no-param-reassign
config2 = config2 || {};
var config = {};
var valueFromConfig2Keys = ['url', 'method', 'data'];
var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];
var defaultToConfig2Keys = [
'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',
'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',
'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',
'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'
];
var directMergeKeys = ['validateStatus'];
function getMergedValue(target, source) {
if (utils.isPlainObject(target) && utils.isPlainObject(source)) {
return utils.merge(target, source);
} else if (utils.isPlainObject(source)) {
return utils.merge({}, source);
} else if (utils.isArray(source)) {
return source.slice();
}
return source;
}
function mergeDeepProperties(prop) {
if (!utils.isUndefined(config2[prop])) {
config[prop] = getMergedValue(config1[prop], config2[prop]);
} else if (!utils.isUndefined(config1[prop])) {
config[prop] = getMergedValue(undefined, config1[prop]);
}
}
utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
if (!utils.isUndefined(config2[prop])) {
config[prop] = getMergedValue(undefined, config2[prop]);
}
});
utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
if (!utils.isUndefined(config2[prop])) {
config[prop] = getMergedValue(undefined, config2[prop]);
} else if (!utils.isUndefined(config1[prop])) {
config[prop] = getMergedValue(undefined, config1[prop]);
}
});
utils.forEach(directMergeKeys, function merge(prop) {
if (prop in config2) {
config[prop] = getMergedValue(config1[prop], config2[prop]);
} else if (prop in config1) {
config[prop] = getMergedValue(undefined, config1[prop]);
}
});
var axiosKeys = valueFromConfig2Keys
.concat(mergeDeepPropertiesKeys)
.concat(defaultToConfig2Keys)
.concat(directMergeKeys);
var otherKeys = Object
.keys(config1)
.concat(Object.keys(config2))
.filter(function filterAxiosKeys(key) {
return axiosKeys.indexOf(key) === -1;
});
utils.forEach(otherKeys, mergeDeepProperties);
return config;
};
/**
* Create a new instance of Axios
*
* @param {Object} instanceConfig The default config for the instance
*/
function Axios(instanceConfig) {
this.defaults = instanceConfig;
this.interceptors = {
request: new InterceptorManager_1(),
response: new InterceptorManager_1()
};
}
/**
* Dispatch a request
*
* @param {Object} config The config specific for this request (merged with this.defaults)
*/
Axios.prototype.request = function request(config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof config === 'string') {
config = arguments[1] || {};
config.url = arguments[0];
} else {
config = config || {};
}
config = mergeConfig(this.defaults, config);
// Set config.method
if (config.method) {
config.method = config.method.toLowerCase();
} else if (this.defaults.method) {
config.method = this.defaults.method.toLowerCase();
} else {
config.method = 'get';
}
// Hook up interceptors middleware
var chain = [dispatchRequest, undefined];
var promise = Promise.resolve(config);
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
chain.unshift(interceptor.fulfilled, interceptor.rejected);
});
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
chain.push(interceptor.fulfilled, interceptor.rejected);
});
while (chain.length) {
promise = promise.then(chain.shift(), chain.shift());
}
return promise;
};
Axios.prototype.getUri = function getUri(config) {
config = mergeConfig(this.defaults, config);
return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
};
// Provide aliases for supported request methods
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, config) {
return this.request(mergeConfig(config || {}, {
method: method,
url: url,
data: (config || {}).data
}));
};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, data, config) {
return this.request(mergeConfig(config || {}, {
method: method,
url: url,
data: data
}));
};
});
var Axios_1 = Axios;
/**
* A `Cancel` is an object that is thrown when an operation is canceled.
*
* @class
* @param {string=} message The message.
*/
function Cancel(message) {
this.message = message;
}
Cancel.prototype.toString = function toString() {
return 'Cancel' + (this.message ? ': ' + this.message : '');
};
Cancel.prototype.__CANCEL__ = true;
var Cancel_1 = Cancel;
/**
* A `CancelToken` is an object that can be used to request cancellation of an operation.
*
* @class
* @param {Function} executor The executor function.
*/
function CancelToken(executor) {
if (typeof executor !== 'function') {
throw new TypeError('executor must be a function.');
}
var resolvePromise;
this.promise = new Promise(function promiseExecutor(resolve) {
resolvePromise = resolve;
});
var token = this;
executor(function cancel(message) {
if (token.reason) {
// Cancellation has already been requested
return;
}
token.reason = new Cancel_1(message);
resolvePromise(token.reason);
});
}
/**
* Throws a `Cancel` if cancellation has been requested.
*/
CancelToken.prototype.throwIfRequested = function throwIfRequested() {
if (this.reason) {
throw this.reason;
}
};
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
CancelToken.source = function source() {
var cancel;
var token = new CancelToken(function executor(c) {
cancel = c;
});
return {
token: token,
cancel: cancel
};
};
var CancelToken_1 = CancelToken;
/**
* Syntactic sugar for invoking a function and expanding an array for arguments.
*
* Common use case would be to use `Function.prototype.apply`.
*
* ```js
* function f(x, y, z) {}
* var args = [1, 2, 3];
* f.apply(null, args);
* ```
*
* With `spread` this example can be re-written.
*
* ```js
* spread(function(x, y, z) {})([1, 2, 3]);
* ```
*
* @param {Function} callback
* @returns {Function}
*/
var spread = function spread(callback) {
return function wrap(arr) {
return callback.apply(null, arr);
};
};
/**
* Determines whether the payload is an error thrown by Axios
*
* @param {*} payload The value to test
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
*/
var isAxiosError = function isAxiosError(payload) {
return (typeof payload === 'object') && (payload.isAxiosError === true);
};
/**
* Create an instance of Axios
*
* @param {Object} defaultConfig The default config for the instance
* @return {Axios} A new instance of Axios
*/
function createInstance(defaultConfig) {
var context = new Axios_1(defaultConfig);
var instance = bind(Axios_1.prototype.request, context);
// Copy axios.prototype to instance
utils.extend(instance, Axios_1.prototype, context);
// Copy context to instance
utils.extend(instance, context);
return instance;
}
// Create the default instance to be exported
var axios$1 = createInstance(defaults_1);
// Expose Axios class to allow class inheritance
axios$1.Axios = Axios_1;
// Factory for creating new instances
axios$1.create = function create(instanceConfig) {
return createInstance(mergeConfig(axios$1.defaults, instanceConfig));
};
// Expose Cancel & CancelToken
axios$1.Cancel = Cancel_1;
axios$1.CancelToken = CancelToken_1;
axios$1.isCancel = isCancel;
// Expose all/spread
axios$1.all = function all(promises) {
return Promise.all(promises);
};
axios$1.spread = spread;
// Expose isAxiosError
axios$1.isAxiosError = isAxiosError;
var axios_1 = axios$1;
// Allow use of default import syntax in TypeScript
var _default = axios$1;
axios_1.default = _default;
var axios = axios_1;
export default axios;
import { _ as _extends } from './_index-4fa100fd.js';
import { k as _assertThisInitialized, a as _objectWithoutProperties, c as _toConsumableArray } from './StylesProvider-c4f38318.js';
import { r as react } from './index-57a74e37.js';
import { _ as _inheritsLoose, a as _objectWithoutPropertiesLoose } from './_index-aecdce4e.js';
import { r as reactDom } from './index-8dbeb7e4.js';
import { c as clsx, w as withStyles } from './withStyles-a5c0f177.js';
import { a as useEventCallback, b as useIsFocusVisible, u as useForkRef } from './useIsFocusVisible-e5c1f5cc.js';
var TransitionGroupContext = react.createContext(null);
/**
* Given `this.props.children`, return an object mapping key to child.
*
* @param {*} children `this.props.children`
* @return {object} Mapping of key to child
*/
function getChildMapping(children, mapFn) {
var mapper = function mapper(child) {
return mapFn && react.isValidElement(child) ? mapFn(child) : child;
};
var result = Object.create(null);
if (children) react.Children.map(children, function (c) {
return c;
}).forEach(function (child) {
// run the map function here instead so that the key is the computed one
result[child.key] = mapper(child);
});
return result;
}
/**
* When you're adding or removing children some may be added or removed in the
* same render pass. We want to show *both* since we want to simultaneously
* animate elements in and out. This function takes a previous set of keys
* and a new set of keys and merges them with its best guess of the correct
* ordering. In the future we may expose some of the utilities in
* ReactMultiChild to make this easy, but for now React itself does not
* directly have this concept of the union of prevChildren and nextChildren
* so we implement it here.
*
* @param {object} prev prev children as returned from
* `ReactTransitionChildMapping.getChildMapping()`.
* @param {object} next next children as returned from
* `ReactTransitionChildMapping.getChildMapping()`.
* @return {object} a key set that contains all keys in `prev` and all keys
* in `next` in a reasonable order.
*/
function mergeChildMappings(prev, next) {
prev = prev || {};
next = next || {};
function getValueForKey(key) {
return key in next ? next[key] : prev[key];
} // For each key of `next`, the list of keys to insert before that key in
// the combined list
var nextKeysPending = Object.create(null);
var pendingKeys = [];
for (var prevKey in prev) {
if (prevKey in next) {
if (pendingKeys.length) {
nextKeysPending[prevKey] = pendingKeys;
pendingKeys = [];
}
} else {
pendingKeys.push(prevKey);
}
}
var i;
var childMapping = {};
for (var nextKey in next) {
if (nextKeysPending[nextKey]) {
for (i = 0; i < nextKeysPending[nextKey].length; i++) {
var pendingNextKey = nextKeysPending[nextKey][i];
childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);
}
}
childMapping[nextKey] = getValueForKey(nextKey);
} // Finally, add the keys which didn't appear before any key in `next`
for (i = 0; i < pendingKeys.length; i++) {
childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);
}
return childMapping;
}
function getProp(child, prop, props) {
return props[prop] != null ? props[prop] : child.props[prop];
}
function getInitialChildMapping(props, onExited) {
return getChildMapping(props.children, function (child) {
return react.cloneElement(child, {
onExited: onExited.bind(null, child),
in: true,
appear: getProp(child, 'appear', props),
enter: getProp(child, 'enter', props),
exit: getProp(child, 'exit', props)
});
});
}
function getNextChildMapping(nextProps, prevChildMapping, onExited) {
var nextChildMapping = getChildMapping(nextProps.children);
var children = mergeChildMappings(prevChildMapping, nextChildMapping);
Object.keys(children).forEach(function (key) {
var child = children[key];
if (!react.isValidElement(child)) return;
var hasPrev = (key in prevChildMapping);
var hasNext = (key in nextChildMapping);
var prevChild = prevChildMapping[key];
var isLeaving = react.isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)
if (hasNext && (!hasPrev || isLeaving)) {
// console.log('entering', key)
children[key] = react.cloneElement(child, {
onExited: onExited.bind(null, child),
in: true,
exit: getProp(child, 'exit', nextProps),
enter: getProp(child, 'enter', nextProps)
});
} else if (!hasNext && hasPrev && !isLeaving) {
// item is old (exiting)
// console.log('leaving', key)
children[key] = react.cloneElement(child, {
in: false
});
} else if (hasNext && hasPrev && react.isValidElement(prevChild)) {
// item hasn't changed transition states
// copy over the last transition props;
// console.log('unchanged', key)
children[key] = react.cloneElement(child, {
onExited: onExited.bind(null, child),
in: prevChild.props.in,
exit: getProp(child, 'exit', nextProps),
enter: getProp(child, 'enter', nextProps)
});
}
});
return children;
}
var values = Object.values || function (obj) {
return Object.keys(obj).map(function (k) {
return obj[k];
});
};
var defaultProps = {
component: 'div',
childFactory: function childFactory(child) {
return child;
}
};
/**
* The `<TransitionGroup>` component manages a set of transition components
* (`<Transition>` and `<CSSTransition>`) in a list. Like with the transition
* components, `<TransitionGroup>` is a state machine for managing the mounting
* and unmounting of components over time.
*
* Consider the example below. As items are removed or added to the TodoList the
* `in` prop is toggled automatically by the `<TransitionGroup>`.
*
* Note that `<TransitionGroup>` does not define any animation behavior!
* Exactly _how_ a list item animates is up to the individual transition
* component. This means you can mix and match animations across different list
* items.
*/
var TransitionGroup = /*#__PURE__*/function (_React$Component) {
_inheritsLoose(TransitionGroup, _React$Component);
function TransitionGroup(props, context) {
var _this;
_this = _React$Component.call(this, props, context) || this;
var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear
_this.state = {
contextValue: {
isMounting: true
},
handleExited: handleExited,
firstRender: true
};
return _this;
}
var _proto = TransitionGroup.prototype;
_proto.componentDidMount = function componentDidMount() {
this.mounted = true;
this.setState({
contextValue: {
isMounting: false
}
});
};
_proto.componentWillUnmount = function componentWillUnmount() {
this.mounted = false;
};
TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {
var prevChildMapping = _ref.children,
handleExited = _ref.handleExited,
firstRender = _ref.firstRender;
return {
children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),
firstRender: false
};
} // node is `undefined` when user provided `nodeRef` prop
;
_proto.handleExited = function handleExited(child, node) {
var currentChildMapping = getChildMapping(this.props.children);
if (child.key in currentChildMapping) return;
if (child.props.onExited) {
child.props.onExited(node);
}
if (this.mounted) {
this.setState(function (state) {
var children = _extends({}, state.children);
delete children[child.key];
return {
children: children
};
});
}
};
_proto.render = function render() {
var _this$props = this.props,
Component = _this$props.component,
childFactory = _this$props.childFactory,
props = _objectWithoutPropertiesLoose(_this$props, ["component", "childFactory"]);
var contextValue = this.state.contextValue;
var children = values(this.state.children).map(childFactory);
delete props.appear;
delete props.enter;
delete props.exit;
if (Component === null) {
return /*#__PURE__*/react.createElement(TransitionGroupContext.Provider, {
value: contextValue
}, children);
}
return /*#__PURE__*/react.createElement(TransitionGroupContext.Provider, {
value: contextValue
}, /*#__PURE__*/react.createElement(Component, props, children));
};
return TransitionGroup;
}(react.Component);
TransitionGroup.propTypes = {};
TransitionGroup.defaultProps = defaultProps;
var useEnhancedEffect = typeof window === 'undefined' ? react.useEffect : react.useLayoutEffect;
/**
* @ignore - internal component.
*/
function Ripple(props) {
var classes = props.classes,
_props$pulsate = props.pulsate,
pulsate = _props$pulsate === void 0 ? false : _props$pulsate,
rippleX = props.rippleX,
rippleY = props.rippleY,
rippleSize = props.rippleSize,
inProp = props.in,
_props$onExited = props.onExited,
onExited = _props$onExited === void 0 ? function () {} : _props$onExited,
timeout = props.timeout;
var _React$useState = react.useState(false),
leaving = _React$useState[0],
setLeaving = _React$useState[1];
var rippleClassName = clsx(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
var rippleStyles = {
width: rippleSize,
height: rippleSize,
top: -(rippleSize / 2) + rippleY,
left: -(rippleSize / 2) + rippleX
};
var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
var handleExited = useEventCallback(onExited); // Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority
useEnhancedEffect(function () {
if (!inProp) {
// react-transition-group#onExit
setLeaving(true); // react-transition-group#onExited
var timeoutId = setTimeout(handleExited, timeout);
return function () {
clearTimeout(timeoutId);
};
}
return undefined;
}, [handleExited, inProp, timeout]);
return /*#__PURE__*/react.createElement("span", {
className: rippleClassName,
style: rippleStyles
}, /*#__PURE__*/react.createElement("span", {
className: childClassName
}));
}
var DURATION = 550;
var DELAY_RIPPLE = 80;
var styles$1 = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
overflow: 'hidden',
pointerEvents: 'none',
position: 'absolute',
zIndex: 0,
top: 0,
right: 0,
bottom: 0,
left: 0,
borderRadius: 'inherit'
},
/* Styles applied to the internal `Ripple` components `ripple` class. */
ripple: {
opacity: 0,
position: 'absolute'
},
/* Styles applied to the internal `Ripple` components `rippleVisible` class. */
rippleVisible: {
opacity: 0.3,
transform: 'scale(1)',
animation: "$enter ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut)
},
/* Styles applied to the internal `Ripple` components `ripplePulsate` class. */
ripplePulsate: {
animationDuration: "".concat(theme.transitions.duration.shorter, "ms")
},
/* Styles applied to the internal `Ripple` components `child` class. */
child: {
opacity: 1,
display: 'block',
width: '100%',
height: '100%',
borderRadius: '50%',
backgroundColor: 'currentColor'
},
/* Styles applied to the internal `Ripple` components `childLeaving` class. */
childLeaving: {
opacity: 0,
animation: "$exit ".concat(DURATION, "ms ").concat(theme.transitions.easing.easeInOut)
},
/* Styles applied to the internal `Ripple` components `childPulsate` class. */
childPulsate: {
position: 'absolute',
left: 0,
top: 0,
animation: "$pulsate 2500ms ".concat(theme.transitions.easing.easeInOut, " 200ms infinite")
},
'@keyframes enter': {
'0%': {
transform: 'scale(0)',
opacity: 0.1
},
'100%': {
transform: 'scale(1)',
opacity: 0.3
}
},
'@keyframes exit': {
'0%': {
opacity: 1
},
'100%': {
opacity: 0
}
},
'@keyframes pulsate': {
'0%': {
transform: 'scale(1)'
},
'50%': {
transform: 'scale(0.92)'
},
'100%': {
transform: 'scale(1)'
}
}
};
};
/**
* @ignore - internal component.
*
* TODO v5: Make private
*/
var TouchRipple = /*#__PURE__*/react.forwardRef(function TouchRipple(props, ref) {
var _props$center = props.center,
centerProp = _props$center === void 0 ? false : _props$center,
classes = props.classes,
className = props.className,
other = _objectWithoutProperties(props, ["center", "classes", "className"]);
var _React$useState = react.useState([]),
ripples = _React$useState[0],
setRipples = _React$useState[1];
var nextKey = react.useRef(0);
var rippleCallback = react.useRef(null);
react.useEffect(function () {
if (rippleCallback.current) {
rippleCallback.current();
rippleCallback.current = null;
}
}, [ripples]); // Used to filter out mouse emulated events on mobile.
var ignoringMouseDown = react.useRef(false); // We use a timer in order to only show the ripples for touch "click" like events.
// We don't want to display the ripple for touch scroll events.
var startTimer = react.useRef(null); // This is the hook called once the previous timeout is ready.
var startTimerCommit = react.useRef(null);
var container = react.useRef(null);
react.useEffect(function () {
return function () {
clearTimeout(startTimer.current);
};
}, []);
var startCommit = react.useCallback(function (params) {
var pulsate = params.pulsate,
rippleX = params.rippleX,
rippleY = params.rippleY,
rippleSize = params.rippleSize,
cb = params.cb;
setRipples(function (oldRipples) {
return [].concat(_toConsumableArray(oldRipples), [/*#__PURE__*/react.createElement(Ripple, {
key: nextKey.current,
classes: classes,
timeout: DURATION,
pulsate: pulsate,
rippleX: rippleX,
rippleY: rippleY,
rippleSize: rippleSize
})]);
});
nextKey.current += 1;
rippleCallback.current = cb;
}, [classes]);
var start = react.useCallback(function () {
var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var cb = arguments.length > 2 ? arguments[2] : undefined;
var _options$pulsate = options.pulsate,
pulsate = _options$pulsate === void 0 ? false : _options$pulsate,
_options$center = options.center,
center = _options$center === void 0 ? centerProp || options.pulsate : _options$center,
_options$fakeElement = options.fakeElement,
fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement;
if (event.type === 'mousedown' && ignoringMouseDown.current) {
ignoringMouseDown.current = false;
return;
}
if (event.type === 'touchstart') {
ignoringMouseDown.current = true;
}
var element = fakeElement ? null : container.current;
var rect = element ? element.getBoundingClientRect() : {
width: 0,
height: 0,
left: 0,
top: 0
}; // Get the size of the ripple
var rippleX;
var rippleY;
var rippleSize;
if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
rippleX = Math.round(rect.width / 2);
rippleY = Math.round(rect.height / 2);
} else {
var _ref = event.touches ? event.touches[0] : event,
clientX = _ref.clientX,
clientY = _ref.clientY;
rippleX = Math.round(clientX - rect.left);
rippleY = Math.round(clientY - rect.top);
}
if (center) {
rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3); // For some reason the animation is broken on Mobile Chrome if the size if even.
if (rippleSize % 2 === 0) {
rippleSize += 1;
}
} else {
var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));
} // Touche devices
if (event.touches) {
// check that this isn't another touchstart due to multitouch
// otherwise we will only clear a single timer when unmounting while two
// are running
if (startTimerCommit.current === null) {
// Prepare the ripple effect.
startTimerCommit.current = function () {
startCommit({
pulsate: pulsate,
rippleX: rippleX,
rippleY: rippleY,
rippleSize: rippleSize,
cb: cb
});
}; // Delay the execution of the ripple effect.
startTimer.current = setTimeout(function () {
if (startTimerCommit.current) {
startTimerCommit.current();
startTimerCommit.current = null;
}
}, DELAY_RIPPLE); // We have to make a tradeoff with this value.
}
} else {
startCommit({
pulsate: pulsate,
rippleX: rippleX,
rippleY: rippleY,
rippleSize: rippleSize,
cb: cb
});
}
}, [centerProp, startCommit]);
var pulsate = react.useCallback(function () {
start({}, {
pulsate: true
});
}, [start]);
var stop = react.useCallback(function (event, cb) {
clearTimeout(startTimer.current); // The touch interaction occurs too quickly.
// We still want to show ripple effect.
if (event.type === 'touchend' && startTimerCommit.current) {
event.persist();
startTimerCommit.current();
startTimerCommit.current = null;
startTimer.current = setTimeout(function () {
stop(event, cb);
});
return;
}
startTimerCommit.current = null;
setRipples(function (oldRipples) {
if (oldRipples.length > 0) {
return oldRipples.slice(1);
}
return oldRipples;
});
rippleCallback.current = cb;
}, []);
react.useImperativeHandle(ref, function () {
return {
pulsate: pulsate,
start: start,
stop: stop
};
}, [pulsate, start, stop]);
return /*#__PURE__*/react.createElement("span", _extends({
className: clsx(classes.root, className),
ref: container
}, other), /*#__PURE__*/react.createElement(TransitionGroup, {
component: null,
exit: true
}, ripples));
});
var TouchRipple$1 = withStyles(styles$1, {
flip: false,
name: 'MuiTouchRipple'
})( /*#__PURE__*/react.memo(TouchRipple));
var styles = {
/* Styles applied to the root element. */
root: {
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
position: 'relative',
WebkitTapHighlightColor: 'transparent',
backgroundColor: 'transparent',
// Reset default value
// We disable the focus ring for mouse, touch and keyboard users.
outline: 0,
border: 0,
margin: 0,
// Remove the margin in Safari
borderRadius: 0,
padding: 0,
// Remove the padding in Firefox
cursor: 'pointer',
userSelect: 'none',
verticalAlign: 'middle',
'-moz-appearance': 'none',
// Reset
'-webkit-appearance': 'none',
// Reset
textDecoration: 'none',
// So we take precedent over the style of a native <a /> element.
color: 'inherit',
'&::-moz-focus-inner': {
borderStyle: 'none' // Remove Firefox dotted outline.
},
'&$disabled': {
pointerEvents: 'none',
// Disable link interactions
cursor: 'default'
},
'@media print': {
colorAdjust: 'exact'
}
},
/* Pseudo-class applied to the root element if `disabled={true}`. */
disabled: {},
/* Pseudo-class applied to the root element if keyboard focused. */
focusVisible: {}
};
/**
* `ButtonBase` contains as few styles as possible.
* It aims to be a simple building block for creating a button.
* It contains a load of style reset and some focus/ripple logic.
*/
var ButtonBase = /*#__PURE__*/react.forwardRef(function ButtonBase(props, ref) {
var action = props.action,
buttonRefProp = props.buttonRef,
_props$centerRipple = props.centerRipple,
centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,
children = props.children,
classes = props.classes,
className = props.className,
_props$component = props.component,
component = _props$component === void 0 ? 'button' : _props$component,
_props$disabled = props.disabled,
disabled = _props$disabled === void 0 ? false : _props$disabled,
_props$disableRipple = props.disableRipple,
disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,
_props$disableTouchRi = props.disableTouchRipple,
disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,
_props$focusRipple = props.focusRipple,
focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,
focusVisibleClassName = props.focusVisibleClassName,
onBlur = props.onBlur,
onClick = props.onClick,
onFocus = props.onFocus,
onFocusVisible = props.onFocusVisible,
onKeyDown = props.onKeyDown,
onKeyUp = props.onKeyUp,
onMouseDown = props.onMouseDown,
onMouseLeave = props.onMouseLeave,
onMouseUp = props.onMouseUp,
onTouchEnd = props.onTouchEnd,
onTouchMove = props.onTouchMove,
onTouchStart = props.onTouchStart,
onDragLeave = props.onDragLeave,
_props$tabIndex = props.tabIndex,
tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
TouchRippleProps = props.TouchRippleProps,
_props$type = props.type,
type = _props$type === void 0 ? 'button' : _props$type,
other = _objectWithoutProperties(props, ["action", "buttonRef", "centerRipple", "children", "classes", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "onBlur", "onClick", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "onDragLeave", "tabIndex", "TouchRippleProps", "type"]);
var buttonRef = react.useRef(null);
function getButtonNode() {
// #StrictMode ready
return reactDom.findDOMNode(buttonRef.current);
}
var rippleRef = react.useRef(null);
var _React$useState = react.useState(false),
focusVisible = _React$useState[0],
setFocusVisible = _React$useState[1];
if (disabled && focusVisible) {
setFocusVisible(false);
}
var _useIsFocusVisible = useIsFocusVisible(),
isFocusVisible = _useIsFocusVisible.isFocusVisible,
onBlurVisible = _useIsFocusVisible.onBlurVisible,
focusVisibleRef = _useIsFocusVisible.ref;
react.useImperativeHandle(action, function () {
return {
focusVisible: function focusVisible() {
setFocusVisible(true);
buttonRef.current.focus();
}
};
}, []);
react.useEffect(function () {
if (focusVisible && focusRipple && !disableRipple) {
rippleRef.current.pulsate();
}
}, [disableRipple, focusRipple, focusVisible]);
function useRippleHandler(rippleAction, eventCallback) {
var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;
return useEventCallback(function (event) {
if (eventCallback) {
eventCallback(event);
}
var ignore = skipRippleAction;
if (!ignore && rippleRef.current) {
rippleRef.current[rippleAction](event);
}
return true;
});
}
var handleMouseDown = useRippleHandler('start', onMouseDown);
var handleDragLeave = useRippleHandler('stop', onDragLeave);
var handleMouseUp = useRippleHandler('stop', onMouseUp);
var handleMouseLeave = useRippleHandler('stop', function (event) {
if (focusVisible) {
event.preventDefault();
}
if (onMouseLeave) {
onMouseLeave(event);
}
});
var handleTouchStart = useRippleHandler('start', onTouchStart);
var handleTouchEnd = useRippleHandler('stop', onTouchEnd);
var handleTouchMove = useRippleHandler('stop', onTouchMove);
var handleBlur = useRippleHandler('stop', function (event) {
if (focusVisible) {
onBlurVisible(event);
setFocusVisible(false);
}
if (onBlur) {
onBlur(event);
}
}, false);
var handleFocus = useEventCallback(function (event) {
// Fix for https://github.com/facebook/react/issues/7769
if (!buttonRef.current) {
buttonRef.current = event.currentTarget;
}
if (isFocusVisible(event)) {
setFocusVisible(true);
if (onFocusVisible) {
onFocusVisible(event);
}
}
if (onFocus) {
onFocus(event);
}
});
var isNonNativeButton = function isNonNativeButton() {
var button = getButtonNode();
return component && component !== 'button' && !(button.tagName === 'A' && button.href);
};
/**
* IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
*/
var keydownRef = react.useRef(false);
var handleKeyDown = useEventCallback(function (event) {
// Check if key is already down to avoid repeats being counted as multiple activations
if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
keydownRef.current = true;
event.persist();
rippleRef.current.stop(event, function () {
rippleRef.current.start(event);
});
}
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
event.preventDefault();
}
if (onKeyDown) {
onKeyDown(event);
} // Keyboard accessibility for non interactive elements
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
event.preventDefault();
if (onClick) {
onClick(event);
}
}
});
var handleKeyUp = useEventCallback(function (event) {
// calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
// https://codesandbox.io/s/button-keyup-preventdefault-dn7f0
if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
keydownRef.current = false;
event.persist();
rippleRef.current.stop(event, function () {
rippleRef.current.pulsate(event);
});
}
if (onKeyUp) {
onKeyUp(event);
} // Keyboard accessibility for non interactive elements
if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
onClick(event);
}
});
var ComponentProp = component;
if (ComponentProp === 'button' && other.href) {
ComponentProp = 'a';
}
var buttonProps = {};
if (ComponentProp === 'button') {
buttonProps.type = type;
buttonProps.disabled = disabled;
} else {
if (ComponentProp !== 'a' || !other.href) {
buttonProps.role = 'button';
}
buttonProps['aria-disabled'] = disabled;
}
var handleUserRef = useForkRef(buttonRefProp, ref);
var handleOwnRef = useForkRef(focusVisibleRef, buttonRef);
var handleRef = useForkRef(handleUserRef, handleOwnRef);
var _React$useState2 = react.useState(false),
mountedState = _React$useState2[0],
setMountedState = _React$useState2[1];
react.useEffect(function () {
setMountedState(true);
}, []);
var enableTouchRipple = mountedState && !disableRipple && !disabled;
return /*#__PURE__*/react.createElement(ComponentProp, _extends({
className: clsx(classes.root, className, focusVisible && [classes.focusVisible, focusVisibleClassName], disabled && classes.disabled),
onBlur: handleBlur,
onClick: onClick,
onFocus: handleFocus,
onKeyDown: handleKeyDown,
onKeyUp: handleKeyUp,
onMouseDown: handleMouseDown,
onMouseLeave: handleMouseLeave,
onMouseUp: handleMouseUp,
onDragLeave: handleDragLeave,
onTouchEnd: handleTouchEnd,
onTouchMove: handleTouchMove,
onTouchStart: handleTouchStart,
ref: handleRef,
tabIndex: disabled ? -1 : tabIndex
}, buttonProps, other), children, enableTouchRipple ?
/*#__PURE__*/
/* TouchRipple is only needed client-side, x2 boost on the server. */
react.createElement(TouchRipple$1, _extends({
ref: rippleRef,
center: centerRipple
}, TouchRippleProps)) : null);
});
var ButtonBase$1 = withStyles(styles, {
name: 'MuiButtonBase'
})(ButtonBase);
export { ButtonBase$1 as B, TransitionGroupContext as T };
import { r as react } from './index-57a74e37.js';
/**
* @ignore - internal component.
*/
var ListContext = react.createContext({});
export { ListContext as L };
This source diff could not be displayed because it is too large. You can view the blob instead.
import { _ as _extends } from './_index-4fa100fd.js';
import { a as _objectWithoutProperties } from './StylesProvider-c4f38318.js';
import { r as react } from './index-57a74e37.js';
import './_index-aecdce4e.js';
import { w as withStyles, c as clsx } from './withStyles-a5c0f177.js';
import { c as capitalize } from './capitalize-46480bf1.js';
var styles = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
margin: 0
},
/* Styles applied to the root element if `variant="body2"`. */
body2: theme.typography.body2,
/* Styles applied to the root element if `variant="body1"`. */
body1: theme.typography.body1,
/* Styles applied to the root element if `variant="caption"`. */
caption: theme.typography.caption,
/* Styles applied to the root element if `variant="button"`. */
button: theme.typography.button,
/* Styles applied to the root element if `variant="h1"`. */
h1: theme.typography.h1,
/* Styles applied to the root element if `variant="h2"`. */
h2: theme.typography.h2,
/* Styles applied to the root element if `variant="h3"`. */
h3: theme.typography.h3,
/* Styles applied to the root element if `variant="h4"`. */
h4: theme.typography.h4,
/* Styles applied to the root element if `variant="h5"`. */
h5: theme.typography.h5,
/* Styles applied to the root element if `variant="h6"`. */
h6: theme.typography.h6,
/* Styles applied to the root element if `variant="subtitle1"`. */
subtitle1: theme.typography.subtitle1,
/* Styles applied to the root element if `variant="subtitle2"`. */
subtitle2: theme.typography.subtitle2,
/* Styles applied to the root element if `variant="overline"`. */
overline: theme.typography.overline,
/* Styles applied to the root element if `variant="srOnly"`. Only accessible to screen readers. */
srOnly: {
position: 'absolute',
height: 1,
width: 1,
overflow: 'hidden'
},
/* Styles applied to the root element if `align="left"`. */
alignLeft: {
textAlign: 'left'
},
/* Styles applied to the root element if `align="center"`. */
alignCenter: {
textAlign: 'center'
},
/* Styles applied to the root element if `align="right"`. */
alignRight: {
textAlign: 'right'
},
/* Styles applied to the root element if `align="justify"`. */
alignJustify: {
textAlign: 'justify'
},
/* Styles applied to the root element if `nowrap={true}`. */
noWrap: {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
},
/* Styles applied to the root element if `gutterBottom={true}`. */
gutterBottom: {
marginBottom: '0.35em'
},
/* Styles applied to the root element if `paragraph={true}`. */
paragraph: {
marginBottom: 16
},
/* Styles applied to the root element if `color="inherit"`. */
colorInherit: {
color: 'inherit'
},
/* Styles applied to the root element if `color="primary"`. */
colorPrimary: {
color: theme.palette.primary.main
},
/* Styles applied to the root element if `color="secondary"`. */
colorSecondary: {
color: theme.palette.secondary.main
},
/* Styles applied to the root element if `color="textPrimary"`. */
colorTextPrimary: {
color: theme.palette.text.primary
},
/* Styles applied to the root element if `color="textSecondary"`. */
colorTextSecondary: {
color: theme.palette.text.secondary
},
/* Styles applied to the root element if `color="error"`. */
colorError: {
color: theme.palette.error.main
},
/* Styles applied to the root element if `display="inline"`. */
displayInline: {
display: 'inline'
},
/* Styles applied to the root element if `display="block"`. */
displayBlock: {
display: 'block'
}
};
};
var defaultVariantMapping = {
h1: 'h1',
h2: 'h2',
h3: 'h3',
h4: 'h4',
h5: 'h5',
h6: 'h6',
subtitle1: 'h6',
subtitle2: 'h6',
body1: 'p',
body2: 'p'
};
var Typography = /*#__PURE__*/react.forwardRef(function Typography(props, ref) {
var _props$align = props.align,
align = _props$align === void 0 ? 'inherit' : _props$align,
classes = props.classes,
className = props.className,
_props$color = props.color,
color = _props$color === void 0 ? 'initial' : _props$color,
component = props.component,
_props$display = props.display,
display = _props$display === void 0 ? 'initial' : _props$display,
_props$gutterBottom = props.gutterBottom,
gutterBottom = _props$gutterBottom === void 0 ? false : _props$gutterBottom,
_props$noWrap = props.noWrap,
noWrap = _props$noWrap === void 0 ? false : _props$noWrap,
_props$paragraph = props.paragraph,
paragraph = _props$paragraph === void 0 ? false : _props$paragraph,
_props$variant = props.variant,
variant = _props$variant === void 0 ? 'body1' : _props$variant,
_props$variantMapping = props.variantMapping,
variantMapping = _props$variantMapping === void 0 ? defaultVariantMapping : _props$variantMapping,
other = _objectWithoutProperties(props, ["align", "classes", "className", "color", "component", "display", "gutterBottom", "noWrap", "paragraph", "variant", "variantMapping"]);
var Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';
return /*#__PURE__*/react.createElement(Component, _extends({
className: clsx(classes.root, className, variant !== 'inherit' && classes[variant], color !== 'initial' && classes["color".concat(capitalize(color))], noWrap && classes.noWrap, gutterBottom && classes.gutterBottom, paragraph && classes.paragraph, align !== 'inherit' && classes["align".concat(capitalize(align))], display !== 'initial' && classes["display".concat(capitalize(display))]),
ref: ref
}, other));
});
var Typography$1 = withStyles(styles, {
name: 'MuiTypography'
})(Typography);
export { Typography$1 as T };
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function createCommonjsModule(fn, basedir, module) {
return module = {
path: basedir,
exports: {},
require: function (path, base) {
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
}
}, fn(module, module.exports), module.exports;
}
function commonjsRequire () {
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
}
export { commonjsGlobal as a, createCommonjsModule as c, getDefaultExportFromCjs as g };
function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
export { _extends as _ };
import { c as createCommonjsModule } from './_commonjsHelpers-8c19dec8.js';
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
var ReactPropTypesSecret_1 = ReactPropTypesSecret;
function emptyFunction() {}
function emptyFunctionWithReset() {}
emptyFunctionWithReset.resetWarningCache = emptyFunction;
var factoryWithThrowingShims = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret === ReactPropTypesSecret_1) {
// It is still safe when called from React.
return;
}
var err = new Error(
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
'Use PropTypes.checkPropTypes() to call them. ' +
'Read more at http://fb.me/use-check-prop-types'
);
err.name = 'Invariant Violation';
throw err;
} shim.isRequired = shim;
function getShim() {
return shim;
} // Important!
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
var ReactPropTypes = {
array: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
elementType: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim,
checkPropTypes: emptyFunctionWithReset,
resetWarningCache: emptyFunction
};
ReactPropTypes.PropTypes = ReactPropTypes;
return ReactPropTypes;
};
var propTypes = createCommonjsModule(function (module) {
/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
{
// By explicitly using `prop-types` you are opting into new production behavior.
// http://fb.me/prop-types-in-prod
module.exports = factoryWithThrowingShims();
}
});
function _objectWithoutPropertiesLoose(source, excluded) {
if (source == null) return {};
var target = {};
var sourceKeys = Object.keys(source);
var key, i;
for (i = 0; i < sourceKeys.length; i++) {
key = sourceKeys[i];
if (excluded.indexOf(key) >= 0) continue;
target[key] = source[key];
}
return target;
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
}
export { _inheritsLoose as _, _objectWithoutPropertiesLoose as a, propTypes as p };
import { j as formatMuiErrorMessage } from './StylesProvider-c4f38318.js';
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
//
// A strict capitalization should uppercase the first letter of each word a the sentence.
// We only handle the first word.
function capitalize(string) {
if (typeof string !== 'string') {
throw new Error(formatMuiErrorMessage(7));
}
return string.charAt(0).toUpperCase() + string.slice(1);
}
export { capitalize as c };
import { c as createCommonjsModule } from './_commonjsHelpers-8c19dec8.js';
import { c as capitalize } from './capitalize-46480bf1.js';
import { c as createChainedFunction, d as debounce, o as ownerDocument, a as ownerWindow } from './ownerWindow-14b71efa.js';
import { _ as _extends } from './_index-4fa100fd.js';
import { r as react } from './index-57a74e37.js';
import { a as _objectWithoutProperties } from './StylesProvider-c4f38318.js';
import './_index-aecdce4e.js';
import { w as withStyles, c as clsx } from './withStyles-a5c0f177.js';
import { i as isMuiElement } from './isMuiElement-81ae803d.js';
import { s as setRef, a as useEventCallback, u as useForkRef, b as useIsFocusVisible } from './useIsFocusVisible-e5c1f5cc.js';
var styles = function styles(theme) {
return {
/* Styles applied to the root element. */
root: {
userSelect: 'none',
width: '1em',
height: '1em',
display: 'inline-block',
fill: 'currentColor',
flexShrink: 0,
fontSize: theme.typography.pxToRem(24),
transition: theme.transitions.create('fill', {
duration: theme.transitions.duration.shorter
})
},
/* Styles applied to the root element if `color="primary"`. */
colorPrimary: {
color: theme.palette.primary.main
},
/* Styles applied to the root element if `color="secondary"`. */
colorSecondary: {
color: theme.palette.secondary.main
},
/* Styles applied to the root element if `color="action"`. */
colorAction: {
color: theme.palette.action.active
},
/* Styles applied to the root element if `color="error"`. */
colorError: {
color: theme.palette.error.main
},
/* Styles applied to the root element if `color="disabled"`. */
colorDisabled: {
color: theme.palette.action.disabled
},
/* Styles applied to the root element if `fontSize="inherit"`. */
fontSizeInherit: {
fontSize: 'inherit'
},
/* Styles applied to the root element if `fontSize="small"`. */
fontSizeSmall: {
fontSize: theme.typography.pxToRem(20)
},
/* Styles applied to the root element if `fontSize="large"`. */
fontSizeLarge: {
fontSize: theme.typography.pxToRem(35)
}
};
};
var SvgIcon = /*#__PURE__*/react.forwardRef(function SvgIcon(props, ref) {
var children = props.children,
classes = props.classes,
className = props.className,
_props$color = props.color,
color = _props$color === void 0 ? 'inherit' : _props$color,
_props$component = props.component,
Component = _props$component === void 0 ? 'svg' : _props$component,
_props$fontSize = props.fontSize,
fontSize = _props$fontSize === void 0 ? 'default' : _props$fontSize,
htmlColor = props.htmlColor,
titleAccess = props.titleAccess,
_props$viewBox = props.viewBox,
viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox,
other = _objectWithoutProperties(props, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]);
return /*#__PURE__*/react.createElement(Component, _extends({
className: clsx(classes.root, className, color !== 'inherit' && classes["color".concat(capitalize(color))], fontSize !== 'default' && classes["fontSize".concat(capitalize(fontSize))]),
focusable: "false",
viewBox: viewBox,
color: htmlColor,
"aria-hidden": titleAccess ? undefined : true,
role: titleAccess ? 'img' : undefined,
ref: ref
}, other), children, titleAccess ? /*#__PURE__*/react.createElement("title", null, titleAccess) : null);
});
SvgIcon.muiName = 'SvgIcon';
var SvgIcon$1 = withStyles(styles, {
name: 'MuiSvgIcon'
})(SvgIcon);
/**
* Private module reserved for @material-ui/x packages.
*/
function createSvgIcon$1(path, displayName) {
var Component = function Component(props, ref) {
return /*#__PURE__*/react.createElement(SvgIcon$1, _extends({
ref: ref
}, props), path);
};
Component.muiName = SvgIcon$1.muiName;
return /*#__PURE__*/react.memo( /*#__PURE__*/react.forwardRef(Component));
}
function deprecatedPropType(validator, reason) {
{
return function () {
return null;
};
}
}
function requirePropFactory(componentNameInError) {
{
return function () {
return null;
};
}
}
function unsupportedProp(props, propName, componentName, location, propFullName) {
{
return null;
}
}
/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */
function useControlled(_ref) {
var controlled = _ref.controlled,
defaultProp = _ref.default;
_ref.name;
_ref.state;
var _React$useRef = react.useRef(controlled !== undefined),
isControlled = _React$useRef.current;
var _React$useState = react.useState(defaultProp),
valueState = _React$useState[0],
setValue = _React$useState[1];
var value = isControlled ? controlled : valueState;
var setValueIfUncontrolled = react.useCallback(function (newValue) {
if (!isControlled) {
setValue(newValue);
}
}, []);
return [value, setValueIfUncontrolled];
}
/**
* Private module reserved for @material-ui/x packages.
*/
function useId(idOverride) {
var _React$useState = react.useState(idOverride),
defaultId = _React$useState[0],
setDefaultId = _React$useState[1];
var id = idOverride || defaultId;
react.useEffect(function () {
if (defaultId == null) {
// Fallback to this default id when possible.
// Use the random value for client-side rendering only.
// We can't use it server-side.
setDefaultId("mui-".concat(Math.round(Math.random() * 1e5)));
}
}, [defaultId]);
return id;
}
var utils = /*#__PURE__*/Object.freeze({
__proto__: null,
capitalize: capitalize,
createChainedFunction: createChainedFunction,
createSvgIcon: createSvgIcon$1,
debounce: debounce,
deprecatedPropType: deprecatedPropType,
isMuiElement: isMuiElement,
ownerDocument: ownerDocument,
ownerWindow: ownerWindow,
requirePropFactory: requirePropFactory,
setRef: setRef,
unsupportedProp: unsupportedProp,
useControlled: useControlled,
useEventCallback: useEventCallback,
useForkRef: useForkRef,
unstable_useId: useId,
useIsFocusVisible: useIsFocusVisible
});
var interopRequireDefault = createCommonjsModule(function (module) {
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
"default": obj
};
}
module.exports = _interopRequireDefault;
module.exports["default"] = module.exports, module.exports.__esModule = true;
});
var _typeof_1 = createCommonjsModule(function (module) {
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
module.exports = _typeof = function _typeof(obj) {
return typeof obj;
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
} else {
module.exports = _typeof = function _typeof(obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
module.exports["default"] = module.exports, module.exports.__esModule = true;
}
return _typeof(obj);
}
module.exports = _typeof;
module.exports["default"] = module.exports, module.exports.__esModule = true;
});
var interopRequireWildcard = createCommonjsModule(function (module) {
var _typeof = _typeof_1["default"];
function _getRequireWildcardCache() {
if (typeof WeakMap !== "function") return null;
var cache = new WeakMap();
_getRequireWildcardCache = function _getRequireWildcardCache() {
return cache;
};
return cache;
}
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
}
if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
return {
"default": obj
};
}
var cache = _getRequireWildcardCache();
if (cache && cache.has(obj)) {
return cache.get(obj);
}
var newObj = {};
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
if (desc && (desc.get || desc.set)) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
newObj["default"] = obj;
if (cache) {
cache.set(obj, newObj);
}
return newObj;
}
module.exports = _interopRequireWildcard;
module.exports["default"] = module.exports, module.exports.__esModule = true;
});
var createSvgIcon = createCommonjsModule(function (module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function get() {
return utils.createSvgIcon;
}
});
});
export { interopRequireDefault as a, createSvgIcon as c, interopRequireWildcard as i };
import { c as createCommonjsModule } from './_commonjsHelpers-8c19dec8.js';
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
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?
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;
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}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d;
var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
var 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)};var typeOf=z;
var reactIs_production_min = {
AsyncMode: AsyncMode,
ConcurrentMode: ConcurrentMode,
ContextConsumer: ContextConsumer,
ContextProvider: ContextProvider,
Element: Element,
ForwardRef: ForwardRef,
Fragment: Fragment,
Lazy: Lazy,
Memo: Memo,
Portal: Portal,
Profiler: Profiler,
StrictMode: StrictMode,
Suspense: Suspense,
isAsyncMode: isAsyncMode,
isConcurrentMode: isConcurrentMode,
isContextConsumer: isContextConsumer,
isContextProvider: isContextProvider,
isElement: isElement,
isForwardRef: isForwardRef,
isFragment: isFragment,
isLazy: isLazy,
isMemo: isMemo,
isPortal: isPortal,
isProfiler: isProfiler,
isStrictMode: isStrictMode,
isSuspense: isSuspense,
isValidElementType: isValidElementType,
typeOf: typeOf
};
var reactIs = createCommonjsModule(function (module) {
{
module.exports = reactIs_production_min;
}
});
/**
* Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/
var REACT_STATICS = {
childContextTypes: true,
contextType: true,
contextTypes: true,
defaultProps: true,
displayName: true,
getDefaultProps: true,
getDerivedStateFromError: true,
getDerivedStateFromProps: true,
mixins: true,
propTypes: true,
type: true
};
var KNOWN_STATICS = {
name: true,
length: true,
prototype: true,
caller: true,
callee: true,
arguments: true,
arity: true
};
var FORWARD_REF_STATICS = {
'$$typeof': true,
render: true,
defaultProps: true,
displayName: true,
propTypes: true
};
var MEMO_STATICS = {
'$$typeof': true,
compare: true,
defaultProps: true,
displayName: true,
propTypes: true,
type: true
};
var TYPE_STATICS = {};
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
function getStatics(component) {
// React v16.11 and below
if (reactIs.isMemo(component)) {
return MEMO_STATICS;
} // React v16.12 and above
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
}
var defineProperty = Object.defineProperty;
var getOwnPropertyNames = Object.getOwnPropertyNames;
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = Object.prototype;
function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') {
// don't hoist over string (html) components
if (objectPrototype) {
var inheritedComponent = getPrototypeOf(sourceComponent);
if (inheritedComponent && inheritedComponent !== objectPrototype) {
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
}
}
var keys = getOwnPropertyNames(sourceComponent);
if (getOwnPropertySymbols) {
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
}
var targetStatics = getStatics(targetComponent);
var sourceStatics = getStatics(sourceComponent);
for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
try {
// Avoid failures from read-only properties
defineProperty(targetComponent, key, descriptor);
} catch (e) {}
}
}
}
return targetComponent;
}
var hoistNonReactStatics_cjs = hoistNonReactStatics;
export { hoistNonReactStatics_cjs as h };
import { c as createCommonjsModule } from './_commonjsHelpers-8c19dec8.js';
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/* eslint-disable no-unused-vars */
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var hasOwnProperty = Object.prototype.hasOwnProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val === null || val === undefined) {
throw new TypeError('Object.assign cannot be called with null or undefined');
}
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign) {
return false;
}
// Detect buggy property enumeration order in older V8 versions.
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
test1[5] = 'de';
if (Object.getOwnPropertyNames(test1)[0] === '5') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test2 = {};
for (var i = 0; i < 10; i++) {
test2['_' + String.fromCharCode(i)] = i;
}
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
return test2[n];
});
if (order2.join('') !== '0123456789') {
return false;
}
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
var test3 = {};
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
test3[letter] = letter;
});
if (Object.keys(Object.assign({}, test3)).join('') !==
'abcdefghijklmnopqrst') {
return false;
}
return true;
} catch (err) {
// We don't expect any of the above to throw, but better to be safe.
return false;
}
}
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
var from;
var to = toObject(target);
var symbols;
for (var s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from) {
if (hasOwnProperty.call(from, key)) {
to[key] = from[key];
}
}
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++) {
if (propIsEnumerable.call(from, symbols[i])) {
to[symbols[i]] = from[symbols[i]];
}
}
}
}
return to;
};
var react_production_min = createCommonjsModule(function (module, exports) {
var n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;
if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");exports.Fragment=w("react.fragment");exports.StrictMode=w("react.strict_mode");exports.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");exports.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy");}var x="function"===typeof Symbol&&Symbol.iterator;
function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return "function"===typeof a?a:null}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return "Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
var A={isMounted:function(){return !1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B={};function C(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}C.prototype.isReactComponent={};C.prototype.setState=function(a,b){if("object"!==typeof a&&"function"!==typeof a&&null!=a)throw Error(z(85));this.updater.enqueueSetState(this,a,b,"setState");};C.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,"forceUpdate");};
function D(){}D.prototype=C.prototype;function E(a,b,c){this.props=a;this.context=b;this.refs=B;this.updater=c||A;}var F=E.prototype=new D;F.constructor=E;objectAssign(F,C.prototype);F.isPureReactComponent=!0;var G={current:null},H=Object.prototype.hasOwnProperty,I={key:!0,ref:!0,__self:!0,__source:!0};
function J(a,b,c){var e,d={},k=null,h=null;if(null!=b)for(e in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=""+b.key),b)H.call(b,e)&&!I.hasOwnProperty(e)&&(d[e]=b[e]);var g=arguments.length-2;if(1===g)d.children=c;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];d.children=f;}if(a&&a.defaultProps)for(e in g=a.defaultProps,g)void 0===d[e]&&(d[e]=g[e]);return {$$typeof:n,type:a,key:k,ref:h,props:d,_owner:G.current}}
function K(a,b){return {$$typeof:n,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function L(a){return "object"===typeof a&&null!==a&&a.$$typeof===n}function escape(a){var b={"=":"=0",":":"=2"};return "$"+a.replace(/[=:]/g,function(a){return b[a]})}var M=/\/+/g;function N(a,b){return "object"===typeof a&&null!==a&&null!=a.key?escape(""+a.key):b.toString(36)}
function O(a,b,c,e,d){var k=typeof a;if("undefined"===k||"boolean"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case "string":case "number":h=!0;break;case "object":switch(a.$$typeof){case n:case p:h=!0;}}if(h)return h=a,d=d(h),a=""===e?"."+N(h,0):e,Array.isArray(d)?(c="",null!=a&&(c=a.replace(M,"$&/")+"/"),O(d,b,c,"",function(a){return a})):null!=d&&(L(d)&&(d=K(d,c+(!d.key||h&&h.key===d.key?"":(""+d.key).replace(M,"$&/")+"/")+a)),b.push(d)),1;h=0;e=""===e?".":e+":";if(Array.isArray(a))for(var g=
0;g<a.length;g++){k=a[g];var f=e+N(k,g);h+=O(k,b,c,f,d);}else if(f=y(a),"function"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=e+N(k,g++),h+=O(k,b,c,f,d);else if("object"===k)throw b=""+a,Error(z(31,"[object Object]"===b?"object with keys {"+Object.keys(a).join(", ")+"}":b));return h}function P(a,b,c){if(null==a)return a;var e=[],d=0;O(a,e,"","",function(a){return b.call(c,a,d++)});return e}
function Q(a){if(-1===a._status){var b=a._result;b=b();a._status=0;a._result=b;b.then(function(b){0===a._status&&(b=b.default,a._status=1,a._result=b);},function(b){0===a._status&&(a._status=2,a._result=b);});}if(1===a._status)return a._result;throw a._result;}var R={current:null};function S(){var a=R.current;if(null===a)throw Error(z(321));return a}var T={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:G,IsSomeRendererActing:{current:!1},assign:objectAssign};
exports.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,arguments);},c);},count:function(a){var b=0;P(a,function(){b++;});return b},toArray:function(a){return P(a,function(a){return a})||[]},only:function(a){if(!L(a))throw Error(z(143));return a}};exports.Component=C;exports.PureComponent=E;exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=T;
exports.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=objectAssign({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)e.children=c;else if(1<f){g=Array(f);for(var m=0;m<f;m++)g[m]=arguments[m+2];e.children=g;}return {$$typeof:n,type:a.type,
key:d,ref:k,props:e,_owner:h}};exports.createContext=function(a,b){void 0===b&&(b=null);a={$$typeof:r,_calculateChangedBits:b,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null};a.Provider={$$typeof:q,_context:a};return a.Consumer=a};exports.createElement=J;exports.createFactory=function(a){var b=J.bind(null,a);b.type=a;return b};exports.createRef=function(){return {current:null}};exports.forwardRef=function(a){return {$$typeof:t,render:a}};exports.isValidElement=L;
exports.lazy=function(a){return {$$typeof:v,_payload:{_status:-1,_result:a},_init:Q}};exports.memo=function(a,b){return {$$typeof:u,type:a,compare:void 0===b?null:b}};exports.useCallback=function(a,b){return S().useCallback(a,b)};exports.useContext=function(a,b){return S().useContext(a,b)};exports.useDebugValue=function(){};exports.useEffect=function(a,b){return S().useEffect(a,b)};exports.useImperativeHandle=function(a,b,c){return S().useImperativeHandle(a,b,c)};
exports.useLayoutEffect=function(a,b){return S().useLayoutEffect(a,b)};exports.useMemo=function(a,b){return S().useMemo(a,b)};exports.useReducer=function(a,b,c){return S().useReducer(a,b,c)};exports.useRef=function(a){return S().useRef(a)};exports.useState=function(a){return S().useState(a)};exports.version="17.0.1";
});
var react = createCommonjsModule(function (module) {
{
module.exports = react_production_min;
}
});
export { objectAssign as o, react as r };
This source diff could not be displayed because it is too large. You can view the blob instead.
import { r as react } from './index-57a74e37.js';
function isMuiElement(element, muiNames) {
return /*#__PURE__*/react.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;
}
export { isMuiElement as i };
/**
* Safe chained function
*
* Will only create a new function if needed,
* otherwise will pass back existing functions or null.
*
* @param {function} functions to chain
* @returns {function|null}
*/
function createChainedFunction() {
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
funcs[_key] = arguments[_key];
}
return funcs.reduce(function (acc, func) {
if (func == null) {
return acc;
}
return function chainedFunction() {
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
acc.apply(this, args);
func.apply(this, args);
};
}, function () {});
}
// Corresponds to 10 frames at 60 Hz.
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
function debounce(func) {
var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;
var timeout;
function debounced() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
// eslint-disable-next-line consistent-this
var that = this;
var later = function later() {
func.apply(that, args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
}
debounced.clear = function () {
clearTimeout(timeout);
};
return debounced;
}
function ownerDocument(node) {
return node && node.ownerDocument || document;
}
function ownerWindow(node) {
var doc = ownerDocument(node);
return doc.defaultView || window;
}
export { ownerWindow as a, createChainedFunction as c, debounce as d, ownerDocument as o };
import { r as react } from './index-57a74e37.js';
import { r as reactDom } from './index-8dbeb7e4.js';
// TODO v5: consider to make it private
function setRef(ref, value) {
if (typeof ref === 'function') {
ref(value);
} else if (ref) {
ref.current = value;
}
}
var useEnhancedEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
/**
* https://github.com/facebook/react/issues/14099#issuecomment-440013892
*
* @param {function} fn
*/
function useEventCallback(fn) {
var ref = react.useRef(fn);
useEnhancedEffect(function () {
ref.current = fn;
});
return react.useCallback(function () {
return (ref.current).apply(void 0, arguments);
}, []);
}
function useForkRef(refA, refB) {
/**
* This will create a new function if the ref props change and are defined.
* This means react will call the old forkRef with `null` and the new forkRef
* with the ref. Cleanup naturally emerges from this behavior
*/
return react.useMemo(function () {
if (refA == null && refB == null) {
return null;
}
return function (refValue) {
setRef(refA, refValue);
setRef(refB, refValue);
};
}, [refA, refB]);
}
// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js
var hadKeyboardEvent = true;
var hadFocusVisibleRecently = false;
var hadFocusVisibleRecentlyTimeout = null;
var inputTypesWhitelist = {
text: true,
search: true,
url: true,
tel: true,
email: true,
password: true,
number: true,
date: true,
month: true,
week: true,
time: true,
datetime: true,
'datetime-local': true
};
/**
* Computes whether the given element should automatically trigger the
* `focus-visible` class being added, i.e. whether it should always match
* `:focus-visible` when focused.
* @param {Element} node
* @return {boolean}
*/
function focusTriggersKeyboardModality(node) {
var type = node.type,
tagName = node.tagName;
if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {
return true;
}
if (tagName === 'TEXTAREA' && !node.readOnly) {
return true;
}
if (node.isContentEditable) {
return true;
}
return false;
}
/**
* Keep track of our keyboard modality state with `hadKeyboardEvent`.
* If the most recent user interaction was via the keyboard;
* and the key press did not include a meta, alt/option, or control key;
* then the modality is keyboard. Otherwise, the modality is not keyboard.
* @param {KeyboardEvent} event
*/
function handleKeyDown(event) {
if (event.metaKey || event.altKey || event.ctrlKey) {
return;
}
hadKeyboardEvent = true;
}
/**
* If at any point a user clicks with a pointing device, ensure that we change
* the modality away from keyboard.
* This avoids the situation where a user presses a key on an already focused
* element, and then clicks on a different element, focusing it with a
* pointing device, while we still think we're in keyboard modality.
*/
function handlePointerDown() {
hadKeyboardEvent = false;
}
function handleVisibilityChange() {
if (this.visibilityState === 'hidden') {
// If the tab becomes active again, the browser will handle calling focus
// on the element (Safari actually calls it twice).
// If this tab change caused a blur on an element with focus-visible,
// re-apply the class when the user switches back to the tab.
if (hadFocusVisibleRecently) {
hadKeyboardEvent = true;
}
}
}
function prepare(doc) {
doc.addEventListener('keydown', handleKeyDown, true);
doc.addEventListener('mousedown', handlePointerDown, true);
doc.addEventListener('pointerdown', handlePointerDown, true);
doc.addEventListener('touchstart', handlePointerDown, true);
doc.addEventListener('visibilitychange', handleVisibilityChange, true);
}
function isFocusVisible(event) {
var target = event.target;
try {
return target.matches(':focus-visible');
} catch (error) {} // browsers not implementing :focus-visible will throw a SyntaxError
// we use our own heuristic for those browsers
// rethrow might be better if it's not the expected error but do we really
// want to crash if focus-visible malfunctioned?
// no need for validFocusTarget check. the user does that by attaching it to
// focusable events only
return hadKeyboardEvent || focusTriggersKeyboardModality(target);
}
/**
* Should be called if a blur event is fired on a focus-visible element
*/
function handleBlurVisible() {
// To detect a tab/window switch, we look for a blur event followed
// rapidly by a visibility change.
// If we don't see a visibility change within 100ms, it's probably a
// regular focus change.
hadFocusVisibleRecently = true;
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {
hadFocusVisibleRecently = false;
}, 100);
}
function useIsFocusVisible() {
var ref = react.useCallback(function (instance) {
var node = reactDom.findDOMNode(instance);
if (node != null) {
prepare(node.ownerDocument);
}
}, []);
return {
isFocusVisible: isFocusVisible,
onBlurVisible: handleBlurVisible,
ref: ref
};
}
export { useEventCallback as a, useIsFocusVisible as b, setRef as s, useForkRef as u };
import { _ as _extends } from './_index-4fa100fd.js';
import { g as deepmerge, a as _objectWithoutProperties, u as useTheme, S as StylesContext, h as getDynamicStyles, i as createMuiTheme } from './StylesProvider-c4f38318.js';
import { r as react } from './index-57a74e37.js';
import './_index-aecdce4e.js';
import { h as hoistNonReactStatics_cjs } from './hoist-non-react-statics.cjs-43de917e.js';
/* eslint-disable no-restricted-syntax */
function getThemeProps(params) {
var theme = params.theme,
name = params.name,
props = params.props;
if (!theme || !theme.props || !theme.props[name]) {
return props;
} // Resolve default props, code borrow from React source.
// https://github.com/facebook/react/blob/15a8f031838a553e41c0b66eb1bcf1da8448104d/packages/react/src/ReactElement.js#L221
var defaultProps = theme.props[name];
var propName;
for (propName in defaultProps) {
if (props[propName] === undefined) {
props[propName] = defaultProps[propName];
}
}
return props;
}
function mergeClasses() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var baseClasses = options.baseClasses,
newClasses = options.newClasses;
options.Component;
if (!newClasses) {
return baseClasses;
}
var nextClasses = _extends({}, baseClasses);
Object.keys(newClasses).forEach(function (key) {
if (newClasses[key]) {
nextClasses[key] = "".concat(baseClasses[key], " ").concat(newClasses[key]);
}
});
return nextClasses;
}
// Used https://github.com/thinkloop/multi-key-cache as inspiration
var multiKeyStore = {
set: function set(cache, key1, key2, value) {
var subCache = cache.get(key1);
if (!subCache) {
subCache = new Map();
cache.set(key1, subCache);
}
subCache.set(key2, value);
},
get: function get(cache, key1, key2) {
var subCache = cache.get(key1);
return subCache ? subCache.get(key2) : undefined;
},
delete: function _delete(cache, key1, key2) {
var subCache = cache.get(key1);
subCache.delete(key2);
}
};
/* eslint-disable import/prefer-default-export */
// Global index counter to preserve source order.
// We create the style sheet during the creation of the component,
// children are handled after the parents, so the order of style elements would be parent->child.
// It is a problem though when a parent passes a className
// which needs to override any child's styles.
// StyleSheet of the child has a higher specificity, because of the source order.
// So our solution is to render sheets them in the reverse order child->sheet, so
// that parent has a higher specificity.
var indexCounter = -1e9;
function increment() {
indexCounter += 1;
return indexCounter;
}
// We use the same empty object to ref count the styles that don't need a theme object.
var noopTheme = {};
function getStylesCreator(stylesOrCreator) {
var themingEnabled = typeof stylesOrCreator === 'function';
return {
create: function create(theme, name) {
var styles;
try {
styles = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator;
} catch (err) {
throw err;
}
if (!name || !theme.overrides || !theme.overrides[name]) {
return styles;
}
var overrides = theme.overrides[name];
var stylesWithOverrides = _extends({}, styles);
Object.keys(overrides).forEach(function (key) {
stylesWithOverrides[key] = deepmerge(stylesWithOverrides[key], overrides[key]);
});
return stylesWithOverrides;
},
options: {}
};
}
function getClasses(_ref, classes, Component) {
var state = _ref.state,
stylesOptions = _ref.stylesOptions;
if (stylesOptions.disableGeneration) {
return classes || {};
}
if (!state.cacheClasses) {
state.cacheClasses = {
// Cache for the finalized classes value.
value: null,
// Cache for the last used classes prop pointer.
lastProp: null,
// Cache for the last used rendered classes pointer.
lastJSS: {}
};
} // Tracks if either the rendered classes or classes prop has changed,
// requiring the generation of a new finalized classes object.
var generate = false;
if (state.classes !== state.cacheClasses.lastJSS) {
state.cacheClasses.lastJSS = state.classes;
generate = true;
}
if (classes !== state.cacheClasses.lastProp) {
state.cacheClasses.lastProp = classes;
generate = true;
}
if (generate) {
state.cacheClasses.value = mergeClasses({
baseClasses: state.cacheClasses.lastJSS,
newClasses: classes,
Component: Component
});
}
return state.cacheClasses.value;
}
function attach(_ref2, props) {
var state = _ref2.state,
theme = _ref2.theme,
stylesOptions = _ref2.stylesOptions,
stylesCreator = _ref2.stylesCreator,
name = _ref2.name;
if (stylesOptions.disableGeneration) {
return;
}
var sheetManager = multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme);
if (!sheetManager) {
sheetManager = {
refs: 0,
staticSheet: null,
dynamicStyles: null
};
multiKeyStore.set(stylesOptions.sheetsManager, stylesCreator, theme, sheetManager);
}
var options = _extends({}, stylesCreator.options, stylesOptions, {
theme: theme,
flip: typeof stylesOptions.flip === 'boolean' ? stylesOptions.flip : theme.direction === 'rtl'
});
options.generateId = options.serverGenerateClassName || options.generateClassName;
var sheetsRegistry = stylesOptions.sheetsRegistry;
if (sheetManager.refs === 0) {
var staticSheet;
if (stylesOptions.sheetsCache) {
staticSheet = multiKeyStore.get(stylesOptions.sheetsCache, stylesCreator, theme);
}
var styles = stylesCreator.create(theme, name);
if (!staticSheet) {
staticSheet = stylesOptions.jss.createStyleSheet(styles, _extends({
link: false
}, options));
staticSheet.attach();
if (stylesOptions.sheetsCache) {
multiKeyStore.set(stylesOptions.sheetsCache, stylesCreator, theme, staticSheet);
}
}
if (sheetsRegistry) {
sheetsRegistry.add(staticSheet);
}
sheetManager.staticSheet = staticSheet;
sheetManager.dynamicStyles = getDynamicStyles(styles);
}
if (sheetManager.dynamicStyles) {
var dynamicSheet = stylesOptions.jss.createStyleSheet(sheetManager.dynamicStyles, _extends({
link: true
}, options));
dynamicSheet.update(props);
dynamicSheet.attach();
state.dynamicSheet = dynamicSheet;
state.classes = mergeClasses({
baseClasses: sheetManager.staticSheet.classes,
newClasses: dynamicSheet.classes
});
if (sheetsRegistry) {
sheetsRegistry.add(dynamicSheet);
}
} else {
state.classes = sheetManager.staticSheet.classes;
}
sheetManager.refs += 1;
}
function update(_ref3, props) {
var state = _ref3.state;
if (state.dynamicSheet) {
state.dynamicSheet.update(props);
}
}
function detach(_ref4) {
var state = _ref4.state,
theme = _ref4.theme,
stylesOptions = _ref4.stylesOptions,
stylesCreator = _ref4.stylesCreator;
if (stylesOptions.disableGeneration) {
return;
}
var sheetManager = multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme);
sheetManager.refs -= 1;
var sheetsRegistry = stylesOptions.sheetsRegistry;
if (sheetManager.refs === 0) {
multiKeyStore.delete(stylesOptions.sheetsManager, stylesCreator, theme);
stylesOptions.jss.removeStyleSheet(sheetManager.staticSheet);
if (sheetsRegistry) {
sheetsRegistry.remove(sheetManager.staticSheet);
}
}
if (state.dynamicSheet) {
stylesOptions.jss.removeStyleSheet(state.dynamicSheet);
if (sheetsRegistry) {
sheetsRegistry.remove(state.dynamicSheet);
}
}
}
function useSynchronousEffect(func, values) {
var key = react.useRef([]);
var output; // Store "generation" key. Just returns a new object every time
var currentKey = react.useMemo(function () {
return {};
}, values); // eslint-disable-line react-hooks/exhaustive-deps
// "the first render", or "memo dropped the value"
if (key.current !== currentKey) {
key.current = currentKey;
output = func();
}
react.useEffect(function () {
return function () {
if (output) {
output();
}
};
}, [currentKey] // eslint-disable-line react-hooks/exhaustive-deps
);
}
function makeStyles(stylesOrCreator) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var name = options.name,
classNamePrefixOption = options.classNamePrefix,
Component = options.Component,
_options$defaultTheme = options.defaultTheme,
defaultTheme = _options$defaultTheme === void 0 ? noopTheme : _options$defaultTheme,
stylesOptions2 = _objectWithoutProperties(options, ["name", "classNamePrefix", "Component", "defaultTheme"]);
var stylesCreator = getStylesCreator(stylesOrCreator);
var classNamePrefix = name || classNamePrefixOption || 'makeStyles';
stylesCreator.options = {
index: increment(),
name: name,
meta: classNamePrefix,
classNamePrefix: classNamePrefix
};
var useStyles = function useStyles() {
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var theme = useTheme() || defaultTheme;
var stylesOptions = _extends({}, react.useContext(StylesContext), stylesOptions2);
var instance = react.useRef();
var shouldUpdate = react.useRef();
useSynchronousEffect(function () {
var current = {
name: name,
state: {},
stylesCreator: stylesCreator,
stylesOptions: stylesOptions,
theme: theme
};
attach(current, props);
shouldUpdate.current = false;
instance.current = current;
return function () {
detach(current);
};
}, [theme, stylesCreator]);
react.useEffect(function () {
if (shouldUpdate.current) {
update(instance.current, props);
}
shouldUpdate.current = true;
});
var classes = getClasses(instance.current, props.classes, Component);
return classes;
};
return useStyles;
}
function toVal(mix) {
var k, y, str='';
if (typeof mix === 'string' || typeof mix === 'number') {
str += mix;
} else if (typeof mix === 'object') {
if (Array.isArray(mix)) {
for (k=0; k < mix.length; k++) {
if (mix[k]) {
if (y = toVal(mix[k])) {
str && (str += ' ');
str += y;
}
}
}
} else {
for (k in mix) {
if (mix[k]) {
str && (str += ' ');
str += k;
}
}
}
}
return str;
}
function clsx () {
var i=0, tmp, x, str='';
while (i < arguments.length) {
if (tmp = arguments[i++]) {
if (x = toVal(tmp)) {
str && (str += ' ');
str += x;
}
}
}
return str;
}
// It does not modify the component passed to it;
// instead, it returns a new component, with a `classes` property.
var withStyles$1 = function withStyles(stylesOrCreator) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return function (Component) {
var defaultTheme = options.defaultTheme,
_options$withTheme = options.withTheme,
withTheme = _options$withTheme === void 0 ? false : _options$withTheme,
name = options.name,
stylesOptions = _objectWithoutProperties(options, ["defaultTheme", "withTheme", "name"]);
var classNamePrefix = name;
var useStyles = makeStyles(stylesOrCreator, _extends({
defaultTheme: defaultTheme,
Component: Component,
name: name || Component.displayName,
classNamePrefix: classNamePrefix
}, stylesOptions));
var WithStyles = /*#__PURE__*/react.forwardRef(function WithStyles(props, ref) {
props.classes;
var innerRef = props.innerRef,
other = _objectWithoutProperties(props, ["classes", "innerRef"]); // The wrapper receives only user supplied props, which could be a subset of
// the actual props Component might receive due to merging with defaultProps.
// So copying it here would give us the same result in the wrapper as well.
var classes = useStyles(_extends({}, Component.defaultProps, props));
var theme;
var more = other;
if (typeof name === 'string' || withTheme) {
// name and withTheme are invariant in the outer scope
// eslint-disable-next-line react-hooks/rules-of-hooks
theme = useTheme() || defaultTheme;
if (name) {
more = getThemeProps({
theme: theme,
name: name,
props: other
});
} // Provide the theme to the wrapped component.
// So we don't have to use the `withTheme()` Higher-order Component.
if (withTheme && !more.theme) {
more.theme = theme;
}
}
return /*#__PURE__*/react.createElement(Component, _extends({
ref: innerRef || ref,
classes: classes
}, more));
});
hoistNonReactStatics_cjs(WithStyles, Component);
return WithStyles;
};
};
var defaultTheme = createMuiTheme();
function withStyles(stylesOrCreator, options) {
return withStyles$1(stylesOrCreator, _extends({
defaultTheme: defaultTheme
}, options));
}
export { clsx as c, defaultTheme as d, getThemeProps as g, makeStyles as m, withStyles as w };
import { c as createCommonjsModule, a as commonjsGlobal } from './common/_commonjsHelpers-8c19dec8.js';
var dayjs_min = createCommonjsModule(function (module, exports) {
!function(t,e){module.exports=e();}(commonjsGlobal,function(){var t="millisecond",e="second",n="minute",r="hour",i="day",s="week",u="month",a="quarter",o="year",f="date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,c=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},$=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},l={s:$,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+$(r,2,"0")+":"+$(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),s=n-i<0,a=e.clone().add(r+(s?-1:1),u);return +(-(r+(n-i)/(s?i-a:a-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return {M:u,y:o,w:s,d:i,D:f,h:r,m:n,s:e,ms:t,Q:a}[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",M={};M[y]=d;var m=function(t){return t instanceof S},D=function(t,e,n){var r;if(!t)return y;if("string"==typeof t)M[t]&&(r=t),e&&(M[t]=e,r=t);else {var i=t.name;M[i]=t,r=i;}return !n&&r&&(y=r),r||!n&&y},v=function(t,e){if(m(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},g=l;g.l=D,g.i=m,g.w=function(t,e){return v(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function d(t){this.$L=D(t.locale,null,!0),this.parse(t);}var $=d.prototype;return $.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(g.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},$.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},$.$utils=function(){return g},$.isValid=function(){return !("Invalid Date"===this.$d.toString())},$.isSame=function(t,e){var n=v(t);return this.startOf(e)<=n&&n<=this.endOf(e)},$.isAfter=function(t,e){return v(t)<this.startOf(e)},$.isBefore=function(t,e){return this.endOf(e)<v(t)},$.$g=function(t,e,n){return g.u(t)?this[e]:this.set(n,t)},$.unix=function(){return Math.floor(this.valueOf()/1e3)},$.valueOf=function(){return this.$d.getTime()},$.startOf=function(t,a){var h=this,c=!!g.u(a)||a,d=g.p(t),$=function(t,e){var n=g.w(h.$u?Date.UTC(h.$y,e,t):new Date(h.$y,e,t),h);return c?n:n.endOf(i)},l=function(t,e){return g.w(h.toDate()[t].apply(h.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),h)},y=this.$W,M=this.$M,m=this.$D,D="set"+(this.$u?"UTC":"");switch(d){case o:return c?$(1,0):$(31,11);case u:return c?$(1,M):$(0,M+1);case s:var v=this.$locale().weekStart||0,S=(y<v?y+7:y)-v;return $(c?m-S:m+(6-S),M);case i:case f:return l(D+"Hours",0);case r:return l(D+"Minutes",1);case n:return l(D+"Seconds",2);case e:return l(D+"Milliseconds",3);default:return this.clone()}},$.endOf=function(t){return this.startOf(t,!1)},$.$set=function(s,a){var h,c=g.p(s),d="set"+(this.$u?"UTC":""),$=(h={},h[i]=d+"Date",h[f]=d+"Date",h[u]=d+"Month",h[o]=d+"FullYear",h[r]=d+"Hours",h[n]=d+"Minutes",h[e]=d+"Seconds",h[t]=d+"Milliseconds",h)[c],l=c===i?this.$D+(a-this.$W):a;if(c===u||c===o){var y=this.clone().set(f,1);y.$d[$](l),y.init(),this.$d=y.set(f,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},$.set=function(t,e){return this.clone().$set(t,e)},$.get=function(t){return this[g.p(t)]()},$.add=function(t,a){var f,h=this;t=Number(t);var c=g.p(a),d=function(e){var n=v(h);return g.w(n.date(n.date()+Math.round(e*t)),h)};if(c===u)return this.set(u,this.$M+t);if(c===o)return this.set(o,this.$y+t);if(c===i)return d(1);if(c===s)return d(7);var $=(f={},f[n]=6e4,f[r]=36e5,f[e]=1e3,f)[c]||1,l=this.$d.getTime()+t*$;return g.w(l,this)},$.subtract=function(t,e){return this.add(-1*t,e)},$.format=function(t){var e=this;if(!this.isValid())return "Invalid Date";var n=t||"YYYY-MM-DDTHH:mm:ssZ",r=g.z(this),i=this.$locale(),s=this.$H,u=this.$m,a=this.$M,o=i.weekdays,f=i.months,h=function(t,r,i,s){return t&&(t[r]||t(e,n))||i[r].substr(0,s)},d=function(t){return g.s(s%12||12,t,"0")},$=i.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:g.s(a+1,2,"0"),MMM:h(i.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:g.s(this.$D,2,"0"),d:String(this.$W),dd:h(i.weekdaysMin,this.$W,o,2),ddd:h(i.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:g.s(s,2,"0"),h:d(1),hh:d(2),a:$(s,u,!0),A:$(s,u,!1),m:String(u),mm:g.s(u,2,"0"),s:String(this.$s),ss:g.s(this.$s,2,"0"),SSS:g.s(this.$ms,3,"0"),Z:r};return n.replace(c,function(t,e){return e||l[t]||r.replace(":","")})},$.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$.diff=function(t,f,h){var c,d=g.p(f),$=v(t),l=6e4*($.utcOffset()-this.utcOffset()),y=this-$,M=g.m(this,$);return M=(c={},c[o]=M/12,c[u]=M,c[a]=M/3,c[s]=(y-l)/6048e5,c[i]=(y-l)/864e5,c[r]=y/36e5,c[n]=y/6e4,c[e]=y/1e3,c)[d]||y,h?M:g.a(M)},$.daysInMonth=function(){return this.endOf(u).$D},$.$locale=function(){return M[this.$L]},$.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=D(t,e,!0);return r&&(n.$L=r),n},$.clone=function(){return g.w(this.$d,this)},$.toDate=function(){return new Date(this.valueOf())},$.toJSON=function(){return this.isValid()?this.toISOString():null},$.toISOString=function(){return this.$d.toISOString()},$.toString=function(){return this.$d.toUTCString()},d}(),p=S.prototype;return v.prototype=p,[["$ms",t],["$s",e],["$m",n],["$H",r],["$W",i],["$M",u],["$y",o],["$D",f]].forEach(function(t){p[t[1]]=function(e){return this.$g(e,t[0],t[1])};}),v.extend=function(t,e){return t.$i||(t(e,S,v),t.$i=!0),v},v.locale=D,v.isDayjs=m,v.unix=function(t){return v(1e3*t)},v.en=M[y],v.Ls=M,v.p={},v});
});
export default dayjs_min;
{
"imports": {
"@emotion/react": "./@emotion/react.js",
"@material-ui/core": "./@material-ui/core.js",
"@material-ui/core/CircularProgress": "./@material-ui/core/CircularProgress.js",
"@material-ui/core/Grid": "./@material-ui/core/Grid.js",
"@material-ui/core/List": "./@material-ui/core/List.js",
"@material-ui/core/ListItem": "./@material-ui/core/ListItem.js",
"@material-ui/core/ListItemAvatar": "./@material-ui/core/ListItemAvatar.js",
"@material-ui/core/ListItemText": "./@material-ui/core/ListItemText.js",
"@material-ui/core/styles": "./@material-ui/core/styles.js",
"@material-ui/icons/MailOutline": "./@material-ui/icons/MailOutline.js",
"@material-ui/icons/Menu": "./@material-ui/icons/Menu.js",
"axios": "./axios.js",
"dayjs": "./dayjs.js",
"react": "./react.js",
"react-dom": "./react-dom.js",
"react-infinite-scroll-component": "./react-infinite-scroll-component.js",
"react-router-dom": "./react-router-dom.js"
}
}
\ No newline at end of file
import { r as reactDom } from './common/index-8dbeb7e4.js';
export { r as default } from './common/index-8dbeb7e4.js';
import './common/_commonjsHelpers-8c19dec8.js';
import './common/index-57a74e37.js';
import { r as react } from './common/index-57a74e37.js';
import './common/_commonjsHelpers-8c19dec8.js';
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
/**
* Throttle execution of a function. Especially useful for rate limiting
* execution of handlers on events like resize and scroll.
*
* @param {Number} delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
* @param {Boolean} [noTrailing] Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds while the
* throttled-function is being called. If noTrailing is false or unspecified, callback will be executed one final time
* after the last throttled-function call. (After the throttled-function has not been called for `delay` milliseconds,
* the internal counter is reset)
* @param {Function} callback A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
* to `callback` when the throttled-function is executed.
* @param {Boolean} [debounceMode] If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is false (at end),
* schedule `callback` to execute after `delay` ms.
*
* @return {Function} A new, throttled, function.
*/
function throttle (delay, noTrailing, callback, debounceMode) {
/*
* After wrapper has stopped being called, this timeout ensures that
* `callback` is executed at the proper times in `throttle` and `end`
* debounce modes.
*/
var timeoutID;
var cancelled = false; // Keep track of the last time `callback` was executed.
var lastExec = 0; // Function to clear existing timeout
function clearExistingTimeout() {
if (timeoutID) {
clearTimeout(timeoutID);
}
} // Function to cancel next exec
function cancel() {
clearExistingTimeout();
cancelled = true;
} // `noTrailing` defaults to falsy.
if (typeof noTrailing !== 'boolean') {
debounceMode = callback;
callback = noTrailing;
noTrailing = undefined;
}
/*
* The `wrapper` function encapsulates all of the throttling / debouncing
* functionality and when executed will limit the rate at which `callback`
* is executed.
*/
function wrapper() {
var self = this;
var elapsed = Date.now() - lastExec;
var args = arguments;
if (cancelled) {
return;
} // Execute `callback` and update the `lastExec` timestamp.
function exec() {
lastExec = Date.now();
callback.apply(self, args);
}
/*
* If `debounceMode` is true (at begin) this is used to clear the flag
* to allow future `callback` executions.
*/
function clear() {
timeoutID = undefined;
}
if (debounceMode && !timeoutID) {
/*
* Since `wrapper` is being called for the first time and
* `debounceMode` is true (at begin), execute `callback`.
*/
exec();
}
clearExistingTimeout();
if (debounceMode === undefined && elapsed > delay) {
/*
* In throttle mode, if `delay` time has been exceeded, execute
* `callback`.
*/
exec();
} else if (noTrailing !== true) {
/*
* In trailing throttle mode, since `delay` time has not been
* exceeded, schedule `callback` to execute `delay` ms after most
* recent execution.
*
* If `debounceMode` is true (at begin), schedule `clear` to execute
* after `delay` ms.
*
* If `debounceMode` is false (at end), schedule `callback` to
* execute after `delay` ms.
*/
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
}
}
wrapper.cancel = cancel; // Return the wrapper function.
return wrapper;
}
var ThresholdUnits = {
Pixel: 'Pixel',
Percent: 'Percent',
};
var defaultThreshold = {
unit: ThresholdUnits.Percent,
value: 0.8,
};
function parseThreshold(scrollThreshold) {
if (typeof scrollThreshold === 'number') {
return {
unit: ThresholdUnits.Percent,
value: scrollThreshold * 100,
};
}
if (typeof scrollThreshold === 'string') {
if (scrollThreshold.match(/^(\d*(\.\d+)?)px$/)) {
return {
unit: ThresholdUnits.Pixel,
value: parseFloat(scrollThreshold),
};
}
if (scrollThreshold.match(/^(\d*(\.\d+)?)%$/)) {
return {
unit: ThresholdUnits.Percent,
value: parseFloat(scrollThreshold),
};
}
console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...');
return defaultThreshold;
}
console.warn('scrollThreshold should be string or number');
return defaultThreshold;
}
var InfiniteScroll = /** @class */ (function (_super) {
__extends(InfiniteScroll, _super);
function InfiniteScroll(props) {
var _this = _super.call(this, props) || this;
_this.lastScrollTop = 0;
_this.actionTriggered = false;
// variables to keep track of pull down behaviour
_this.startY = 0;
_this.currentY = 0;
_this.dragging = false;
// will be populated in componentDidMount
// based on the height of the pull down element
_this.maxPullDownDistance = 0;
_this.getScrollableTarget = function () {
if (_this.props.scrollableTarget instanceof HTMLElement)
return _this.props.scrollableTarget;
if (typeof _this.props.scrollableTarget === 'string') {
return document.getElementById(_this.props.scrollableTarget);
}
if (_this.props.scrollableTarget === null) {
console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n ");
}
return null;
};
_this.onStart = function (evt) {
if (_this.lastScrollTop)
return;
_this.dragging = true;
if (evt instanceof MouseEvent) {
_this.startY = evt.pageY;
}
else if (evt instanceof TouchEvent) {
_this.startY = evt.touches[0].pageY;
}
_this.currentY = _this.startY;
if (_this._infScroll) {
_this._infScroll.style.willChange = 'transform';
_this._infScroll.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)";
}
};
_this.onMove = function (evt) {
if (!_this.dragging)
return;
if (evt instanceof MouseEvent) {
_this.currentY = evt.pageY;
}
else if (evt instanceof TouchEvent) {
_this.currentY = evt.touches[0].pageY;
}
// user is scrolling down to up
if (_this.currentY < _this.startY)
return;
if (_this.currentY - _this.startY >=
Number(_this.props.pullDownToRefreshThreshold)) {
_this.setState({
pullToRefreshThresholdBreached: true,
});
}
// so you can drag upto 1.5 times of the maxPullDownDistance
if (_this.currentY - _this.startY > _this.maxPullDownDistance * 1.5)
return;
if (_this._infScroll) {
_this._infScroll.style.overflow = 'visible';
_this._infScroll.style.transform = "translate3d(0px, " + (_this.currentY -
_this.startY) + "px, 0px)";
}
};
_this.onEnd = function () {
_this.startY = 0;
_this.currentY = 0;
_this.dragging = false;
if (_this.state.pullToRefreshThresholdBreached) {
_this.props.refreshFunction && _this.props.refreshFunction();
_this.setState({
pullToRefreshThresholdBreached: false,
});
}
requestAnimationFrame(function () {
// this._infScroll
if (_this._infScroll) {
_this._infScroll.style.overflow = 'auto';
_this._infScroll.style.transform = 'none';
_this._infScroll.style.willChange = 'unset';
}
});
};
_this.onScrollListener = function (event) {
if (typeof _this.props.onScroll === 'function') {
// Execute this callback in next tick so that it does not affect the
// functionality of the library.
setTimeout(function () { return _this.props.onScroll && _this.props.onScroll(event); }, 0);
}
var target = _this.props.height || _this._scrollableNode
? event.target
: document.documentElement.scrollTop
? document.documentElement
: document.body;
// return immediately if the action has already been triggered,
// prevents multiple triggers.
if (_this.actionTriggered)
return;
var atBottom = _this.props.inverse
? _this.isElementAtTop(target, _this.props.scrollThreshold)
: _this.isElementAtBottom(target, _this.props.scrollThreshold);
// call the `next` function in the props to trigger the next data fetch
if (atBottom && _this.props.hasMore) {
_this.actionTriggered = true;
_this.setState({ showLoader: true });
_this.props.next && _this.props.next();
}
_this.lastScrollTop = target.scrollTop;
};
_this.state = {
showLoader: false,
pullToRefreshThresholdBreached: false,
};
_this.throttledOnScrollListener = throttle(150, _this.onScrollListener).bind(_this);
_this.onStart = _this.onStart.bind(_this);
_this.onMove = _this.onMove.bind(_this);
_this.onEnd = _this.onEnd.bind(_this);
return _this;
}
InfiniteScroll.prototype.componentDidMount = function () {
if (typeof this.props.dataLength === 'undefined') {
throw new Error("mandatory prop \"dataLength\" is missing. The prop is needed" +
" when loading more content. Check README.md for usage");
}
this._scrollableNode = this.getScrollableTarget();
this.el = this.props.height
? this._infScroll
: this._scrollableNode || window;
if (this.el) {
this.el.addEventListener('scroll', this
.throttledOnScrollListener);
}
if (typeof this.props.initialScrollY === 'number' &&
this.el &&
this.el instanceof HTMLElement &&
this.el.scrollHeight > this.props.initialScrollY) {
this.el.scrollTo(0, this.props.initialScrollY);
}
if (this.props.pullDownToRefresh && this.el) {
this.el.addEventListener('touchstart', this.onStart);
this.el.addEventListener('touchmove', this.onMove);
this.el.addEventListener('touchend', this.onEnd);
this.el.addEventListener('mousedown', this.onStart);
this.el.addEventListener('mousemove', this.onMove);
this.el.addEventListener('mouseup', this.onEnd);
// get BCR of pullDown element to position it above
this.maxPullDownDistance =
(this._pullDown &&
this._pullDown.firstChild &&
this._pullDown.firstChild.getBoundingClientRect()
.height) ||
0;
this.forceUpdate();
if (typeof this.props.refreshFunction !== 'function') {
throw new Error("Mandatory prop \"refreshFunction\" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage'");
}
}
};
InfiniteScroll.prototype.componentWillUnmount = function () {
if (this.el) {
this.el.removeEventListener('scroll', this
.throttledOnScrollListener);
if (this.props.pullDownToRefresh) {
this.el.removeEventListener('touchstart', this.onStart);
this.el.removeEventListener('touchmove', this.onMove);
this.el.removeEventListener('touchend', this.onEnd);
this.el.removeEventListener('mousedown', this.onStart);
this.el.removeEventListener('mousemove', this.onMove);
this.el.removeEventListener('mouseup', this.onEnd);
}
}
};
InfiniteScroll.prototype.UNSAFE_componentWillReceiveProps = function (props) {
// do nothing when dataLength is unchanged
if (this.props.dataLength === props.dataLength)
return;
this.actionTriggered = false;
// update state when new data was sent in
this.setState({
showLoader: false,
});
};
InfiniteScroll.prototype.isElementAtTop = function (target, scrollThreshold) {
if (scrollThreshold === void 0) { scrollThreshold = 0.8; }
var clientHeight = target === document.body || target === document.documentElement
? window.screen.availHeight
: target.clientHeight;
var threshold = parseThreshold(scrollThreshold);
if (threshold.unit === ThresholdUnits.Pixel) {
return (target.scrollTop <=
threshold.value + clientHeight - target.scrollHeight + 1);
}
return (target.scrollTop <=
threshold.value / 100 + clientHeight - target.scrollHeight + 1);
};
InfiniteScroll.prototype.isElementAtBottom = function (target, scrollThreshold) {
if (scrollThreshold === void 0) { scrollThreshold = 0.8; }
var clientHeight = target === document.body || target === document.documentElement
? window.screen.availHeight
: target.clientHeight;
var threshold = parseThreshold(scrollThreshold);
if (threshold.unit === ThresholdUnits.Pixel) {
return (target.scrollTop + clientHeight >= target.scrollHeight - threshold.value);
}
return (target.scrollTop + clientHeight >=
(threshold.value / 100) * target.scrollHeight);
};
InfiniteScroll.prototype.render = function () {
var _this = this;
var style = __assign({ height: this.props.height || 'auto', overflow: 'auto', WebkitOverflowScrolling: 'touch' }, this.props.style);
var hasChildren = this.props.hasChildren ||
!!(this.props.children &&
this.props.children instanceof Array &&
this.props.children.length);
// because heighted infiniteScroll visualy breaks
// on drag down as overflow becomes visible
var outerDivStyle = this.props.pullDownToRefresh && this.props.height
? { overflow: 'auto' }
: {};
return (react.createElement("div", { style: outerDivStyle, className: "infinite-scroll-component__outerdiv" },
react.createElement("div", { className: "infinite-scroll-component " + (this.props.className || ''), ref: function (infScroll) { return (_this._infScroll = infScroll); }, style: style },
this.props.pullDownToRefresh && (react.createElement("div", { style: { position: 'relative' }, ref: function (pullDown) { return (_this._pullDown = pullDown); } },
react.createElement("div", { style: {
position: 'absolute',
left: 0,
right: 0,
top: -1 * this.maxPullDownDistance,
} }, this.state.pullToRefreshThresholdBreached
? this.props.releaseToRefreshContent
: this.props.pullDownToRefreshContent))),
this.props.children,
!this.state.showLoader &&
!hasChildren &&
this.props.hasMore &&
this.props.loader,
this.state.showLoader && this.props.hasMore && this.props.loader,
!this.props.hasMore && this.props.endMessage)));
};
return InfiniteScroll;
}(react.Component));
export default InfiniteScroll;
import { p as propTypes, _ as _inheritsLoose, a as _objectWithoutPropertiesLoose } from './common/_index-aecdce4e.js';
import { r as react } from './common/index-57a74e37.js';
import { _ as _extends } from './common/_index-4fa100fd.js';
import { c as createCommonjsModule } from './common/_commonjsHelpers-8c19dec8.js';
import './common/hoist-non-react-statics.cjs-43de917e.js';
function isAbsolute(pathname) {
return pathname.charAt(0) === '/';
}
// About 1.5x faster than the two-arg version of Array#splice()
function spliceOne(list, index) {
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {
list[i] = list[k];
}
list.pop();
}
// This implementation is based heavily on node's url.parse
function resolvePathname(to, from) {
if (from === undefined) from = '';
var toParts = (to && to.split('/')) || [];
var fromParts = (from && from.split('/')) || [];
var isToAbs = to && isAbsolute(to);
var isFromAbs = from && isAbsolute(from);
var mustEndAbs = isToAbs || isFromAbs;
if (to && isAbsolute(to)) {
// to is absolute
fromParts = toParts;
} else if (toParts.length) {
// to is relative, drop the filename
fromParts.pop();
fromParts = fromParts.concat(toParts);
}
if (!fromParts.length) return '/';
var hasTrailingSlash;
if (fromParts.length) {
var last = fromParts[fromParts.length - 1];
hasTrailingSlash = last === '.' || last === '..' || last === '';
} else {
hasTrailingSlash = false;
}
var up = 0;
for (var i = fromParts.length; i >= 0; i--) {
var part = fromParts[i];
if (part === '.') {
spliceOne(fromParts, i);
} else if (part === '..') {
spliceOne(fromParts, i);
up++;
} else if (up) {
spliceOne(fromParts, i);
up--;
}
}
if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');
if (
mustEndAbs &&
fromParts[0] !== '' &&
(!fromParts[0] || !isAbsolute(fromParts[0]))
)
fromParts.unshift('');
var result = fromParts.join('/');
if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';
return result;
}
var prefix = 'Invariant failed';
function invariant(condition, message) {
if (condition) {
return;
}
{
throw new Error(prefix);
}
}
function addLeadingSlash$1(path) {
return path.charAt(0) === '/' ? path : '/' + path;
}
function stripLeadingSlash(path) {
return path.charAt(0) === '/' ? path.substr(1) : path;
}
function hasBasename(path, prefix) {
return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;
}
function stripBasename$1(path, prefix) {
return hasBasename(path, prefix) ? path.substr(prefix.length) : path;
}
function stripTrailingSlash(path) {
return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;
}
function parsePath(path) {
var pathname = path || '/';
var search = '';
var hash = '';
var hashIndex = pathname.indexOf('#');
if (hashIndex !== -1) {
hash = pathname.substr(hashIndex);
pathname = pathname.substr(0, hashIndex);
}
var searchIndex = pathname.indexOf('?');
if (searchIndex !== -1) {
search = pathname.substr(searchIndex);
pathname = pathname.substr(0, searchIndex);
}
return {
pathname: pathname,
search: search === '?' ? '' : search,
hash: hash === '#' ? '' : hash
};
}
function createPath(location) {
var pathname = location.pathname,
search = location.search,
hash = location.hash;
var path = pathname || '/';
if (search && search !== '?') path += search.charAt(0) === '?' ? search : "?" + search;
if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : "#" + hash;
return path;
}
function createLocation(path, state, key, currentLocation) {
var location;
if (typeof path === 'string') {
// Two-arg form: push(path, state)
location = parsePath(path);
location.state = state;
} else {
// One-arg form: push(location)
location = _extends({}, path);
if (location.pathname === undefined) location.pathname = '';
if (location.search) {
if (location.search.charAt(0) !== '?') location.search = '?' + location.search;
} else {
location.search = '';
}
if (location.hash) {
if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;
} else {
location.hash = '';
}
if (state !== undefined && location.state === undefined) location.state = state;
}
try {
location.pathname = decodeURI(location.pathname);
} catch (e) {
if (e instanceof URIError) {
throw new URIError('Pathname "' + location.pathname + '" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');
} else {
throw e;
}
}
if (key) location.key = key;
if (currentLocation) {
// Resolve incomplete/relative pathname relative to current location.
if (!location.pathname) {
location.pathname = currentLocation.pathname;
} else if (location.pathname.charAt(0) !== '/') {
location.pathname = resolvePathname(location.pathname, currentLocation.pathname);
}
} else {
// When there is no prior location and pathname is empty, set it to /
if (!location.pathname) {
location.pathname = '/';
}
}
return location;
}
function createTransitionManager() {
var prompt = null;
function setPrompt(nextPrompt) {
prompt = nextPrompt;
return function () {
if (prompt === nextPrompt) prompt = null;
};
}
function confirmTransitionTo(location, action, getUserConfirmation, callback) {
// TODO: If another transition starts while we're still confirming
// the previous one, we may end up in a weird state. Figure out the
// best way to handle this.
if (prompt != null) {
var result = typeof prompt === 'function' ? prompt(location, action) : prompt;
if (typeof result === 'string') {
if (typeof getUserConfirmation === 'function') {
getUserConfirmation(result, callback);
} else {
callback(true);
}
} else {
// Return false from a transition hook to cancel the transition.
callback(result !== false);
}
} else {
callback(true);
}
}
var listeners = [];
function appendListener(fn) {
var isActive = true;
function listener() {
if (isActive) fn.apply(void 0, arguments);
}
listeners.push(listener);
return function () {
isActive = false;
listeners = listeners.filter(function (item) {
return item !== listener;
});
};
}
function notifyListeners() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
listeners.forEach(function (listener) {
return listener.apply(void 0, args);
});
}
return {
setPrompt: setPrompt,
confirmTransitionTo: confirmTransitionTo,
appendListener: appendListener,
notifyListeners: notifyListeners
};
}
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
function getConfirmation(message, callback) {
callback(window.confirm(message)); // eslint-disable-line no-alert
}
/**
* Returns true if the HTML5 history API is supported. Taken from Modernizr.
*
* https://github.com/Modernizr/Modernizr/blob/master/LICENSE
* https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js
* changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586
*/
function supportsHistory() {
var ua = window.navigator.userAgent;
if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;
return window.history && 'pushState' in window.history;
}
/**
* Returns true if browser fires popstate on hash change.
* IE10 and IE11 do not.
*/
function supportsPopStateOnHashChange() {
return window.navigator.userAgent.indexOf('Trident') === -1;
}
/**
* Returns false if using go(n) with hash history causes a full page reload.
*/
function supportsGoWithoutReloadUsingHash() {
return window.navigator.userAgent.indexOf('Firefox') === -1;
}
/**
* Returns true if a given popstate event is an extraneous WebKit event.
* Accounts for the fact that Chrome on iOS fires real popstate events
* containing undefined state when pressing the back button.
*/
function isExtraneousPopstateEvent(event) {
return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;
}
var PopStateEvent = 'popstate';
var HashChangeEvent = 'hashchange';
function getHistoryState() {
try {
return window.history.state || {};
} catch (e) {
// IE 11 sometimes throws when accessing window.history.state
// See https://github.com/ReactTraining/history/pull/289
return {};
}
}
/**
* Creates a history object that uses the HTML5 history API including
* pushState, replaceState, and the popstate event.
*/
function createBrowserHistory(props) {
if (props === void 0) {
props = {};
}
!canUseDOM ? invariant(false) : void 0;
var globalHistory = window.history;
var canUseHistory = supportsHistory();
var needsHashChangeListener = !supportsPopStateOnHashChange();
var _props = props,
_props$forceRefresh = _props.forceRefresh,
forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,
_props$getUserConfirm = _props.getUserConfirmation,
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
_props$keyLength = _props.keyLength,
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
var basename = props.basename ? stripTrailingSlash(addLeadingSlash$1(props.basename)) : '';
function getDOMLocation(historyState) {
var _ref = historyState || {},
key = _ref.key,
state = _ref.state;
var _window$location = window.location,
pathname = _window$location.pathname,
search = _window$location.search,
hash = _window$location.hash;
var path = pathname + search + hash;
if (basename) path = stripBasename$1(path, basename);
return createLocation(path, state, key);
}
function createKey() {
return Math.random().toString(36).substr(2, keyLength);
}
var transitionManager = createTransitionManager();
function setState(nextState) {
_extends(history, nextState);
history.length = globalHistory.length;
transitionManager.notifyListeners(history.location, history.action);
}
function handlePopState(event) {
// Ignore extraneous popstate events in WebKit.
if (isExtraneousPopstateEvent(event)) return;
handlePop(getDOMLocation(event.state));
}
function handleHashChange() {
handlePop(getDOMLocation(getHistoryState()));
}
var forceNextPop = false;
function handlePop(location) {
if (forceNextPop) {
forceNextPop = false;
setState();
} else {
var action = 'POP';
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (ok) {
setState({
action: action,
location: location
});
} else {
revertPop(location);
}
});
}
}
function revertPop(fromLocation) {
var toLocation = history.location; // TODO: We could probably make this more reliable by
// keeping a list of keys we've seen in sessionStorage.
// Instead, we just default to 0 for keys we don't know.
var toIndex = allKeys.indexOf(toLocation.key);
if (toIndex === -1) toIndex = 0;
var fromIndex = allKeys.indexOf(fromLocation.key);
if (fromIndex === -1) fromIndex = 0;
var delta = toIndex - fromIndex;
if (delta) {
forceNextPop = true;
go(delta);
}
}
var initialLocation = getDOMLocation(getHistoryState());
var allKeys = [initialLocation.key]; // Public interface
function createHref(location) {
return basename + createPath(location);
}
function push(path, state) {
var action = 'PUSH';
var location = createLocation(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var href = createHref(location);
var key = location.key,
state = location.state;
if (canUseHistory) {
globalHistory.pushState({
key: key,
state: state
}, null, href);
if (forceRefresh) {
window.location.href = href;
} else {
var prevIndex = allKeys.indexOf(history.location.key);
var nextKeys = allKeys.slice(0, prevIndex + 1);
nextKeys.push(location.key);
allKeys = nextKeys;
setState({
action: action,
location: location
});
}
} else {
window.location.href = href;
}
});
}
function replace(path, state) {
var action = 'REPLACE';
var location = createLocation(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var href = createHref(location);
var key = location.key,
state = location.state;
if (canUseHistory) {
globalHistory.replaceState({
key: key,
state: state
}, null, href);
if (forceRefresh) {
window.location.replace(href);
} else {
var prevIndex = allKeys.indexOf(history.location.key);
if (prevIndex !== -1) allKeys[prevIndex] = location.key;
setState({
action: action,
location: location
});
}
} else {
window.location.replace(href);
}
});
}
function go(n) {
globalHistory.go(n);
}
function goBack() {
go(-1);
}
function goForward() {
go(1);
}
var listenerCount = 0;
function checkDOMListeners(delta) {
listenerCount += delta;
if (listenerCount === 1 && delta === 1) {
window.addEventListener(PopStateEvent, handlePopState);
if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);
} else if (listenerCount === 0) {
window.removeEventListener(PopStateEvent, handlePopState);
if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);
}
}
var isBlocked = false;
function block(prompt) {
if (prompt === void 0) {
prompt = false;
}
var unblock = transitionManager.setPrompt(prompt);
if (!isBlocked) {
checkDOMListeners(1);
isBlocked = true;
}
return function () {
if (isBlocked) {
isBlocked = false;
checkDOMListeners(-1);
}
return unblock();
};
}
function listen(listener) {
var unlisten = transitionManager.appendListener(listener);
checkDOMListeners(1);
return function () {
checkDOMListeners(-1);
unlisten();
};
}
var history = {
length: globalHistory.length,
action: 'POP',
location: initialLocation,
createHref: createHref,
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward,
block: block,
listen: listen
};
return history;
}
var HashChangeEvent$1 = 'hashchange';
var HashPathCoders = {
hashbang: {
encodePath: function encodePath(path) {
return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);
},
decodePath: function decodePath(path) {
return path.charAt(0) === '!' ? path.substr(1) : path;
}
},
noslash: {
encodePath: stripLeadingSlash,
decodePath: addLeadingSlash$1
},
slash: {
encodePath: addLeadingSlash$1,
decodePath: addLeadingSlash$1
}
};
function stripHash(url) {
var hashIndex = url.indexOf('#');
return hashIndex === -1 ? url : url.slice(0, hashIndex);
}
function getHashPath() {
// We can't use window.location.hash here because it's not
// consistent across browsers - Firefox will pre-decode it!
var href = window.location.href;
var hashIndex = href.indexOf('#');
return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
}
function pushHashPath(path) {
window.location.hash = path;
}
function replaceHashPath(path) {
window.location.replace(stripHash(window.location.href) + '#' + path);
}
function createHashHistory(props) {
if (props === void 0) {
props = {};
}
!canUseDOM ? invariant(false) : void 0;
var globalHistory = window.history;
supportsGoWithoutReloadUsingHash();
var _props = props,
_props$getUserConfirm = _props.getUserConfirmation,
getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,
_props$hashType = _props.hashType,
hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;
var basename = props.basename ? stripTrailingSlash(addLeadingSlash$1(props.basename)) : '';
var _HashPathCoders$hashT = HashPathCoders[hashType],
encodePath = _HashPathCoders$hashT.encodePath,
decodePath = _HashPathCoders$hashT.decodePath;
function getDOMLocation() {
var path = decodePath(getHashPath());
if (basename) path = stripBasename$1(path, basename);
return createLocation(path);
}
var transitionManager = createTransitionManager();
function setState(nextState) {
_extends(history, nextState);
history.length = globalHistory.length;
transitionManager.notifyListeners(history.location, history.action);
}
var forceNextPop = false;
var ignorePath = null;
function locationsAreEqual$$1(a, b) {
return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;
}
function handleHashChange() {
var path = getHashPath();
var encodedPath = encodePath(path);
if (path !== encodedPath) {
// Ensure we always have a properly-encoded hash.
replaceHashPath(encodedPath);
} else {
var location = getDOMLocation();
var prevLocation = history.location;
if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.
if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.
ignorePath = null;
handlePop(location);
}
}
function handlePop(location) {
if (forceNextPop) {
forceNextPop = false;
setState();
} else {
var action = 'POP';
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (ok) {
setState({
action: action,
location: location
});
} else {
revertPop(location);
}
});
}
}
function revertPop(fromLocation) {
var toLocation = history.location; // TODO: We could probably make this more reliable by
// keeping a list of paths we've seen in sessionStorage.
// Instead, we just default to 0 for paths we don't know.
var toIndex = allPaths.lastIndexOf(createPath(toLocation));
if (toIndex === -1) toIndex = 0;
var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
if (fromIndex === -1) fromIndex = 0;
var delta = toIndex - fromIndex;
if (delta) {
forceNextPop = true;
go(delta);
}
} // Ensure the hash is encoded properly before doing anything else.
var path = getHashPath();
var encodedPath = encodePath(path);
if (path !== encodedPath) replaceHashPath(encodedPath);
var initialLocation = getDOMLocation();
var allPaths = [createPath(initialLocation)]; // Public interface
function createHref(location) {
var baseTag = document.querySelector('base');
var href = '';
if (baseTag && baseTag.getAttribute('href')) {
href = stripHash(window.location.href);
}
return href + '#' + encodePath(basename + createPath(location));
}
function push(path, state) {
var action = 'PUSH';
var location = createLocation(path, undefined, undefined, history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var path = createPath(location);
var encodedPath = encodePath(basename + path);
var hashChanged = getHashPath() !== encodedPath;
if (hashChanged) {
// We cannot tell if a hashchange was caused by a PUSH, so we'd
// rather setState here and ignore the hashchange. The caveat here
// is that other hash histories in the page will consider it a POP.
ignorePath = path;
pushHashPath(encodedPath);
var prevIndex = allPaths.lastIndexOf(createPath(history.location));
var nextPaths = allPaths.slice(0, prevIndex + 1);
nextPaths.push(path);
allPaths = nextPaths;
setState({
action: action,
location: location
});
} else {
setState();
}
});
}
function replace(path, state) {
var action = 'REPLACE';
var location = createLocation(path, undefined, undefined, history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var path = createPath(location);
var encodedPath = encodePath(basename + path);
var hashChanged = getHashPath() !== encodedPath;
if (hashChanged) {
// We cannot tell if a hashchange was caused by a REPLACE, so we'd
// rather setState here and ignore the hashchange. The caveat here
// is that other hash histories in the page will consider it a POP.
ignorePath = path;
replaceHashPath(encodedPath);
}
var prevIndex = allPaths.indexOf(createPath(history.location));
if (prevIndex !== -1) allPaths[prevIndex] = path;
setState({
action: action,
location: location
});
});
}
function go(n) {
globalHistory.go(n);
}
function goBack() {
go(-1);
}
function goForward() {
go(1);
}
var listenerCount = 0;
function checkDOMListeners(delta) {
listenerCount += delta;
if (listenerCount === 1 && delta === 1) {
window.addEventListener(HashChangeEvent$1, handleHashChange);
} else if (listenerCount === 0) {
window.removeEventListener(HashChangeEvent$1, handleHashChange);
}
}
var isBlocked = false;
function block(prompt) {
if (prompt === void 0) {
prompt = false;
}
var unblock = transitionManager.setPrompt(prompt);
if (!isBlocked) {
checkDOMListeners(1);
isBlocked = true;
}
return function () {
if (isBlocked) {
isBlocked = false;
checkDOMListeners(-1);
}
return unblock();
};
}
function listen(listener) {
var unlisten = transitionManager.appendListener(listener);
checkDOMListeners(1);
return function () {
checkDOMListeners(-1);
unlisten();
};
}
var history = {
length: globalHistory.length,
action: 'POP',
location: initialLocation,
createHref: createHref,
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward,
block: block,
listen: listen
};
return history;
}
function clamp(n, lowerBound, upperBound) {
return Math.min(Math.max(n, lowerBound), upperBound);
}
/**
* Creates a history object that stores locations in memory.
*/
function createMemoryHistory(props) {
if (props === void 0) {
props = {};
}
var _props = props,
getUserConfirmation = _props.getUserConfirmation,
_props$initialEntries = _props.initialEntries,
initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,
_props$initialIndex = _props.initialIndex,
initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,
_props$keyLength = _props.keyLength,
keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;
var transitionManager = createTransitionManager();
function setState(nextState) {
_extends(history, nextState);
history.length = history.entries.length;
transitionManager.notifyListeners(history.location, history.action);
}
function createKey() {
return Math.random().toString(36).substr(2, keyLength);
}
var index = clamp(initialIndex, 0, initialEntries.length - 1);
var entries = initialEntries.map(function (entry) {
return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());
}); // Public interface
var createHref = createPath;
function push(path, state) {
var action = 'PUSH';
var location = createLocation(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
var prevIndex = history.index;
var nextIndex = prevIndex + 1;
var nextEntries = history.entries.slice(0);
if (nextEntries.length > nextIndex) {
nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);
} else {
nextEntries.push(location);
}
setState({
action: action,
location: location,
index: nextIndex,
entries: nextEntries
});
});
}
function replace(path, state) {
var action = 'REPLACE';
var location = createLocation(path, state, createKey(), history.location);
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (!ok) return;
history.entries[history.index] = location;
setState({
action: action,
location: location
});
});
}
function go(n) {
var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);
var action = 'POP';
var location = history.entries[nextIndex];
transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {
if (ok) {
setState({
action: action,
location: location,
index: nextIndex
});
} else {
// Mimic the behavior of DOM histories by
// causing a render after a cancelled POP.
setState();
}
});
}
function goBack() {
go(-1);
}
function goForward() {
go(1);
}
function canGo(n) {
var nextIndex = history.index + n;
return nextIndex >= 0 && nextIndex < history.entries.length;
}
function block(prompt) {
if (prompt === void 0) {
prompt = false;
}
return transitionManager.setPrompt(prompt);
}
function listen(listener) {
return transitionManager.appendListener(listener);
}
var history = {
length: entries.length,
action: 'POP',
location: entries[index],
index: index,
entries: entries,
createHref: createHref,
push: push,
replace: replace,
go: go,
goBack: goBack,
goForward: goForward,
canGo: canGo,
block: block,
listen: listen
};
return history;
}
var MAX_SIGNED_31_BIT_INT = 1073741823;
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
function getUniqueId() {
var key = '__global_unique_id__';
return commonjsGlobal[key] = (commonjsGlobal[key] || 0) + 1;
}
function objectIs(x, y) {
if (x === y) {
return x !== 0 || 1 / x === 1 / y;
} else {
return x !== x && y !== y;
}
}
function createEventEmitter(value) {
var handlers = [];
return {
on: function on(handler) {
handlers.push(handler);
},
off: function off(handler) {
handlers = handlers.filter(function (h) {
return h !== handler;
});
},
get: function get() {
return value;
},
set: function set(newValue, changedBits) {
value = newValue;
handlers.forEach(function (handler) {
return handler(value, changedBits);
});
}
};
}
function onlyChild(children) {
return Array.isArray(children) ? children[0] : children;
}
function createReactContext(defaultValue, calculateChangedBits) {
var _Provider$childContex, _Consumer$contextType;
var contextProp = '__create-react-context-' + getUniqueId() + '__';
var Provider = /*#__PURE__*/function (_Component) {
_inheritsLoose(Provider, _Component);
function Provider() {
var _this;
_this = _Component.apply(this, arguments) || this;
_this.emitter = createEventEmitter(_this.props.value);
return _this;
}
var _proto = Provider.prototype;
_proto.getChildContext = function getChildContext() {
var _ref;
return _ref = {}, _ref[contextProp] = this.emitter, _ref;
};
_proto.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
if (this.props.value !== nextProps.value) {
var oldValue = this.props.value;
var newValue = nextProps.value;
var changedBits;
if (objectIs(oldValue, newValue)) {
changedBits = 0;
} else {
changedBits = typeof calculateChangedBits === 'function' ? calculateChangedBits(oldValue, newValue) : MAX_SIGNED_31_BIT_INT;
changedBits |= 0;
if (changedBits !== 0) {
this.emitter.set(nextProps.value, changedBits);
}
}
}
};
_proto.render = function render() {
return this.props.children;
};
return Provider;
}(react.Component);
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[contextProp] = propTypes.object.isRequired, _Provider$childContex);
var Consumer = /*#__PURE__*/function (_Component2) {
_inheritsLoose(Consumer, _Component2);
function Consumer() {
var _this2;
_this2 = _Component2.apply(this, arguments) || this;
_this2.state = {
value: _this2.getValue()
};
_this2.onUpdate = function (newValue, changedBits) {
var observedBits = _this2.observedBits | 0;
if ((observedBits & changedBits) !== 0) {
_this2.setState({
value: _this2.getValue()
});
}
};
return _this2;
}
var _proto2 = Consumer.prototype;
_proto2.componentWillReceiveProps = function componentWillReceiveProps(nextProps) {
var observedBits = nextProps.observedBits;
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
};
_proto2.componentDidMount = function componentDidMount() {
if (this.context[contextProp]) {
this.context[contextProp].on(this.onUpdate);
}
var observedBits = this.props.observedBits;
this.observedBits = observedBits === undefined || observedBits === null ? MAX_SIGNED_31_BIT_INT : observedBits;
};
_proto2.componentWillUnmount = function componentWillUnmount() {
if (this.context[contextProp]) {
this.context[contextProp].off(this.onUpdate);
}
};
_proto2.getValue = function getValue() {
if (this.context[contextProp]) {
return this.context[contextProp].get();
} else {
return defaultValue;
}
};
_proto2.render = function render() {
return onlyChild(this.props.children)(this.state.value);
};
return Consumer;
}(react.Component);
Consumer.contextTypes = (_Consumer$contextType = {}, _Consumer$contextType[contextProp] = propTypes.object, _Consumer$contextType);
return {
Provider: Provider,
Consumer: Consumer
};
}
var index = react.createContext || createReactContext;
var isarray = Array.isArray || function (arr) {
return Object.prototype.toString.call(arr) == '[object Array]';
};
/**
* Expose `pathToRegexp`.
*/
var pathToRegexp_1 = pathToRegexp;
var parse_1 = parse;
var compile_1 = compile;
var tokensToFunction_1 = tokensToFunction;
var tokensToRegExp_1 = tokensToRegExp;
/**
* The main path matching regexp utility.
*
* @type {RegExp}
*/
var PATH_REGEXP = new RegExp([
// Match escaped characters that would otherwise appear in future matches.
// This allows the user to escape special characters that won't transform.
'(\\\\.)',
// Match Express-style parameters and un-named parameters with a prefix
// and optional suffixes. Matches appear as:
//
// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined]
// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined]
// "/*" => ["/", undefined, undefined, undefined, undefined, "*"]
'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'
].join('|'), 'g');
/**
* Parse a string for the raw tokens.
*
* @param {string} str
* @param {Object=} options
* @return {!Array}
*/
function parse (str, options) {
var tokens = [];
var key = 0;
var index = 0;
var path = '';
var defaultDelimiter = options && options.delimiter || '/';
var res;
while ((res = PATH_REGEXP.exec(str)) != null) {
var m = res[0];
var escaped = res[1];
var offset = res.index;
path += str.slice(index, offset);
index = offset + m.length;
// Ignore already escaped sequences.
if (escaped) {
path += escaped[1];
continue
}
var next = str[index];
var prefix = res[2];
var name = res[3];
var capture = res[4];
var group = res[5];
var modifier = res[6];
var asterisk = res[7];
// Push the current path onto the tokens.
if (path) {
tokens.push(path);
path = '';
}
var partial = prefix != null && next != null && next !== prefix;
var repeat = modifier === '+' || modifier === '*';
var optional = modifier === '?' || modifier === '*';
var delimiter = res[2] || defaultDelimiter;
var pattern = capture || group;
tokens.push({
name: name || key++,
prefix: prefix || '',
delimiter: delimiter,
optional: optional,
repeat: repeat,
partial: partial,
asterisk: !!asterisk,
pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
});
}
// Match any characters still remaining.
if (index < str.length) {
path += str.substr(index);
}
// If the path exists, push it onto the end.
if (path) {
tokens.push(path);
}
return tokens
}
/**
* Compile a string to a template function for the path.
*
* @param {string} str
* @param {Object=} options
* @return {!function(Object=, Object=)}
*/
function compile (str, options) {
return tokensToFunction(parse(str, options), options)
}
/**
* Prettier encoding of URI path segments.
*
* @param {string}
* @return {string}
*/
function encodeURIComponentPretty (str) {
return encodeURI(str).replace(/[\/?#]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
})
}
/**
* Encode the asterisk parameter. Similar to `pretty`, but allows slashes.
*
* @param {string}
* @return {string}
*/
function encodeAsterisk (str) {
return encodeURI(str).replace(/[?#]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16).toUpperCase()
})
}
/**
* Expose a method for transforming tokens into the path function.
*/
function tokensToFunction (tokens, options) {
// Compile all the tokens into regexps.
var matches = new Array(tokens.length);
// Compile all the patterns before compilation.
for (var i = 0; i < tokens.length; i++) {
if (typeof tokens[i] === 'object') {
matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options));
}
}
return function (obj, opts) {
var path = '';
var data = obj || {};
var options = opts || {};
var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent;
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (typeof token === 'string') {
path += token;
continue
}
var value = data[token.name];
var segment;
if (value == null) {
if (token.optional) {
// Prepend partial segment prefixes.
if (token.partial) {
path += token.prefix;
}
continue
} else {
throw new TypeError('Expected "' + token.name + '" to be defined')
}
}
if (isarray(value)) {
if (!token.repeat) {
throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`')
}
if (value.length === 0) {
if (token.optional) {
continue
} else {
throw new TypeError('Expected "' + token.name + '" to not be empty')
}
}
for (var j = 0; j < value.length; j++) {
segment = encode(value[j]);
if (!matches[i].test(segment)) {
throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`')
}
path += (j === 0 ? token.prefix : token.delimiter) + segment;
}
continue
}
segment = token.asterisk ? encodeAsterisk(value) : encode(value);
if (!matches[i].test(segment)) {
throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"')
}
path += token.prefix + segment;
}
return path
}
}
/**
* Escape a regular expression string.
*
* @param {string} str
* @return {string}
*/
function escapeString (str) {
return str.replace(/([.+*?=^!:${}()[\]|\/\\])/g, '\\$1')
}
/**
* Escape the capturing group by escaping special characters and meaning.
*
* @param {string} group
* @return {string}
*/
function escapeGroup (group) {
return group.replace(/([=!:$\/()])/g, '\\$1')
}
/**
* Attach the keys as a property of the regexp.
*
* @param {!RegExp} re
* @param {Array} keys
* @return {!RegExp}
*/
function attachKeys (re, keys) {
re.keys = keys;
return re
}
/**
* Get the flags for a regexp from the options.
*
* @param {Object} options
* @return {string}
*/
function flags (options) {
return options && options.sensitive ? '' : 'i'
}
/**
* Pull out keys from a regexp.
*
* @param {!RegExp} path
* @param {!Array} keys
* @return {!RegExp}
*/
function regexpToRegexp (path, keys) {
// Use a negative lookahead to match only capturing groups.
var groups = path.source.match(/\((?!\?)/g);
if (groups) {
for (var i = 0; i < groups.length; i++) {
keys.push({
name: i,
prefix: null,
delimiter: null,
optional: false,
repeat: false,
partial: false,
asterisk: false,
pattern: null
});
}
}
return attachKeys(path, keys)
}
/**
* Transform an array into a regexp.
*
* @param {!Array} path
* @param {Array} keys
* @param {!Object} options
* @return {!RegExp}
*/
function arrayToRegexp (path, keys, options) {
var parts = [];
for (var i = 0; i < path.length; i++) {
parts.push(pathToRegexp(path[i], keys, options).source);
}
var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options));
return attachKeys(regexp, keys)
}
/**
* Create a path regexp from string input.
*
* @param {string} path
* @param {!Array} keys
* @param {!Object} options
* @return {!RegExp}
*/
function stringToRegexp (path, keys, options) {
return tokensToRegExp(parse(path, options), keys, options)
}
/**
* Expose a function for taking tokens and returning a RegExp.
*
* @param {!Array} tokens
* @param {(Array|Object)=} keys
* @param {Object=} options
* @return {!RegExp}
*/
function tokensToRegExp (tokens, keys, options) {
if (!isarray(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
options = options || {};
var strict = options.strict;
var end = options.end !== false;
var route = '';
// Iterate over the tokens and create our regexp string.
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i];
if (typeof token === 'string') {
route += escapeString(token);
} else {
var prefix = escapeString(token.prefix);
var capture = '(?:' + token.pattern + ')';
keys.push(token);
if (token.repeat) {
capture += '(?:' + prefix + capture + ')*';
}
if (token.optional) {
if (!token.partial) {
capture = '(?:' + prefix + '(' + capture + '))?';
} else {
capture = prefix + '(' + capture + ')?';
}
} else {
capture = prefix + '(' + capture + ')';
}
route += capture;
}
}
var delimiter = escapeString(options.delimiter || '/');
var endsWithDelimiter = route.slice(-delimiter.length) === delimiter;
// In non-strict mode we allow a slash at the end of match. If the path to
// match already ends with a slash, we remove it for consistency. The slash
// is valid at the end of a path match, not in the middle. This is important
// in non-ending mode, where "/test/" shouldn't match "/test//route".
if (!strict) {
route = (endsWithDelimiter ? route.slice(0, -delimiter.length) : route) + '(?:' + delimiter + '(?=$))?';
}
if (end) {
route += '$';
} else {
// In non-ending mode, we need the capturing groups to match as much as
// possible by using a positive lookahead to the end or next path segment.
route += strict && endsWithDelimiter ? '' : '(?=' + delimiter + '|$)';
}
return attachKeys(new RegExp('^' + route, flags(options)), keys)
}
/**
* Normalize the given path string, returning a regular expression.
*
* An empty array can be passed in for the keys, which will hold the
* placeholder key descriptions. For example, using `/user/:id`, `keys` will
* contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`.
*
* @param {(string|RegExp|Array)} path
* @param {(Array|Object)=} keys
* @param {Object=} options
* @return {!RegExp}
*/
function pathToRegexp (path, keys, options) {
if (!isarray(keys)) {
options = /** @type {!Object} */ (keys || options);
keys = [];
}
options = options || {};
if (path instanceof RegExp) {
return regexpToRegexp(path, /** @type {!Array} */ (keys))
}
if (isarray(path)) {
return arrayToRegexp(/** @type {!Array} */ (path), /** @type {!Array} */ (keys), options)
}
return stringToRegexp(/** @type {string} */ (path), /** @type {!Array} */ (keys), options)
}
pathToRegexp_1.parse = parse_1;
pathToRegexp_1.compile = compile_1;
pathToRegexp_1.tokensToFunction = tokensToFunction_1;
pathToRegexp_1.tokensToRegExp = tokensToRegExp_1;
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
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?
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;
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}var AsyncMode=l;var ConcurrentMode=m;var ContextConsumer=k;var ContextProvider=h;var Element=c;var ForwardRef=n;var Fragment=e;var Lazy=t;var Memo=r;var Portal=d;
var Profiler=g;var StrictMode=f;var Suspense=p;var isAsyncMode=function(a){return A(a)||z(a)===l};var isConcurrentMode=A;var isContextConsumer=function(a){return z(a)===k};var isContextProvider=function(a){return z(a)===h};var isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};var isForwardRef=function(a){return z(a)===n};var isFragment=function(a){return z(a)===e};var isLazy=function(a){return z(a)===t};
var isMemo=function(a){return z(a)===r};var isPortal=function(a){return z(a)===d};var isProfiler=function(a){return z(a)===g};var isStrictMode=function(a){return z(a)===f};var isSuspense=function(a){return z(a)===p};
var 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)};var typeOf=z;
var reactIs_production_min = {
AsyncMode: AsyncMode,
ConcurrentMode: ConcurrentMode,
ContextConsumer: ContextConsumer,
ContextProvider: ContextProvider,
Element: Element,
ForwardRef: ForwardRef,
Fragment: Fragment,
Lazy: Lazy,
Memo: Memo,
Portal: Portal,
Profiler: Profiler,
StrictMode: StrictMode,
Suspense: Suspense,
isAsyncMode: isAsyncMode,
isConcurrentMode: isConcurrentMode,
isContextConsumer: isContextConsumer,
isContextProvider: isContextProvider,
isElement: isElement,
isForwardRef: isForwardRef,
isFragment: isFragment,
isLazy: isLazy,
isMemo: isMemo,
isPortal: isPortal,
isProfiler: isProfiler,
isStrictMode: isStrictMode,
isSuspense: isSuspense,
isValidElementType: isValidElementType,
typeOf: typeOf
};
createCommonjsModule(function (module) {
{
module.exports = reactIs_production_min;
}
});
// TODO: Replace with React.createContext once we can assume React 16+
var createNamedContext = function createNamedContext(name) {
var context = index();
context.displayName = name;
return context;
};
var historyContext =
/*#__PURE__*/
createNamedContext("Router-History");
// TODO: Replace with React.createContext once we can assume React 16+
var createNamedContext$1 = function createNamedContext(name) {
var context = index();
context.displayName = name;
return context;
};
var context =
/*#__PURE__*/
createNamedContext$1("Router");
/**
* The public API for putting history on context.
*/
var Router =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(Router, _React$Component);
Router.computeRootMatch = function computeRootMatch(pathname) {
return {
path: "/",
url: "/",
params: {},
isExact: pathname === "/"
};
};
function Router(props) {
var _this;
_this = _React$Component.call(this, props) || this;
_this.state = {
location: props.history.location
}; // This is a bit of a hack. We have to start listening for location
// changes here in the constructor in case there are any <Redirect>s
// on the initial render. If there are, they will replace/push when
// they mount and since cDM fires in children before parents, we may
// get a new location before the <Router> is mounted.
_this._isMounted = false;
_this._pendingLocation = null;
if (!props.staticContext) {
_this.unlisten = props.history.listen(function (location) {
if (_this._isMounted) {
_this.setState({
location: location
});
} else {
_this._pendingLocation = location;
}
});
}
return _this;
}
var _proto = Router.prototype;
_proto.componentDidMount = function componentDidMount() {
this._isMounted = true;
if (this._pendingLocation) {
this.setState({
location: this._pendingLocation
});
}
};
_proto.componentWillUnmount = function componentWillUnmount() {
if (this.unlisten) this.unlisten();
};
_proto.render = function render() {
return react.createElement(context.Provider, {
value: {
history: this.props.history,
location: this.state.location,
match: Router.computeRootMatch(this.state.location.pathname),
staticContext: this.props.staticContext
}
}, react.createElement(historyContext.Provider, {
children: this.props.children || null,
value: this.props.history
}));
};
return Router;
}(react.Component);
/**
* The public API for a <Router> that stores location in memory.
*/
/*#__PURE__*/
(function (_React$Component) {
_inheritsLoose(MemoryRouter, _React$Component);
function MemoryRouter() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.history = createMemoryHistory(_this.props);
return _this;
}
var _proto = MemoryRouter.prototype;
_proto.render = function render() {
return react.createElement(Router, {
history: this.history,
children: this.props.children
});
};
return MemoryRouter;
})(react.Component);
/*#__PURE__*/
(function (_React$Component) {
_inheritsLoose(Lifecycle, _React$Component);
function Lifecycle() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = Lifecycle.prototype;
_proto.componentDidMount = function componentDidMount() {
if (this.props.onMount) this.props.onMount.call(this, this);
};
_proto.componentDidUpdate = function componentDidUpdate(prevProps) {
if (this.props.onUpdate) this.props.onUpdate.call(this, this, prevProps);
};
_proto.componentWillUnmount = function componentWillUnmount() {
if (this.props.onUnmount) this.props.onUnmount.call(this, this);
};
_proto.render = function render() {
return null;
};
return Lifecycle;
})(react.Component);
var cache$1 = {};
var cacheLimit$1 = 10000;
var cacheCount$1 = 0;
function compilePath$1(path, options) {
var cacheKey = "" + options.end + options.strict + options.sensitive;
var pathCache = cache$1[cacheKey] || (cache$1[cacheKey] = {});
if (pathCache[path]) return pathCache[path];
var keys = [];
var regexp = pathToRegexp_1(path, keys, options);
var result = {
regexp: regexp,
keys: keys
};
if (cacheCount$1 < cacheLimit$1) {
pathCache[path] = result;
cacheCount$1++;
}
return result;
}
/**
* Public API for matching a URL pathname to a path.
*/
function matchPath(pathname, options) {
if (options === void 0) {
options = {};
}
if (typeof options === "string" || Array.isArray(options)) {
options = {
path: options
};
}
var _options = options,
path = _options.path,
_options$exact = _options.exact,
exact = _options$exact === void 0 ? false : _options$exact,
_options$strict = _options.strict,
strict = _options$strict === void 0 ? false : _options$strict,
_options$sensitive = _options.sensitive,
sensitive = _options$sensitive === void 0 ? false : _options$sensitive;
var paths = [].concat(path);
return paths.reduce(function (matched, path) {
if (!path && path !== "") return null;
if (matched) return matched;
var _compilePath = compilePath$1(path, {
end: exact,
strict: strict,
sensitive: sensitive
}),
regexp = _compilePath.regexp,
keys = _compilePath.keys;
var match = regexp.exec(pathname);
if (!match) return null;
var url = match[0],
values = match.slice(1);
var isExact = pathname === url;
if (exact && !isExact) return null;
return {
path: path,
// the path used to match
url: path === "/" && url === "" ? "/" : url,
// the matched portion of the URL
isExact: isExact,
// whether or not we matched exactly
params: keys.reduce(function (memo, key, index) {
memo[key.name] = values[index];
return memo;
}, {})
};
}, null);
}
/**
* The public API for matching a single path and rendering.
*/
var Route =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(Route, _React$Component);
function Route() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = Route.prototype;
_proto.render = function render() {
var _this = this;
return react.createElement(context.Consumer, null, function (context$1) {
!context$1 ? invariant(false) : void 0;
var location = _this.props.location || context$1.location;
var match = _this.props.computedMatch ? _this.props.computedMatch // <Switch> already computed the match for us
: _this.props.path ? matchPath(location.pathname, _this.props) : context$1.match;
var props = _extends({}, context$1, {
location: location,
match: match
});
var _this$props = _this.props,
children = _this$props.children,
component = _this$props.component,
render = _this$props.render; // Preact uses an empty array as children by
// default, so use null if that's the case.
if (Array.isArray(children) && children.length === 0) {
children = null;
}
return react.createElement(context.Provider, {
value: props
}, props.match ? children ? typeof children === "function" ? children(props) : children : component ? react.createElement(component, props) : render ? render(props) : null : typeof children === "function" ? children(props) : null);
});
};
return Route;
}(react.Component);
function addLeadingSlash(path) {
return path.charAt(0) === "/" ? path : "/" + path;
}
function addBasename(basename, location) {
if (!basename) return location;
return _extends({}, location, {
pathname: addLeadingSlash(basename) + location.pathname
});
}
function stripBasename(basename, location) {
if (!basename) return location;
var base = addLeadingSlash(basename);
if (location.pathname.indexOf(base) !== 0) return location;
return _extends({}, location, {
pathname: location.pathname.substr(base.length)
});
}
function createURL(location) {
return typeof location === "string" ? location : createPath(location);
}
function staticHandler(methodName) {
return function () {
invariant(false) ;
};
}
function noop() {}
/**
* The public top-level API for a "static" <Router>, so-called because it
* can't actually change the current location. Instead, it just records
* location changes in a context object. Useful mainly in testing and
* server-rendering scenarios.
*/
/*#__PURE__*/
(function (_React$Component) {
_inheritsLoose(StaticRouter, _React$Component);
function StaticRouter() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.handlePush = function (location) {
return _this.navigateTo(location, "PUSH");
};
_this.handleReplace = function (location) {
return _this.navigateTo(location, "REPLACE");
};
_this.handleListen = function () {
return noop;
};
_this.handleBlock = function () {
return noop;
};
return _this;
}
var _proto = StaticRouter.prototype;
_proto.navigateTo = function navigateTo(location, action) {
var _this$props = this.props,
_this$props$basename = _this$props.basename,
basename = _this$props$basename === void 0 ? "" : _this$props$basename,
_this$props$context = _this$props.context,
context = _this$props$context === void 0 ? {} : _this$props$context;
context.action = action;
context.location = addBasename(basename, createLocation(location));
context.url = createURL(context.location);
};
_proto.render = function render() {
var _this$props2 = this.props,
_this$props2$basename = _this$props2.basename,
basename = _this$props2$basename === void 0 ? "" : _this$props2$basename,
_this$props2$context = _this$props2.context,
context = _this$props2$context === void 0 ? {} : _this$props2$context,
_this$props2$location = _this$props2.location,
location = _this$props2$location === void 0 ? "/" : _this$props2$location,
rest = _objectWithoutPropertiesLoose(_this$props2, ["basename", "context", "location"]);
var history = {
createHref: function createHref(path) {
return addLeadingSlash(basename + createURL(path));
},
action: "POP",
location: stripBasename(basename, createLocation(location)),
push: this.handlePush,
replace: this.handleReplace,
go: staticHandler(),
goBack: staticHandler(),
goForward: staticHandler(),
listen: this.handleListen,
block: this.handleBlock
};
return react.createElement(Router, _extends({}, rest, {
history: history,
staticContext: context
}));
};
return StaticRouter;
})(react.Component);
/**
* The public API for rendering the first <Route> that matches.
*/
var Switch =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(Switch, _React$Component);
function Switch() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = Switch.prototype;
_proto.render = function render() {
var _this = this;
return react.createElement(context.Consumer, null, function (context) {
!context ? invariant(false) : void 0;
var location = _this.props.location || context.location;
var element, match; // We use React.Children.forEach instead of React.Children.toArray().find()
// here because toArray adds keys to all child elements and we do not want
// to trigger an unmount/remount for two <Route>s that render the same
// component at different URLs.
react.Children.forEach(_this.props.children, function (child) {
if (match == null && react.isValidElement(child)) {
element = child;
var path = child.props.path || child.props.from;
match = path ? matchPath(location.pathname, _extends({}, child.props, {
path: path
})) : context.match;
}
});
return match ? react.cloneElement(element, {
location: location,
computedMatch: match
}) : null;
});
};
return Switch;
}(react.Component);
var useContext = react.useContext;
function useHistory() {
return useContext(historyContext);
}
function useLocation() {
return useContext(context).location;
}
function useParams() {
var match = useContext(context).match;
return match ? match.params : {};
}
/**
* The public API for a <Router> that uses HTML5 history.
*/
var BrowserRouter =
/*#__PURE__*/
function (_React$Component) {
_inheritsLoose(BrowserRouter, _React$Component);
function BrowserRouter() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.history = createBrowserHistory(_this.props);
return _this;
}
var _proto = BrowserRouter.prototype;
_proto.render = function render() {
return react.createElement(Router, {
history: this.history,
children: this.props.children
});
};
return BrowserRouter;
}(react.Component);
/**
* The public API for a <Router> that uses window.location.hash.
*/
/*#__PURE__*/
(function (_React$Component) {
_inheritsLoose(HashRouter, _React$Component);
function HashRouter() {
var _this;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
_this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
_this.history = createHashHistory(_this.props);
return _this;
}
var _proto = HashRouter.prototype;
_proto.render = function render() {
return react.createElement(Router, {
history: this.history,
children: this.props.children
});
};
return HashRouter;
})(react.Component);
var resolveToLocation = function resolveToLocation(to, currentLocation) {
return typeof to === "function" ? to(currentLocation) : to;
};
var normalizeToLocation = function normalizeToLocation(to, currentLocation) {
return typeof to === "string" ? createLocation(to, null, null, currentLocation) : to;
};
var forwardRefShim = function forwardRefShim(C) {
return C;
};
var forwardRef = react.forwardRef;
if (typeof forwardRef === "undefined") {
forwardRef = forwardRefShim;
}
function isModifiedEvent(event) {
return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
}
var LinkAnchor = forwardRef(function (_ref, forwardedRef) {
var innerRef = _ref.innerRef,
navigate = _ref.navigate,
_onClick = _ref.onClick,
rest = _objectWithoutPropertiesLoose(_ref, ["innerRef", "navigate", "onClick"]);
var target = rest.target;
var props = _extends({}, rest, {
onClick: function onClick(event) {
try {
if (_onClick) _onClick(event);
} catch (ex) {
event.preventDefault();
throw ex;
}
if (!event.defaultPrevented && // onClick prevented default
event.button === 0 && ( // ignore everything but left clicks
!target || target === "_self") && // let browser handle "target=_blank" etc.
!isModifiedEvent(event) // ignore clicks with modifier keys
) {
event.preventDefault();
navigate();
}
}
}); // React 15 compat
if (forwardRefShim !== forwardRef) {
props.ref = forwardedRef || innerRef;
} else {
props.ref = innerRef;
}
/* eslint-disable-next-line jsx-a11y/anchor-has-content */
return react.createElement("a", props);
});
/**
* The public API for rendering a history-aware <a>.
*/
var Link = forwardRef(function (_ref2, forwardedRef) {
var _ref2$component = _ref2.component,
component = _ref2$component === void 0 ? LinkAnchor : _ref2$component,
replace = _ref2.replace,
to = _ref2.to,
innerRef = _ref2.innerRef,
rest = _objectWithoutPropertiesLoose(_ref2, ["component", "replace", "to", "innerRef"]);
return react.createElement(context.Consumer, null, function (context) {
!context ? invariant(false) : void 0;
var history = context.history;
var location = normalizeToLocation(resolveToLocation(to, context.location), context.location);
var href = location ? history.createHref(location) : "";
var props = _extends({}, rest, {
href: href,
navigate: function navigate() {
var location = resolveToLocation(to, context.location);
var method = replace ? history.replace : history.push;
method(location);
}
}); // React 15 compat
if (forwardRefShim !== forwardRef) {
props.ref = forwardedRef || innerRef;
} else {
props.innerRef = innerRef;
}
return react.createElement(component, props);
});
});
var forwardRefShim$1 = function forwardRefShim(C) {
return C;
};
var forwardRef$1 = react.forwardRef;
if (typeof forwardRef$1 === "undefined") {
forwardRef$1 = forwardRefShim$1;
}
function joinClassnames() {
for (var _len = arguments.length, classnames = new Array(_len), _key = 0; _key < _len; _key++) {
classnames[_key] = arguments[_key];
}
return classnames.filter(function (i) {
return i;
}).join(" ");
}
/**
* A <Link> wrapper that knows if it's "active" or not.
*/
forwardRef$1(function (_ref, forwardedRef) {
var _ref$ariaCurrent = _ref["aria-current"],
ariaCurrent = _ref$ariaCurrent === void 0 ? "page" : _ref$ariaCurrent,
_ref$activeClassName = _ref.activeClassName,
activeClassName = _ref$activeClassName === void 0 ? "active" : _ref$activeClassName,
activeStyle = _ref.activeStyle,
classNameProp = _ref.className,
exact = _ref.exact,
isActiveProp = _ref.isActive,
locationProp = _ref.location,
sensitive = _ref.sensitive,
strict = _ref.strict,
styleProp = _ref.style,
to = _ref.to,
innerRef = _ref.innerRef,
rest = _objectWithoutPropertiesLoose(_ref, ["aria-current", "activeClassName", "activeStyle", "className", "exact", "isActive", "location", "sensitive", "strict", "style", "to", "innerRef"]);
return react.createElement(context.Consumer, null, function (context) {
!context ? invariant(false) : void 0;
var currentLocation = locationProp || context.location;
var toLocation = normalizeToLocation(resolveToLocation(to, currentLocation), currentLocation);
var path = toLocation.pathname; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202
var escapedPath = path && path.replace(/([.+*?=^!:${}()[\]|/\\])/g, "\\$1");
var match = escapedPath ? matchPath(currentLocation.pathname, {
path: escapedPath,
exact: exact,
sensitive: sensitive,
strict: strict
}) : null;
var isActive = !!(isActiveProp ? isActiveProp(match, currentLocation) : match);
var className = isActive ? joinClassnames(classNameProp, activeClassName) : classNameProp;
var style = isActive ? _extends({}, styleProp, {}, activeStyle) : styleProp;
var props = _extends({
"aria-current": isActive && ariaCurrent || null,
className: className,
style: style,
to: toLocation
}, rest); // React 15 compat
if (forwardRefShim$1 !== forwardRef$1) {
props.ref = forwardedRef || innerRef;
} else {
props.innerRef = innerRef;
}
return react.createElement(Link, props);
});
});
export { BrowserRouter, Link, Route, Switch, useHistory, useLocation, useParams };
import { r as react } from './common/index-57a74e37.js';
export { r as default } from './common/index-57a74e37.js';
import './common/_commonjsHelpers-8c19dec8.js';
var useEffect = react.useEffect;
var useState = react.useState;
export { useEffect, useState };
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Web site created using create-snowpack-app" />
<title>Snowpack App</title>
</head>
<body>
<div id="root"></div>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script type="module" src="/dist/index.js"></script>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
import React, { ReactNode } from 'react';
import Link from 'next/link';
import Head from 'next/head';
type Props = {
children?: ReactNode;
title?: string;
};
const Layout = ({ children, title = 'This is the default title' }: Props) => (
<div>
<Head>
<title>{title}</title>
<meta charSet="utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
<header>
<nav>
<Link href="/">
<a>Home</a>
</Link>{' '}
|{' '}
<Link href="/about">
<a>About</a>
</Link>{' '}
|{' '}
<Link href="/users">
<a>Users List</a>
</Link>{' '}
| <a href="/api/users">Users API</a>
</nav>
</header>
{children}
<footer>
<hr />
<span>I'm here to stay (Footer)</span>
</footer>
</div>
);
export default Layout;
import * as React from 'react';
import ListItem from '@components/ListItem';
import { User } from '@interfaces';
type Props = {
items: User[];
};
const List = ({ items }: Props) => (
<ul>
{items.map((item) => (
<li key={item.id}>
<ListItem data={item} />
</li>
))}
</ul>
);
export default List;
import * as React from 'react';
import { User } from '@interfaces';
type ListDetailProps = {
item: User;
};
const ListDetail = ({ item: user }: ListDetailProps) => (
<div>
<h1>Detail for {user.name}</h1>
<p>ID: {user.id}</p>
</div>
);
export default ListDetail;
import React from 'react';
import Link from 'next/link';
import { User } from '@interfaces';
type Props = {
data: User;
};
const ListItem = ({ data }: Props) => (
<Link href="/users/[id]" as={`/users/${data.id}`}>
<a>
{data.id}: {data.name}
</a>
</Link>
);
export default ListItem;
/// <reference types="next" />
/// <reference types="next/types/global" />
{
"name": "with-typescript",
"version": "1.0.0",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start",
"type-check": "tsc",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --fix"
},
"dependencies": {
"@reduxjs/toolkit": "1.5.0",
"axios": "0.21.1",
"next": "latest",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-redux": "7.2.2"
},
"devDependencies": {
"@types/node": "^12.12.21",
"@types/react": "^16.9.16",
"@types/react-dom": "^16.9.4",
"@types/react-redux": "7.1.16",
"@typescript-eslint/eslint-plugin": "4.15.1",
"@typescript-eslint/parser": "4.15.1",
"eslint": "7.20.0",
"eslint-config-prettier": "8.0.0",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-react": "7.22.0",
"eslint-plugin-react-hooks": "4.2.0",
"prettier": "2.2.1",
"sass": "1.32.8",
"typescript": "4.0"
},
"license": "MIT"
}
import React from 'react';
import type { AppProps } from 'next/app';
import { Provider } from 'react-redux';
import store from '@store';
import '@styles/index.scss';
const MyApp = ({ Component, pageProps }: AppProps) => {
return (
<Provider store={store}>
<Component {...pageProps} />
</Provider>
);
};
export default MyApp;
import Link from 'next/link';
import Layout from '@components/Layout';
const AboutPage = () => (
<Layout title="About | Next.js + TypeScript Example">
<h1>About</h1>
<p>This is the about page</p>
<p>
<Link href="/">
<a>Go home</a>
</Link>
</p>
</Layout>
);
export default AboutPage;
import { NextApiRequest, NextApiResponse } from 'next';
import { sampleUserData } from '@utils/sample-data';
const handler = (_req: NextApiRequest, res: NextApiResponse) => {
try {
if (!Array.isArray(sampleUserData)) {
throw new Error('Cannot find user data');
}
res.status(200).json(sampleUserData);
} catch (err) {
res.status(500).json({ statusCode: 500, message: err.message });
}
};
export default handler;
import { NextApiRequest, NextApiResponse } from 'next';
const handler = (_req: NextApiRequest, res: NextApiResponse) => {
try {
res.status(200).json({
id: 1,
name: 'Richard Do'
});
} catch (err) {
res.status(500).json({ statusCode: 500, message: err.message });
}
};
export default handler;
import React, { useEffect } from 'react';
import Link from 'next/link';
import { useDispatch } from 'react-redux';
import { getUserProfile } from '@store/user';
import Layout from '@components/Layout';
const IndexPage = () => {
const dispatch = useDispatch();
useEffect(() => {
dispatch(getUserProfile());
}, []);
return (
<Layout title="Home | Next.js + TypeScript Example">
<h1>Hello Next.js 👋</h1>
<p>
<Link href="/about">
<a>About</a>
</Link>
</p>
</Layout>
);
};
export default IndexPage;
import { GetStaticProps, GetStaticPaths } from 'next';
import { User } from '@/shared/interfaces';
import { sampleUserData } from '@utils/sample-data';
import Layout from '@components/Layout';
import ListDetail from '@components/ListDetail';
type Props = {
item?: User;
errors?: string;
};
const StaticPropsDetail = ({ item, errors }: Props) => {
if (errors) {
return (
<Layout title="Error | Next.js + TypeScript Example">
<p>
<span style={{ color: 'red' }}>Error:</span> {errors}
</p>
</Layout>
);
}
return (
<Layout title={`${item ? item.name : 'User Detail'} | Next.js + TypeScript Example`}>
{item && <ListDetail item={item} />}
</Layout>
);
};
export default StaticPropsDetail;
export const getStaticPaths: GetStaticPaths = async () => {
// Get the paths we want to pre-render based on users
const paths = sampleUserData.map((user) => ({
params: { id: user.id.toString() }
}));
// We'll pre-render only these paths at build time.
// { fallback: false } means other routes should 404.
return { paths, fallback: false };
};
// This function gets called at build time on server-side.
// It won't be called on client-side, so you can even do
// direct database queries.
export const getStaticProps: GetStaticProps = async ({ params }) => {
try {
const id = params?.id;
const item = sampleUserData.find((data) => data.id === Number(id));
// By returning { props: item }, the StaticPropsDetail component
// will receive `item` as a prop at build time
return { props: { item } };
} catch (err) {
return { props: { errors: err.message } };
}
};
import { GetStaticProps } from 'next';
import Link from 'next/link';
import { User } from '@interfaces';
import { sampleUserData } from '@utils/sample-data';
import Layout from '@components/Layout';
import List from '@components/List';
type Props = {
items: User[];
};
const WithStaticProps = ({ items }: Props) => (
<Layout title="Users List | Next.js + TypeScript Example">
<h1>Users List</h1>
<p>
Example fetching data from inside <code>getStaticProps()</code>.
</p>
<p>You are currently on: /users</p>
<List items={items} />
<p>
<Link href="/">
<a>Go home</a>
</Link>
</p>
</Layout>
);
export const getStaticProps: GetStaticProps = async () => {
// Example for including static props in a Next.js function component page.
// Don't forget to include the respective types for any props passed into
// the component.
const items: User[] = sampleUserData;
return { props: { items } };
};
export default WithStaticProps;
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios';
const isDev = process.env.NODE_ENV === 'development';
const instance = axios.create({
timeout: 20000,
baseURL: process.env.NEXT_PUBLIC_BASE_URL_API
});
instance.interceptors.request.use(
(requestConfig: AxiosRequestConfig) => {
return requestConfig;
},
(error) => {
if (isDev) {
console.error('API Request Error:', error);
}
return Promise.reject(error);
}
);
instance.interceptors.response.use(
(response: AxiosResponse) => {
// Try to find the access token from response
if (response.data?.token?.accessToken) {
instance.defaults.headers = {
...instance.defaults.headers,
Authorization: `Bearer ${response.data?.token?.accessToken}`
};
}
return response;
},
(error) => {
if (isDev) {
console.error('API Response Error:', error);
}
const errorMessage = error?.response?.data?.message;
if (errorMessage) {
return Promise.reject(new Error(errorMessage));
}
return Promise.reject(error);
}
);
export default instance;
import { AxiosResponse } from 'axios';
import httpClient from './http-client';
import { User } from '@interfaces';
export function me(): Promise<AxiosResponse<User>> {
return httpClient.get(`users/me`);
}
export const PAGE_SIZE = 20;
export enum AuthStatus {
Active = 1,
Blocked = 2
}
// You can include shared interfaces/types in a separate file
// and then use them in any component by importing them. For
// example, to import the interface below do:
//
// import { User } from 'path/to/interfaces';
export type User = {
id: number;
name: string;
};
export type Nullable<T> = T | undefined | null;
import { User } from '@interfaces';
/** Dummy user data. */
export const sampleUserData: User[] = [
{ id: 101, name: 'Alice' },
{ id: 102, name: 'Bob' },
{ id: 103, name: 'Caroline' },
{ id: 104, name: 'Dave' }
];
import { configureStore } from '@reduxjs/toolkit';
import rootReducer from './reducers';
export type AppState = ReturnType<typeof rootReducer>;
export default configureStore({
reducer: rootReducer,
devTools: process.env.NODE_ENV !== 'production'
});
import { combineReducers } from '@reduxjs/toolkit';
import userReducer from './user';
const rootReducer = combineReducers({
user: userReducer
});
export default rootReducer;
import { createSlice, PayloadAction, Dispatch } from '@reduxjs/toolkit';
import { AppState } from '@store';
import { Nullable } from '@types';
import { User } from '@interfaces';
import * as userService from '@services/user';
interface State {
currentUser: Nullable<User>;
}
const initialState: State = {
currentUser: null
};
const userSlice = createSlice({
name: 'user',
initialState,
reducers: {
setCurrentUser(state, action: PayloadAction<Nullable<User>>) {
state.currentUser = action.payload;
}
}
});
export const selectCurrentUser = (state: AppState) => state;
export const userActions = userSlice.actions;
export const getUserProfile = () => (dispatch: Dispatch) => {
userService
.me()
.then((res) => dispatch(userActions.setCurrentUser(res.data)))
.catch(console.error);
};
export default userSlice.reducer;
html, body {
height: 100%;
}
\ No newline at end of file
{
"compilerOptions": {
"allowJs": true,
"alwaysStrict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "preserve",
"lib": ["dom", "es2017"],
"module": "esnext",
"moduleResolution": "node",
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
"target": "esnext",
"baseUrl": ".",
"paths": {
"@*": ["./*"],
"@components/*": ["./components/*"],
"@interfaces": ["./shared/interfaces/"],
"@interfaces/*": ["./shared/interfaces/*"],
"@enums": ["./shared/enums/"],
"@enums/*": ["./shared/enums/*"],
"@constants": ["./shared/constants/"],
"@constants/*": ["./shared/constants/*"],
"@utils": ["./shared/utils/"],
"@utils/*": ["./shared/utils/*"],
"@types": ["./shared/types/"],
"@types/*": ["./shared/types/*"],
}
},
"exclude": ["node_modules"],
"include": ["**/*.ts", "**/*.tsx"]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment