(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6954],{83811:function(n,t,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/blog/fitness",function(){return e(41854)}])},73153:function(n,t,e){"use strict";e.d(t,{Z:function(){return d},C:function(){return p}});var s=e(85893),o=e(67294),r=e(4115),i=e(69925),a=e(45604),l=e(37429),_=e.n(l),u=e(94184),c=e.n(u);class d extends o.Component{sendEvent(n){(0,a.Ng)(n,this.props.id),this.props.onClick&&this.props.onClick()}static getDerivedStateFromProps(n,t){return n.toObj!==t.toObj?{toObj:t.toObj}:null}render(){let{children:n,className:t,to:e,toLegacySite:o,shadow:a,newWindow:l,id:u,toObj:d,onClick:p,autoTablet:h,variant:g,ariaLabel:m}=this.props,f=this.state.toObj?this.state.toObj:{...d},b=!!Object.keys(f).length,k=g?_()["buttonLink_".concat(g)]:_().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:n});if(!b)return(0,s.jsx)(r.Z,{href:(0,i.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:n})});if(b){let t=f.query&&f.query.handle?f.query.handle:"",e=f.as?f.as:"".concat(f.pathname,"/").concat(t);if(e){let{as:n,...t}={...f};f=t}return(0,s.jsx)(r.Z,{href:f,as:e,children:(0,s.jsx)("a",{"aria-label":m,role:"link",id:u,className:L,onClick:()=>this.sendEvent(e),children:n})})}return(0,s.jsx)(s.Fragment,{})}constructor(n){super(n),this.state={toObj:this.props.toObj},this.sendEvent=this.sendEvent.bind(this)}}var p=d},25662:function(n,t,e){"use strict";e.d(t,{x:function(){return u}});var s=e(85893),o=e(88317),r=e(73153),i=e(94184),a=e.n(i),l=e(85146),_=e.n(l);let u=n=>(0,s.jsx)(o._y,{src:n.imgMobile,alt:"",sources:[{mediaQuery:"(min-width: 600px)",src:n.imgDesktop}],className:_().container,children:(0,s.jsxs)("div",{className:a()("inner-paddings-x",_().hero_content),children:[n.subtext?(0,s.jsx)("p",{className:a()("light",_().subtext),children:n.subtext}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)("h1",{className:a()("light",_().heading),children:n.heading}),(0,s.jsx)("div",{className:_().hero_cta_c,children:(0,s.jsx)(r.Z,{variant:"white",to:n.href,className:_().hero_cta,children:"Read more"})})]})})},66159:function(n,t,e){"use strict";e.d(t,{S:function(){return v}});var s=e(85893),o=e(7297),r=e(17283),i=e(24145),a=e(46693),l=e(38067);function _(){let n=(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 n},n}function u(){let n=(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 n},n}function c(){let n=(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 n},n}function d(){let n=(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 n},n}function p(){let n=(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 n},n}let h="dGVybToxMzc0",g=["wellness","sleep","fitness","science","membership"];(0,r.Ps)(_()),(0,r.Ps)(u()),(0,r.Ps)(c(),h),(0,r.Ps)(d(),h),(0,r.Ps)(p(),h),new i.f({ssrMode:!0,link:(0,a.L)({uri:"https://blog.eightsleep.com/graphql",credentials:"same-origin"}),cache:new l.h});var m=e(89728),f=e(41664),b=e.n(f),k=e(67294),L=e(484),x=e.n(L);let v=n=>{var t,e,o;let r=(0,k.useRef)(null),{post:i}=n;(0,k.useEffect)(()=>{if(r.current){var n;r.current.innerHTML=(null===(n=i.excerpt)||void 0===n?void 0:n.split("