(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4886],{17147:function(t,n,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/blog/science",function(){return e(5549)}])},73153:function(t,n,e){"use strict";e.d(n,{Z:function(){return d},C:function(){return p}});var s=e(85893),o=e(67294),i=e(4115),r=e(69925),a=e(45604),l=e(37429),_=e.n(l),u=e(94184),c=e.n(u);class d extends o.Component{sendEvent(t){(0,a.Ng)(t,this.props.id),this.props.onClick&&this.props.onClick()}static getDerivedStateFromProps(t,n){return t.toObj!==n.toObj?{toObj:n.toObj}:null}render(){let{children:t,className:n,to:e,toLegacySite:o,shadow:a,newWindow:l,id:u,toObj:d,onClick:p,autoTablet:g,variant:h,ariaLabel:m}=this.props,b=this.state.toObj?this.state.toObj:{...d},f=!!Object.keys(b).length,k=h?_()["buttonLink_".concat(h)]:_().buttonLink,L=c()(k,this.props.className);if(o)return(0,s.jsx)("a",{"aria-label":m,role:"link",id:u,href:e,className:L,target:l?"_blank":"_self",rel:"noreferrer",children:t});if(!f)return(0,s.jsx)(i.Z,{href:(0,r.E)(e),children:(0,s.jsx)("a",{"aria-label":m+"Open in new Window",role:"link",id:u,className:L,onClick:()=>this.sendEvent(e),target:l?"_blank":"_self",children:t})});if(f){let n=b.query&&b.query.handle?b.query.handle:"",e=b.as?b.as:"".concat(b.pathname,"/").concat(n);if(e){let{as:t,...n}={...b};b=n}return(0,s.jsx)(i.Z,{href:b,as:e,children:(0,s.jsx)("a",{"aria-label":m,role:"link",id:u,className:L,onClick:()=>this.sendEvent(e),children:t})})}return(0,s.jsx)(s.Fragment,{})}constructor(t){super(t),this.state={toObj:this.props.toObj},this.sendEvent=this.sendEvent.bind(this)}}var p=d},25662:function(t,n,e){"use strict";e.d(n,{x:function(){return u}});var s=e(85893),o=e(88317),i=e(73153),r=e(94184),a=e.n(r),l=e(85146),_=e.n(l);let u=t=>(0,s.jsx)(o._y,{src:t.imgMobile,alt:"",sources:[{mediaQuery:"(min-width: 600px)",src:t.imgDesktop}],className:_().container,children:(0,s.jsxs)("div",{className:a()("inner-paddings-x",_().hero_content),children:[t.subtext?(0,s.jsx)("p",{className:a()("light",_().subtext),children:t.subtext}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)("h1",{className:a()("light",_().heading),children:t.heading}),(0,s.jsx)("div",{className:_().hero_cta_c,children:(0,s.jsx)(i.Z,{variant:"white",to:t.href,className:_().hero_cta,children:"Read more"})})]})})},66159:function(t,n,e){"use strict";e.d(n,{S:function(){return v}});var s=e(85893),o=e(7297),i=e(17283),r=e(24145),a=e(46693),l=e(38067);function _(){let t=(0,o.Z)(["\n query GetAllPosts($after: String) {\n posts(first: 100, after: $after, where: { orderby: { field: DATE, order: DESC } }) {\n edges {\n node {\n id\n slug\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n }\n }\n }\n"]);return _=function(){return t},t}function u(){let t=(0,o.Z)(['\n {\n posts(first: 3, where: { orderby: { field: DATE, order: DESC }, nameIn: ["improved-sleep-quality", "optimal-sleeping-temperature", "accessing-a-deep-state-of-rest-with-nsdr"] }) {\n edges {\n node {\n id\n title\n slug\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n date\n content(format: RENDERED)\n }\n }\n }\n }\n']);return u=function(){return t},t}function c(){let t=(0,o.Z)(['\n {\n posts(first: 3, where: { orderby: { field: DATE, order: DESC }, tagNotIn: "','", tagSlugIn: ["wellness", "sleep", "fitness", "science", "membership"] }) {\n edges {\n node {\n id\n title\n slug\n excerpt\n date\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n content(format: RENDERED)\n }\n }\n }\n }\n']);return c=function(){return t},t}function d(){let t=(0,o.Z)(['\n query GetPostBySlug($slug: String) {\n postBy(slug: $slug) {\n id\n title\n slug\n excerpt\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n date\n content(format: RENDERED)\n author {\n node {\n name\n slug\n posts(first: 4, where: { orderby: { field: DATE, order: DESC }, tagNotIn: "','", tagSlugIn: ["wellness", "sleep", "fitness", "science", "membership"] }) {\n edges {\n node {\n title\n slug\n excerpt\n date\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n tags {\n edges {\n node {\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n']);return d=function(){return t},t}function p(){let t=(0,o.Z)(['\n query GetLatestPostsByAuthor($author: String) {\n posts(first: 3, where: { authorName: $author, orderby: { field: DATE, order: DESC }, tagNotIn: "','", tagSlugIn: ["wellness", "sleep", "fitness", "science", "membership"] }) {\n edges {\n node {\n id\n slug\n title\n excerpt\n date\n featuredImage {\n node {\n altText\n sourceUrl\n }\n }\n }\n }\n }\n }\n']);return p=function(){return t},t}let g="dGVybToxMzc0",h=["wellness","sleep","fitness","science","membership"];(0,i.Ps)(_()),(0,i.Ps)(u()),(0,i.Ps)(c(),g),(0,i.Ps)(d(),g),(0,i.Ps)(p(),g),new r.f({ssrMode:!0,link:(0,a.L)({uri:"https://blog.eightsleep.com/graphql",credentials:"same-origin"}),cache:new l.h});var m=e(89728),b=e(41664),f=e.n(b),k=e(67294),L=e(484),x=e.n(L);let v=t=>{var n,e,o;let i=(0,k.useRef)(null),{post:r}=t;(0,k.useEffect)(()=>{if(i.current){var t;i.current.innerHTML=(null===(t=r.excerpt)||void 0===t?void 0:t.split("