pretty-lights
Advanced tools
Comparing version 0.0.24 to 0.0.25
@@ -11,2 +11,3 @@ "use strict"; | ||
exports["default"] = _default; | ||
exports.hashRegistry = void 0; | ||
@@ -58,2 +59,5 @@ var _path = _interopRequireDefault(require("path")); | ||
// export type BabelPath = any; | ||
var hashRegistry = (0, _hashing.createHashRegistry)(); | ||
exports.hashRegistry = hashRegistry; | ||
function hoistPureArgs(path) { | ||
@@ -131,2 +135,3 @@ var args = path.get('arguments'); | ||
var registerSelector = hashRegistry.registerSelector; | ||
var filename = state.file.opts.filename; // normalize the file path to ignore folder structure | ||
@@ -155,3 +160,3 @@ // outside the current node project and arch-specific delimiters | ||
var stableClassName = (0, _hashing.registerSelector)("e".concat((0, _hashing.hashArray)(stuffToHash)).concat(positionInFile)); | ||
var stableClassName = registerSelector("e".concat((0, _hashing.hashArray)(stuffToHash)).concat(positionInFile)); | ||
return t.objectProperty(t.identifier('target'), t.stringLiteral(stableClassName)); | ||
@@ -158,0 +163,0 @@ } |
@@ -6,6 +6,6 @@ "use strict"; | ||
}); | ||
exports.getKnownInternalSelectors = getKnownInternalSelectors; | ||
exports.hashString = hashString; | ||
exports.registerSelector = registerSelector; | ||
exports.hashArray = hashArray; | ||
exports.createHashRegistry = createHashRegistry; | ||
exports["default"] = void 0; | ||
@@ -16,15 +16,2 @@ var _hash = _interopRequireDefault(require("@emotion/hash")); | ||
/* <in-memory registry of known hashes> | ||
This is important to ensure that the jest snapshot serialized knows | ||
all hashes ever created for any "stableClassName" of emotion styles as | ||
well as css and keyframe animation hash strings. That way it can | ||
replace them with deterministic strings, ensuring no test flakiness | ||
due to random-looking strings. | ||
*/ | ||
var internalSelectors = []; | ||
function getKnownInternalSelectors() { | ||
return internalSelectors; | ||
} | ||
function hashString(value) { | ||
@@ -34,13 +21,52 @@ return (0, _hash["default"])(value); | ||
function registerSelector(selector) { | ||
// stores all generated selectors so that Jest serializer knows exactly what to replace with deterministic selectors | ||
if (process.env.NODE_ENV !== 'production') { | ||
internalSelectors.push(selector); | ||
function hashArray(arr) { | ||
return hashString(arr.join('')); | ||
} | ||
function createHashRegistry() { | ||
/* <in-memory registry of known hashes> | ||
This is important to ensure that the jest snapshot serialized knows | ||
all hashes ever created for any "stableClassName" of emotion styles as | ||
well as css and keyframe animation hash strings. That way it can | ||
replace them with deterministic strings, ensuring no test flakiness | ||
due to random-looking strings. | ||
*/ | ||
var internalSelectors = new Set(); | ||
var internalHashes = new Set(); | ||
function getKnownInternalSelectors() { | ||
return Array.from(internalSelectors); | ||
} | ||
return selector; | ||
function getKnownInternalHashes() { | ||
return Array.from(internalHashes); | ||
} | ||
function registerSelector(selector) { | ||
// stores all generated selectors so that Jest serializer knows exactly what to replace with deterministic selectors | ||
if (selector) { | ||
internalSelectors.add(selector); | ||
} | ||
return selector; | ||
} | ||
function registerHash(hash) { | ||
// stores all generated hashes so that Jest serializer knows exactly what to replace with deterministic hashes | ||
if (hash && /\w{3,}/.test(hash)) { | ||
internalHashes.add(hash); | ||
} | ||
return hash; | ||
} | ||
return { | ||
registerHash: registerHash, | ||
registerSelector: registerSelector, | ||
getKnownInternalHashes: getKnownInternalHashes, | ||
getKnownInternalSelectors: getKnownInternalSelectors | ||
}; | ||
} | ||
function hashArray(arr) { | ||
return hashString(arr.join('')); | ||
} | ||
var _default = createHashRegistry; | ||
exports["default"] = _default; |
@@ -42,2 +42,3 @@ export const flush: () => void; | ||
export const Global: any; | ||
export const hashRegistry: any; | ||
export { ThemeContext, ThemeProvider, useTheme, withTheme, themeFn }; |
@@ -23,2 +23,4 @@ "use strict"; | ||
var _ = require(".."); | ||
var _matchers = require("./matchers"); | ||
@@ -118,3 +120,3 @@ | ||
var keys = (0, _utils.getKeys)(elements); | ||
return (0, _replaceClassNames.replaceClassNamesInFinalCode)(classNames, styles, printedVal, keys, classNameReplacer); | ||
return (0, _replaceClassNames.replaceClassNamesInFinalCode)(classNames, styles, printedVal, keys, classNameReplacer, _.hashRegistry); | ||
} | ||
@@ -121,0 +123,0 @@ |
@@ -9,4 +9,14 @@ "use strict"; | ||
var _hashing = require("../hashing"); | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | ||
function defaultClassNameReplacer(className, index) { | ||
@@ -24,5 +34,9 @@ return "lights-".concat(index); | ||
var classNameReplacer = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultClassNameReplacer; | ||
var internalHashes = (0, _hashing.getKnownInternalSelectors)(); | ||
var hashRegistry = arguments.length > 3 ? arguments[3] : undefined; | ||
var getKnownInternalSelectors = hashRegistry.getKnownInternalSelectors, | ||
getKnownInternalHashes = hashRegistry.getKnownInternalHashes; | ||
var internalHashes = [].concat(_toConsumableArray(getKnownInternalSelectors()), _toConsumableArray(getKnownInternalHashes())); | ||
return internalHashes.reduce(function (fixed, hashName) { | ||
var result = fixed.replace(new RegExp(escapeRegex(hashName), 'g'), classNameReplacer(hashName, index)); | ||
var deterministicName = classNameReplacer(hashName, index); | ||
var result = fixed.replace(new RegExp(escapeRegex(hashName), 'g'), deterministicName); | ||
index += 1; | ||
@@ -38,2 +52,3 @@ return result; | ||
var classNameReplacer = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : defaultClassNameReplacer; | ||
var hashRegistry = arguments.length > 5 ? arguments[5] : undefined; | ||
var index = 0; | ||
@@ -45,3 +60,4 @@ var keyPattern = new RegExp("^(".concat(keys.join('|'), ")-")); | ||
var escapedRegex = new RegExp(escapeRegex(className), 'g'); | ||
var returnVal = acc.replace(escapedRegex, classNameReplacer(className, index)); | ||
var deterministicName = classNameReplacer(className, index); | ||
var returnVal = acc.replace(escapedRegex, deterministicName); | ||
index += 1; | ||
@@ -53,5 +69,5 @@ return returnVal; | ||
}, "".concat(styles).concat(space).concat(code)); | ||
return cleanupRogueClassNames(replacedCode, index, classNameReplacer); | ||
return cleanupRogueClassNames(replacedCode, index, classNameReplacer, hashRegistry); | ||
}; | ||
exports.replaceClassNamesInFinalCode = replaceClassNamesInFinalCode; |
@@ -1,2 +0,2 @@ | ||
var e=require("@emotion/stylis"),t=require("@emotion/weak-memoize"),r=require("@emotion/unitless"),n=require("@emotion/memoize"),o=require("@emotion/hash"),i=require("react"),s=require("@emotion/is-prop-valid"),a=require("hoist-non-react-statics");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function l(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var u=c(e),p=c(t),d=c(r),f=c(n),h=c(o),m=c(i),v=l(i),y=c(s),g=c(a),b=function(){function e(e){this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);n.insertRule(e,o?0:n.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+e+'"',t)}}else r.appendChild(document.createTextNode(e));this.ctr+=1},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),_={current:null};function E(e){e&&_.current.insert(e+"}")}var N=function(e,t,r,n,o,i,s,a,c,l){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return _.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return _.current.insert(r[0]+t),"";default:return t+(0===l?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(E)}},w=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},x="undefined"!=typeof document,O=/\/\*\|\*\//g,k={},C=x?void 0:p.default(function(){var e=p.default(function(){return{}}),t={},r={};return function(n){return void 0===n||!0===n?t:!1===n?r:e(n)}});function S(e){return process,e}var P,j="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",A=/[A-Z]|^ms/g,D=/_EMO_([^_]+?)_([^]*?)_EMO_/g,T=function(e){return 45===e.charCodeAt(1)},V=function(e){return null!=e&&"boolean"!=typeof e},q=f.default(function(e){return T(e)?e:e.replace(A,"-$&").toLowerCase()}),R=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(D,function(e,t,r){return P={name:t,styles:r,next:P},t})}return 1===d.default[e]||T(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var z=/(attr|calc|counters?|url)\(/,I=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],G=R,L=/^-ms-/,M=/-(.)/g,Y={};R=function(e,t){"content"===e&&("string"!=typeof t||-1===I.indexOf(t)&&!z.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var r=G(e,t);return""===r||T(e)||-1===e.indexOf("-")||void 0!==Y[e]||(Y[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(L,"ms-").replace(M,function(e,t){return t.toUpperCase()})+"?")),r}}function U(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return P={name:r.name,styles:r.styles,next:P},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)P={name:i.name,styles:i.styles,next:P},i=i.next;var s=r.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(s+=r.map),s}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=U(e,t,r[o],!1);else for(var i in r){var s=r[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":V(s)&&(n+=q(i)+":"+R(i,s)+";");else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=U(e,t,s,!1);switch(i){case"animation":case"animationName":n+=q(i)+":"+a+";";break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error("You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."),n+=i+"{"+a+"}"}}else for(var c=0;c<s.length;c+=1)V(s[c])&&(n+=q(i)+":"+R(i,s[c])+";")}}return n}(e,t,r);case"function":if(void 0!==e){var a=P,c=r(e);return P=a,U(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var l=[],u=r.replace(D,function(e,t,r){var n="animation"+l.length;return l.push("const "+n+" = keyframes`"+r.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+n+"}"});l.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(l,["`"+u+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+u+"`")}}if(null==t)return r;var p=t[r];return!1===n&&void 0!==p?p:r}var F,$=/label:\s*([^\s;\n{]+)\s*;/g;function H(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";P=void 0;var i,s=e[0];null==s||void 0===s.raw?(n=!1,o+=U(r,t,s,!1)):("production"!==process.env.NODE_ENV&&void 0===s[0]&&console.error(j),o+=s[0]);for(var a=1;a<e.length;a+=1)o+=U(r,t,e[a],46===o.charCodeAt(o.length-1)),n&&("production"!==process.env.NODE_ENV&&void 0===s[a]&&console.error(j),o+=s[a]);"production"!==process.env.NODE_ENV&&(o=o.replace(F,function(e){return i=e,""})),$.lastIndex=0;for(var c,l="";null!==(c=$.exec(o));)l+="-"+c[1];return{name:h.default(o)+l,styles:o,map:i,next:P}}"production"!==process.env.NODE_ENV&&(F=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var W="undefined"!=typeof document;function B(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):r&&(n+=r+" ")}),n}var J=function(e,t){var r=S(e.key+"-"+t.name);if(void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var n="",o=t;do{var i=e.insert("."+r,o,e.sheet,!0);W||void 0===i||(n+=i),o=o.next}while(void 0!==o);if(!W&&0!==n.length)return n}};function Z(e,t,r){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0,r)}function K(e,t,r){var n=[],o=B(e,n,r);return n.length<2?r:o+t(n)}var Q=function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r};function X(){return(X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ee(e,t){return(ee=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var te=m.default.createContext({}),re="undefined"!=typeof document,ne=y.default,oe=function(e){return"theme"!==e&&"innerRef"!==e},ie=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?ne:oe},se=p.default(function(e){return p.default(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!=typeof r||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!=typeof t||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return X({},e,t)}(e,t)})}),ae=function(e){return v.createElement(te.Consumer,null,function(t){return e.theme!==t&&(t=se(t)(e.theme)),v.createElement(te.Provider,{value:t},e.children)})};function ce(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function le(e,t){return function(r){return ce(e,r,t)}}ae.displayName="ThemeProvider",le.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&ce(e,n,o)}};var ue=function(e,t){if(void 0!==e.__SECRET_LIGHTS__)return e.__SECRET_LIGHTS__;var r=function(e){void 0===e&&(e={});var t,r,n=e.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(n))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'+n+'" was passed');void 0!==e.prefix&&(r={prefix:e.prefix});var o,i,s=new u.default(r),a={};if(x){o=e.container||document.head;var c="data-lights-"+n,l=document.querySelectorAll("style["+c+"]");Array.prototype.forEach.call(l,function(e){(e.getAttribute(c)||"").split(" ").forEach(function(e){a[e]=!0}),e.parentNode!==o&&o.appendChild(e)})}if(x)s.use(e.stylisPlugins)(N),i=function(e,r,n,o,i){if(_.current=n,"production"!==process.env.NODE_ENV&&void 0!==r.map){var a=r.map;_.current={insert:function(e){n.insert(e+a)}}}if(void 0===t.inserted[r.name]){var c=s(e,r.styles);o&&(t.inserted[r.name]=c.replace(O,""),""===e&&i&&(t.global[r.name]=!0))}};else{s.use(w);var p=k;(e.stylisPlugins||void 0!==e.prefix)&&(s.use(e.stylisPlugins),p=C(e.stylisPlugins||k)(e.prefix)),i=function(e,r,n,o,i){if(void 0===t.inserted[r.name]){var a=function(e,t){var r=t.name;return void 0===p[r]&&(p[r]=s(e,t.styles)),p[r]}(e,r);if(!o)return a;t.inserted[r.name]=a,""===e&&i&&(t.global[r.name]=!0)}}}if("production"!==process.env.NODE_ENV){var d=/\/\*/g,f=/\*\//g;s.use(function(e,t){switch(e){default:break;case-1:for(;d.test(t);){if(f.lastIndex=d.lastIndex,!f.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');d.lastIndex=f.lastIndex}d.lastIndex=0}})}return t={key:n,sheet:new b({key:n,container:o,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:a,registered:{},global:{},insert:i}}(void 0);r.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},r.compat=!0;var n=function(){var e=H([].slice.call(arguments),r.registered),t=S(r.key+"-"+e.name);return J(r,e),t},o={css:n,cx:function(){return K(r.registered,n,Q([].slice.call(arguments)))},injectGlobal:function(){var e=H([].slice.call(arguments),r.registered);Z(r,e,!0)},keyframes:function(){var e=H([].slice.call(arguments),r.registered),t=S("animation-"+e.name);return Z(r,{name:e.name,styles:"@keyframes "+t+"{"+e.styles+"}"}),t},hydrate:function(e){e.forEach(function(e){r.inserted[e]=!0})},flush:function(){r.registered={},r.inserted={},r.global={},r.sheet.flush()},sheet:r.sheet,cache:r,getRegisteredStyles:B,merge:K.bind(null,r.registered,n)};return e.__SECRET_LIGHTS__=o,o}("undefined"!=typeof global?global:{}),pe=function(e){var t=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,ee(t,r);var o=n.prototype;return o.componentDidMount=function(){this.sheet=new b({key:this.props.cache.key+"-global",nonce:this.props.cache.sheet.nonce,container:this.props.cache.sheet.container});var e=document.querySelector("style[data-lights-"+this.props.cache.key+'="'+this.props.serialized.name+'"]');null!==e&&this.sheet.tags.push(e),this.props.cache.sheet.tags.length&&(this.sheet.before=this.props.cache.sheet.tags[0]),this.insertStyles()},o.componentDidUpdate=function(e){e.serialized.name!==this.props.serialized.name&&this.insertStyles()},o.insertStyles=function(){void 0!==this.props.serialized.next&&J(this.props.cache,this.props.serialized.next),this.sheet.tags.length&&(this.sheet.before=this.sheet.tags[this.sheet.tags.length-1].nextElementSibling,this.sheet.flush()),this.props.cache.insert("",this.props.serialized,this.sheet,!1)},o.componentWillUnmount=function(){this.sheet.flush()},o.render=function(){if(!re){for(var e,t=this.props.serialized,r=t.name,n=t.styles,o=t.next;void 0!==o;)r+=" "+o.name,n+=o.styles,o=o.next;this.props.cache.insert("",{name:r,styles:n},this.sheet,!0);var i=((e={})["data-global-"+this.props.cache.key]=r,e);return v.createElement("style",i)}return null},n}(v.Component);return t.displayName="InnerGlobal",function(r){var n=r.styles;if("function"==typeof n)return v.createElement(te.Consumer,null,function(r){var o=H([n(r)],e.cache.registered);return v.createElement(t,{serialized:o,cache:e.cache})});var o=H([n],e.cache.registered);return v.createElement(t,{serialized:o,cache:e.cache})}}(ue),de=function(e){return function t(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,i,s;void 0!==n&&(o=n.label,s=n.target,i=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var a=r.__lights_real===r,c=a&&r.__lights_base||r;"function"!=typeof i&&a&&(i=r.__lights_forwardProp);var l=i||ie(c),u=!l("as");return function(){var p=[].slice.call(arguments),d=a&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==o&&d.push("label:"+o+";"),null==p[0]||void 0===p[0].raw)d.push.apply(d,p);else{"production"!==process.env.NODE_ENV&&void 0===p[0][0]&&console.error(j),d.push(p[0][0]);for(var f=p.length,h=1;h<f;h+=1)"production"!==process.env.NODE_ENV&&void 0===p[0][h]&&console.error(j),d.push(p[h],p[0][h])}var m=function(t){return v.createElement(te.Consumer,null,function(r){var n=u&&t.as||c,o="",a=[],p=t;if(null==t.theme){for(var f in p={},t)p[f]=t[f];p.theme=r}"string"==typeof t.className?o=B(e.cache.registered,a,t.className):null!=t.className&&(o=t.className+" ");var h=H(d.concat(a),e.cache.registered,p);J(e.cache,h),o+=e.cache.key+"-"+h.name,void 0!==s&&(o+=" "+s);var m=u&&void 0===i?ie(n):l,y={};for(var g in t)u&&"as"===g||m(g)&&(y[g]=t[g]);return y.className=o,o.split(/\s+/g).forEach(function(e){-1===(""+t.className).indexOf(e)&&S(e)}),y.ref=t.innerRef,v.createElement(n,y)})};return m.displayName=void 0!==o?o:"Styled("+("string"==typeof c?c:c.displayName||c.name||"Component")+")",void 0!==r.defaultProps&&(m.defaultProps=r.defaultProps),m.__lights_styles=d,m.__lights_base=c,m.__lights_real=m,m.__lights_forwardProp=i,Object.defineProperty(m,"toString",{value:function(){return void 0===s&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":"."+s}}),m.withComponent=function(e,r){return t(e,void 0!==r?X({},n||{},r):n).apply(void 0,d)},m}}}(ue).bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){de[e]=de(e)});var fe=ue.flush,he=ue.hydrate,me=ue.cx,ve=ue.merge,ye=ue.getRegisteredStyles,ge=ue.injectGlobal,be=ue.keyframes,_e=ue.css,Ee=ue.sheet,Ne=ue.cache;exports.Global=pe,exports.ThemeContext=te,exports.ThemeProvider=ae,exports.cache=Ne,exports.css=_e,exports.cx=me,exports.flush=fe,exports.getRegisteredStyles=ye,exports.hydrate=he,exports.injectGlobal=ge,exports.keyframes=be,exports.merge=ve,exports.sheet=Ee,exports.styled=de,exports.themeFn=le,exports.useTheme=function(){return m.default.useContext(te)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=v.forwardRef(function(t,r){return v.createElement(te.Consumer,null,function(n){return v.createElement(e,X({theme:n,ref:r},t))})});return r.displayName="WithTheme("+t+")",g.default(r,e)}; | ||
var e=require("@emotion/stylis"),t=require("@emotion/weak-memoize"),r=require("@emotion/unitless"),n=require("@emotion/memoize"),o=require("@emotion/hash");require("path");var i=require("find-root");require("@emotion/babel-utils"),require("source-map"),require("convert-source-map");var s=require("react"),a=require("@emotion/is-prop-valid"),c=require("hoist-non-react-statics");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,t}var d=l(e),p=l(t),h=l(r),f=l(n),v=l(o),m=l(i),y=l(s),g=u(s),b=l(a),_=l(c),E=function(){function e(e){this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);n.insertRule(e,o?0:n.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+e+'"',t)}}else r.appendChild(document.createTextNode(e));this.ctr+=1},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),N={current:null};function w(e){e&&N.current.insert(e+"}")}var x,O=function(e,t,r,n,o,i,s,a,c,l){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return N.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return N.current.insert(r[0]+t),"";default:return t+(0===l?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(w)}},k=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},S="undefined"!=typeof document,C=/\/\*\|\*\//g,A={},P=S?void 0:p.default(function(){var e=p.default(function(){return{}}),t={},r={};return function(n){return void 0===n||!0===n?t:!1===n?r:e(n)}}),j="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",D=/[A-Z]|^ms/g,q=/_EMO_([^_]+?)_([^]*?)_EMO_/g,R=function(e){return 45===e.charCodeAt(1)},T=function(e){return null!=e&&"boolean"!=typeof e},V=f.default(function(e){return R(e)?e:e.replace(D,"-$&").toLowerCase()}),I=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(q,function(e,t,r){return x={name:t,styles:r,next:x},t})}return 1===h.default[e]||R(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var z=/(attr|calc|counters?|url)\(/,G=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],L=I,M=/^-ms-/,Y=/-(.)/g,H={};I=function(e,t){"content"===e&&("string"!=typeof t||-1===G.indexOf(t)&&!z.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var r=L(e,t);return""===r||R(e)||-1===e.indexOf("-")||void 0!==H[e]||(H[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(M,"ms-").replace(Y,function(e,t){return t.toUpperCase()})+"?")),r}}function U(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return x={name:r.name,styles:r.styles,next:x},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)x={name:i.name,styles:i.styles,next:x},i=i.next;var s=r.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(s+=r.map),s}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=U(e,t,r[o],!1);else for(var i in r){var s=r[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":T(s)&&(n+=V(i)+":"+I(i,s)+";");else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=U(e,t,s,!1);switch(i){case"animation":case"animationName":n+=V(i)+":"+a+";";break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error("You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."),n+=i+"{"+a+"}"}}else for(var c=0;c<s.length;c+=1)T(s[c])&&(n+=V(i)+":"+I(i,s[c])+";")}}return n}(e,t,r);case"function":if(void 0!==e){var a=x,c=r(e);return x=a,U(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var l=[],u=r.replace(q,function(e,t,r){var n="animation"+l.length;return l.push("const "+n+" = keyframes`"+r.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+n+"}"});l.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(l,["`"+u+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+u+"`")}}if(null==t)return r;var d=t[r];return!1===n&&void 0!==d?d:r}var F,$=/label:\s*([^\s;\n{]+)\s*;/g;function W(e,t,r,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var o=n.registerHash,i=!0,s="";x=void 0;var a,c=e[0];null==c||void 0===c.raw?(i=!1,s+=U(r,t,c,!1)):("production"!==process.env.NODE_ENV&&void 0===c[0]&&console.error(j),s+=c[0]);for(var l=1;l<e.length;l+=1)s+=U(r,t,e[l],46===s.charCodeAt(s.length-1)),i&&("production"!==process.env.NODE_ENV&&void 0===c[l]&&console.error(j),s+=c[l]);"production"!==process.env.NODE_ENV&&(s=s.replace(F,function(e){return a=e,""})),$.lastIndex=0;for(var u,d="";null!==(u=$.exec(s));)d+="-"+u[1];var p=v.default(s)+d;return o(p),{name:p,styles:s,map:a,next:x}}"production"!==process.env.NODE_ENV&&(F=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var B="undefined"!=typeof document;function J(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):r&&(n+=r+" ")}),n}var K=function(e,t,r){var n=(0,r.registerSelector)(e.key+"-"+t.name);if(void 0===e.registered[n]&&(e.registered[n]=t.styles),void 0===e.inserted[t.name]){var o="",i=t;do{var s=e.insert("."+n,i,e.sheet,!0);B||void 0===s||(o+=s),i=i.next}while(void 0!==i);if(!B&&0!==o.length)return o}};function Z(){return(Z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Q(e,t){return(Q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var X,ee,te=(X=new Set,ee=new Set,{registerHash:function(e){return e&&/\w{3,}/.test(e)&&ee.add(e),e},registerSelector:function(e){return e&&X.add(e),e},getKnownInternalHashes:function(){return Array.from(ee)},getKnownInternalSelectors:function(){return Array.from(X)}});function re(e,t,r){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0,r)}function ne(e,t,r){var n=[],o=J(e,n,r);return n.length<2?r:o+t(n)}require,f.default(function(e){return m.default(e)});var oe=function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r},ie=y.default.createContext({}),se="undefined"!=typeof document,ae=b.default,ce=function(e){return"theme"!==e&&"innerRef"!==e},le=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?ae:ce},ue=p.default(function(e){return p.default(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!=typeof r||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!=typeof t||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return Z({},e,t)}(e,t)})}),de=function(e){return g.createElement(ie.Consumer,null,function(t){return e.theme!==t&&(t=ue(t)(e.theme)),g.createElement(ie.Provider,{value:t},e.children)})};function pe(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function he(e,t){return function(r){return pe(e,r,t)}}de.displayName="ThemeProvider",he.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&pe(e,n,o)}};var fe=function(e,t){if(void 0!==e.__SECRET_LIGHTS__)return e.__SECRET_LIGHTS__;var r=function(e){void 0===e&&(e={});var t,r,n=e.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(n))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'+n+'" was passed');void 0!==e.prefix&&(r={prefix:e.prefix});var o,i,s=new d.default(r),a={};if(S){o=e.container||document.head;var c="data-lights-"+n,l=document.querySelectorAll("style["+c+"]");Array.prototype.forEach.call(l,function(e){(e.getAttribute(c)||"").split(" ").forEach(function(e){a[e]=!0}),e.parentNode!==o&&o.appendChild(e)})}if(S)s.use(e.stylisPlugins)(O),i=function(e,r,n,o,i){if(N.current=n,"production"!==process.env.NODE_ENV&&void 0!==r.map){var a=r.map;N.current={insert:function(e){n.insert(e+a)}}}if(void 0===t.inserted[r.name]){var c=s(e,r.styles);o&&(t.inserted[r.name]=c.replace(C,""),""===e&&i&&(t.global[r.name]=!0))}};else{s.use(k);var u=A;(e.stylisPlugins||void 0!==e.prefix)&&(s.use(e.stylisPlugins),u=P(e.stylisPlugins||A)(e.prefix)),i=function(e,r,n,o,i){if(void 0===t.inserted[r.name]){var a=function(e,t){var r=t.name;return void 0===u[r]&&(u[r]=s(e,t.styles)),u[r]}(e,r);if(!o)return a;t.inserted[r.name]=a,""===e&&i&&(t.global[r.name]=!0)}}}if("production"!==process.env.NODE_ENV){var p=/\/\*/g,h=/\*\//g;s.use(function(e,t){switch(e){default:break;case-1:for(;p.test(t);){if(h.lastIndex=p.lastIndex,!h.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');p.lastIndex=h.lastIndex}p.lastIndex=0}})}return t={key:n,sheet:new E({key:n,container:o,nonce:e.nonce,speedy:e.speedy}),nonce:e.nonce,inserted:a,registered:{},global:{},insert:i}}(void 0),n=te.registerSelector;r.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},r.compat=!0;var o=function(){var e=W([].slice.call(arguments),r.registered,void 0,te),t=n(r.key+"-"+e.name);return K(r,e,te),t},i={css:o,cx:function(){return ne(r.registered,o,oe([].slice.call(arguments)))},injectGlobal:function(){var e=W([].slice.call(arguments),r.registered,void 0,te);re(r,e,!0)},keyframes:function(){var e=W([].slice.call(arguments),r.registered,void 0,te),t=n("animation-"+e.name);return re(r,{name:e.name,styles:"@keyframes "+t+"{"+e.styles+"}"}),t},hashRegistry:te,hydrate:function(e){e.forEach(function(e){r.inserted[e]=!0})},flush:function(){r.registered={},r.inserted={},r.global={},r.sheet.flush()},sheet:r.sheet,cache:r,getRegisteredStyles:J,merge:ne.bind(null,r.registered,o)};return e.__SECRET_LIGHTS__=i,i}("undefined"!=typeof global?global:{}),ve=function(e){var t=e.hashRegistry,r=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Q(t,r);var o=n.prototype;return o.componentDidMount=function(){this.sheet=new E({key:this.props.cache.key+"-global",nonce:this.props.cache.sheet.nonce,container:this.props.cache.sheet.container});var e=document.querySelector("style[data-lights-"+this.props.cache.key+'="'+this.props.serialized.name+'"]');null!==e&&this.sheet.tags.push(e),this.props.cache.sheet.tags.length&&(this.sheet.before=this.props.cache.sheet.tags[0]),this.insertStyles()},o.componentDidUpdate=function(e){e.serialized.name!==this.props.serialized.name&&this.insertStyles()},o.insertStyles=function(){void 0!==this.props.serialized.next&&K(this.props.cache,this.props.serialized.next,this.props.hashRegistry),this.sheet.tags.length&&(this.sheet.before=this.sheet.tags[this.sheet.tags.length-1].nextElementSibling,this.sheet.flush()),this.props.cache.insert("",this.props.serialized,this.sheet,!1)},o.componentWillUnmount=function(){this.sheet.flush()},o.render=function(){if(!se){for(var e,t=this.props.serialized,r=t.name,n=t.styles,o=t.next;void 0!==o;)r+=" "+o.name,n+=o.styles,o=o.next;this.props.cache.insert("",{name:r,styles:n},this.sheet,!0);var i=((e={})["data-global-"+this.props.cache.key]=r,e);return g.createElement("style",i)}return null},n}(g.Component);return r.displayName="InnerGlobal",function(n){var o=n.styles;if("function"==typeof o)return g.createElement(ie.Consumer,null,function(n){var i=W([o(n)],e.cache.registered,void 0,t);return g.createElement(r,{serialized:i,cache:e.cache,hashRegistry:t})});var i=W([o],e.cache.registered,void 0,t);return g.createElement(r,{serialized:i,cache:e.cache,hashRegistry:t})}}(fe),me=function(e){var t=e.hashRegistry,r=t.registerSelector;return function n(o,i){if("production"!==process.env.NODE_ENV&&void 0===o)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var s,a,c;void 0!==i&&(s=i.label,c=r(i.target),a=o.__lights_forwardProp&&i.shouldForwardProp?function(e){return o.__lights_forwardProp(e)&&i.shouldForwardProp(e)}:i.shouldForwardProp);var l=o.__lights_real===o,u=l&&o.__lights_base||o;"function"!=typeof a&&l&&(a=o.__lights_forwardProp);var d=a||le(u),p=!d("as");return function(){var h=[].slice.call(arguments),f=l&&void 0!==o.__lights_styles?o.__lights_styles.slice(0):[];if(void 0!==s&&f.push("label:"+s+";"),null==h[0]||void 0===h[0].raw)f.push.apply(f,h);else{"production"!==process.env.NODE_ENV&&void 0===h[0][0]&&console.error(j),f.push(h[0][0]);for(var v=h.length,m=1;m<v;m+=1)"production"!==process.env.NODE_ENV&&void 0===h[0][m]&&console.error(j),f.push(h[m],h[0][m])}var y=function(n){return g.createElement(ie.Consumer,null,function(o){var i=p&&n.as||u,s="",l=[],h=n;if(null==n.theme){for(var v in h={},n)h[v]=n[v];h.theme=o}"string"==typeof n.className?s=J(e.cache.registered,l,n.className):null!=n.className&&(s=n.className+" ");var m=W(f.concat(l),e.cache.registered,h,t);K(e.cache,m,t),s+=e.cache.key+"-"+m.name,void 0!==c&&(s+=" "+c);var y=p&&void 0===a?le(i):d,b={};for(var _ in n)p&&"as"===_||y(_)&&(b[_]=n[_]);return b.className=s,s.split(/\s+/g).forEach(function(e){-1===(""+n.className).indexOf(e)&&r(e)}),b.ref=n.innerRef,g.createElement(i,b)})};return y.displayName=void 0!==s?s:"Styled("+("string"==typeof u?u:u.displayName||u.name||"Component")+")",void 0!==o.defaultProps&&(y.defaultProps=o.defaultProps),y.__lights_styles=f,y.__lights_base=u,y.__lights_real=y,y.__lights_forwardProp=a,Object.defineProperty(y,"toString",{value:function(){return void 0===c&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":"."+c}}),y.withComponent=function(e,t){return n(e,void 0!==t?Z({},i||{},t):i).apply(void 0,f)},y}}}(fe).bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){me[e]=me(e)});var ye=fe.flush,ge=fe.hydrate,be=fe.cx,_e=fe.merge,Ee=fe.getRegisteredStyles,Ne=fe.injectGlobal,we=fe.keyframes,xe=fe.css,Oe=fe.sheet,ke=fe.cache,Se=fe.hashRegistry;exports.Global=ve,exports.ThemeContext=ie,exports.ThemeProvider=de,exports.cache=ke,exports.css=xe,exports.cx=be,exports.flush=ye,exports.getRegisteredStyles=Ee,exports.hashRegistry=Se,exports.hydrate=ge,exports.injectGlobal=Ne,exports.keyframes=we,exports.merge=_e,exports.sheet=Oe,exports.styled=me,exports.themeFn=he,exports.useTheme=function(){return y.default.useContext(ie)},exports.withTheme=function(e){var t=e.displayName||e.name||"Component",r=g.forwardRef(function(t,r){return g.createElement(ie.Consumer,null,function(n){return g.createElement(e,Z({theme:n,ref:r},t))})});return r.displayName="WithTheme("+t+")",_.default(r,e)}; | ||
//# sourceMappingURL=pretty-lights.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"@emotion/stylis";import t from"@emotion/weak-memoize";import r from"@emotion/unitless";import n from"@emotion/memoize";import o from"@emotion/hash";import*as i from"react";import s from"react";import a from"@emotion/is-prop-valid";import c from"hoist-non-react-statics";var l=function(){function e(e){this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);n.insertRule(e,o?0:n.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+e+'"',t)}}else r.appendChild(document.createTextNode(e));this.ctr+=1},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),u={current:null};function p(e){e&&u.current.insert(e+"}")}var d=function(e,t,r,n,o,i,s,a,c,l){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return u.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return u.current.insert(r[0]+t),"";default:return t+(0===l?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(p)}},h=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},f="undefined"!=typeof document,m=/\/\*\|\*\//g,v={},y=f?void 0:t(function(){var e=t(function(){return{}}),r={},n={};return function(t){return void 0===t||!0===t?r:!1===t?n:e(t)}});function g(e){return process,e}var b,_="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",E=/[A-Z]|^ms/g,N=/_EMO_([^_]+?)_([^]*?)_EMO_/g,w=function(e){return 45===e.charCodeAt(1)},O=function(e){return null!=e&&"boolean"!=typeof e},k=n(function(e){return w(e)?e:e.replace(E,"-$&").toLowerCase()}),x=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(N,function(e,t,r){return b={name:t,styles:r,next:b},t})}return 1===r[e]||w(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var C=/(attr|calc|counters?|url)\(/,S=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],A=x,P=/^-ms-/,D=/-(.)/g,j={};x=function(e,t){"content"===e&&("string"!=typeof t||-1===S.indexOf(t)&&!C.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var r=A(e,t);return""===r||w(e)||-1===e.indexOf("-")||void 0!==j[e]||(j[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(P,"ms-").replace(D,function(e,t){return t.toUpperCase()})+"?")),r}}function V(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return b={name:r.name,styles:r.styles,next:b},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)b={name:i.name,styles:i.styles,next:b},i=i.next;var s=r.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(s+=r.map),s}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=V(e,t,r[o],!1);else for(var i in r){var s=r[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":O(s)&&(n+=k(i)+":"+x(i,s)+";");else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=V(e,t,s,!1);switch(i){case"animation":case"animationName":n+=k(i)+":"+a+";";break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error("You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."),n+=i+"{"+a+"}"}}else for(var c=0;c<s.length;c+=1)O(s[c])&&(n+=k(i)+":"+x(i,s[c])+";")}}return n}(e,t,r);case"function":if(void 0!==e){var a=b,c=r(e);return b=a,V(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var l=[],u=r.replace(N,function(e,t,r){var n="animation"+l.length;return l.push("const "+n+" = keyframes`"+r.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+n+"}"});l.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(l,["`"+u+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+u+"`")}}if(null==t)return r;var p=t[r];return!1===n&&void 0!==p?p:r}var T,R=/label:\s*([^\s;\n{]+)\s*;/g;function z(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";b=void 0;var s,a=e[0];null==a||void 0===a.raw?(n=!1,i+=V(r,t,a,!1)):("production"!==process.env.NODE_ENV&&void 0===a[0]&&console.error(_),i+=a[0]);for(var c=1;c<e.length;c+=1)i+=V(r,t,e[c],46===i.charCodeAt(i.length-1)),n&&("production"!==process.env.NODE_ENV&&void 0===a[c]&&console.error(_),i+=a[c]);"production"!==process.env.NODE_ENV&&(i=i.replace(T,function(e){return s=e,""})),R.lastIndex=0;for(var l,u="";null!==(l=R.exec(i));)u+="-"+l[1];return{name:o(i)+u,styles:i,map:s,next:b}}"production"!==process.env.NODE_ENV&&(T=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var I="undefined"!=typeof document;function q(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):r&&(n+=r+" ")}),n}var L=function(e,t){var r=g(e.key+"-"+t.name);if(void 0===e.registered[r]&&(e.registered[r]=t.styles),void 0===e.inserted[t.name]){var n="",o=t;do{var i=e.insert("."+r,o,e.sheet,!0);I||void 0===i||(n+=i),o=o.next}while(void 0!==o);if(!I&&0!==n.length)return n}};function G(e,t,r){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0,r)}function Y(e,t,r){var n=[],o=q(e,n,r);return n.length<2?r:o+t(n)}var M=function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r};function U(){return(U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function F(e,t){return(F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var $=s.createContext({}),H="undefined"!=typeof document,W=a,B=function(e){return"theme"!==e&&"innerRef"!==e},J=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?W:B},Z=t(function(e){return t(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!=typeof r||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!=typeof t||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return U({},e,t)}(e,t)})}),K=function(e){return i.createElement($.Consumer,null,function(t){return e.theme!==t&&(t=Z(t)(e.theme)),i.createElement($.Provider,{value:t},e.children)})};function Q(e){var t=e.displayName||e.name||"Component",r=i.forwardRef(function(t,r){return i.createElement($.Consumer,null,function(n){return i.createElement(e,U({theme:n,ref:r},t))})});return r.displayName="WithTheme("+t+")",c(r,e)}function X(){return s.useContext($)}function ee(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function te(e,t){return function(r){return ee(e,r,t)}}K.displayName="ThemeProvider",te.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&ee(e,n,o)}};var re=function(t,r){if(void 0!==t.__SECRET_LIGHTS__)return t.__SECRET_LIGHTS__;var n=function(t){void 0===t&&(t={});var r,n,o=t.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'+o+'" was passed');void 0!==t.prefix&&(n={prefix:t.prefix});var i,s,a=new e(n),c={};if(f){i=t.container||document.head;var p="data-lights-"+o,g=document.querySelectorAll("style["+p+"]");Array.prototype.forEach.call(g,function(e){(e.getAttribute(p)||"").split(" ").forEach(function(e){c[e]=!0}),e.parentNode!==i&&i.appendChild(e)})}if(f)a.use(t.stylisPlugins)(d),s=function(e,t,n,o,i){if(u.current=n,"production"!==process.env.NODE_ENV&&void 0!==t.map){var s=t.map;u.current={insert:function(e){n.insert(e+s)}}}if(void 0===r.inserted[t.name]){var c=a(e,t.styles);o&&(r.inserted[t.name]=c.replace(m,""),""===e&&i&&(r.global[t.name]=!0))}};else{a.use(h);var b=v;(t.stylisPlugins||void 0!==t.prefix)&&(a.use(t.stylisPlugins),b=y(t.stylisPlugins||v)(t.prefix)),s=function(e,t,n,o,i){if(void 0===r.inserted[t.name]){var s=function(e,t){var r=t.name;return void 0===b[r]&&(b[r]=a(e,t.styles)),b[r]}(e,t);if(!o)return s;r.inserted[t.name]=s,""===e&&i&&(r.global[t.name]=!0)}}}if("production"!==process.env.NODE_ENV){var _=/\/\*/g,E=/\*\//g;a.use(function(e,t){switch(e){default:break;case-1:for(;_.test(t);){if(E.lastIndex=_.lastIndex,!E.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');_.lastIndex=E.lastIndex}_.lastIndex=0}})}return r={key:o,sheet:new l({key:o,container:i,nonce:t.nonce,speedy:t.speedy}),nonce:t.nonce,inserted:c,registered:{},global:{},insert:s}}(void 0);n.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},n.compat=!0;var o=function(){var e=z([].slice.call(arguments),n.registered),t=g(n.key+"-"+e.name);return L(n,e),t},i={css:o,cx:function(){return Y(n.registered,o,M([].slice.call(arguments)))},injectGlobal:function(){var e=z([].slice.call(arguments),n.registered);G(n,e,!0)},keyframes:function(){var e=z([].slice.call(arguments),n.registered),t=g("animation-"+e.name);return G(n,{name:e.name,styles:"@keyframes "+t+"{"+e.styles+"}"}),t},hydrate:function(e){e.forEach(function(e){n.inserted[e]=!0})},flush:function(){n.registered={},n.inserted={},n.global={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:q,merge:Y.bind(null,n.registered,o)};return t.__SECRET_LIGHTS__=i,i}("undefined"!=typeof global?global:{}),ne=function(e){var t=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,F(t,r);var o=n.prototype;return o.componentDidMount=function(){this.sheet=new l({key:this.props.cache.key+"-global",nonce:this.props.cache.sheet.nonce,container:this.props.cache.sheet.container});var e=document.querySelector("style[data-lights-"+this.props.cache.key+'="'+this.props.serialized.name+'"]');null!==e&&this.sheet.tags.push(e),this.props.cache.sheet.tags.length&&(this.sheet.before=this.props.cache.sheet.tags[0]),this.insertStyles()},o.componentDidUpdate=function(e){e.serialized.name!==this.props.serialized.name&&this.insertStyles()},o.insertStyles=function(){void 0!==this.props.serialized.next&&L(this.props.cache,this.props.serialized.next),this.sheet.tags.length&&(this.sheet.before=this.sheet.tags[this.sheet.tags.length-1].nextElementSibling,this.sheet.flush()),this.props.cache.insert("",this.props.serialized,this.sheet,!1)},o.componentWillUnmount=function(){this.sheet.flush()},o.render=function(){if(!H){for(var e,t=this.props.serialized,r=t.name,n=t.styles,o=t.next;void 0!==o;)r+=" "+o.name,n+=o.styles,o=o.next;this.props.cache.insert("",{name:r,styles:n},this.sheet,!0);var s=((e={})["data-global-"+this.props.cache.key]=r,e);return i.createElement("style",s)}return null},n}(i.Component);return t.displayName="InnerGlobal",function(r){var n=r.styles;if("function"==typeof n)return i.createElement($.Consumer,null,function(r){var o=z([n(r)],e.cache.registered);return i.createElement(t,{serialized:o,cache:e.cache})});var o=z([n],e.cache.registered);return i.createElement(t,{serialized:o,cache:e.cache})}}(re),oe=function(e){return function t(r,n){if("production"!==process.env.NODE_ENV&&void 0===r)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var o,s,a;void 0!==n&&(o=n.label,a=n.target,s=r.__lights_forwardProp&&n.shouldForwardProp?function(e){return r.__lights_forwardProp(e)&&n.shouldForwardProp(e)}:n.shouldForwardProp);var c=r.__lights_real===r,l=c&&r.__lights_base||r;"function"!=typeof s&&c&&(s=r.__lights_forwardProp);var u=s||J(l),p=!u("as");return function(){var d=[].slice.call(arguments),h=c&&void 0!==r.__lights_styles?r.__lights_styles.slice(0):[];if(void 0!==o&&h.push("label:"+o+";"),null==d[0]||void 0===d[0].raw)h.push.apply(h,d);else{"production"!==process.env.NODE_ENV&&void 0===d[0][0]&&console.error(_),h.push(d[0][0]);for(var f=d.length,m=1;m<f;m+=1)"production"!==process.env.NODE_ENV&&void 0===d[0][m]&&console.error(_),h.push(d[m],d[0][m])}var v=function(t){return i.createElement($.Consumer,null,function(r){var n=p&&t.as||l,o="",c=[],d=t;if(null==t.theme){for(var f in d={},t)d[f]=t[f];d.theme=r}"string"==typeof t.className?o=q(e.cache.registered,c,t.className):null!=t.className&&(o=t.className+" ");var m=z(h.concat(c),e.cache.registered,d);L(e.cache,m),o+=e.cache.key+"-"+m.name,void 0!==a&&(o+=" "+a);var v=p&&void 0===s?J(n):u,y={};for(var b in t)p&&"as"===b||v(b)&&(y[b]=t[b]);return y.className=o,o.split(/\s+/g).forEach(function(e){-1===(""+t.className).indexOf(e)&&g(e)}),y.ref=t.innerRef,i.createElement(n,y)})};return v.displayName=void 0!==o?o:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",void 0!==r.defaultProps&&(v.defaultProps=r.defaultProps),v.__lights_styles=h,v.__lights_base=l,v.__lights_real=v,v.__lights_forwardProp=s,Object.defineProperty(v,"toString",{value:function(){return void 0===a&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":"."+a}}),v.withComponent=function(e,r){return t(e,void 0!==r?U({},n||{},r):n).apply(void 0,h)},v}}}(re).bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){oe[e]=oe(e)});var ie=re.flush,se=re.hydrate,ae=re.cx,ce=re.merge,le=re.getRegisteredStyles,ue=re.injectGlobal,pe=re.keyframes,de=re.css,he=re.sheet,fe=re.cache;export{ne as Global,$ as ThemeContext,K as ThemeProvider,fe as cache,de as css,ae as cx,ie as flush,le as getRegisteredStyles,se as hydrate,ue as injectGlobal,pe as keyframes,ce as merge,he as sheet,oe as styled,te as themeFn,X as useTheme,Q as withTheme}; | ||
import e from"@emotion/stylis";import t from"@emotion/weak-memoize";import r from"@emotion/unitless";import n from"@emotion/memoize";import o from"@emotion/hash";import"path";import i from"find-root";import"@emotion/babel-utils";import"source-map";import"convert-source-map";import*as s from"react";import a from"react";import c from"@emotion/is-prop-valid";import l from"hoist-non-react-statics";var u=function(){function e(e){this.isSpeedy=void 0===e.speedy?"production"===process.env.NODE_ENV:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)==0){var t=function(e){var t=document.createElement("style");return t.setAttribute("data-lights",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);this.container.insertBefore(t,0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling),this.tags.push(t)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t+=1)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{var o=105===e.charCodeAt(1)&&64===e.charCodeAt(0);n.insertRule(e,o?0:n.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn('There was a problem inserting the following rule: "'+e+'"',t)}}else r.appendChild(document.createTextNode(e));this.ctr+=1},t.flush=function(){this.tags.forEach(function(e){return e.parentNode.removeChild(e)}),this.tags=[],this.ctr=0},e}(),p={current:null};function d(e){e&&p.current.insert(e+"}")}var h,f=function(e,t,r,n,o,i,s,a,c,l){switch(e){default:break;case 1:switch(t.charCodeAt(0)){default:break;case 64:return p.current.insert(t+";"),"";case 108:if(98===t.charCodeAt(2))return""}break;case 2:if(0===a)return t+"/*|*/";break;case 3:switch(a){case 102:case 112:return p.current.insert(r[0]+t),"";default:return t+(0===l?"/*|*/":"")}case-2:t.split("/*|*/}").forEach(d)}},m=function(e,t){if(1===e&&108===t.charCodeAt(0)&&98===t.charCodeAt(2))return""},v="undefined"!=typeof document,y=/\/\*\|\*\//g,g={},b=v?void 0:t(function(){var e=t(function(){return{}}),r={},n={};return function(t){return void 0===t||!0===t?r:!1===t?n:e(t)}}),_="You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences",E=/[A-Z]|^ms/g,N=/_EMO_([^_]+?)_([^]*?)_EMO_/g,w=function(e){return 45===e.charCodeAt(1)},O=function(e){return null!=e&&"boolean"!=typeof e},k=n(function(e){return w(e)?e:e.replace(E,"-$&").toLowerCase()}),S=function(e,t){switch(e){default:break;case"animation":case"animationName":if("string"==typeof t)return t.replace(N,function(e,t,r){return h={name:t,styles:r,next:h},t})}return 1===r[e]||w(e)||"number"!=typeof t||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var x=/(attr|calc|counters?|url)\(/,C=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],A=S,P=/^-ms-/,D=/-(.)/g,j={};S=function(e,t){"content"===e&&("string"!=typeof t||-1===C.indexOf(t)&&!x.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`");var r=A(e,t);return""===r||w(e)||-1===e.indexOf("-")||void 0!==j[e]||(j[e]=!0,console.error("Using kebab-case for css properties in objects is not supported. Did you mean "+e.replace(P,"ms-").replace(D,function(e,t){return t.toUpperCase()})+"?")),r}}function V(e,t,r,n){if(null==r)return"";if(void 0!==r.__lights_styles){var o=r.toString();if("NO_COMPONENT_SELECTOR"===o&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");return o}switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return h={name:r.name,styles:r.styles,next:h},r.name;if(void 0!==r.styles){var i=r.next;if(void 0!==i)for(;void 0!==i;)h={name:i.name,styles:i.styles,next:h},i=i.next;var s=r.styles+";";return"production"!==process.env.NODE_ENV&&void 0!==r.map&&(s+=r.map),s}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o+=1)n+=V(e,t,r[o],!1);else for(var i in r){var s=r[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?n+=i+"{"+t[s]+"}":O(s)&&(n+=k(i)+":"+S(i,s)+";");else{if("NO_COMPONENT_SELECTOR"===i&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with pretty-lights/babel.");if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=V(e,t,s,!1);switch(i){case"animation":case"animationName":n+=k(i)+":"+a+";";break;default:"production"!==process.env.NODE_ENV&&"undefined"===i&&console.error("You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."),n+=i+"{"+a+"}"}}else for(var c=0;c<s.length;c+=1)O(s[c])&&(n+=k(i)+":"+S(i,s[c])+";")}}return n}(e,t,r);case"function":if(void 0!==e){var a=h,c=r(e);return h=a,V(e,t,c,n)}"production"!==process.env.NODE_ENV&&console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");break;case"string":if("production"!==process.env.NODE_ENV){var l=[],u=r.replace(N,function(e,t,r){var n="animation"+l.length;return l.push("const "+n+" = keyframes`"+r.replace(/^@keyframes animation-\w+/,"")+"`"),"${"+n+"}"});l.length&&console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n"+[].concat(l,["`"+u+"`"]).join("\n")+"\n\nYou should wrap it with `css` like this:\n\ncss`"+u+"`")}}if(null==t)return r;var p=t[r];return!1===n&&void 0!==p?p:r}var R,T=/label:\s*([^\s;\n{]+)\s*;/g;function I(e,t,r,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var i=n.registerHash,s=!0,a="";h=void 0;var c,l=e[0];null==l||void 0===l.raw?(s=!1,a+=V(r,t,l,!1)):("production"!==process.env.NODE_ENV&&void 0===l[0]&&console.error(_),a+=l[0]);for(var u=1;u<e.length;u+=1)a+=V(r,t,e[u],46===a.charCodeAt(a.length-1)),s&&("production"!==process.env.NODE_ENV&&void 0===l[u]&&console.error(_),a+=l[u]);"production"!==process.env.NODE_ENV&&(a=a.replace(R,function(e){return c=e,""})),T.lastIndex=0;for(var p,d="";null!==(p=T.exec(a));)d+="-"+p[1];var f=o(a)+d;return i(f),{name:f,styles:a,map:c,next:h}}"production"!==process.env.NODE_ENV&&(R=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//);var q="undefined"!=typeof document;function z(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]):r&&(n+=r+" ")}),n}var L=function(e,t,r){var n=(0,r.registerSelector)(e.key+"-"+t.name);if(void 0===e.registered[n]&&(e.registered[n]=t.styles),void 0===e.inserted[t.name]){var o="",i=t;do{var s=e.insert("."+n,i,e.sheet,!0);q||void 0===s||(o+=s),i=i.next}while(void 0!==i);if(!q&&0!==o.length)return o}};function G(){return(G=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function Y(e,t){return(Y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var M,H,U=(M=new Set,H=new Set,{registerHash:function(e){return e&&/\w{3,}/.test(e)&&H.add(e),e},registerSelector:function(e){return e&&M.add(e),e},getKnownInternalHashes:function(){return Array.from(H)},getKnownInternalSelectors:function(){return Array.from(M)}});function F(e,t,r){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0,r)}function $(e,t,r){var n=[],o=z(e,n,r);return n.length<2?r:o+t(n)}require,n(function(e){return i(e)});var W=function e(t){for(var r="",n=0;n<t.length;n+=1){var o=t[n];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(r&&(r+=" "),r+=i)}}return r},B=a.createContext({}),J="undefined"!=typeof document,K=c,Z=function(e){return"theme"!==e&&"innerRef"!==e},Q=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?K:Z},X=t(function(e){return t(function(t){return function(e,t){if("function"==typeof t){var r=t(e);if("production"!==process.env.NODE_ENV&&(null==r||"object"!=typeof r||Array.isArray(r)))throw new Error("[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!");return r}if("production"!==process.env.NODE_ENV&&(null==t||"object"!=typeof t||Array.isArray(t)))throw new Error("[ThemeProvider] Please make your theme prop a plain object");return G({},e,t)}(e,t)})}),ee=function(e){return s.createElement(B.Consumer,null,function(t){return e.theme!==t&&(t=X(t)(e.theme)),s.createElement(B.Provider,{value:t},e.children)})};function te(e){var t=e.displayName||e.name||"Component",r=s.forwardRef(function(t,r){return s.createElement(B.Consumer,null,function(n){return s.createElement(e,G({theme:n,ref:r},t))})});return r.displayName="WithTheme("+t+")",l(r,e)}function re(){return a.useContext(B)}function ne(e,t,r){var n,o=t.theme&&t.theme[e];return"function"==typeof(n="function"==typeof o?o(r):r[o]?r[o]:r.none)?n(t):n}function oe(e,t){return function(r){return ne(e,r,t)}}ee.displayName="ThemeProvider",oe.variants=function(e,t,r){return function(n){var o=n[t]&&r[n[t]];return o&&ne(e,n,o)}};var ie=function(t,r){if(void 0!==t.__SECRET_LIGHTS__)return t.__SECRET_LIGHTS__;var n=function(t){void 0===t&&(t={});var r,n,o=t.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(o))throw new Error('Pretty Lights key must only contain lower case alphabetical characters and - but "'+o+'" was passed');void 0!==t.prefix&&(n={prefix:t.prefix});var i,s,a=new e(n),c={};if(v){i=t.container||document.head;var l="data-lights-"+o,d=document.querySelectorAll("style["+l+"]");Array.prototype.forEach.call(d,function(e){(e.getAttribute(l)||"").split(" ").forEach(function(e){c[e]=!0}),e.parentNode!==i&&i.appendChild(e)})}if(v)a.use(t.stylisPlugins)(f),s=function(e,t,n,o,i){if(p.current=n,"production"!==process.env.NODE_ENV&&void 0!==t.map){var s=t.map;p.current={insert:function(e){n.insert(e+s)}}}if(void 0===r.inserted[t.name]){var c=a(e,t.styles);o&&(r.inserted[t.name]=c.replace(y,""),""===e&&i&&(r.global[t.name]=!0))}};else{a.use(m);var h=g;(t.stylisPlugins||void 0!==t.prefix)&&(a.use(t.stylisPlugins),h=b(t.stylisPlugins||g)(t.prefix)),s=function(e,t,n,o,i){if(void 0===r.inserted[t.name]){var s=function(e,t){var r=t.name;return void 0===h[r]&&(h[r]=a(e,t.styles)),h[r]}(e,t);if(!o)return s;r.inserted[t.name]=s,""===e&&i&&(r.global[t.name]=!0)}}}if("production"!==process.env.NODE_ENV){var _=/\/\*/g,E=/\*\//g;a.use(function(e,t){switch(e){default:break;case-1:for(;_.test(t);){if(E.lastIndex=_.lastIndex,!E.test(t))throw new Error('Your styles have an unterminated comment ("/*" without corresponding "*/").');_.lastIndex=E.lastIndex}_.lastIndex=0}})}return r={key:o,sheet:new u({key:o,container:i,nonce:t.nonce,speedy:t.speedy}),nonce:t.nonce,inserted:c,registered:{},global:{},insert:s}}(void 0),o=U.registerSelector;n.sheet.speedy=function(e){if("production"!==process.env.NODE_ENV&&0!==this.ctr)throw new Error("speedy must be changed before any rules are inserted");this.isSpeedy=e},n.compat=!0;var i=function(){var e=I([].slice.call(arguments),n.registered,void 0,U),t=o(n.key+"-"+e.name);return L(n,e,U),t},s={css:i,cx:function(){return $(n.registered,i,W([].slice.call(arguments)))},injectGlobal:function(){var e=I([].slice.call(arguments),n.registered,void 0,U);F(n,e,!0)},keyframes:function(){var e=I([].slice.call(arguments),n.registered,void 0,U),t=o("animation-"+e.name);return F(n,{name:e.name,styles:"@keyframes "+t+"{"+e.styles+"}"}),t},hashRegistry:U,hydrate:function(e){e.forEach(function(e){n.inserted[e]=!0})},flush:function(){n.registered={},n.inserted={},n.global={},n.sheet.flush()},sheet:n.sheet,cache:n,getRegisteredStyles:z,merge:$.bind(null,n.registered,i)};return t.__SECRET_LIGHTS__=s,s}("undefined"!=typeof global?global:{}),se=function(e){var t=e.hashRegistry,r=function(e){var t,r;function n(){return e.apply(this,arguments)||this}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,Y(t,r);var o=n.prototype;return o.componentDidMount=function(){this.sheet=new u({key:this.props.cache.key+"-global",nonce:this.props.cache.sheet.nonce,container:this.props.cache.sheet.container});var e=document.querySelector("style[data-lights-"+this.props.cache.key+'="'+this.props.serialized.name+'"]');null!==e&&this.sheet.tags.push(e),this.props.cache.sheet.tags.length&&(this.sheet.before=this.props.cache.sheet.tags[0]),this.insertStyles()},o.componentDidUpdate=function(e){e.serialized.name!==this.props.serialized.name&&this.insertStyles()},o.insertStyles=function(){void 0!==this.props.serialized.next&&L(this.props.cache,this.props.serialized.next,this.props.hashRegistry),this.sheet.tags.length&&(this.sheet.before=this.sheet.tags[this.sheet.tags.length-1].nextElementSibling,this.sheet.flush()),this.props.cache.insert("",this.props.serialized,this.sheet,!1)},o.componentWillUnmount=function(){this.sheet.flush()},o.render=function(){if(!J){for(var e,t=this.props.serialized,r=t.name,n=t.styles,o=t.next;void 0!==o;)r+=" "+o.name,n+=o.styles,o=o.next;this.props.cache.insert("",{name:r,styles:n},this.sheet,!0);var i=((e={})["data-global-"+this.props.cache.key]=r,e);return s.createElement("style",i)}return null},n}(s.Component);return r.displayName="InnerGlobal",function(n){var o=n.styles;if("function"==typeof o)return s.createElement(B.Consumer,null,function(n){var i=I([o(n)],e.cache.registered,void 0,t);return s.createElement(r,{serialized:i,cache:e.cache,hashRegistry:t})});var i=I([o],e.cache.registered,void 0,t);return s.createElement(r,{serialized:i,cache:e.cache,hashRegistry:t})}}(ie),ae=function(e){var t=e.hashRegistry,r=t.registerSelector;return function n(o,i){if("production"!==process.env.NODE_ENV&&void 0===o)throw new Error("You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.");var a,c,l;void 0!==i&&(a=i.label,l=r(i.target),c=o.__lights_forwardProp&&i.shouldForwardProp?function(e){return o.__lights_forwardProp(e)&&i.shouldForwardProp(e)}:i.shouldForwardProp);var u=o.__lights_real===o,p=u&&o.__lights_base||o;"function"!=typeof c&&u&&(c=o.__lights_forwardProp);var d=c||Q(p),h=!d("as");return function(){var f=[].slice.call(arguments),m=u&&void 0!==o.__lights_styles?o.__lights_styles.slice(0):[];if(void 0!==a&&m.push("label:"+a+";"),null==f[0]||void 0===f[0].raw)m.push.apply(m,f);else{"production"!==process.env.NODE_ENV&&void 0===f[0][0]&&console.error(_),m.push(f[0][0]);for(var v=f.length,y=1;y<v;y+=1)"production"!==process.env.NODE_ENV&&void 0===f[0][y]&&console.error(_),m.push(f[y],f[0][y])}var g=function(n){return s.createElement(B.Consumer,null,function(o){var i=h&&n.as||p,a="",u=[],f=n;if(null==n.theme){for(var v in f={},n)f[v]=n[v];f.theme=o}"string"==typeof n.className?a=z(e.cache.registered,u,n.className):null!=n.className&&(a=n.className+" ");var y=I(m.concat(u),e.cache.registered,f,t);L(e.cache,y,t),a+=e.cache.key+"-"+y.name,void 0!==l&&(a+=" "+l);var g=h&&void 0===c?Q(i):d,b={};for(var _ in n)h&&"as"===_||g(_)&&(b[_]=n[_]);return b.className=a,a.split(/\s+/g).forEach(function(e){-1===(""+n.className).indexOf(e)&&r(e)}),b.ref=n.innerRef,s.createElement(i,b)})};return g.displayName=void 0!==a?a:"Styled("+("string"==typeof p?p:p.displayName||p.name||"Component")+")",void 0!==o.defaultProps&&(g.defaultProps=o.defaultProps),g.__lights_styles=m,g.__lights_base=p,g.__lights_real=g,g.__lights_forwardProp=c,Object.defineProperty(g,"toString",{value:function(){return void 0===l&&"production"!==process.env.NODE_ENV?"NO_COMPONENT_SELECTOR":"."+l}}),g.withComponent=function(e,t){return n(e,void 0!==t?G({},i||{},t):i).apply(void 0,m)},g}}}(ie).bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){ae[e]=ae(e)});var ce=ie.flush,le=ie.hydrate,ue=ie.cx,pe=ie.merge,de=ie.getRegisteredStyles,he=ie.injectGlobal,fe=ie.keyframes,me=ie.css,ve=ie.sheet,ye=ie.cache,ge=ie.hashRegistry;export{se as Global,B as ThemeContext,ee as ThemeProvider,ye as cache,me as css,ue as cx,ce as flush,de as getRegisteredStyles,ge as hashRegistry,le as hydrate,he as injectGlobal,fe as keyframes,pe as merge,ve as sheet,ae as styled,oe as themeFn,re as useTheme,te as withTheme}; | ||
//# sourceMappingURL=pretty-lights.modern.js.map |
{ | ||
"name": "pretty-lights", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "CSS-in-JS with a reliable API", | ||
@@ -5,0 +5,0 @@ "main": "lib/pretty-lights.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
279695
1259
49