@vista.io/react-vista-js
Version:
NodeJS implementation of the Vista API.
84 lines (83 loc) • 93.2 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@vista.io/vista-api-client"),n=require("@mui/styles"),r=require("@mui/material/Button"),o=require("@mui/material/FormControl"),a=require("@mui/material/InputLabel"),s=require("@mui/material/Checkbox"),i=require("@mui/material/Box"),l=require("@mui/material/List"),c=require("@mui/material/ListItem"),d=require("@mui/material/ListItemText"),u=require("@mui/material/MenuItem"),p=require("@mui/material/Select"),g=require("@mui/material/Chip"),h=require("@mui/material/Autocomplete"),f=require("@mui/material/TextField"),m=require("@mui/material/ListItemButton"),b=require("react-is");function w(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function y(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var v=w(e),x=y(e),C=w(t),S=w(r),R=w(o),E=w(a),k=w(s),O=w(i),P=w(l),A=w(c),I=w(d),_=w(u),D=w(p),T=w(g),N=w(h),j=w(f),$=w(m),L=w(b);const H=v.default.createContext({secret:"",defaultClient:new C.default("","","")});class F extends v.default.Component{render(){const{secret:e,branch:t,hostname:n}=this.props,r=new C.default(e,t,n);return v.default.createElement(H.Provider,{value:{secret:this.props.secret,defaultClient:r}},this.props.children)}}class M extends v.default.Component{constructor(){super(...arguments),this.state={hasChecked:!1,granted:!1},this.componentDidMount=async()=>{if(!this.state.hasChecked){const e=this.context.defaultClient,t=(await e.users.check(this.props.userId,this.props.action,this.props.resourceId,this.props.resourceType,this.props.branch).catch((e=>{this.props.handleError?this.props.handleError(e):console.log(e)}))).length>0;t&&this.setState({hasChecked:!0,granted:t})}}}renderedComponent(){return this.state.hasChecked&&this.state.granted?this.props.children:this.props.denyComponent?this.props.denyComponent:null}render(){return v.default.createElement(v.default.Fragment,null,this.renderedComponent())}}M.contextType=H;function z(e){const{label:t,userRoles:n,grantSelectLabel:r,grantSelectLabelStyles:o,allRoles:a,selectClassName:s,chipsClassName:i,selectStyles:l,chipsStyles:c,grantRole:d,revokeRole:u}=e;return v.default.createElement(R.default,{sx:{minWidth:"200px"}},v.default.createElement(E.default,{className:r,style:o,shrink:n.length>0},t||""),v.default.createElement(D.default,{multiple:!0,value:[...n],renderValue:e=>v.default.createElement(O.default,{sx:{display:"flex",flexWrap:"wrap",gap:.5}},e.sort().map((e=>v.default.createElement(T.default,{key:e,label:e,className:i,style:c||{}})))),onChange:e=>{const t=e.target.value;if(t.length<n.length){const e=new Set(t),r=n.find((t=>!e.has(t)));r&&u(r)}else{const e=new Set(n),r=t.find((t=>!e.has(t)));r&&d(r)}},label:t||"",className:s,style:l||{}},a.map((e=>e.id)).sort().map((e=>v.default.createElement(_.default,{key:e,value:e},v.default.createElement(k.default,{checked:n.includes(e)}),v.default.createElement(I.default,{primary:e}))))))}class B extends v.default.Component{constructor(e,t){super(e),this.onGrantChange=async(e,t,n)=>{const{resourceId:r,resourceType:o,orgId:a,branch:s}=this.props,i=await n(e,t,r,o,a,s);return i&&await this.refresh(),i},this.state={client:t.defaultClient,userIdInput:"",selectedUserId:"",selectedRoleIds:[],roles:[],usersetIdToGrants:{},userIds:[],orgId:e.orgId,branch:e.branch}}async componentDidMount(){const{orgId:e,branch:t}=this.props;e&&e.length&&t&&t.length&&await this.refresh()}async componentDidUpdate(){const{orgId:e,branch:t}=this.props;this.state.orgId===e&&this.state.branch===t||""!==e&&""!==t&&(await this.refresh(),this.setState({orgId:e,branch:t}))}async refresh(){const{resourceId:e,resourceType:t,orgId:n,branch:r}=this.props,o=this.state.client.withBranch(r),a=(await o.users.list(n)).map((e=>e.id)),s=await o.roles.list(n),i=await o.grants.listUnflattened(null,null,null,e,t,null,n),l={};i.forEach((e=>{l[e.userset_id]||(l[e.userset_id]=[]),"ROLE"===e.relation_type&&l[e.userset_id].push(e)})),this.setState({userIds:a,roles:s,usersetIdToGrants:l})}render(){const{classes:e,styles:t,userIdMap:n,title:r,onGrant:o,onRevoke:a}=this.props,{selectedUserId:s,selectedRoleIds:i,roles:l,usersetIdToGrants:c,userIds:d,userIdInput:u}=this.state;return v.default.createElement("div",{className:e.container,style:t.container},v.default.createElement("h1",{className:e.title,style:t.title},r),v.default.createElement("div",{className:e.newGrantRow,style:t.newGrantRow},v.default.createElement("div",{className:e.userSelectContainer,style:t.userSelectContainer},v.default.createElement(N.default,{value:s.length?s:null,onChange:(e,t)=>{this.setState({selectedUserId:t||"",selectedRoleIds:[]})},inputValue:u,onInputChange:(e,t)=>{this.setState({userIdInput:t})},className:e.userSelect,style:t.userSelect,sx:{width:"100%"},options:n?["*",...Object.keys(n)]:["*",...d],renderInput:n=>v.default.createElement(j.default,Object.assign({},n,{InputLabelProps:{className:e.grantSelectLabel,style:t.grantSelectLabel},label:"Select User"}))})),v.default.createElement("div",{className:e.roleSelect,style:t.roleSelect},v.default.createElement(z,{label:"Select Role",userRoles:i,grantRole:e=>{i.push(e),this.setState({selectedRoleIds:i})},revokeRole:e=>{this.setState({selectedRoleIds:i.filter((t=>t!==e))})},selectClassName:e.grantRoleSelect,chipsClassName:e.grantRoleSelectChip,selectStyles:t.grantRoleSelect,chipsStyles:t.grantRoleSelectChip,grantSelectLabel:e.grantSelectLabel,grantSelectLabelStyles:t.grantSelectLabel,allRoles:s.length&&c[s]?l.filter((e=>!c[s].map((e=>e.relation)).includes(e.id))):l})),v.default.createElement(S.default,{className:e.grantButton,style:t.grantButton,variant:"contained",disabled:!(s.length&&i.length),onClick:async()=>{for(const e of i)await this.onGrantChange(s,e,o);this.setState({selectedUserId:"",selectedRoleIds:[]})}},"Grant")),v.default.createElement("div",{className:e.grantList,style:t.grantList},v.default.createElement(P.default,null,Object.keys(c).sort().map((n=>{const r=c[n],s=r.map((e=>e.relation));return v.default.createElement(A.default,{key:n,className:e.grantRow,style:t.grantRow,secondaryAction:v.default.createElement(z,{userRoles:s,grantRole:e=>{r.push({userId:n,relation:e,userset_id:n,relation_type:"ROLE"}),c[n]=r,this.onGrantChange(n,e,o),this.setState({usersetIdToGrants:c})},revokeRole:e=>{const t=r.filter((t=>t.relation!==e));c[n]=t,this.onGrantChange(n,e,a),this.setState({usersetIdToGrants:c})},selectClassName:e.grantRoleSelect,chipsClassName:e.grantRoleSelectChip,selectStyles:t.grantRoleSelect,chipsStyles:t.grantRoleSelectChip,grantSelectLabel:e.grantSelectLabel,grantSelectLabelStyles:t.grantSelectLabel,allRoles:l})},v.default.createElement(I.default,{primary:n}))})))))}}B.contextType=H,B.defaultProps={styles:{},title:"Add Teammates"};const W=n.withStyles({container:{height:"500px",width:"600px",display:"flex",flexDirection:"column",border:"solid",borderColor:"lightgray",borderWidth:"1px",padding:"50px",marginBottom:"50px"},title:{marginTop:"0px"},newGrantRow:{display:"flex",marginBottom:"20px"},userSelectContainer:{flexGrow:"1",height:"64px !important",marginRight:"10px"},userSelect:{height:"64px !important","& \t.MuiAutocomplete-inputRoot":{height:"64px"}},grantSelectLabel:{top:"4px"},roleSelect:{marginRight:"10px"},grantButton:{},grantRow:{height:"75px"},grantList:{flexGrow:"1",width:"100%",padding:"0",border:"solid",borderColor:"lightgray",borderWidth:"1px",overflow:"scroll",margin:"0"},grantRoleSelect:{height:"64px"},grantRoleSelectChip:{backgroundColor:"black !important",color:"white !important"}})(B);function G(e){function t(e,r,l,c,p){for(var g,h,f,m,v,C=0,S=0,R=0,E=0,k=0,D=0,N=f=g=0,$=0,L=0,H=0,F=0,M=l.length,z=M-1,B="",W="",G="",V="";$<M;){if(h=l.charCodeAt($),$===z&&0!==S+E+R+C&&(0!==S&&(h=47===S?10:47),E=R=C=0,M++,z++),0===S+E+R+C){if($===z&&(0<L&&(B=B.replace(u,"")),0<B.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:B+=l.charAt($)}h=59}switch(h){case 123:for(g=(B=B.trim()).charCodeAt(0),f=1,F=++$;$<M;){switch(h=l.charCodeAt($)){case 123:f++;break;case 125:f--;break;case 47:switch(h=l.charCodeAt($+1)){case 42:case 47:e:{for(N=$+1;N<z;++N)switch(l.charCodeAt(N)){case 47:if(42===h&&42===l.charCodeAt(N-1)&&$+2!==N){$=N+1;break e}break;case 10:if(47===h){$=N+1;break e}}$=N}}break;case 91:h++;case 40:h++;case 34:case 39:for(;$++<z&&l.charCodeAt($)!==h;);}if(0===f)break;$++}if(f=l.substring(F,$),0===g&&(g=(B=B.replace(d,"").trim()).charCodeAt(0)),64===g){switch(0<L&&(B=B.replace(u,"")),h=B.charCodeAt(1)){case 100:case 109:case 115:case 45:L=r;break;default:L=_}if(F=(f=t(r,L,f,h,p+1)).length,0<T&&(v=i(3,f,L=n(_,B,H),r,P,O,F,h,p,c),B=L.join(""),void 0!==v&&0===(F=(f=v.trim()).length)&&(h=0,f="")),0<F)switch(h){case 115:B=B.replace(x,s);case 100:case 109:case 45:f=B+"{"+f+"}";break;case 107:f=(B=B.replace(b,"$1 $2"))+"{"+f+"}",f=1===I||2===I&&a("@"+f,3)?"@-webkit-"+f+"@"+f:"@"+f;break;default:f=B+f,112===c&&(W+=f,f="")}else f=""}else f=t(r,n(r,B,H),f,c,p+1);G+=f,f=H=L=N=g=0,B="",h=l.charCodeAt(++$);break;case 125:case 59:if(1<(F=(B=(0<L?B.replace(u,""):B).trim()).length))switch(0===N&&(g=B.charCodeAt(0),45===g||96<g&&123>g)&&(F=(B=B.replace(" ",":")).length),0<T&&void 0!==(v=i(1,B,r,e,P,O,W.length,c,p,c))&&0===(F=(B=v.trim()).length)&&(B="\0\0"),g=B.charCodeAt(0),h=B.charCodeAt(1),g){case 0:break;case 64:if(105===h||99===h){V+=B+l.charAt($);break}default:58!==B.charCodeAt(F-1)&&(W+=o(B,g,h,B.charCodeAt(2)))}H=L=N=g=0,B="",h=l.charCodeAt(++$)}}switch(h){case 13:case 10:47===S?S=0:0===1+g&&107!==c&&0<B.length&&(L=1,B+="\0"),0<T*j&&i(0,B,r,e,P,O,W.length,c,p,c),O=1,P++;break;case 59:case 125:if(0===S+E+R+C){O++;break}default:switch(O++,m=l.charAt($),h){case 9:case 32:if(0===E+C+S)switch(k){case 44:case 58:case 9:case 32:m="";break;default:32!==h&&(m=" ")}break;case 0:m="\\0";break;case 12:m="\\f";break;case 11:m="\\v";break;case 38:0===E+S+C&&(L=H=1,m="\f"+m);break;case 108:if(0===E+S+C+A&&0<N)switch($-N){case 2:112===k&&58===l.charCodeAt($-3)&&(A=k);case 8:111===D&&(A=D)}break;case 58:0===E+S+C&&(N=$);break;case 44:0===S+R+E+C&&(L=1,m+="\r");break;case 34:case 39:0===S&&(E=E===h?0:0===E?h:E);break;case 91:0===E+S+R&&C++;break;case 93:0===E+S+R&&C--;break;case 41:0===E+S+C&&R--;break;case 40:if(0===E+S+C){if(0===g)if(2*k+3*D==533);else g=1;R++}break;case 64:0===S+R+E+C+N+f&&(f=1);break;case 42:case 47:if(!(0<E+C+R))switch(S){case 0:switch(2*h+3*l.charCodeAt($+1)){case 235:S=47;break;case 220:F=$,S=42}break;case 42:47===h&&42===k&&F+2!==$&&(33===l.charCodeAt(F+2)&&(W+=l.substring(F,$+1)),m="",S=0)}}0===S&&(B+=m)}D=k,k=h,$++}if(0<(F=W.length)){if(L=r,0<T&&(void 0!==(v=i(2,W,L,e,P,O,F,c,p,c))&&0===(W=v).length))return V+W+G;if(W=L.join(",")+"{"+W+"}",0!=I*A){switch(2!==I||a(W,2)||(A=0),A){case 111:W=W.replace(y,":-moz-$1")+W;break;case 112:W=W.replace(w,"::-webkit-input-$1")+W.replace(w,"::-moz-$1")+W.replace(w,":-ms-input-$1")+W}A=0}}return V+W+G}function n(e,t,n){var o=t.trim().split(f);t=o;var a=o.length,s=e.length;switch(s){case 0:case 1:var i=0;for(e=0===s?"":e[0]+" ";i<a;++i)t[i]=r(e,t[i],n).trim();break;default:var l=i=0;for(t=[];i<a;++i)for(var c=0;c<s;++c)t[l++]=r(e[c]+" ",o[i],n).trim()}return t}function r(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function o(e,t,n,r){var s=e+";",i=2*t+3*n+4*r;if(944===i){e=s.indexOf(":",9)+1;var l=s.substring(e,s.length-1).trim();return l=s.substring(0,e).trim()+l+";",1===I||2===I&&a(l,1)?"-webkit-"+l+l:l}if(0===I||2===I&&!a(s,1))return s;switch(i){case 1015:return 97===s.charCodeAt(10)?"-webkit-"+s+s:s;case 951:return 116===s.charCodeAt(3)?"-webkit-"+s+s:s;case 963:return 110===s.charCodeAt(5)?"-webkit-"+s+s:s;case 1009:if(100!==s.charCodeAt(4))break;case 969:case 942:return"-webkit-"+s+s;case 978:return"-webkit-"+s+"-moz-"+s+s;case 1019:case 983:return"-webkit-"+s+"-moz-"+s+"-ms-"+s+s;case 883:if(45===s.charCodeAt(8))return"-webkit-"+s+s;if(0<s.indexOf("image-set(",11))return s.replace(k,"$1-webkit-$2")+s;break;case 932:if(45===s.charCodeAt(4))switch(s.charCodeAt(5)){case 103:return"-webkit-box-"+s.replace("-grow","")+"-webkit-"+s+"-ms-"+s.replace("grow","positive")+s;case 115:return"-webkit-"+s+"-ms-"+s.replace("shrink","negative")+s;case 98:return"-webkit-"+s+"-ms-"+s.replace("basis","preferred-size")+s}return"-webkit-"+s+"-ms-"+s+s;case 964:return"-webkit-"+s+"-ms-flex-"+s+s;case 1023:if(99!==s.charCodeAt(8))break;return"-webkit-box-pack"+(l=s.substring(s.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+s+"-ms-flex-pack"+l+s;case 1005:return g.test(s)?s.replace(p,":-webkit-")+s.replace(p,":-moz-")+s:s;case 1e3:switch(t=(l=s.substring(13).trim()).indexOf("-")+1,l.charCodeAt(0)+l.charCodeAt(t)){case 226:l=s.replace(v,"tb");break;case 232:l=s.replace(v,"tb-rl");break;case 220:l=s.replace(v,"lr");break;default:return s}return"-webkit-"+s+"-ms-"+l+s;case 1017:if(-1===s.indexOf("sticky",9))break;case 975:switch(t=(s=e).length-10,i=(l=(33===s.charCodeAt(t)?s.substring(0,t):s).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|l.charCodeAt(7))){case 203:if(111>l.charCodeAt(8))break;case 115:s=s.replace(l,"-webkit-"+l)+";"+s;break;case 207:case 102:s=s.replace(l,"-webkit-"+(102<i?"inline-":"")+"box")+";"+s.replace(l,"-webkit-"+l)+";"+s.replace(l,"-ms-"+l+"box")+";"+s}return s+";";case 938:if(45===s.charCodeAt(5))switch(s.charCodeAt(6)){case 105:return l=s.replace("-items",""),"-webkit-"+s+"-webkit-box-"+l+"-ms-flex-"+l+s;case 115:return"-webkit-"+s+"-ms-flex-item-"+s.replace(S,"")+s;default:return"-webkit-"+s+"-ms-flex-line-pack"+s.replace("align-content","").replace(S,"")+s}break;case 973:case 989:if(45!==s.charCodeAt(3)||122===s.charCodeAt(4))break;case 931:case 953:if(!0===E.test(e))return 115===(l=e.substring(e.indexOf(":")+1)).charCodeAt(0)?o(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):s.replace(l,"-webkit-"+l)+s.replace(l,"-moz-"+l.replace("fill-",""))+s;break;case 962:if(s="-webkit-"+s+(102===s.charCodeAt(5)?"-ms-"+s:"")+s,211===n+r&&105===s.charCodeAt(13)&&0<s.indexOf("transform",10))return s.substring(0,s.indexOf(";",27)+1).replace(h,"$1-webkit-$2")+s}return s}function a(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),N(2!==t?r:r.replace(R,"$1"),n,t)}function s(e,t){var n=o(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(C," or ($1)").substring(4):"("+t+")"}function i(e,t,n,r,o,a,s,i,l,d){for(var u,p=0,g=t;p<T;++p)switch(u=D[p].call(c,e,g,n,r,o,a,s,i,l,d)){case void 0:case!1:case!0:case null:break;default:g=u}if(g!==t)return g}function l(e){return void 0!==(e=e.prefix)&&(N=null,e?"function"!=typeof e?I=1:(I=2,N=e):I=0),l}function c(e,n){var r=e;if(33>r.charCodeAt(0)&&(r=r.trim()),r=[r],0<T){var o=i(-1,n,r,r,P,O,0,0,0,0);void 0!==o&&"string"==typeof o&&(n=o)}var a=t(_,r,n,0,0);return 0<T&&(void 0!==(o=i(-2,a,r,r,P,O,a.length,0,0,0))&&(a=o)),"",A=0,O=P=1,a}var d=/^\0+/g,u=/[\0\r\f]/g,p=/: */g,g=/zoo|gra/,h=/([,: ])(transform)/g,f=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,b=/@(k\w+)\s*(\S*)\s*/,w=/::(place)/g,y=/:(read-only)/g,v=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,S=/-self|flex-/g,R=/[^]*?(:[rp][el]a[\w-]+)[^]*/,E=/stretch|:\s*\w+\-(?:conte|avail)/,k=/([^-])(image-set\()/,O=1,P=1,A=0,I=1,_=[],D=[],T=0,N=null,j=0;return c.use=function e(t){switch(t){case void 0:case null:T=D.length=0;break;default:if("function"==typeof t)D[T++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else j=0|!!t}return e},c.set=l,void 0!==e&&l(e),c}var V={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,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function q(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var U=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Y=q((function(e){return U.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),X=L.default,K={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Z={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},J={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Q={};function ee(e){return X.isMemo(e)?J:Q[e.$$typeof]||K}Q[X.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Q[X.Memo]=J;var te=Object.defineProperty,ne=Object.getOwnPropertyNames,re=Object.getOwnPropertySymbols,oe=Object.getOwnPropertyDescriptor,ae=Object.getPrototypeOf,se=Object.prototype;var ie=function e(t,n,r){if("string"!=typeof n){if(se){var o=ae(n);o&&o!==se&&e(t,o,r)}var a=ne(n);re&&(a=a.concat(re(n)));for(var s=ee(t),i=ee(n),l=0;l<a.length;++l){var c=a[l];if(!(Z[c]||r&&r[c]||i&&i[c]||s&&s[c])){var d=oe(n,c);try{te(t,c,d)}catch(e){}}}}return t};function le(){return(le=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var ce=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},de=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!b.typeOf(e)},ue=Object.freeze([]),pe=Object.freeze({});function ge(e){return"function"==typeof e}function he(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function fe(e){return e&&"string"==typeof e.styledComponentId}var me="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",be="undefined"!=typeof window&&"HTMLElement"in window,we=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY?"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY:"production"!==process.env.NODE_ENV),ye="production"!==process.env.NODE_ENV?{1:"Cannot create styled-component for component: %s.\n\n",2:"Can't collect styles once you've consumed a `ServerStyleSheet`'s styles! `ServerStyleSheet` is a one off instance for each server-side render cycle.\n\n- Are you trying to reuse it across renders?\n- Are you accidentally calling collectStyles twice?\n\n",3:"Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.\n\n",4:"The `StyleSheetManager` expects a valid target or sheet prop!\n\n- Does this error occur on the client and is your target falsy?\n- Does this error occur on the server and is the sheet falsy?\n\n",5:"The clone method cannot be used on the client!\n\n- Are you running in a client-like environment on the server?\n- Are you trying to run SSR on the client?\n\n",6:"Trying to insert a new style tag, but the given Node is unmounted!\n\n- Are you using a custom target that isn't mounted?\n- Does your document not have a valid head element?\n- Have you accidentally removed a style tag manually?\n\n",7:'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document `<head>`\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"}:{};function ve(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],n=1,r=arguments.length;n<r;n+=1)t.push(n<0||arguments.length<=n?void 0:arguments[n]);return t.forEach((function(t){e=e.replace(/%[a-z]/,t)})),e}function xe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw"production"===process.env.NODE_ENV?new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):"")):new Error(ve.apply(void 0,[ye[e]].concat(n)).trim())}var Ce=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&xe(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var a=r;a<o;a++)this.groupSizes[a]=0}for(var s=this.indexOfGroup(e+1),i=0,l=t.length;i<l;i++)this.tag.insertRule(s,t[i])&&(this.groupSizes[e]++,s++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,a=r;a<o;a++)t+=this.tag.getRule(a)+"/*!sc*/\n";return t},e}(),Se=new Map,Re=new Map,Ee=1,ke=function(e){if(Se.has(e))return Se.get(e);for(;Re.has(Ee);)Ee++;var t=Ee++;return"production"!==process.env.NODE_ENV&&((0|t)<0||t>1<<30)&&xe(16,""+t),Se.set(e,t),Re.set(t,e),t},Oe=function(e){return Re.get(e)},Pe=function(e,t){t>=Ee&&(Ee=t+1),Se.set(e,t),Re.set(t,e)},Ae="style["+me+'][data-styled-version="5.3.5"]',Ie=new RegExp("^"+me+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),_e=function(e,t,n){for(var r,o=n.split(","),a=0,s=o.length;a<s;a++)(r=o[a])&&e.registerName(t,r)},De=function(e,t){for(var n=(t.textContent||"").split("/*!sc*/\n"),r=[],o=0,a=n.length;o<a;o++){var s=n[o].trim();if(s){var i=s.match(Ie);if(i){var l=0|parseInt(i[1],10),c=i[2];0!==l&&(Pe(c,l),_e(e,c,i[3]),e.getTag().insertRules(l,r)),r.length=0}else r.push(s)}}},Te=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(me))return r}}(n),a=void 0!==o?o.nextSibling:null;r.setAttribute(me,"active"),r.setAttribute("data-styled-version","5.3.5");var s="undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null;return s&&r.setAttribute("nonce",s),n.insertBefore(r,a),r},Ne=function(){function e(e){var t=this.element=Te(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}xe(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),je=function(){function e(e){var t=this.element=Te(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),$e=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),Le=be,He={isServer:!be,useCSSOMInjection:!we},Fe=function(){function e(e,t,n){void 0===e&&(e=pe),void 0===t&&(t={}),this.options=le({},He,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&be&&Le&&(Le=!1,function(e){for(var t=document.querySelectorAll(Ae),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(me)&&(De(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return ke(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(le({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new $e(o):r?new Ne(o):new je(o),new Ce(e)));var e,t,n,r,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(ke(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(ke(e),n)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(ke(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var a=Oe(o);if(void 0!==a){var s=e.names.get(a),i=t.getGroup(o);if(s&&i&&s.size){var l=me+".g"+o+'[id="'+a+'"]',c="";void 0!==s&&s.forEach((function(e){e.length>0&&(c+=e+",")})),r+=""+i+l+'{content:"'+c+'"}/*!sc*/\n'}}}return r}(this)},e}(),Me=/(a)(d)/gi,ze=function(e){return String.fromCharCode(e+(e>25?39:97))};function Be(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=ze(t%52)+n;return(ze(t%52)+n).replace(Me,"$1-$2")}var We=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Ge=function(e){return We(5381,e)};var Ve=Ge("5.3.5"),qe=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&function(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(ge(n)&&!fe(n))return!1}return!0}(e),this.componentId=t,this.baseHash=We(Ve,t),this.baseStyle=n,Fe.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else{var a=st(this.rules,e,t,n).join(""),s=Be(We(this.baseHash,a)>>>0);if(!t.hasNameForId(r,s)){var i=n(a,"."+s,void 0,r);t.insertRules(r,s,i)}o.push(s),this.staticRulesId=s}else{for(var l=this.rules.length,c=We(this.baseHash,n.hash),d="",u=0;u<l;u++){var p=this.rules[u];if("string"==typeof p)d+=p,"production"!==process.env.NODE_ENV&&(c=We(c,p+u));else if(p){var g=st(p,e,t,n),h=Array.isArray(g)?g.join(""):g;c=We(c,h+u),d+=h}}if(d){var f=Be(c>>>0);if(!t.hasNameForId(r,f)){var m=n(d,"."+f,void 0,r);t.insertRules(r,f,m)}o.push(f)}}return o.join(" ")},e}(),Ue=/^\s*\/\/.*$/gm,Ye=[":","[",".","#"];var Xe=v.default.createContext();Xe.Consumer;var Ke=v.default.createContext(),Ze=(Ke.Consumer,new Fe),Je=function(e){var t,n,r,o,a=void 0===e?pe:e,s=a.options,i=void 0===s?pe:s,l=a.plugins,c=void 0===l?ue:l,d=new G(i),u=[],p=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,a,s,i,l,c,d,u){switch(n){case 1:if(0===d&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===c)return r+"/*|*/";break;case 3:switch(c){case 102:case 112:return e(o[0]+r),"";default:return r+(0===u?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){u.push(e)})),g=function(e,r,a){return 0===r&&-1!==Ye.indexOf(a[n.length])||a.match(o)?e:"."+t};function h(e,a,s,i){void 0===i&&(i="&");var l=e.replace(Ue,""),c=a&&s?s+" "+a+" { "+l+" }":l;return t=i,n=a,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),d(s||!a?"":a,c)}return d.use([].concat(c,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,g))},p,function(e){if(-2===e){var t=u;return u=[],t}}])),h.hash=c.length?c.reduce((function(e,t){return t.name||xe(15),We(e,t.name)}),5381).toString():"",h}();var Qe=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Je);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return xe(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Je),this.name+e.hash},e}(),et=/([A-Z])/,tt=/([A-Z])/g,nt=/^ms-/,rt=function(e){return"-"+e.toLowerCase()};function ot(e){return et.test(e)?e.replace(tt,rt).replace(nt,"-ms-"):e}var at=function(e){return null==e||!1===e||""===e};function st(e,t,n,r){if(Array.isArray(e)){for(var o,a=[],s=0,i=e.length;s<i;s+=1)""!==(o=st(e[s],t,n,r))&&(Array.isArray(o)?a.push.apply(a,o):a.push(o));return a}if(at(e))return"";if(fe(e))return"."+e.styledComponentId;if(ge(e)){if("function"!=typeof(c=e)||c.prototype&&c.prototype.isReactComponent||!t)return e;var l=e(t);return"production"!==process.env.NODE_ENV&&b.isElement(l)&&console.warn(he(e)+" is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details."),st(l,t,n,r)}var c;return e instanceof Qe?n?(e.inject(n,r),e.getName(r)):e:de(e)?function e(t,n){var r,o,a=[];for(var s in t)t.hasOwnProperty(s)&&!at(t[s])&&(Array.isArray(t[s])&&t[s].isCss||ge(t[s])?a.push(ot(s)+":",t[s],";"):de(t[s])?a.push.apply(a,e(t[s],s)):a.push(ot(s)+": "+(r=s,(null==(o=t[s])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in V?String(o).trim():o+"px")+";")));return n?[n+" {"].concat(a,["}"]):a}(e):e.toString()}var it=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function lt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ge(e)||de(e)?it(st(ce(ue,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:it(st(ce(e,n)))}var ct=/invalid hook call/i,dt=new Set,ut=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,pt=/(^-|-$)/g;function gt(e){return e.replace(ut,"-").replace(pt,"")}function ht(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var ft=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},mt=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function bt(e,t,n){var r=e[n];ft(t)&&ft(r)?wt(r,t):e[n]=t}function wt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,a=n;o<a.length;o++){var s=a[o];if(ft(s))for(var i in s)mt(i)&&bt(e,s[i],i)}return e}var yt=v.default.createContext();function vt(t){var n=e.useContext(yt),r=e.useMemo((function(){return function(e,t){if(!e)return xe(14);if(ge(e)){var n=e(t);return"production"===process.env.NODE_ENV||null!==n&&!Array.isArray(n)&&"object"==typeof n?n:xe(7)}return Array.isArray(e)||"object"!=typeof e?xe(8):t?le({},t,{},e):e}(t.theme,n)}),[t.theme,n]);return t.children?v.default.createElement(yt.Provider,{value:r},t.children):null}yt.Consumer;var xt={};function Ct(t,n,r){var o=fe(t),a=!ht(t),s=n.attrs,i=void 0===s?ue:s,l=n.componentId,c=void 0===l?function(e,t){var n="string"!=typeof e?"sc":gt(e);xt[n]=(xt[n]||0)+1;var r=n+"-"+function(e){return Be(Ge(e)>>>0)}("5.3.5"+n+xt[n]);return t?t+"-"+r:r}(n.displayName,n.parentComponentId):l,d=n.displayName,u=void 0===d?function(e){return ht(e)?"styled."+e:"Styled("+he(e)+")"}(t):d,p=n.displayName&&n.componentId?gt(n.displayName)+"-"+n.componentId:n.componentId||c,g=o&&t.attrs?Array.prototype.concat(t.attrs,i).filter(Boolean):i,h=n.shouldForwardProp;o&&t.shouldForwardProp&&(h=n.shouldForwardProp?function(e,r,o){return t.shouldForwardProp(e,r,o)&&n.shouldForwardProp(e,r,o)}:t.shouldForwardProp);var f,m=new qe(r,p,o?t.componentStyle:void 0),b=m.isStatic&&0===i.length,w=function(t,n){return function(t,n,r,o){var a=t.attrs,s=t.componentStyle,i=t.defaultProps,l=t.foldedComponentIds,c=t.shouldForwardProp,d=t.styledComponentId,u=t.target;"production"!==process.env.NODE_ENV&&e.useDebugValue(d);var p=function(e,t,n){void 0===e&&(e=pe);var r=le({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,a,s=e;for(t in ge(s)&&(s=s(r)),s)r[t]=o[t]="className"===t?(n=o[t],a=s[t],n&&a?n+" "+a:n||a):s[t]})),[r,o]}(function(e,t,n){return void 0===n&&(n=pe),e.theme!==n.theme&&e.theme||t||n.theme}(n,e.useContext(yt),i)||pe,n,a),g=p[0],h=p[1],f=function(t,n,r,o){var a=e.useContext(Xe)||Ze,s=e.useContext(Ke)||Je,i=n?t.generateAndInjectStyles(pe,a,s):t.generateAndInjectStyles(r,a,s);return"production"!==process.env.NODE_ENV&&e.useDebugValue(i),"production"!==process.env.NODE_ENV&&!n&&o&&o(i),i}(s,o,g,"production"!==process.env.NODE_ENV?t.warnTooManyClasses:void 0),m=r,b=h.$as||n.$as||h.as||n.as||u,w=ht(b),y=h!==n?le({},n,{},h):n,v={};for(var x in y)"$"!==x[0]&&"as"!==x&&("forwardedAs"===x?v.as=y[x]:(c?c(x,Y,b):!w||Y(x))&&(v[x]=y[x]));return n.style&&h.style!==n.style&&(v.style=le({},n.style,{},h.style)),v.className=Array.prototype.concat(l,d,f!==d?f:null,n.className,h.className).filter(Boolean).join(" "),v.ref=m,e.createElement(b,v)}(f,t,n,b)};return w.displayName=u,(f=v.default.forwardRef(w)).attrs=g,f.componentStyle=m,f.displayName=u,f.shouldForwardProp=h,f.foldedComponentIds=o?Array.prototype.concat(t.foldedComponentIds,t.styledComponentId):ue,f.styledComponentId=p,f.target=o?t.target:t,f.withComponent=function(e){var t=n.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(n,["componentId"]),a=t&&t+"-"+(ht(e)?e:gt(he(e)));return Ct(e,le({},o,{attrs:g,componentId:a}),r)},Object.defineProperty(f,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=o?wt({},t.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(function(t,n){if("production"!==process.env.NODE_ENV){var r="The component "+t+(n?' with the id of "'+n+'"':"")+" has been created dynamically.\nYou may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.",o=console.error;try{var a=!0;console.error=function(e){if(ct.test(e))a=!1,dt.delete(r);else{for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];o.apply(void 0,[e].concat(n))}},e.useRef(),a&&!dt.has(r)&&(console.warn(r),dt.add(r))}catch(e){ct.test(e.message)&&dt.delete(r)}finally{console.error=o}}}(u,p),f.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var a=t?' with the id of "'+t+'"':"";console.warn("Over 200 classes were generated for component "+e+a+".\nConsider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n <Component />"),r=!0,n={}}}}(u,p)),f.toString=function(){return"."+f.styledComponentId},a&&ie(f,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),f}var St,Rt=function(e){return function e(t,n,r){if(void 0===r&&(r=pe),!b.isValidElementType(n))return xe(1,String(n));var o=function(){return t(n,r,lt.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,le({},r,{},o))},o.attrs=function(o){return e(t,n,le({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Ct,e)};function Et(e,t){return e[t]}function kt(e,t){return t.split(".").reduce(((e,t)=>{const n=t.match(/[^\]\\[.]+/g);if(n&&n.length>1)for(let t=0;t<n.length;t++)return e[n[t]][n[t+1]];return e[t]}),e)}function Ot(e=[],t,n=0){return[...e.slice(0,n),t,...e.slice(n)]}function Pt(e=[],t,n="id"){const r=e.slice(),o=Et(t,n);return o?r.splice(r.findIndex((e=>Et(e,n)===o)),1):r.splice(r.findIndex((e=>e===t)),1),r}function At(e){return e.map(((e,t)=>{const n=Object.assign(Object.assign({},e),{sortable:e.sortable||!!e.sortFunction||void 0});return e.id||(n.id=t+1),n}))}function It(e,t){return Math.ceil(e/t)}function _t(e,t){return Math.min(e,t)}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Rt[e]=Rt(e)})),"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native"),"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window["__styled-components-init__"]=window["__styled-components-init__"]||0,1===window["__styled-components-init__"]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window["__styled-components-init__"]+=1),function(e){e.ASC="asc",e.DESC="desc"}(St||(St={}));const Dt=()=>null;function Tt(e,t=[],n=[]){let r={},o=[...n];return t.length&&t.forEach((t=>{if(!t.when||"function"!=typeof t.when)throw new Error('"when" must be defined in the conditional style object and must be function');t.when(e)&&(r=t.style||{},t.classNames&&(o=[...o,...t.classNames]),"function"==typeof t.style&&(r=t.style(e)||{}))})),{style:r,classNames:o.join(" ")}}function Nt(e,t=[],n="id"){const r=Et(e,n);return r?t.some((e=>Et(e,n)===r)):t.some((t=>t===e))}function jt(e,t){return t?e.findIndex((e=>$t(e.id,t))):-1}function $t(e,t){return e==t}function Lt(e,t){const n=!e.toggleOnSelectedRowsChange;switch(t.type){case"SELECT_ALL_ROWS":{const{keyField:n,rows:r,rowCount:o,mergeSelections:a}=t,s=!e.allSelected,i=!e.toggleOnSelectedRowsChange;if(a){const t=s?[...e.selectedRows,...r.filter((t=>!Nt(t,e.selectedRows,n)))]:e.selectedRows.filter((e=>!Nt(e,r,n)));return Object.assign(Object.assign({},e),{allSelected:s,selectedCount:t.length,selectedRows:t,toggleOnSelectedRowsChange:i})}return Object.assign(Object.assign({},e),{allSelected:s,selectedCount:s?o:0,selectedRows:s?r:[],toggleOnSelectedRowsChange:i})}case"SELECT_SINGLE_ROW":{const{keyField:r,row:o,isSelected:a,rowCount:s,singleSelect:i}=t;return i?a?Object.assign(Object.assign({},e),{selectedCount:0,allSelected:!1,selectedRows:[],toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:1,allSelected:!1,selectedRows:[o],toggleOnSelectedRowsChange:n}):a?Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length>0?e.selectedRows.length-1:0,allSelected:!1,selectedRows:Pt(e.selectedRows,o,r),toggleOnSelectedRowsChange:n}):Object.assign(Object.assign({},e),{selectedCount:e.selectedRows.length+1,allSelected:e.selectedRows.length+1===s,selectedRows:Ot(e.selectedRows,o),toggleOnSelectedRowsChange:n})}case"SELECT_MULTIPLE_ROWS":{const{keyField:r,selectedRows:o,totalRows:a,mergeSelections:s}=t;if(s){const t=[...e.selectedRows,...o.filter((t=>!Nt(t,e.selectedRows,r)))];return Object.assign(Object.assign({},e),{selectedCount:t.length,allSelected:!1,selectedRows:t,toggleOnSelectedRowsChange:n})}return Object.assign(Object.assign({},e),{selectedCount:o.length,allSelected:o.length===a,selectedRows:o,toggleOnSelectedRowsChange:n})}case"CLEAR_SELECTED_ROWS":{const{selectedRowsFlag:n}=t;return Object.assign(Object.assign({},e),{allSelected:!1,selectedCount:0,selectedRows:[],selectedRowsFlag:n})}case"SORT_CHANGE":{const{sortDirection:r,selectedColumn:o,clearSelectedOnSort:a}=t;return Object.assign(Object.assign(Object.assign({},e),{selectedColumn:o,sortDirection:r,currentPage:1}),a&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_PAGE":{const{page:r,paginationServer:o,visibleOnly:a,persistSelectedOnPageChange:s}=t,i=o&&s,l=o&&!s||a;return Object.assign(Object.assign(Object.assign(Object.assign({},e),{currentPage:r}),i&&{allSelected:!1}),l&&{allSelected:!1,selectedCount:0,selectedRows:[],toggleOnSelectedRowsChange:n})}case"CHANGE_ROWS_PER_PAGE":{const{rowsPerPage:n,page:r}=t;return Object.assign(Object.assign({},e),{currentPage:r,rowsPerPage:n})}}}const Ht=lt`
pointer-events: none;
opacity: 0.4;
`,Ft=Rt.div`
position: relative;
box-sizing: border-box;
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
max-width: 100%;
${({disabled:e})=>e&&Ht};
${({theme:e})=>e.table.style};
`,Mt=lt`
position: sticky;
position: -webkit-sticky; /* Safari */
top: 0;
z-index: 1;
`,zt=Rt.div`
display: flex;
width: 100%;
${({fixedHeader:e})=>e&&Mt};
${({theme:e})=>e.head.style};
`,Bt=Rt.div`
display: flex;
align-items: stretch;
width: 100%;
${({theme:e})=>e.headRow.style};
${({dense:e,theme:t})=>e&&t.headRow.denseStyle};
`,Wt=(e,...t)=>lt`
@media screen and (max-width: ${599}px) {
${lt(e,...t)}
}
`,Gt=(e,...t)=>lt`
@media screen and (max-width: ${959}px) {
${lt(e,...t)}
}
`,Vt=(e,...t)=>lt`
@media screen and (max-width: ${1280}px) {
${lt(e,...t)}
}
`,qt=Rt.div`
position: relative;
display: flex;
align-items: center;
box-sizing: border-box;
line-height: normal;
${({theme:e,headCell:t})=>e[t?"headCells":"cells"].style};
${({noPadding:e})=>e&&"padding: 0"};
`,Ut=Rt(qt)`
flex-grow: ${({button:e,grow:t})=>0===t||e?0:t||1};
flex-shrink: 0;
flex-basis: 0;
max-width: ${({maxWidth:e})=>e||"100%"};
min-width: ${({minWidth:e})=>e||"100px"};
${({width:e})=>e&<`
min-width: ${e};
max-width: ${e};
`};
${({right:e})=>e&&"justify-content: flex-end"};
${({button:e,center:t})=>(t||e)&&"justify-content: center"};
${({compact:e,button:t})=>(e||t)&&"padding: 0"};
/* handle hiding cells */
${({hide:e})=>e&&"sm"===e&&Wt`
display: none;
`};
${({hide:e})=>e&&"md"===e&&Gt`
display: none;
`};
${({hide:e})=>e&&"lg"===e&&Vt`
display: none;
`};
${({hide:e})=>e&&Number.isInteger(e)&&(e=>(t,...n)=>lt`
@media screen and (max-width: ${e}px) {
${lt(t,...n)}
}
`)(e)`
display: none;
`};
`,Yt=lt`
div:first-child {
white-space: ${({wrapCell:e})=>e?"normal":"nowrap"};
overflow: ${({allowOverflow