UNPKG

styled-components

Version:

CSS for the <Component> Age. Style components your way with speed, strong typing, and flexibility.

3 lines (2 loc) 24.3 kB
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("css-to-react-native"),t=require("postcss"),n=require("tslib"),r=require("react"),o=require("stylis"),i=require("@emotion/unitless");function s(e){return e&&e.__esModule?e:{default:e}}function a(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 u=/*#__PURE__*/s(e),c=/*#__PURE__*/s(r),l=/*#__PURE__*/a(o),p=/*#__PURE__*/s(i),h=Object.freeze([]),f=Object.freeze({}),d="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 y(){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 v(e){for(var t=[],r=1;r<arguments.length;r++)t[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(e," for more information.").concat(t.length>0?" Args: ".concat(t.join(", ")):"")):new Error(y.apply(void 0,n.__spreadArray([d[e]],t,!1)).trim())}function g(e,t){Object.defineProperty(e,"toString",{value:t})}var m="undefined"!=typeof process&&void 0!==process.env&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",S="active",_="data-styled-version",w="6.3.11",A="/*!sc*/\n",b="undefined"!=typeof window&&"undefined"!=typeof document,C=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),E=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 v(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,u=(i=0,t.length);i<u;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)+A;return t},e}(),P=1<<30,N=new Map,x=new Map,O=1,T=function(e){if(N.has(e))return N.get(e);for(;x.has(O);)O++;var t=O++;if("production"!==process.env.NODE_ENV&&((0|t)<0||t>P))throw v(16,"".concat(t));return N.set(e,t),x.set(t,e),t},D=function(e,t){O=t+1,N.set(e,t),x.set(t,e)},R="style[".concat(m,"][").concat(_,'="').concat(w,'"]'),j=new RegExp("^".concat(m,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),I=function(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot||"host"in e&&11===e.nodeType},z=function(e){if(!e)return document;if(I(e))return e;if("getRootNode"in e){var t=e.getRootNode();if(I(t))return t}return document},B=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)},k=function(e,t){for(var n,r=(null!==(n=t.textContent)&&void 0!==n?n:"").split(A),o=[],i=0,s=r.length;i<s;i++){var a=r[i].trim();if(a){var u=a.match(j);if(u){var c=0|parseInt(u[1],10),l=u[2];0!==c&&(D(l,c),B(e,l,u[3]),e.getTag().insertRules(c,o)),o.length=0}else o.push(a)}}},G=function(e){for(var t=z(e.options.target).querySelectorAll(R),n=0,r=t.length;n<r;n++){var o=t[n];o&&o.getAttribute(m)!==S&&(k(e,o),o.parentNode&&o.parentNode.removeChild(o))}},L=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){var t=Array.from(e.querySelectorAll("style[".concat(m,"]")));return t[t.length-1]}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(m,S),r.setAttribute(_,w);var s="undefined"!=typeof __webpack_nonce__?__webpack_nonce__:null;return s&&r.setAttribute("nonce",s),n.insertBefore(r,i),r},V=function(){function e(e){this.element=L(e),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 v(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}(),M=function(){function e(e){this.element=L(e),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}(),$=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}(),F=b,q={isServer:!b,useCSSOMInjection:!C},Y=function(){function e(e,t,r){void 0===e&&(e=f),void 0===t&&(t={});var o=this;this.options=n.__assign(n.__assign({},q),e),this.gs=t,this.names=new Map(r),this.server=!!e.isServer,!this.server&&b&&F&&(F=!1,G(this)),g(this,function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=function(n){var o=function(e){return x.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=m+".g"+n+'[id="'+o+'"]',u="";i.forEach(function(e){e.length>0&&(u+=e+",")}),r+=s+a+'{content:"'+u+'"}'+A},i=0;i<n;i++)o(i);return r}(o)})}return e.registerId=function(e){return T(e)},e.prototype.rehydrate=function(){!this.server&&b&&G(this)},e.prototype.reconstructWithOptions=function(t,r){void 0===r&&(r=!0);var o=new e(n.__assign(n.__assign({},this.options),t),this.gs,r&&this.names||void 0);return!this.server&&b&&t.target!==this.options.target&&z(this.options.target)!==z(t.target)&&G(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;return e.isServer?new $(n):t?new V(n):new M(n)}(this.options),new E(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){T(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(T(e),n)},e.prototype.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},e.prototype.clearRules=function(e){this.getTag().clearGroup(T(e)),this.clearNames(e)},e.prototype.clearTag=function(){this.tag=void 0},e}(),W=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},H=/&/g,U=47,K=42;function Z(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!==U||e.charCodeAt(i+1)!==K)if(o)s===K&&e.charCodeAt(i+1)===U&&(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 J(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=J(e.children,t)),e})}var Q=new Y,X=function(){var e,t,n,r=f.options,o=void 0===r?f:r,i=f.plugins,s=void 0===i?h:i,a=function(n,r,o){return o.startsWith(t)&&o.endsWith(t)&&o.replaceAll(t,"").length>0?".".concat(e):n},u=s.slice();u.push(function(e){e.type===l.RULESET&&e.value.includes("&")&&(n||(n=new RegExp("\\".concat(t,"\\b"),"g")),e.props[0]=e.props[0].replace(H,t).replace(n,a))}),o.prefix&&u.push(l.prefixer),u.push(l.stringify);var c=[],p=l.middleware(u.concat(l.rulesheet(function(e){return c.push(e)}))),d=function(r,i,s,a){void 0===i&&(i=""),void 0===s&&(s=""),void 0===a&&(a="&"),e=a,t=i,n=void 0;var u=function(e){if(!Z(e))return e;for(var t=e.length,n="",r=0,o=0,i=0,s=!1,a=0;a<t;a++){var u=e.charCodeAt(a);if(0!==i||s||u!==U||e.charCodeAt(a+1)!==K)if(s)u===K&&e.charCodeAt(a+1)===U&&(s=!1,a++);else if(34!==u&&39!==u||0!==a&&92===e.charCodeAt(a-1)){if(0===i)if(123===u)o++;else if(125===u){if(--o<0){for(var c=a+1;c<t;){var l=e.charCodeAt(c);if(59===l||10===l)break;c++}c<t&&59===e.charCodeAt(c)&&c++,o=0,a=c-1,r=c;continue}0===o&&(n+=e.substring(r,a+1),r=a+1)}else 59===u&&0===o&&(n+=e.substring(r,a+1),r=a+1)}else 0===i?i=u:i===u&&(i=0);else s=!0,a++}if(r<t){var p=e.substring(r);Z(p)||(n+=p)}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===U&&o+1<t&&e.charCodeAt(o+1)===K){for(o+=2;o+1<t&&(e.charCodeAt(o)!==K||e.charCodeAt(o+1)!==U);)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===K&&o+1<t&&e.charCodeAt(o+1)===U)o>r&&n.push(e.substring(r,o)),r=o+=2;else if(a===U&&o+1<t&&e.charCodeAt(o+1)===U){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(""))}(r)),h=l.compile(s||i?"".concat(s," ").concat(i," { ").concat(u," }"):u);return o.namespace&&(h=J(h,o.namespace)),c=[],l.serialize(h,p),c};return d.hash=s.length?s.reduce(function(e,t){return t.name||v(15),W(e,t.name)},5381).toString():"",d}(),ee=(c.default.createContext({shouldForwardProp:void 0,styleSheet:Q,stylis:X}),c.default.createContext(void 0),function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=X);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="sc-keyframes-".concat(e),this.rules=t,g(this,function(){throw v(12,String(n.name))})}return e.prototype.getName=function(e){return void 0===e&&(e=X),this.name+e.hash},e}());function te(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||e in p.default||e.startsWith("--")?String(t).trim():"".concat(t,"px")}function ne(e){return"production"!==process.env.NODE_ENV&&"string"==typeof e&&e||e.displayName||e.name||"Component"}var re=function(e){return e>="A"&&e<="Z"};function oe(e){for(var t="",n=0;n<e.length;n++){var r=e[n];if(1===n&&"-"===r&&"-"===e[0])return e;re(r)?t+="-"+r.toLowerCase():t+=r}return t.startsWith("ms-")?"-"+t:t}function ie(e){return"function"==typeof e}function se(e){return null!==e&&"object"==typeof e&&e.constructor.name===Object.name&&!("props"in e&&e.$$typeof)}function ae(e){return"object"==typeof e&&"styledComponentId"in e}var ue=function(e){return null==e||!1===e||""===e},ce=function(e){var t=[];for(var r in e){var o=e[r];e.hasOwnProperty(r)&&!ue(o)&&(Array.isArray(o)&&o.isCss||ie(o)?t.push("".concat(oe(r),":"),o,";"):se(o)?t.push.apply(t,n.__spreadArray(n.__spreadArray(["".concat(r," {")],ce(o),!1),["}"],!1)):t.push("".concat(oe(r),": ").concat(te(r,o),";")))}return t};function le(e,t,n,r,o){if(void 0===o&&(o=[]),"string"==typeof e)return e&&o.push(e),o;if(ue(e))return o;if(ae(e))return o.push(".".concat(e.styledComponentId)),o;if(ie(e)){if(!ie(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)||i instanceof ee||se(i)||null===i||console.error("".concat(ne(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.")),le(i,t,n,r,o)}var s;if(e instanceof ee)return n?(e.inject(n,r),o.push(e.getName(r))):o.push(e),o;if(se(e)){for(var a=ce(e),u=0;u<a.length;u++)o.push(a[u]);return o}if(!Array.isArray(e))return o.push(e.toString()),o;for(u=0;u<e.length;u++)le(e[u],t,n,r,o);return o}function pe(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 he=function(e){return Object.assign(e,{isCss:!0})};function fe(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(ie(e)||se(e))return he(le(pe(h,n.__spreadArray([e],t,!0))));var o=e;return 0===t.length&&1===o.length&&"string"==typeof o[0]?le(o):he(le(pe(o,t)))}function de(e,t,r){if(void 0===r&&(r=f),!t)throw v(1,t);var o=function(o){for(var i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];return e(t,r,fe.apply(void 0,n.__spreadArray([o],i,!1)))};return o.attrs=function(o){return de(e,t,n.__assign(n.__assign({},r),{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o.withConfig=function(o){return de(e,t,n.__assign(n.__assign({},r),o))},o}var ye,ve=c.default.createContext(void 0),ge=ve.Consumer;function me(e,t,n){return void 0===n&&(n=f),e.theme!==n.theme&&e.theme||t||n.theme}var Se="function"==typeof Symbol&&Symbol.for,_e=Se?Symbol.for("react.memo"):60115,we=Se?Symbol.for("react.forward_ref"):60112,Ae={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},be={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Ce={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Ee=((ye={})[we]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ye[_e]=Ce,ye);function Pe(e){return("type"in(t=e)&&t.type.$$typeof)===_e?Ce:"$$typeof"in e?Ee[e.$$typeof]:Ae;var t}var Ne=Object.defineProperty,xe=Object.getOwnPropertyNames,Oe=Object.getOwnPropertySymbols,Te=Object.getOwnPropertyDescriptor,De=Object.getPrototypeOf,Re=Object.prototype;function je(e,t,n){if("string"!=typeof t){if(Re){var r=De(t);r&&r!==Re&&je(e,r,n)}var o=xe(t);Oe&&(o=o.concat(Oe(t)));for(var i=Pe(e),s=Pe(t),a=0;a<o.length;++a){var u=o[a];if(!(u in be||n&&n[u]||s&&u in s||i&&u in i)){var c=Te(t,u);try{Ne(e,u,c)}catch(e){}}}}return e}var Ie=/(a)(d)/gi,ze=function(e){return String.fromCharCode(e+(e>25?39:97))};function Be(e,t){return e.join(t||"")}var ke=["fit-content","min-content","max-content"],Ge={};function Le(e,t,n){if(void 0===n&&(n=!1),!n&&!se(e)&&!Array.isArray(e))return t;if(Array.isArray(t))for(var r=0;r<t.length;r++)e[r]=Le(e[r],t[r]);else if(se(t))for(var r in t)e[r]=Le(e[r],t[r]);return e}var Ve,Me,$e=require("react-native"),Fe=(Ve=$e.StyleSheet,Me=function(){function e(e){this.rules=e}return e.prototype.generateStyleObject=function(e){var n=Be(le(this.rules,e)),r=function(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(Ie,"$1-$2")}(W(5381,n)>>>0);if(!Ge[r]){var o=t.parse(n),i=[];o.each(function(e){if("decl"===e.type){if(ke.includes(e.value))return void("production"!==process.env.NODE_ENV&&console.warn('[styled-components/native] The value "'.concat(e.value,'" for property "').concat(e.prop,'" is not supported in React Native and will be ignored.')));i.push([e.prop,e.value])}else"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var s=u.default(i,["borderWidth","borderColor"]),a=Ve.create({generated:s});Ge[r]=a.generated}return Ge[r]},e}(),function(e,t,o){var i=ae(e),s=e,a=t.displayName,u=void 0===a?function(e){return function(e){return"string"==typeof e&&("production"===process.env.NODE_ENV||e.charAt(0)===e.charAt(0).toLowerCase())}(e)?"styled.".concat(e):"Styled(".concat(ne(e),")")}(e):a,l=t.attrs,p=void 0===l?h:l,d=i&&s.attrs?s.attrs.concat(p).filter(Boolean):p,y=t.shouldForwardProp;if(i&&s.shouldForwardProp){var v=s.shouldForwardProp;if(t.shouldForwardProp){var g=t.shouldForwardProp;y=function(e,t){return v(e,t)&&g(e,t)}}else y=v}var m=function(e,t){return function(e,t,o){var i=e.attrs,s=e.inlineStyle,a=e.defaultProps,u=e.shouldForwardProp,l=e.target,p=c.default.useContext?c.default.useContext(ve):void 0,h=function(e,t,r){void 0===e&&(e=f);var o=n.__assign(n.__assign({},t),{theme:e}),i={};return r.forEach(function(e){var t,n=ie(e)?e(o):e;for(t in n)o[t]=i[t]=n[t]}),[o,i]}(me(t,p,a)||f,t,i),d=h[1],y=s.generateStyleObject(h[0]),v=o,g=d.as||t.as||l,m=d!==t?n.__assign(n.__assign({},t),d):t,S={};for(var _ in m)"$"!==_[0]&&"as"!==_&&("forwardedAs"===_?S.as=m[_]:u&&!u(_,g)||(S[_]=m[_]));return S.style=c.default.useMemo?c.default.useMemo(function(){return ie(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y},[t.style,y]):ie(t.style)?function(e){return[y].concat(t.style(e))}:t.style?[y].concat(t.style):y,o&&(S.ref=v),r.createElement(g,S)}(S,e,t)};m.displayName=u;var S=c.default.forwardRef(m);return S.attrs=d,S.inlineStyle=new Me(i?s.inlineStyle.rules.concat(o):o),S.displayName=u,S.shouldForwardProp=y,S.styledComponentId=!0,S.target=i?s.target:e,Object.defineProperty(S,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?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++)Le(e,o[r],!0);return e}({},s.defaultProps,e):e}}),je(S,e,{attrs:!0,inlineStyle:!0,displayName:!0,shouldForwardProp:!0,target:!0}),S}),qe=function(e){return de(Fe,e)};["ActivityIndicator","Button","DatePickerIOS","DrawerLayoutAndroid","FlatList","Image","ImageBackground","KeyboardAvoidingView","Modal","Pressable","ProgressBarAndroid","ProgressViewIOS","RefreshControl","SafeAreaView","ScrollView","SectionList","Slider","Switch","Text","TextInput","TouchableHighlight","TouchableOpacity","View","VirtualizedList"].forEach(function(e){return Object.defineProperty(qe,e,{enumerable:!0,configurable:!1,get:function(){if(e in $e&&$e[e])return qe($e[e]);throw new Error("".concat(e," is not available in the currently-installed version of react-native"))}})}),exports.ThemeConsumer=ge,exports.ThemeContext=ve,exports.ThemeProvider=function(e){var t=c.default.useContext(ve),r=c.default.useMemo(function(){return function(e,t){if(!e)throw v(14);if(ie(e)){var r=e(t);if("production"!==process.env.NODE_ENV&&(null===r||Array.isArray(r)||"object"!=typeof r))throw v(7);return r}if(Array.isArray(e)||"object"!=typeof e)throw v(8);return t?n.__assign(n.__assign({},t),e):e}(e.theme,t)},[e.theme,t]);return e.children?c.default.createElement(ve.Provider,{value:r},e.children):null},exports.css=fe,exports.default=qe,exports.isStyledComponent=ae,exports.styled=qe,exports.toStyleSheet=function(e){var n=Be(le(e)),r=t.parse(n),o=[];r.each(function(e){"decl"===e.type?o.push([e.prop,e.value]):"production"!==process.env.NODE_ENV&&"comment"!==e.type&&console.warn("Node of type ".concat(e.type," not supported as an inline style"))});var i=u.default(o,["borderWidth","borderColor"]);return $e.StyleSheet.create({style:i}).style},exports.useTheme=function(){var e=c.default.useContext(ve);if(!e)throw v(18);return e},exports.withTheme=function(e){var t=c.default.forwardRef(function(t,r){var o=me(t,c.default.useContext(ve),e.defaultProps);return"production"!==process.env.NODE_ENV&&void 0===o&&console.warn('[withTheme] You are not using a ThemeProvider nor passing a theme prop or a theme in defaultProps in component class "'.concat(ne(e),'"')),c.default.createElement(e,n.__assign(n.__assign({},t),{theme:o,ref:r}))});return t.displayName="WithTheme(".concat(ne(e),")"),je(t,e)}; //# sourceMappingURL=styled-components.native.cjs.js.map