styled-components 6.4.0-prerelease.3 → 6.4.0-prerelease.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +221 -47
- package/dist/constructors/createTheme.d.ts +1 -1
- package/dist/styled-components.browser.cjs.js +5 -1
- package/dist/styled-components.browser.cjs.js.map +1 -1
- package/dist/styled-components.browser.esm.js +5 -1
- package/dist/styled-components.browser.esm.js.map +1 -1
- package/dist/styled-components.cjs.js +5 -1
- package/dist/styled-components.cjs.js.map +1 -1
- package/dist/styled-components.esm.js +5 -1
- package/dist/styled-components.esm.js.map +1 -1
- package/dist/styled-components.js +647 -935
- package/dist/styled-components.js.map +1 -1
- package/dist/styled-components.min.js +5 -1
- package/dist/styled-components.min.js.map +1 -1
- package/dist/utils/hoist.d.ts +0 -4
- package/native/dist/constructors/createTheme.d.ts +1 -1
- package/native/dist/dist/constructors/createTheme.d.ts +1 -1
- package/native/dist/dist/utils/hoist.d.ts +0 -4
- package/native/dist/styled-components.native.cjs.js +1 -1
- package/native/dist/styled-components.native.cjs.js.map +1 -1
- package/native/dist/styled-components.native.esm.js +1 -1
- package/native/dist/styled-components.native.esm.js.map +1 -1
- package/native/dist/utils/hoist.d.ts +0 -4
- package/package.json +4 -5
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import{__spreadArray as e,__assign as t,__makeTemplateObject as n}from"tslib";import r from"@emotion/is-prop-valid";import o,{createElement as i}from"react";import s from"@emotion/unitless";import*as a from"stylis";var c="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",u="active",l="data-styled-version",d="6.4.0-prerelease.3",p="/*!sc*/\n",h="undefined"!=typeof window&&"undefined"!=typeof document,f=void 0===o.createContext,m=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env&&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&&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),v="sc-keyframes-",y={},g="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",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function S(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=e[0],r=[],o=1,i=e.length;o<i;o+=1)r.push(e[o]);return r.forEach(function(e){n=n.replace(/%[a-z]/,e)}),n}function w(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return"production"===process.env.NODE_ENV?new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(n.length>0?" Args: ".concat(n.join(", ")):"")):new Error(S.apply(void 0,e([g[t]],n,!1)).trim())}var b=1<<30,E=new Map,C=new Map,N=1,A=function(e){if(E.has(e))return E.get(e);for(;C.has(N);)N++;var t=N++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>b))throw w(16,"".concat(t));return E.set(e,t),C.set(t,e),t},_=function(e,t){N=t+1,E.set(e,t),C.set(t,e)},I=/invalid hook call/i,P=new Set,R=function(t,n){if("production"!==process.env.NODE_ENV){if(f)return;var r=n?' with the id of "'.concat(n,'"'):"",i="The component ".concat(t).concat(r," has been created dynamically.\n")+"You 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.\nSee https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\n",s=console.error;try{var a=!0;console.error=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];I.test(t)?(a=!1,P.delete(i)):s.apply(void 0,e([t],n,!1))},"function"==typeof o.useState&&o.useState(null),a&&!P.has(i)&&(console.warn(i),P.add(i))}catch(e){I.test(e.message)&&P.delete(i)}finally{console.error=s}}},O=Object.freeze([]),D=Object.freeze({});function T(e,t,n){return void 0===n&&(n=D),e.theme!==n.theme&&e.theme||t||n.theme}var x=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","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","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]),k=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,j=/(^-|-$)/g;function M(e){return e.replace(k,"-").replace(j,"")}var V=/(a)(d)/gi,G=function(e){return String.fromCharCode(e+(e>25?39:97))};function F(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=G(t%52)+n;return(G(t%52)+n).replace(V,"$1-$2")}var z,B=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},L=function(e){return B(5381,e)};function $(e){return F(L(e)>>>0)}function Y(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function q(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}var W="function"==typeof Symbol&&Symbol.for,H=W?Symbol.for("react.memo"):60115,U=W?Symbol.for("react.forward_ref"):60112,J={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},X={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},K=((z={})[U]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},z[H]=X,z);function Q(e){return("type"in(t=e)&&t.type.$$typeof)===H?X:"$$typeof"in e?K[e.$$typeof]:J;var t}var ee=Object.defineProperty,te=Object.getOwnPropertyNames,ne=Object.getOwnPropertySymbols,re=Object.getOwnPropertyDescriptor,oe=Object.getPrototypeOf,ie=Object.prototype;function se(e,t,n){if("string"!=typeof t){if(ie){var r=oe(t);r&&r!==ie&&se(e,r,n)}var o=te(t);ne&&(o=o.concat(ne(t)));for(var i=Q(e),s=Q(t),a=0;a<o.length;++a){var c=o[a];if(!(c in Z||n&&n[c]||s&&c in s||i&&c in i)){var u=re(t,c);try{ee(e,c,u)}catch(e){}}}}return e}function ae(e){return"function"==typeof e}function ce(e){return"object"==typeof e&&"styledComponentId"in e}function ue(e,t){return e&&t?"".concat(e," ").concat(t):e||t||""}function le(e,t){return e.join(t||"")}function de(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function pe(e,t,n){if(void 0===n&&(n=!1),!n&&!de(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=pe(e[r],t[r]);else if(de(t))for(var r in t)e[r]=pe(e[r],t[r]);return e}function he(e,t){Object.defineProperty(e,"toString",{value:t})}var fe=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}return e.prototype.indexOfGroup=function(e){if(e===this._cGroup)return this._cIndex;var t=this._cIndex;if(e>this._cGroup)for(var n=this._cGroup;n<e;n++)t+=this.groupSizes[n];else for(n=this._cGroup-1;n>=e;n--)t-=this.groupSizes[n];return this._cGroup=e,this._cIndex=t,t},e.prototype.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)if((o<<=1)<0)throw w(16,"".concat(e));this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i<o;i++)this.groupSizes[i]=0}for(var s=this.indexOfGroup(e+1),a=0,c=(i=0,t.length);i<c;i++)this.tag.insertRule(s,t[i])&&(this.groupSizes[e]++,s++,a++);a>0&&this._cGroup>e&&(this._cIndex+=a)},e.prototype.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>0&&this._cGroup>e&&(this._cIndex-=t)}},e.prototype.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,i=r;i<o;i++)t+=this.tag.getRule(i)+p;return t},e}(),me="style[".concat(c,"][").concat(l,'="').concat(d,'"]'),ve=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ye=function(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot||"host"in e&&11===e.nodeType},ge=function(e){if(!e)return document;if(ye(e))return e;if("getRootNode"in e){var t=e.getRootNode();if(ye(t))return t}return document},Se=function(e,t,n){for(var r,o=n.split(","),i=0,s=o.length;i<s;i++)(r=o[i])&&e.registerName(t,r)},we=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(p),o=[],i=0,s=r.length;i<s;i++){var a=r[i].trim();if(a){var c=a.match(ve);if(c){var u=0|parseInt(c[1],10),l=c[2];0!==u&&(_(l,u),Se(e,l,c[3]),e.getTag().insertRules(u,o)),o.length=0}else o.push(a)}}},be=function(e){for(var t=ge(e.options.target).querySelectorAll(me),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(c)!==u&&(we(e,o),o.parentNode&&o.parentNode.removeChild(o))}},Ee=!1;function Ce(){if(!1!==Ee)return Ee;if("undefined"!=typeof document){var e=document.head.querySelector('meta[property="csp-nonce"]');if(e)return Ee=e.nonce||e.getAttribute("content")||void 0;var t=document.head.querySelector('meta[name="sc-nonce"]');if(t)return Ee=t.getAttribute("content")||void 0}return Ee="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0}var Ne=function(e,t){var n=document.head,r=e||n,o=document.createElement("style"),i=function(e){var t=Array.from(e.querySelectorAll("style[".concat(c,"]")));return t[t.length-1]}(r),s=void 0!==i?i.nextSibling:null;o.setAttribute(c,u),o.setAttribute(l,d);var a=t||Ce();return a&&o.setAttribute("nonce",a),r.insertBefore(o,s),o},Ae=function(){function e(e,t){this.element=Ne(e,t),this.element.appendChild(document.createTextNode("")),this.sheet=function(e){var t;if(e.sheet)return e.sheet;for(var n=null!==(t=e.getRootNode().styleSheets)&&void 0!==t?t:document.styleSheets,r=0,o=n.length;r<o;r++){var i=n[r];if(i.ownerNode===e)return i}throw w(17)}(this.element),this.length=0}return e.prototype.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},e.prototype.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},e.prototype.getRule=function(e){var t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""},e}(),_e=function(){function e(e,t){this.element=Ne(e,t),this.nodes=this.element.childNodes,this.length=0}return e.prototype.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},e.prototype.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),Ie=function(){function e(e){this.rules=[],this.length=0}return e.prototype.insertRule=function(e,t){return e<=this.length&&(e===this.length?this.rules.push(t):this.rules.splice(e,0,t),this.length++,!0)},e.prototype.deleteRule=function(e){this.rules.splice(e,1),this.length--},e.prototype.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),Pe=h,Re={isServer:!h,useCSSOMInjection:!m},Oe=function(){function e(e,n,r){void 0===e&&(e=D),void 0===n&&(n={});var o=this;this.options=t(t({},Re),e),this.gs=n,this.keyframeIds=new Set,this.names=new Map(r),this.server=!!e.isServer,!this.server&&h&&Pe&&(Pe=!1,be(this)),he(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return C.get(e)}(n);if(void 0===o)return"continue";var i=e.names.get(o);if(void 0===i||!i.size)return"continue";var s=t.getGroup(n);if(0===s.length)return"continue";var a=c+".g"+n+'[id="'+o+'"]',u="";i.forEach(function(e){e.length>0&&(u+=e+",")}),r+=s+a+'{content:"'+u+'"}'+p},i=0;i<n;i++)o(i);return r}(o)})}return e.registerId=function(e){return A(e)},e.prototype.rehydrate=function(){!this.server&&h&&be(this)},e.prototype.reconstructWithOptions=function(n,r){void 0===r&&(r=!0);var o=new e(t(t({},this.options),n),this.gs,r&&this.names||void 0);return o.keyframeIds=new Set(this.keyframeIds),!this.server&&h&&n.target!==this.options.target&&ge(this.options.target)!==ge(n.target)&&be(o),o},e.prototype.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},e.prototype.getTag=function(){return this.tag||(this.tag=(e=function(e){var t=e.useCSSOMInjection,n=e.target,r=e.nonce;return e.isServer?new Ie(n):t?new Ae(n,r):new _e(n,r)}(this.options),new fe(e)));var e},e.prototype.hasNameForId=function(e,t){var n,r;return null!==(r=null===(n=this.names.get(e))||void 0===n?void 0:n.has(t))&&void 0!==r&&r},e.prototype.registerName=function(e,t){A(e),e.startsWith(v)&&this.keyframeIds.add(e);var n=this.names.get(e);n?n.add(t):this.names.set(e,new Set([t]))},e.prototype.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(A(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(A(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}();function De(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in s||e.startsWith("--")?String(t).trim():"".concat(t,"px")}var Te=function(e){return e>="A"&&e<="Z"};function xe(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;Te(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}var ke=Symbol.for("sc-keyframes");function je(e){return"object"==typeof e&&null!==e&&ke in e}var Me=function(e){return null==e||!1===e||""===e},Ve=function(t){var n=[];for(var r in t){var o=t[r];t.hasOwnProperty(r)&&!Me(o)&&(Array.isArray(o)&&o.isCss||ae(o)?n.push("".concat(xe(r),":"),o,";"):de(o)?n.push.apply(n,e(e(["".concat(r," {")],Ve(o),!1),["}"],!1)):n.push("".concat(xe(r),": ").concat(De(r,o),";")))}return n};function Ge(e,t,n,r,o){if(void 0===o&&(o=[]),"string"==typeof e)return e&&o.push(e),o;if(Me(e))return o;if(ce(e))return o.push(".".concat(e.styledComponentId)),o;if(ae(e)){if(!ae(s=e)||s.prototype&&s.prototype.isReactComponent||!t)return o.push(e),o;var i=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof i||Array.isArray(i)||je(i)||de(i)||null===i||console.error("".concat(Y(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.")),Ge(i,t,n,r,o)}var s;if(je(e))return n?(e.inject(n,r),o.push(e.getName(r))):o.push(e),o;if(de(e)){for(var a=Ve(e),c=0;c<a.length;c++)o.push(a[c]);return o}if(!Array.isArray(e))return o.push(e.toString()),o;for(c=0;c<e.length;c++)Ge(e[c],t,n,r,o);return o}function Fe(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(ae(n)&&!ce(n))return!1}return!0}var ze=L(d),Be=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&Fe(e),this.componentId=t,this.baseHash=B(ze,t),this.baseStyle=n,Oe.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))r=ue(r,this.staticRulesId);else{var o=le(Ge(this.rules,e,t,n)),i=F(B(this.baseHash,o)>>>0);if(!t.hasNameForId(this.componentId,i)){var s=n(o,"."+i,void 0,this.componentId);t.insertRules(this.componentId,i,s)}r=ue(r,i),this.staticRulesId=i}else{for(var a=B(this.baseHash,n.hash),c="",u=0;u<this.rules.length;u++){var l=this.rules[u];if("string"==typeof l)c+=l,"production"!==process.env.NODE_ENV&&(a=B(a,l));else if(l){var d=le(Ge(l,e,t,n));a=B(B(a,String(u)),d),c+=d}}if(c){var p=F(a>>>0);if(!t.hasNameForId(this.componentId,p)){var h=n(c,"."+p,void 0,this.componentId);t.insertRules(this.componentId,p,h)}r=ue(r,p)}}return r},e}(),Le=/&/g,$e=47,Ye=42;function qe(e){if(-1===e.indexOf("}"))return!1;for(var t=e.length,n=0,r=0,o=!1,i=0;i<t;i++){var s=e.charCodeAt(i);if(0!==r||o||s!==$e||e.charCodeAt(i+1)!==Ye)if(o)s===Ye&&e.charCodeAt(i+1)===$e&&(o=!1,i++);else if(34!==s&&39!==s||0!==i&&92===e.charCodeAt(i-1)){if(0===r)if(123===s)n++;else if(125===s&&--n<0)return!0}else 0===r?r=s:r===s&&(r=0);else o=!0,i++}return 0!==n||0!==r}function We(e,t){return e.map(function(e){return"rule"===e.type&&(e.value="".concat(t," ").concat(e.value),e.value=e.value.replaceAll(",",",".concat(t," ")),e.props=e.props.map(function(e){return"".concat(t," ").concat(e)})),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=We(e.children,t)),e})}function He(e){var t,n,r,o=void 0===e?D:e,i=o.options,s=void 0===i?D:i,c=o.plugins,u=void 0===c?O:c,l=function(e,r,o){return o.startsWith(n)&&o.endsWith(n)&&o.replaceAll(n,"").length>0?".".concat(t):e},d=u.slice();d.push(function(e){e.type===a.RULESET&&e.value.includes("&")&&(r||(r=new RegExp("\\".concat(n,"\\b"),"g")),e.props[0]=e.props[0].replace(Le,n).replace(r,l))}),s.prefix&&d.push(a.prefixer),d.push(a.stringify);var p=[],h=a.middleware(d.concat(a.rulesheet(function(e){return p.push(e)}))),f=function(e,o,i,c){void 0===o&&(o=""),void 0===i&&(i=""),void 0===c&&(c="&"),t=c,n=o,r=void 0;var u=function(e){if(!qe(e))return e;for(var t=e.length,n="",r=0,o=0,i=0,s=!1,a=0;a<t;a++){var c=e.charCodeAt(a);if(0!==i||s||c!==$e||e.charCodeAt(a+1)!==Ye)if(s)c===Ye&&e.charCodeAt(a+1)===$e&&(s=!1,a++);else if(34!==c&&39!==c||0!==a&&92===e.charCodeAt(a-1)){if(0===i)if(123===c)o++;else if(125===c){if(--o<0){for(var u=a+1;u<t;){var l=e.charCodeAt(u);if(59===l||10===l)break;u++}u<t&&59===e.charCodeAt(u)&&u++,o=0,a=u-1,r=u;continue}0===o&&(n+=e.substring(r,a+1),r=a+1)}else 59===c&&0===o&&(n+=e.substring(r,a+1),r=a+1)}else 0===i?i=c:i===c&&(i=0);else s=!0,a++}if(r<t){var d=e.substring(r);qe(d)||(n+=d)}return n}(function(e){if(-1===e.indexOf("//"))return e;for(var t=e.length,n=[],r=0,o=0,i=0,s=0;o<t;){var a=e.charCodeAt(o);if(34!==a&&39!==a||0!==o&&92===e.charCodeAt(o-1))if(0===i)if(a===$e&&o+1<t&&e.charCodeAt(o+1)===Ye){for(o+=2;o+1<t&&(e.charCodeAt(o)!==Ye||e.charCodeAt(o+1)!==$e);)o++;o+=2}else if(40===a&&o>=3&&108==(32|e.charCodeAt(o-1))&&114==(32|e.charCodeAt(o-2))&&117==(32|e.charCodeAt(o-3)))s=1,o++;else if(s>0)41===a?s--:40===a&&s++,o++;else if(a===Ye&&o+1<t&&e.charCodeAt(o+1)===$e)o>r&&n.push(e.substring(r,o)),r=o+=2;else if(a===$e&&o+1<t&&e.charCodeAt(o+1)===$e){for(o>r&&n.push(e.substring(r,o));o<t&&10!==e.charCodeAt(o);)o++;r=o}else o++;else o++;else 0===i?i=a:i===a&&(i=0),o++}return 0===r?e:(r<t&&n.push(e.substring(r)),n.join(""))}(e)),l=a.compile(i||o?"".concat(i," ").concat(o," { ").concat(u," }"):u);return s.namespace&&(l=We(l,s.namespace)),p=[],a.serialize(l,h),p};return f.hash=u.length?u.reduce(function(e,t){return t.name||w(15),B(e,t.name)},5381).toString():"",f}var Ue=new Oe,Je=He(),Ze={shouldForwardProp:void 0,styleSheet:Ue,stylis:Je},Xe=f?{Provider:function(e){return e.children},Consumer:function(e){return(0,e.children)(Ze)}}:o.createContext(Ze),Ke=Xe.Consumer,Qe=f?{Provider:function(e){return e.children},Consumer:function(e){return(0,e.children)(void 0)}}:o.createContext(void 0);function et(){return f?Ze:o.useContext(Xe)}function tt(e){if(f||!o.useMemo)return e.children;var t=et().styleSheet,n=o.useMemo(function(){var n=t;return e.sheet?n=e.sheet:e.target?n=n.reconstructWithOptions({target:e.target,nonce:e.nonce},!1):void 0!==e.nonce&&(n=n.reconstructWithOptions({nonce:e.nonce})),e.disableCSSOMInjection&&(n=n.reconstructWithOptions({useCSSOMInjection:!1})),n},[e.disableCSSOMInjection,e.nonce,e.sheet,e.target,t]),r=o.useMemo(function(){return He({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:e.stylisPlugins})},[e.enableVendorPrefixes,e.namespace,e.stylisPlugins]),i=o.useMemo(function(){return{shouldForwardProp:e.shouldForwardProp,styleSheet:n,stylis:r}},[e.shouldForwardProp,n,r]);return o.createElement(Xe.Provider,{value:i},o.createElement(Qe.Provider,{value:r},e.children))}var nt=f?{Provider:function(e){return e.children},Consumer:function(e){return(0,e.children)(void 0)}}:o.createContext(void 0),rt=nt.Consumer;function ot(){var e=f?void 0:o.useContext(nt);if(!e)throw w(18);return e}function it(e){if(f)return e.children;var n=o.useContext(nt),r=o.useMemo(function(){return function(e,n){if(!e)throw w(14);if(ae(e)){var r=e(n);if("production"!==process.env.NODE_ENV&&(null===r||Array.isArray(r)||"object"!=typeof r))throw w(7);return r}if(Array.isArray(e)||"object"!=typeof e)throw w(8);return n?t(t({},n),e):e}(e.theme,n)},[e.theme,n]);return e.children?o.createElement(nt.Provider,{value:r},e.children):null}var st={},at=new Set,ct=new Map;function ut(e,n,s){var a=ce(e),c=e,u=!q(e),l=n.attrs,p=void 0===l?O:l,h=n.componentId,m=void 0===h?function(e,t){var n="string"!=typeof e?"sc":M(e);st[n]=(st[n]||0)+1;var r="".concat(n,"-").concat($(d+n+st[n]));return t?"".concat(t,"-").concat(r):r}(n.displayName,n.parentComponentId):h,v=n.displayName,y=void 0===v?function(e){return q(e)?"styled.".concat(e):"Styled(".concat(Y(e),")")}(e):v,g=n.displayName&&n.componentId?"".concat(M(n.displayName),"-").concat(n.componentId):n.componentId||m,S=a&&c.attrs?c.attrs.concat(p).filter(Boolean):p,w=n.shouldForwardProp;if(a&&c.shouldForwardProp){var b=c.shouldForwardProp;if(n.shouldForwardProp){var E=n.shouldForwardProp;w=function(e,t){return b(e,t)&&E(e,t)}}else w=b}var C=new Be(s,g,a?c.componentStyle:void 0);function N(e,n){return function(e,n,s){var a=e.attrs,c=e.componentStyle,u=e.defaultProps,l=e.foldedComponentIds,d=e.styledComponentId,p=e.target,h=f?void 0:o.useContext(nt),m=et(),v=e.shouldForwardProp||m.shouldForwardProp;"production"!==process.env.NODE_ENV&&o.useDebugValue&&o.useDebugValue(d);var y=T(n,h,u)||(f?void 0:D),g=function(e,n,r){for(var o,i=t(t({},n),{className:void 0,theme:r}),s=0;s<e.length;s+=1){var a=ae(o=e[s])?o(t({},i)):o;for(var c in a)"className"===c?i.className=ue(i.className,a[c]):"style"===c?i.style=t(t({},i.style),a[c]):c in n&&void 0===n[c]||(i[c]=a[c])}return"className"in n&&"string"==typeof n.className&&(i.className=ue(i.className,n.className)),i}(a,n,y),S=g.as||p,w={};for(var b in g)void 0===g[b]||"$"===b[0]||"as"===b||"theme"===b&&g.theme===y||("forwardedAs"===b?w.as=g.forwardedAs:v&&!v(b,S)||(w[b]=g[b],v||"development"!==process.env.NODE_ENV||r(b)||at.has(b)||!x.has(S)||(at.add(b),console.warn('styled-components: it looks like an unknown prop "'.concat(b,'" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));var E=function(e,t,n,r){var i=e.generateAndInjectStyles(t,n,r);return"production"!==process.env.NODE_ENV&&o.useDebugValue&&o.useDebugValue(i),i}(c,g,m.styleSheet,m.stylis);"production"!==process.env.NODE_ENV&&e.warnTooManyClasses&&e.warnTooManyClasses(E);var C=ue(l,d);E&&(C+=" "+E),g.className&&(C+=" "+g.className),w[q(S)&&!x.has(S)?"class":"className"]=C,s&&(w.ref=s);var N=i(S,w);if(f){for(var _=m.styleSheet.getTag(),I="",P=c,R=function(){var e=_.getGroup(A(P.componentId));if(e&&P!==c){var t=m.styleSheet.names.get(P.componentId);t&&t.forEach(function(t){var n=function(e){var t=ct.get(e);return t||(t=new RegExp("\\."+e+"(?![a-zA-Z0-9_-])","g"),ct.set(e,t)),t}(t);n.lastIndex=0,e=e.replace(n,":where(."+t+")")})}I=e+I,P=P.baseStyle};P;)R();var O="";if(m.styleSheet.keyframeIds.forEach(function(e){O+=_.getGroup(A(e))}),I=O+I)return o.createElement(o.Fragment,null,o.createElement("style",{key:"sc-"+c.componentId,children:I}),N)}return N}(_,e,n)}N.displayName=y;var _=o.forwardRef(N);return _.attrs=S,_.componentStyle=C,_.displayName=y,_.shouldForwardProp=w,_.foldedComponentIds=a?ue(c.foldedComponentIds,c.styledComponentId):"",_.styledComponentId=g,_.target=a?c.target:e,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=a?function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,o=t;r<o.length;r++)pe(e,o[r],!0);return e}({},c.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&(R(y,g),_.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var i=t?' with the id of "'.concat(t,'"'):"";console.warn("Over ".concat(200," classes were generated for component ").concat(e).concat(i,".\n")+"Consider 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={}}}}(y,g)),he(_,function(){return".".concat(_.styledComponentId)}),u&&se(_,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function lt(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}var dt=function(e){return Object.assign(e,{isCss:!0})};function pt(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];if(ae(t)||de(t))return dt(Ge(lt(O,e([t],n,!0))));var o=t;return 0===n.length&&1===o.length&&"string"==typeof o[0]?Ge(o):dt(Ge(lt(o,n)))}function ht(n,r,o){if(void 0===o&&(o=D),!r)throw w(1,r);var i=function(t){for(var i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];return n(r,o,pt.apply(void 0,e([t],i,!1)))};return i.attrs=function(e){return ht(n,r,t(t({},o),{attrs:Array.prototype.concat(o.attrs,e).filter(Boolean)}))},i.withConfig=function(e){return ht(n,r,t(t({},o),e))},i}var ft=function(e){return ht(ut,e)},mt=ft;x.forEach(function(e){mt[e]=ft(e)});var vt,yt,gt=function(){function e(e,t){this.instanceRules=new Map,this.rules=e,this.componentId=t,this.isStatic=Fe(e),Oe.registerId(this.componentId)}return e.prototype.removeStyles=function(e,t){this.instanceRules.delete(e),this.rebuildGroup(t)},e.prototype.renderStyles=function(e,t,n,r){var o=this.componentId;if(this.isStatic)if(n.hasNameForId(o,o+e))this.instanceRules.has(e)||this.computeRules(e,t,n,r);else{var i=this.computeRules(e,t,n,r);n.insertRules(o,i.name,i.rules)}else{var s=this.instanceRules.get(e);if(this.computeRules(e,t,n,r),!n.server&&s){var a=s.rules,c=this.instanceRules.get(e).rules;if(a.length===c.length){for(var u=!0,l=0;l<a.length;l++)if(a[l]!==c[l]){u=!1;break}if(u)return}}this.rebuildGroup(n)}},e.prototype.computeRules=function(e,t,n,r){var o=le(Ge(this.rules,t,n,r)),i={name:this.componentId+e,rules:r(o,"")};return this.instanceRules.set(e,i),i},e.prototype.rebuildGroup=function(e){var t=this.componentId;e.clearRules(t),this.instanceRules.forEach(function(n){e.insertRules(t,n.name,n.rules)})},e}();function St(n){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s=pt.apply(void 0,e([n],r,!1)),a="sc-global-".concat($(JSON.stringify(s))),c=new gt(s,a);"production"!==process.env.NODE_ENV&&R(a);var u=function(e){var n,r=et(),i=f?void 0:o.useContext(nt);if(n=r.styleSheet.allocateGSInstance(a),"production"!==process.env.NODE_ENV&&o.Children.count(e.children)&&console.warn("The global style component ".concat(a," was given child JSX. createGlobalStyle does not render children.")),"production"!==process.env.NODE_ENV&&s.some(function(e){return"string"==typeof e&&-1!==e.indexOf("@import")})&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),function(e,n,r,o,i){if(c.isStatic)c.renderStyles(e,y,r,i);else{var s=t(t({},n),{theme:T(n,o,u.defaultProps)});c.renderStyles(e,s,r,i)}}(n,e,r.styleSheet,i,r.stylis),f){var l="undefined"==typeof window?c.instanceRules.get(n):void 0,d="";if(l)for(var h=l.rules,m=0;m<h.length;m++)d+=h[m]+p;if(d)return c.instanceRules.delete(n),o.createElement("style",{key:"".concat(a,"-").concat(n),"data-styled-global":a,children:d})}return c.instanceRules.delete(n),null};return o.memo(u)}function wt(e,t,n,r,o){for(var i in e){var s=e[i],a=o?o+"-"+i:i;if("object"==typeof s&&null!==s){var c={};wt(s,t,c,r,a),n[i]=c}else n[i]=r(a,s,i)}}function bt(e,t,n,r){var o="";for(var i in e){var s=e[i],a=t[i],c=r?r+"-"+i:i;"object"==typeof s&&null!==s?"object"==typeof a&&null!==a&&(o+=bt(s,a,n,c)):void 0!==a&&"function"!=typeof a&&(o+="--"+n+c+":"+a+";")}return o}function Et(e,t){var r,o,i,s,a=(null!==(r=null==t?void 0:t.prefix)&&void 0!==r?r:"sc")+"-",c=null!==(o=null==t?void 0:t.selector)&&void 0!==o?o:":root",u=(wt(e,i=a,s={},function(e,t){if("production"!==process.env.NODE_ENV){for(var n=String(t),r=0,o=0;o<n.length&&(40===n.charCodeAt(o)?r++:41===n.charCodeAt(o)&&r--,!(r<0));o++);0!==r&&console.warn('createTheme: value "'.concat(n,'" at "').concat(e,'" contains unbalanced parentheses and may break the var() fallback'))}return"var(--"+i+e+", "+t+")"}),s),l=St(vt||(vt=n(["\n "," {\n ","\n }\n "],["\n "," {\n ","\n }\n "])),c,function(t){return bt(e,t.theme,a)});return Object.assign(u,{GlobalStyle:l,raw:e,resolve:function(t){if(!h)throw new Error("createTheme.resolve() is client-only");var n=null!=t?t:document.documentElement;return function(e,t,n){var r={};return wt(e,t,r,function(e,r){return n.getPropertyValue("--"+t+e).trim()||r}),r}(e,a,getComputedStyle(n))}})}var Ct=function(){function e(e,t){var n=this;this[yt]=!0,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.name=e,this.id=v+e,this.rules=t,A(this.id),he(this,function(){throw w(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=Je),this.name+e.hash},e}();function Nt(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");var o=le(pt.apply(void 0,e([t],n,!1))),i=$(o);return new Ct(i,o)}function At(e){var n=o.forwardRef(function(n,r){var i=T(n,f?void 0:o.useContext(nt),e.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===i&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'.concat(Y(e),'"')),o.createElement(e,t(t({},n),{theme:i,ref:r}))});return n.displayName="WithTheme(".concat(Y(e),")"),se(n,e)}yt=ke;var _t=/^\s*<\/[a-z]/i,It=function(){function e(e){var n=(void 0===e?{}:e).nonce,r=this;this._emitSheetCSS=function(){var e=r.instance.toString();if(!e)return"";var t=r.instance.options.nonce||Ce(),n=le([t&&'nonce="'.concat(t,'"'),"".concat(c,'="true"'),"".concat(l,'="').concat(d,'"')].filter(Boolean)," ");return"<style ".concat(n,">").concat(e,"</style>")},this.getStyleTags=function(){if(r.sealed)throw w(2);return r._emitSheetCSS()},this.getStyleElement=function(){var e;if(r.sealed)throw w(2);var n=r.instance.toString();if(!n)return[];var i=((e={})[c]="",e[l]=d,e.dangerouslySetInnerHTML={__html:n},e),s=r.instance.options.nonce||Ce();return s&&(i.nonce=s),[o.createElement("style",t({},i,{key:"sc-0-0"}))]},this.seal=function(){r.sealed=!0},this.instance=new Oe({isServer:!0,nonce:n}),this.sealed=!1}return e.prototype.collectStyles=function(e){if(this.sealed)throw w(2);return o.createElement(tt,{sheet:this.instance},e)},e.prototype.interleaveWithNodeStream=function(e){if(this.sealed)throw w(2);this.seal();var t=require("stream").Transform,n=this.instance,r=this._emitSheetCSS,o=new t({transform:function(e,t,o){var i=e.toString(),s=r();if(n.clearTag(),_t.test(i)){var a=i.indexOf(">")+1,c=i.slice(0,a),u=i.slice(a);this.push(c+s+u)}else this.push(s+i);o()}});if("on"in e&&"function"==typeof e.on&&"pipe"in e){var i=e;return i.on("error",function(e){o.emit("error",e)}),i.pipe(o)}if("pipe"in e&&"function"==typeof e.pipe)return e.pipe(o);throw new Error("Unsupported stream type")},e}(),Pt={StyleSheet:Oe,mainSheet:Ue};"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");var Rt="__sc-".concat(c,"__");"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[Rt]||(window[Rt]=0),1===window[Rt]&&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://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info."),window[Rt]+=1);export{It as ServerStyleSheet,Ke as StyleSheetConsumer,Xe as StyleSheetContext,tt as StyleSheetManager,rt as ThemeConsumer,nt as ThemeContext,it as ThemeProvider,Pt as __PRIVATE__,St as createGlobalStyle,Et as createTheme,pt as css,mt as default,ce as isStyledComponent,Nt as keyframes,mt as styled,ot as useTheme,d as version,At as withTheme};
|
|
1
|
+
import e from"@emotion/is-prop-valid";import t,{createElement as n}from"react";import*as o from"stylis";var s,r;const i="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",a="active",c="data-styled-version",l="6.4.0-prerelease.5",u="/*!sc*/\n",h="undefined"!=typeof window&&"undefined"!=typeof document,d=void 0===t.createContext;function p(e){if("undefined"!=typeof process&&void 0!==process.env){const t=process.env[e];if(void 0!==t&&""!==t)return"false"!==t}}const f=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:null!==(r=null!==(s=p("REACT_APP_SC_DISABLE_SPEEDY"))&&void 0!==s?s:p("SC_DISABLE_SPEEDY"))&&void 0!==r?r:"undefined"==typeof process||void 0===process.env||"production"!==process.env.NODE_ENV),m="sc-keyframes-",g={},y="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",18:"ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`"}:{};function v(e,...t){return"production"===process.env.NODE_ENV?new Error(`An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#${e} for more information.${t.length>0?` Args: ${t.join(", ")}`:""}`):new Error(function(...e){let t=e[0];const n=[];for(let t=1,o=e.length;t<o;t+=1)n.push(e[t]);return n.forEach(e=>{t=t.replace(/%[a-z]/,e)}),t}(y[e],...t).trim())}const S=1<<30;let w=new Map,b=new Map,C=1;const N=e=>{if(w.has(e))return w.get(e);for(;b.has(C);)C++;const t=C++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>S))throw v(16,`${t}`);return w.set(e,t),b.set(t,e),t},E=e=>b.get(e),O=(e,t)=>{C=t+1,w.set(e,t),b.set(t,e)},I=/invalid hook call/i,A=new Set,$=(e,n)=>{if("production"!==process.env.NODE_ENV){if(d)return;const o=`The component ${e}${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.\nSee https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\n`,s=console.error;try{let e=!0;console.error=(t,...n)=>{I.test(t)?(e=!1,A.delete(o)):s(t,...n)},"function"==typeof t.useState&&t.useState(null),e&&!A.has(o)&&(console.warn(o),A.add(o))}catch(e){I.test(e.message)&&A.delete(o)}finally{console.error=s}}},_=Object.freeze([]),R=Object.freeze({});function P(e,t,n=R){return e.theme!==n.theme&&e.theme||t||n.theme}var j=new Set(["a","abbr","address","area","article","aside","audio","b","bdi","bdo","blockquote","body","button","br","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","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","map","mark","menu","meter","nav","object","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","slot","small","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use"]);const x=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,k=/(^-|-$)/g;function T(e){return e.replace(x,"-").replace(k,"")}const D=/(a)(d)/gi,M=e=>String.fromCharCode(e+(e>25?39:97));function G(e){let t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=M(t%52)+n;return(M(t%52)+n).replace(D,"$1-$2")}const V=(e,t)=>{let n=t.length;for(;n;)e=33*e^t.charCodeAt(--n);return e},F=e=>V(5381,e);function z(e){return G(F(e)>>>0)}function W(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}function L(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}function B(e){return L(e)?`styled.${e}`:`Styled(${W(e)})`}const q=Symbol.for("react.memo"),H=Symbol.for("react.forward_ref"),Y={contextType:!0,defaultProps:!0,displayName:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,propTypes:!0,type:!0},U={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},Z={[H]:{$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},[q]:J};function X(e){return("type"in(t=e)&&t.type.$$typeof)===q?J:"$$typeof"in e?Z[e.$$typeof]:Y;var t}const K=Object.defineProperty,Q=Object.getOwnPropertyNames,ee=Object.getOwnPropertySymbols,te=Object.getOwnPropertyDescriptor,ne=Object.getPrototypeOf,oe=Object.prototype;function se(e,t,n){if("string"!=typeof t){const o=ne(t);o&&o!==oe&&se(e,o,n);const s=Q(t).concat(ee(t)),r=X(e),i=X(t);for(let o=0;o<s.length;++o){const a=s[o];if(!(a in U||n&&n[a]||i&&a in i||r&&a in r)){const n=te(t,a);try{K(e,a,n)}catch(e){}}}}return e}function re(e){return"function"==typeof e}function ie(e){return"object"==typeof e&&"styledComponentId"in e}function ae(e,t){return e&&t?`${e} ${t}`:e||t||""}function ce(e,t){return e.join(t||"")}function le(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ue(e,t,n=!1){if(!n&&!le(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(let n=0;n<t.length;n++)e[n]=ue(e[n],t[n]);else if(le(t))for(const n in t)e[n]=ue(e[n],t[n]);return e}function he(e,t){Object.defineProperty(e,"toString",{value:t})}const de=class{constructor(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e,this._cGroup=0,this._cIndex=0}indexOfGroup(e){if(e===this._cGroup)return this._cIndex;let t=this._cIndex;if(e>this._cGroup)for(let n=this._cGroup;n<e;n++)t+=this.groupSizes[n];else for(let n=this._cGroup-1;n>=e;n--)t-=this.groupSizes[n];return this._cGroup=e,this._cIndex=t,t}insertRules(e,t){if(e>=this.groupSizes.length){const t=this.groupSizes,n=t.length;let o=n;for(;e>=o;)if(o<<=1,o<0)throw v(16,`${e}`);this.groupSizes=new Uint32Array(o),this.groupSizes.set(t),this.length=o;for(let e=n;e<o;e++)this.groupSizes[e]=0}let n=this.indexOfGroup(e+1),o=0;for(let s=0,r=t.length;s<r;s++)this.tag.insertRule(n,t[s])&&(this.groupSizes[e]++,n++,o++);o>0&&this._cGroup>e&&(this._cIndex+=o)}clearGroup(e){if(e<this.length){const t=this.groupSizes[e],n=this.indexOfGroup(e),o=n+t;this.groupSizes[e]=0;for(let e=n;e<o;e++)this.tag.deleteRule(n);t>0&&this._cGroup>e&&(this._cIndex-=t)}}getGroup(e){let t="";if(e>=this.length||0===this.groupSizes[e])return t;const n=this.groupSizes[e],o=this.indexOfGroup(e),s=o+n;for(let e=o;e<s;e++)t+=this.tag.getRule(e)+u;return t}},pe=`style[${i}][${c}="${l}"]`,fe=new RegExp(`^${i}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)`),me=e=>"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot||"host"in e&&11===e.nodeType,ge=e=>{if(!e)return document;if(me(e))return e;if("getRootNode"in e){const t=e.getRootNode();if(me(t))return t}return document},ye=(e,t,n)=>{const o=n.split(",");let s;for(let n=0,r=o.length;n<r;n++)(s=o[n])&&e.registerName(t,s)},ve=(e,t)=>{var n;const o=(null!==(n=t.textContent)&&void 0!==n?n:"").split(u),s=[];for(let t=0,n=o.length;t<n;t++){const n=o[t].trim();if(!n)continue;const r=n.match(fe);if(r){const t=0|parseInt(r[1],10),n=r[2];0!==t&&(O(n,t),ye(e,n,r[3]),e.getTag().insertRules(t,s)),s.length=0}else s.push(n)}},Se=e=>{const t=ge(e.options.target).querySelectorAll(pe);for(let n=0,o=t.length;n<o;n++){const o=t[n];o&&o.getAttribute(i)!==a&&(ve(e,o),o.parentNode&&o.parentNode.removeChild(o))}};let we=!1;function be(){if(!1!==we)return we;if("undefined"!=typeof document){const e=document.head.querySelector('meta[property="csp-nonce"]');if(e)return we=e.nonce||e.getAttribute("content")||void 0;const t=document.head.querySelector('meta[name="sc-nonce"]');if(t)return we=t.getAttribute("content")||void 0}return we="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:void 0}const Ce=(e,t)=>{const n=document.head,o=e||n,s=document.createElement("style"),r=(e=>{const t=Array.from(e.querySelectorAll(`style[${i}]`));return t[t.length-1]})(o),u=void 0!==r?r.nextSibling:null;s.setAttribute(i,a),s.setAttribute(c,l);const h=t||be();return h&&s.setAttribute("nonce",h),o.insertBefore(s,u),s},Ne=class{constructor(e,t){this.element=Ce(e,t),this.element.appendChild(document.createTextNode("")),this.sheet=(e=>{var t;if(e.sheet)return e.sheet;const n=null!==(t=e.getRootNode().styleSheets)&&void 0!==t?t:document.styleSheets;for(let t=0,o=n.length;t<o;t++){const o=n[t];if(o.ownerNode===e)return o}throw v(17)})(this.element),this.length=0}insertRule(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}}deleteRule(e){this.sheet.deleteRule(e),this.length--}getRule(e){const t=this.sheet.cssRules[e];return t&&t.cssText?t.cssText:""}},Ee=class{constructor(e,t){this.element=Ce(e,t),this.nodes=this.element.childNodes,this.length=0}insertRule(e,t){if(e<=this.length&&e>=0){const n=document.createTextNode(t);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1}deleteRule(e){this.element.removeChild(this.nodes[e]),this.length--}getRule(e){return e<this.length?this.nodes[e].textContent:""}},Oe=class{constructor(e){this.rules=[],this.length=0}insertRule(e,t){return e<=this.length&&(e===this.length?this.rules.push(t):this.rules.splice(e,0,t),this.length++,!0)}deleteRule(e){this.rules.splice(e,1),this.length--}getRule(e){return e<this.length?this.rules[e]:""}};let Ie=h;const Ae={isServer:!h,useCSSOMInjection:!f};class $e{static registerId(e){return N(e)}constructor(e=R,t={},n){this.options=Object.assign(Object.assign({},Ae),e),this.gs=t,this.keyframeIds=new Set,this.names=new Map(n),this.server=!!e.isServer,!this.server&&h&&Ie&&(Ie=!1,Se(this)),he(this,()=>(e=>{const t=e.getTag(),{length:n}=t;let o="";for(let s=0;s<n;s++){const n=E(s);if(void 0===n)continue;const r=e.names.get(n);if(void 0===r||!r.size)continue;const a=t.getGroup(s);if(0===a.length)continue;const c=i+".g"+s+'[id="'+n+'"]';let l="";r.forEach(e=>{e.length>0&&(l+=e+",")}),o+=a+c+'{content:"'+l+'"}'+u}return o})(this))}rehydrate(){!this.server&&h&&Se(this)}reconstructWithOptions(e,t=!0){const n=new $e(Object.assign(Object.assign({},this.options),e),this.gs,t&&this.names||void 0);return n.keyframeIds=new Set(this.keyframeIds),!this.server&&h&&e.target!==this.options.target&&ge(this.options.target)!==ge(e.target)&&Se(n),n}allocateGSInstance(e){return this.gs[e]=(this.gs[e]||0)+1}getTag(){return this.tag||(this.tag=(e=(({isServer:e,useCSSOMInjection:t,target:n,nonce:o})=>e?new Oe(n):t?new Ne(n,o):new Ee(n,o))(this.options),new de(e)));var e}hasNameForId(e,t){var n,o;return null!==(o=null===(n=this.names.get(e))||void 0===n?void 0:n.has(t))&&void 0!==o&&o}registerName(e,t){N(e),e.startsWith(m)&&this.keyframeIds.add(e);const n=this.names.get(e);n?n.add(t):this.names.set(e,new Set([t]))}insertRules(e,t,n){this.registerName(e,t),this.getTag().insertRules(N(e),n)}clearNames(e){this.names.has(e)&&this.names.get(e).clear()}clearRules(e){this.getTag().clearGroup(N(e)),this.clearNames(e)}clearTag(){this.tag=void 0}}const _e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexShrink:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale: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 Re(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in _e||e.startsWith("--")?String(t).trim():`${t}px`}const Pe=e=>e>="A"&&e<="Z";function je(e){let t="";for(let n=0;n<e.length;n++){const o=e[n];if(1===n&&"-"===o&&"-"===e[0])return e;Pe(o)?t+="-"+o.toLowerCase():t+=o}return t.startsWith("ms-")?"-"+t:t}const xe=Symbol.for("sc-keyframes");function ke(e){return"object"==typeof e&&null!==e&&xe in e}const Te=e=>null==e||!1===e||""===e,De=e=>{const t=[];for(const n in e){const o=e[n];e.hasOwnProperty(n)&&!Te(o)&&(Array.isArray(o)&&o.isCss||re(o)?t.push(`${je(n)}:`,o,";"):le(o)?t.push(`${n} {`,...De(o),"}"):t.push(`${je(n)}: ${Re(n,o)};`))}return t};function Me(e,t,n,o,s=[]){if("string"==typeof e)return e&&s.push(e),s;if(Te(e))return s;if(ie(e))return s.push(`.${e.styledComponentId}`),s;if(re(e)){if(!re(r=e)||r.prototype&&r.prototype.isReactComponent||!t)return s.push(e),s;{const r=e(t);return"production"===process.env.NODE_ENV||"object"!=typeof r||Array.isArray(r)||ke(r)||le(r)||null===r||console.error(`${W(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.`),Me(r,t,n,o,s)}}var r;if(ke(e))return n?(e.inject(n,o),s.push(e.getName(o))):s.push(e),s;if(le(e)){const t=De(e);for(let e=0;e<t.length;e++)s.push(t[e]);return s}if(!Array.isArray(e))return s.push(e.toString()),s;for(let r=0;r<e.length;r++)Me(e[r],t,n,o,s);return s}function Ge(e){for(let t=0;t<e.length;t+=1){const n=e[t];if(re(n)&&!ie(n))return!1}return!0}const Ve=F(l);class Fe{constructor(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===process.env.NODE_ENV&&(void 0===n||n.isStatic)&&Ge(e),this.componentId=t,this.baseHash=V(Ve,t),this.baseStyle=n,$e.registerId(t)}generateAndInjectStyles(e,t,n){let o=this.baseStyle?this.baseStyle.generateAndInjectStyles(e,t,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(this.componentId,this.staticRulesId))o=ae(o,this.staticRulesId);else{const s=ce(Me(this.rules,e,t,n)),r=G(V(this.baseHash,s)>>>0);if(!t.hasNameForId(this.componentId,r)){const e=n(s,"."+r,void 0,this.componentId);t.insertRules(this.componentId,r,e)}o=ae(o,r),this.staticRulesId=r}else{let s=V(this.baseHash,n.hash),r="";for(let o=0;o<this.rules.length;o++){const i=this.rules[o];if("string"==typeof i)r+=i,"production"!==process.env.NODE_ENV&&(s=V(s,i));else if(i){const a=ce(Me(i,e,t,n));s=V(V(s,String(o)),a),r+=a}}if(r){const e=G(s>>>0);if(!t.hasNameForId(this.componentId,e)){const o=n(r,"."+e,void 0,this.componentId);t.insertRules(this.componentId,e,o)}o=ae(o,e)}}return o}}const ze=/&/g,We=47,Le=42;function Be(e){if(-1===e.indexOf("}"))return!1;const t=e.length;let n=0,o=0,s=!1;for(let r=0;r<t;r++){const t=e.charCodeAt(r);if(0!==o||s||t!==We||e.charCodeAt(r+1)!==Le)if(s)t===Le&&e.charCodeAt(r+1)===We&&(s=!1,r++);else if(34!==t&&39!==t||0!==r&&92===e.charCodeAt(r-1)){if(0===o)if(123===t)n++;else if(125===t&&(n--,n<0))return!0}else 0===o?o=t:o===t&&(o=0);else s=!0,r++}return 0!==n||0!==o}function qe(e,t){return e.map(e=>("rule"===e.type&&(e.value=`${t} ${e.value}`,e.value=e.value.replaceAll(",",`,${t} `),e.props=e.props.map(e=>`${t} ${e}`)),Array.isArray(e.children)&&"@keyframes"!==e.type&&(e.children=qe(e.children,t)),e))}function He({options:e=R,plugins:t=_}=R){let n,s,r;const i=(e,t,o)=>o.startsWith(s)&&o.endsWith(s)&&o.replaceAll(s,"").length>0?`.${n}`:e,a=t.slice();a.push(e=>{e.type===o.RULESET&&e.value.includes("&")&&(r||(r=new RegExp(`\\${s}\\b`,"g")),e.props[0]=e.props[0].replace(ze,s).replace(r,i))}),e.prefix&&a.push(o.prefixer),a.push(o.stringify);let c=[];const l=o.middleware(a.concat(o.rulesheet(e=>c.push(e)))),u=(t,i="",a="",u="&")=>{n=u,s=i,r=void 0;const h=function(e){if(!Be(e))return e;const t=e.length;let n="",o=0,s=0,r=0,i=!1;for(let a=0;a<t;a++){const c=e.charCodeAt(a);if(0!==r||i||c!==We||e.charCodeAt(a+1)!==Le)if(i)c===Le&&e.charCodeAt(a+1)===We&&(i=!1,a++);else if(34!==c&&39!==c||0!==a&&92===e.charCodeAt(a-1)){if(0===r)if(123===c)s++;else if(125===c){if(s--,s<0){let n=a+1;for(;n<t;){const t=e.charCodeAt(n);if(59===t||10===t)break;n++}n<t&&59===e.charCodeAt(n)&&n++,s=0,a=n-1,o=n;continue}0===s&&(n+=e.substring(o,a+1),o=a+1)}else 59===c&&0===s&&(n+=e.substring(o,a+1),o=a+1)}else 0===r?r=c:r===c&&(r=0);else i=!0,a++}if(o<t){const t=e.substring(o);Be(t)||(n+=t)}return n}(function(e){if(-1===e.indexOf("//"))return e;const t=e.length,n=[];let o=0,s=0,r=0,i=0;for(;s<t;){const a=e.charCodeAt(s);if(34!==a&&39!==a||0!==s&&92===e.charCodeAt(s-1))if(0===r)if(a===We&&s+1<t&&e.charCodeAt(s+1)===Le){for(s+=2;s+1<t&&(e.charCodeAt(s)!==Le||e.charCodeAt(s+1)!==We);)s++;s+=2}else if(40===a&&s>=3&&108==(32|e.charCodeAt(s-1))&&114==(32|e.charCodeAt(s-2))&&117==(32|e.charCodeAt(s-3)))i=1,s++;else if(i>0)41===a?i--:40===a&&i++,s++;else if(a===Le&&s+1<t&&e.charCodeAt(s+1)===We)s>o&&n.push(e.substring(o,s)),s+=2,o=s;else if(a===We&&s+1<t&&e.charCodeAt(s+1)===We){for(s>o&&n.push(e.substring(o,s));s<t&&10!==e.charCodeAt(s);)s++;o=s}else s++;else s++;else 0===r?r=a:r===a&&(r=0),s++}return 0===o?e:(o<t&&n.push(e.substring(o)),n.join(""))}(t));let d=o.compile(a||i?`${a} ${i} { ${h} }`:h);return e.namespace&&(d=qe(d,e.namespace)),c=[],o.serialize(d,l),c};return u.hash=t.length?t.reduce((e,t)=>(t.name||v(15),V(e,t.name)),5381).toString():"",u}const Ye=new $e,Ue=He(),Je={shouldForwardProp:void 0,styleSheet:Ye,stylis:Ue},Ze=d?{Provider:({children:e})=>e,Consumer:({children:e})=>e(Je)}:t.createContext(Je),Xe=Ze.Consumer,Ke=d?{Provider:({children:e})=>e,Consumer:({children:e})=>e(void 0)}:t.createContext(void 0);function Qe(){return d?Je:t.useContext(Ze)}function et(e){if(d||!t.useMemo)return e.children;const{styleSheet:n}=Qe(),o=t.useMemo(()=>{let t=n;return e.sheet?t=e.sheet:e.target?t=t.reconstructWithOptions({target:e.target,nonce:e.nonce},!1):void 0!==e.nonce&&(t=t.reconstructWithOptions({nonce:e.nonce})),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.nonce,e.sheet,e.target,n]),s=t.useMemo(()=>He({options:{namespace:e.namespace,prefix:e.enableVendorPrefixes},plugins:e.stylisPlugins}),[e.enableVendorPrefixes,e.namespace,e.stylisPlugins]),r=t.useMemo(()=>({shouldForwardProp:e.shouldForwardProp,styleSheet:o,stylis:s}),[e.shouldForwardProp,o,s]);return t.createElement(Ze.Provider,{value:r},t.createElement(Ke.Provider,{value:s},e.children))}const tt=d?{Provider:({children:e})=>e,Consumer:({children:e})=>e(void 0)}:t.createContext(void 0),nt=tt.Consumer;function ot(){const e=d?void 0:t.useContext(tt);if(!e)throw v(18);return e}function st(e){if(d)return e.children;const n=t.useContext(tt),o=t.useMemo(()=>function(e,t){if(!e)throw v(14);if(re(e)){const n=e(t);if("production"!==process.env.NODE_ENV&&(null===n||Array.isArray(n)||"object"!=typeof n))throw v(7);return n}if(Array.isArray(e)||"object"!=typeof e)throw v(8);return t?Object.assign(Object.assign({},t),e):e}(e.theme,n),[e.theme,n]);return e.children?t.createElement(tt.Provider,{value:o},e.children):null}const rt={};function it(e,t){const n="string"!=typeof e?"sc":T(e);rt[n]=(rt[n]||0)+1;const o=`${n}-${z(l+n+rt[n])}`;return t?`${t}-${o}`:o}let at=new Set,ct=null;if(d){const e=t.cache;e&&(ct=e(()=>new Set))}const lt=new Map;function ut(e){let t=lt.get(e);return t||(t=new RegExp("\\."+e+"(?![a-zA-Z0-9_-])","g"),lt.set(e,t)),t}function ht(o,s,r){const i=ie(o),a=o,c=!L(o),{attrs:l=_,componentId:u=it(s.displayName,s.parentComponentId),displayName:h=B(o)}=s,p=s.displayName&&s.componentId?`${T(s.displayName)}-${s.componentId}`:s.componentId||u,f=i&&a.attrs?a.attrs.concat(l).filter(Boolean):l;let{shouldForwardProp:m}=s;if(i&&a.shouldForwardProp){const e=a.shouldForwardProp;if(s.shouldForwardProp){const t=s.shouldForwardProp;m=(n,o)=>e(n,o)&&t(n,o)}else m=e}const g=new Fe(r,p,i?a.componentStyle:void 0);function y(o,s){return function(o,s,r){const{attrs:i,componentStyle:a,defaultProps:c,foldedComponentIds:l,styledComponentId:u,target:h}=o,p=d?void 0:t.useContext(tt),f=Qe(),m=o.shouldForwardProp||f.shouldForwardProp;"production"!==process.env.NODE_ENV&&t.useDebugValue&&t.useDebugValue(u);const g=P(s,p,c)||(d?void 0:R),y=function(e,t,n){const o=Object.assign(Object.assign({},t),{className:void 0,theme:n});let s;for(let n=0;n<e.length;n+=1){s=e[n];const r=re(s)?s(Object.assign({},o)):s;for(const e in r)"className"===e?o.className=ae(o.className,r[e]):"style"===e?o.style=Object.assign(Object.assign({},o.style),r[e]):e in t&&void 0===t[e]||(o[e]=r[e])}return"className"in t&&"string"==typeof t.className&&(o.className=ae(o.className,t.className)),o}(i,s,g),v=y.as||h,S={};for(const t in y)void 0===y[t]||"$"===t[0]||"as"===t||"theme"===t&&y.theme===g||("forwardedAs"===t?S.as=y.forwardedAs:m&&!m(t,v)||(S[t]=y[t],m||"development"!==process.env.NODE_ENV||e(t)||at.has(t)||!j.has(v)||(at.add(t),console.warn(`styled-components: it looks like an unknown prop "${t}" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via \`<StyleSheetManager shouldForwardProp={...}>\` (connect an API like \`@emotion/is-prop-valid\`) or consider using transient props (\`$\` prefix for automatic filtering.)`))));const w=function(e,n,o,s){const r=e.generateAndInjectStyles(n,o,s);return"production"!==process.env.NODE_ENV&&t.useDebugValue&&t.useDebugValue(r),r}(a,y,f.styleSheet,f.stylis);"production"!==process.env.NODE_ENV&&o.warnTooManyClasses&&o.warnTooManyClasses(w);let b=ae(l,u);w&&(b+=" "+w),y.className&&(b+=" "+y.className),S[L(v)&&!j.has(v)?"class":"className"]=b,r&&(S.ref=r);const C=n(v,S);if(d){const e=f.styleSheet.getTag();let n="",o=a;for(;o;){let t=e.getGroup(N(o.componentId));if(t&&o!==a){const e=f.styleSheet.names.get(o.componentId);e&&e.forEach(e=>{const n=ut(e);n.lastIndex=0,t=t.replace(n,":where(."+e+")")})}n=t+n,o=o.baseStyle}let s="";if(f.styleSheet.keyframeIds.forEach(t=>{s+=e.getGroup(N(t))}),n=s+n,n){if(ct){const e=ct();if(e.has(n))return C;e.add(n)}return t.createElement(t.Fragment,null,t.createElement("style",{key:"sc-"+a.componentId,children:n}),C)}}return C}(v,o,s)}y.displayName=h;let v=t.forwardRef(y);return v.attrs=f,v.componentStyle=g,v.displayName=h,v.shouldForwardProp=m,v.foldedComponentIds=i?ae(a.foldedComponentIds,a.styledComponentId):"",v.styledComponentId=p,v.target=i?a.target:o,Object.defineProperty(v,"defaultProps",{get(){return this._foldedDefaultProps},set(e){this._foldedDefaultProps=i?function(e,...t){for(const n of t)ue(e,n,!0);return e}({},a.defaultProps,e):e}}),"production"!==process.env.NODE_ENV&&($(h,p),v.warnTooManyClasses=((e,t)=>{let n={},o=!1;return s=>{!o&&(n[s]=!0,Object.keys(n).length>=200)&&(console.warn(`Over 200 classes were generated for component ${e}${t?` with the id of "${t}"`:""}.\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 />`),o=!0,n={})}})(h,p)),he(v,()=>`.${v.styledComponentId}`),c&&se(v,o,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),v}function dt(e,t){const n=[e[0]];for(let o=0,s=t.length;o<s;o+=1)n.push(t[o],e[o+1]);return n}const pt=e=>Object.assign(e,{isCss:!0});function ft(e,...t){if(re(e)||le(e))return pt(Me(dt(_,[e,...t])));const n=e;return 0===t.length&&1===n.length&&"string"==typeof n[0]?Me(n):pt(Me(dt(n,t)))}function mt(e,t,n=R){if(!t)throw v(1,t);const o=(o,...s)=>e(t,n,ft(o,...s));return o.attrs=o=>mt(e,t,Object.assign(Object.assign({},n),{attrs:Array.prototype.concat(n.attrs,o).filter(Boolean)})),o.withConfig=o=>mt(e,t,Object.assign(Object.assign({},n),o)),o}const gt=e=>mt(ht,e),yt=gt;j.forEach(e=>{yt[e]=gt(e)});class vt{constructor(e,t){this.instanceRules=new Map,this.rules=e,this.componentId=t,this.isStatic=Ge(e),$e.registerId(this.componentId)}removeStyles(e,t){this.instanceRules.delete(e),this.rebuildGroup(t)}renderStyles(e,t,n,o){const s=this.componentId;if(this.isStatic){if(n.hasNameForId(s,s+e))this.instanceRules.has(e)||this.computeRules(e,t,n,o);else{const r=this.computeRules(e,t,n,o);n.insertRules(s,r.name,r.rules)}return}const r=this.instanceRules.get(e);if(this.computeRules(e,t,n,o),!n.server&&r){const t=r.rules,n=this.instanceRules.get(e).rules;if(t.length===n.length){let e=!0;for(let o=0;o<t.length;o++)if(t[o]!==n[o]){e=!1;break}if(e)return}}this.rebuildGroup(n)}computeRules(e,t,n,o){const s=ce(Me(this.rules,t,n,o)),r={name:this.componentId+e,rules:o(s,"")};return this.instanceRules.set(e,r),r}rebuildGroup(e){const t=this.componentId;e.clearRules(t),this.instanceRules.forEach(n=>{e.insertRules(t,n.name,n.rules)})}}function St(e,...n){const o=ft(e,...n),s=`sc-global-${z(JSON.stringify(o))}`,r=new vt(o,s);"production"!==process.env.NODE_ENV&&$(s);const i=e=>{const n=Qe(),a=d?void 0:t.useContext(tt);let c;if(c=n.styleSheet.allocateGSInstance(s),"production"!==process.env.NODE_ENV&&t.Children.count(e.children)&&console.warn(`The global style component ${s} was given child JSX. createGlobalStyle does not render children.`),"production"!==process.env.NODE_ENV&&o.some(e=>"string"==typeof e&&-1!==e.indexOf("@import"))&&console.warn("Please do not use @import CSS syntax in createGlobalStyle at this time, as the CSSOM APIs we use in production do not handle it well. Instead, we recommend using a library such as react-helmet to inject a typical <link> meta tag to the stylesheet, or simply embedding it manually in your index.html <head> section for a simpler app."),(d||n.styleSheet.server)&&function(e,t,n,o,s){if(r.isStatic)r.renderStyles(e,g,n,s);else{const a=Object.assign(Object.assign({},t),{theme:P(t,o,i.defaultProps)});r.renderStyles(e,a,n,s)}}(c,e,n.styleSheet,a,n.stylis),d){const e="undefined"==typeof window?r.instanceRules.get(c):void 0;let n="";if(e){const t=e.rules;for(let e=0;e<t.length;e++)n+=t[e]+u}if(n)return r.instanceRules.delete(c),t.createElement("style",{key:`${s}-${c}`,"data-styled-global":s,children:n})}return r.instanceRules.delete(c),null};return t.memo(i)}function wt(e,t,n,o,s){for(const r in e){const i=e[r],a=s?s+"-"+r:r;if("object"==typeof i&&null!==i){const e={};wt(i,t,e,o,a),n[r]=e}else n[r]=o(a,i,r)}}function bt(e,t,n,o){let s="";for(const r in e){const i=e[r],a=t[r],c=o?o+"-"+r:r;"object"==typeof i&&null!==i?"object"==typeof a&&null!==a&&(s+=bt(i,a,n,c)):void 0!==a&&"function"!=typeof a&&(s+="--"+n+c+":"+a+";")}return s}function Ct(e,t){var n,o;const s=(null!==(n=null==t?void 0:t.prefix)&&void 0!==n?n:"sc")+"-",r=null!==(o=null==t?void 0:t.selector)&&void 0!==o?o:":root",i=function(e,t){const n={};return wt(e,t,n,(e,n)=>{if("production"!==process.env.NODE_ENV){const t=String(n);let o=0;for(let e=0;e<t.length&&(40===t.charCodeAt(e)?o++:41===t.charCodeAt(e)&&o--,!(o<0));e++);0!==o&&console.warn(`createTheme: value "${t}" at "${e}" contains unbalanced parentheses and may break the var() fallback`)}return"var(--"+t+e+", "+n+")"}),n}(e,s),a=St`
|
|
2
|
+
${r} {
|
|
3
|
+
${t=>bt(e,t.theme,s)}
|
|
4
|
+
}
|
|
5
|
+
`;return Object.assign(i,{GlobalStyle:a,raw:e,resolve(t){if(!h)throw new Error("createTheme.resolve() is client-only");const n=null!=t?t:document.documentElement;return function(e,t,n){const o={};return wt(e,t,o,(e,o)=>n.getPropertyValue("--"+t+e).trim()||o),o}(e,s,getComputedStyle(n))}})}var Nt;class Et{constructor(e,t){this[Nt]=!0,this.inject=(e,t=Ue)=>{const n=this.name+t.hash;e.hasNameForId(this.id,n)||e.insertRules(this.id,n,t(this.rules,n,"@keyframes"))},this.name=e,this.id=m+e,this.rules=t,N(this.id),he(this,()=>{throw v(12,String(this.name))})}getName(e=Ue){return this.name+e.hash}}function Ot(e,...t){"production"!==process.env.NODE_ENV&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("`keyframes` cannot be used on ReactNative, only on the web. To do animation in ReactNative please use Animated.");const n=ce(ft(e,...t)),o=z(n);return new Et(o,n)}function It(e){const n=t.forwardRef((n,o)=>{const s=P(n,d?void 0:t.useContext(tt),e.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===s&&console.warn(`[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "${W(e)}"`),t.createElement(e,Object.assign(Object.assign({},n),{theme:s,ref:o}))});return n.displayName=`WithTheme(${W(e)})`,se(n,e)}Nt=xe;const At=/^\s*<\/[a-z]/i;class $t{constructor({nonce:e}={}){this._emitSheetCSS=()=>{const e=this.instance.toString();if(!e)return"";const t=this.instance.options.nonce||be();return`<style ${ce([t&&`nonce="${t}"`,`${i}="true"`,`${c}="${l}"`].filter(Boolean)," ")}>${e}</style>`},this.getStyleTags=()=>{if(this.sealed)throw v(2);return this._emitSheetCSS()},this.getStyleElement=()=>{if(this.sealed)throw v(2);const e=this.instance.toString();if(!e)return[];const n={[i]:"",[c]:l,dangerouslySetInnerHTML:{__html:e}},o=this.instance.options.nonce||be();return o&&(n.nonce=o),[t.createElement("style",Object.assign({},n,{key:"sc-0-0"}))]},this.seal=()=>{this.sealed=!0},this.instance=new $e({isServer:!0,nonce:e}),this.sealed=!1}collectStyles(e){if(this.sealed)throw v(2);return t.createElement(et,{sheet:this.instance},e)}interleaveWithNodeStream(e){if(this.sealed)throw v(2);this.seal();const{Transform:t}=require("stream"),{instance:n,_emitSheetCSS:o}=this,s=new t({transform:function(e,t,s){const r=e.toString(),i=o();if(n.clearTag(),At.test(r)){const e=r.indexOf(">")+1,t=r.slice(0,e),n=r.slice(e);this.push(t+i+n)}else this.push(i+r);s()}});if("on"in e&&"function"==typeof e.on&&"pipe"in e){const t=e;return t.on("error",e=>{s.emit("error",e)}),t.pipe(s)}if("pipe"in e&&"function"==typeof e.pipe)return e.pipe(s);throw new Error("Unsupported stream type")}}const _t={StyleSheet:$e,mainSheet:Ye};"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");const Rt=`__sc-${i}__`;"production"!==process.env.NODE_ENV&&"test"!==process.env.NODE_ENV&&"undefined"!=typeof window&&(window[Rt]||(window[Rt]=0),1===window[Rt]&&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://styled-components.com/docs/faqs#why-am-i-getting-a-warning-about-several-instances-of-module-on-the-page for more info."),window[Rt]+=1);export{$t as ServerStyleSheet,Xe as StyleSheetConsumer,Ze as StyleSheetContext,et as StyleSheetManager,nt as ThemeConsumer,tt as ThemeContext,st as ThemeProvider,_t as __PRIVATE__,St as createGlobalStyle,Ct as createTheme,ft as css,yt as default,ie as isStyledComponent,Ot as keyframes,yt as styled,ot as useTheme,l as version,It as withTheme};
|
|
2
6
|
//# sourceMappingURL=styled-components.esm.js.map
|