1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4214],{26541:function(e,t,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"updateNotificationPreference"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"type"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"enabled"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Boolean"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"updateNotificationPreference"},arguments:[{kind:"Argument",name:{kind:"Name",value:"type"},value:{kind:"Variable",name:{kind:"Name",value:"type"}}},{kind:"Argument",name:{kind:"Name",value:"enabled"},value:{kind:"Variable",name:{kind:"Name",value:"enabled"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"notificationPreferenceFields"},directives:[]}]}}]}}],loc:{start:0,end:243}};i.loc.source={body:"#import 'fragments/notification-preferences.graphql'\n\nmutation updateNotificationPreference($type: String!, $enabled: Boolean!) {\n updateNotificationPreference(type: $type, enabled: $enabled) {\n ...notificationPreferenceFields\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var o={};i.definitions=i.definitions.concat(n(30081).definitions.filter(function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!o[t]&&(o[t]=!0,!0)}));var a={};function r(e,t){for(var n=0;n<e.definitions.length;n++){var i=e.definitions[n];if(i.name&&i.name.value==t)return i}}i.definitions.forEach(function(e){if(e.name){var t=new Set;(function e(t,n){if("FragmentSpread"===t.kind)n.add(t.name.value);else if("VariableDefinition"===t.kind){var i=t.type;"NamedType"===i.kind&&n.add(i.name.value)}t.selectionSet&&t.selectionSet.selections.forEach(function(t){e(t,n)}),t.variableDefinitions&&t.variableDefinitions.forEach(function(t){e(t,n)}),t.definitions&&t.definitions.forEach(function(t){e(t,n)})})(e,t),a[e.name.value]=t}}),e.exports=i,e.exports.updateNotificationPreference=function(e,t){var n={kind:e.kind,definitions:[r(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var i=a[t]||new Set,o=new Set,s=new Set;for(i.forEach(function(e){s.add(e)});s.size>0;){var c=s;s=new Set,c.forEach(function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach(function(e){s.add(e)}))})}return o.forEach(function(t){var i=r(e,t);i&&n.definitions.push(i)}),n}(i,"updateNotificationPreference")},56739:function(e,t,n){var i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getNotificationPreferences"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"notificationPreferences"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"notificationPreferenceFields"},directives:[]}]}}]}}],loc:{start:0,end:165}};i.loc.source={body:"#import 'fragments/notification-preferences.graphql'\n\nquery getNotificationPreferences {\n notificationPreferences {\n ...notificationPreferenceFields\n }\n}\n",name:"GraphQL request",locationOffset:{line:1,column:1}};var o={};i.definitions=i.definitions.concat(n(30081).definitions.filter(function(e){if("FragmentDefinition"!==e.kind)return!0;var t=e.name.value;return!o[t]&&(o[t]=!0,!0)}));var a={};function r(e,t){for(var n=0;n<e.definitions.length;n++){var i=e.definitions[n];if(i.name&&i.name.value==t)return i}}i.definitions.forEach(function(e){if(e.name){var t=new Set;(function e(t,n){if("FragmentSpread"===t.kind)n.add(t.name.value);else if("VariableDefinition"===t.kind){var i=t.type;"NamedType"===i.kind&&n.add(i.name.value)}t.selectionSet&&t.selectionSet.selections.forEach(function(t){e(t,n)}),t.variableDefinitions&&t.variableDefinitions.forEach(function(t){e(t,n)}),t.definitions&&t.definitions.forEach(function(t){e(t,n)})})(e,t),a[e.name.value]=t}}),e.exports=i,e.exports.getNotificationPreferences=function(e,t){var n={kind:e.kind,definitions:[r(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var i=a[t]||new Set,o=new Set,s=new Set;for(i.forEach(function(e){s.add(e)});s.size>0;){var c=s;
1s=new Set,c.forEach(function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach(function(e){s.add(e)}))})}return o.forEach(function(t){var i=r(e,t);i&&n.definitions.push(i)}),n}(i,"getNotificationPreferences")},30081:function(e){var t={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"notificationPreferenceFields"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"NotificationPreference"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"enabled"},arguments:[],directives:[]}]}}],loc:{start:0,end:89}};t.loc.source={body:"fragment notificationPreferenceFields on NotificationPreference {\n id\n type\n enabled\n}",name:"GraphQL request",locationOffset:{line:1,column:1}};var n={};function i(e,t){for(var n=0;n<e.definitions.length;n++){var i=e.definitions[n];if(i.name&&i.name.value==t)return i}}t.definitions.forEach(function(e){if(e.name){var t=new Set;(function e(t,n){if("FragmentSpread"===t.kind)n.add(t.name.value);else if("VariableDefinition"===t.kind){var i=t.type;"NamedType"===i.kind&&n.add(i.name.value)}t.selectionSet&&t.selectionSet.selections.forEach(function(t){e(t,n)}),t.variableDefinitions&&t.variableDefinitions.forEach(function(t){e(t,n)}),t.definitions&&t.definitions.forEach(function(t){e(t,n)})})(e,t),n[e.name.value]=t}}),e.exports=t,e.exports.notificationPreferenceFields=function(e,t){var o={kind:e.kind,definitions:[i(e,t)]};e.hasOwnProperty("loc")&&(o.loc=e.loc);var a=n[t]||new Set,r=new Set,s=new Set;for(a.forEach(function(e){s.add(e)});s.size>0;){var c=s;s=new Set,c.forEach(function(e){r.has(e)||(r.add(e),(n[e]||new Set).forEach(function(e){s.add(e)}))})}return r.forEach(function(t){var n=i(e,t);n&&o.definitions.push(n)}),o}(t,"notificationPreferenceFields")},19681:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/notification-preferences",function(){return n(93041)}])},93041:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I}});var i=n(85893),o=n(89007),a=n(11163),r=n(30470),s=n(43783),c=n(39737),l=n(37977),d=n(47915),f=n(30137),u=n(73292),h=n(76341),p=n(67462),v=n(93128),m=n(97582),k=n(50319),b=n(6812),y=n(67294),w=n(26836),g=n(71689),N=n(59936),S=n(44662),_=n(80727),E=n(26541),x=n(56739),D=n(74601),T=n.n(D),P=n(42823),C=n(72085),M=n(59990),O=n(57552),j={UNREAD_CLIENT_SMS_REMINDER:"An sms has been unread for over 3 hours",WORKOUT_STARTED:"A client has started a workout",WORKOUT_ACTIVITY_COMPLETED:"A client has completed a workout activity",WORKOUT_COMMENT:"A client leaves a comment on an exercise",CLIENT_COACH_FEEDBACK:"A client has left feedback",WORKOUT_RATING_BELOW_THREE:"A client gave a workout less than 3 stars"},F=function(){var e,t=(0,C.Z)(),n=(0,v._)((0,k.D)(E.updateNotificationPreference),1)[0],o=(0,b.a)(x.getNotificationPreferences),a=o.loading,r=o.data,s=(0,v._)((0,y.useState)({}),2),c=s[0],l=s[1];if((0,y.useEffect)(function(){r&&l((0,M.HK)(w.Z("type"),r.notificationPreferences))},[r]),(0,y.useEffect)(function(){var e;P.o.logEvent("Coach - Acc. Settings - Notif. Pref. - View",{"Coach ID":null===(e=t.data)||void 0===e?void 0:e.me.user.coach.id})},[t.data]),a)return(0,i.jsxs)("div",{className:T().container,children:[(0,i.jsx)(_.Z,{}),(0,i.jsx)("span",{children:"Loading"}),(0,i.jsx)(S.Z,{className:"spinner"})]});var d=(e=(0,f._)(function(e,i,o){var a,r,s,d,f;return(0,m.Jh)(this,function(v){switch(v.label){case 0:return i.preventDefault(),[4,n({variables:{type:o,enabled:e}})];case 1:return s=(r=v.sent().data.updateNotificationPreference).type,d=r.enabled,f="Notification Preferences - toggle ".concat(d?"on":"off"),P.o.logEvent(f,{"Coach ID":null===(a=t.data)||void 0===a?void 0:a.me.user.coach.id,"Notification Preference Type":s}),l((0,p._)((0,h._)({},c),(0,u._)({},o,{enabled:e}))),[2]}})}),function(t,n,i){return e.apply(this,arguments)});return(0,i.jsxs)("div",{className:T().container,children:[(0,i.jsx)(_.Z,{}),(0,i.jsxs)("div",{className:T().content,children:[(0,i.jsx)("span",{className:T().title,children:"Notification Preferences"}),(0,i.jsx)("span",{className:T().subtitle,children:"Notify me when ..."}),(0,i.jsx)("div",{className:T().rowContainer,children:g.Z(function(e){var t;return(0,i.jsxs)("div",{className:T().row,children:[(0,i.jsx)("span",{className:T().displayName,children:j[e.type]}),(0,i.jsx)(N.default,{className:T().switch,id:e.type,checked:(null===(t=c[e.type])||void 0===t?void 0:t.enabled)||!1,onChange:d})]},e.type)},r.notificationPreferences)})]}),(0,i.jsxs)("div",{className:T().content,children:[(0,i.jsx)("span",{className:T().title,children:"Prompt Settings"}),(0,i.jsx)(O.Z,{})]})]})},R=n(11342),A=function(){return(0,i.jsx)(R.B,{children:(0,i.jsx)(l.Z,{children:(0,i.jsx)(d.Z,{children:(0,i.jsx)(F,{})})})})};A.getInitalProps=(0,o.Z)(function(e){var t=e.ctx,n=e.currentUserPayload.data.me;return n.user&&n.user.coach&&n.user.coach.isActive||(0,s.Z)(c.jk.signIn({redirect:t.asPath}),t),{}});var I=(0,a.withRouter)((0,r.C)(A))},59990:function(e,t,n){"use strict";n.d(t,{HK:function(){return d},Sy:function(){return l},kd:function(){return u},m8:function(){return f}});var i=n(53353);n(67294);var o=n(18740),a=n(71689),r=n(74178),s=n(16027),c=n(93568),l=function(e){for(var t=(0,i._)(e),n=t.length-1;n>0;n--){var o,a=Math.floor(Math.random()*(n+1));o=[t[a],t[n]],t[n]=o[0],t[a]=o[1]}return t},d=o.Z(2,function(e,t){return a.Z(r.Z,s.Z(e,t))}),f=o.Z(2,function(e,t){return c.Z(a.Z)(function(n,i){return e(n,{index:i,isFirst:0===i,isLast:i===t.length-1,isEven:i%2==0})},t)}),u=function(e){return e[Math.floor(Math.random()*e.length)]}},98415:function(e){e.exports={style:{fontFamily:"'__heebo_a54333', '__heebo_Fallback_a54333'"},className:"__className_a54333"}},74601:function(e){e.exports={container:"styles_container__JuVNo",content:"styles_content__QjqTx",title:"styles_title__LUCP6",subtitle:"styles_subt
1itle__qA5yu",rowContainer:"styles_rowContainer__qmyKD",row:"styles_row__wUWO2",displayName:"styles_displayName__wUKko",switch:"styles_switch__HabSy"}},83231:function(e,t,n){var i=n(67294);function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}var a=i.createElement("svg",{viewBox:"-2 -5 14 20",height:"100%",width:"100%",style:{position:"absolute",top:0}},i.createElement("path",{d:"M9.9 2.12L7.78 0 4.95 2.828 2.12 0 0 2.12l2.83 2.83L0 7.776 2.123 9.9 4.95 7.07 7.78 9.9 9.9 7.776 7.072 4.95 9.9 2.12",fill:"#fff",fillRule:"evenodd"})),r=i.createElement("svg",{height:"100%",width:"100%",viewBox:"-2 -5 17 21",style:{position:"absolute",top:0}},i.createElement("path",{d:"M11.264 0L5.26 6.004 2.103 2.847 0 4.95l5.26 5.26 8.108-8.107L11.264 0",fill:"#fff",fillRule:"evenodd"}));function s(e){if(7===e.length)return e;for(var t="#",n=1;n<4;n+=1)t+=e[n]+e[n];return t}function c(e,t,n,i,o){return function(e,t,n,i,o){var a=(e-n)/(t-n);if(0===a)return i;if(1===a)return o;for(var r="#",s=1;s<6;s+=2){var c=Math.round((1-a)*parseInt(i.substr(s,2),16)+a*parseInt(o.substr(s,2),16)).toString(16);1===c.length&&(c="0"+c),r+=c}return r}(e,t,n,s(i),s(o))}var l=function(e){function t(t){e.call(this,t);var n=t.height,i=t.width,o=t.checked;this.t=t.handleDiameter||n-2,this.i=Math.max(i-n,i-(n+this.t)/2),this.o=Math.max(0,(n-this.t)/2),this.state={s:o?this.i:this.o},this.n=0,this.e=0,this.h=this.h.bind(this),this.r=this.r.bind(this),this.a=this.a.bind(this),this.c=this.c.bind(this),this.l=this.l.bind(this),this.u=this.u.bind(this),this.f=this.f.bind(this),this.p=this.p.bind(this),this.b=this.b.bind(this),this.g=this.g.bind(this),this.v=this.v.bind(this),this.w=this.w.bind(this)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.componentDidUpdate=function(e){e.checked!==this.props.checked&&this.setState({s:this.props.checked?this.i:this.o})},t.prototype.k=function(e){this.y.focus(),this.setState({C:e,M:!0,m:Date.now()})},t.prototype.x=function(e){var t=this.state,n=t.C,i=t.s,o=(this.props.checked?this.i:this.o)+e-n;t.R||e===n||this.setState({R:!0});var a=Math.min(this.i,Math.max(this.o,o));a!==i&&this.setState({s:a})},t.prototype.S=function(e){var t=this.state,n=t.s,i=t.R,o=t.m,a=this.props.checked,r=(this.i+this.o)/2,s=Date.now()-o;!i||s<250?this.T(e):a?r<n?this.setState({s:this.i}):this.T(e):n<r?this.setState({s:this.o}):this.T(e),this.setState({R:!1,M:!1}),this.n=Date.now()},t.prototype.h=function(e){e.preventDefault(),"number"==typeof e.button&&0!==e.button||(this.k(e.clientX),window.addEventListener("mousemove",this.r),window.addEventListener("mouseup",this.a))},t.prototype.r=function(e){e.preventDefault(),this.x(e.clientX)},t.prototype.a=function(e){this.S(e),window.removeEventListener("mousemove",this.r),window.removeEventListener("mouseup",this.a)},t.prototype.c=function(e){this.$=null,this.k(e.touches[0].clientX)},t.prototype.l=function(e){this.x(e.touches[0].clientX)},t.prototype.u=function(e){e.preventDefault(),this.S(e)},t.prototype.p=function(e){50<Date.now()-this.n&&(this.T(e),50<Date.now()-this.e&&this.setState({M:!1}))},t.prototype.b=function(){this.e=Date.now()},t.prototype.g=function(){this.setState({M:!0})},t.prototype.v=function(){this.setState({M:!1})},t.prototype.w=function(e){this.y=e},t.prototype.f=function(e){e.preventDefault(),this.y.focus(),this.T(e),this.setState({M:!1})},t.prototype.T=function(e){var t=this.props;(0,t.onChange)(!t.checked,e,t.id)},t.prototype.render=function(){var e=this.props,t=e.disabled,n=e.className,a=e.offColor,r=e.onColor,s=e.offHandleColor,l=e.onHandleColor,d=e.checkedIcon,f=e.uncheckedIcon,u=e.boxShadow,h=e.activeBoxShadow,p=e.height,v=e.width,m=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&-1===t.indexOf(i)&&(n[i]=e[i]);return n}(e,["disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","boxShadow","activeBoxShadow","height","width","handleDiameter"]),k=this.state,b=k.s,y=k.R,w=k.M,g={height:p,width:v,margin:Math.max(0,(this.t-p)/2),position:"relative",background:c(b,this.i,this.o,a,r),borderRadius:p/2,cursor:t?"default":"pointer",WebkitTransition:y?null:"background 0.25s",MozTransition:y?null:"background 0.25s",transition:y?null:"background 0.25s"},N={height:p,width:Math.min(1.5*p,v-(this.t+p)/2+1),position:"relative",opacity:(b-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:y?null:"opacity 0.25s",MozTransition:y?null:"opacity 0.25s",transition:y?null:"opacity 0.25s"},S={height:p,width:Math.min(1.5*p,v-(this.t+p)/2+1),position:"absolute",opacity:1-(b-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:y?null:"opacity 0.25s",MozTransition:y?null:"opacity 0.25s",transition:y?null:"opacity 0.25s"},_={height:this.t,width:this.t,background:c(b,this.i,this.o,s,l),display:"inline-block",cursor:t?"default":"pointer",borderRadius:"50%",position:"absolute",transform:"translateX("+b+"px)",top:Math.max(0,(p-this.t)/2),outline:0,boxShadow:w?h:u,border:0,WebkitTransition:y?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:y?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:y?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"};return i.createElement("div",{className:n,style:{position:"relative",display:"inline-block",textAlign:"left",opacity:t?.5:1,direction:"ltr",borderRadius:p/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"}},i.createElement("div",{className:"react-switch-bg",style:g,onClick:t?null:this.f,onMouseDown:function(e){return e.preventDefault()}},d&&i.createElement("div",{style:N},d),f&&i.createElement("div",{style:S},f)),i.createElement("div",{className:"react-switch-handle",style:_,onClick:function(e){return e.preventDefault()},onMouseDown:t?null:this.h,onTouchStart:t?null:this.c,onTouchMove:t?null:this.l,onTouchEnd:t?null:this.u,onTouchCancel:t?null:this.v}),i.createElement("input",o({},{type:"checkbox",role:"switch",disabled:t,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},m,{ref:this.w,onFocus:this.g,onBlur:this.v,onKeyUp:this.b,onChange:this.p})))},t}(i.Component);l.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:a,checkedIcon:r,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56},t.default=l},59936:function(e,t,n){e.exports=n(83231)}}
1,function(e){e.O(0,[9468,8523,2315,4853,8407,6025,984,546,7362,7844,8909,5675,945,2279,4129,1003,2201,2964,9405,7977,3420,7092,78,1211,2888,9774,179],function(){return e(e.s=19681)}),_N_E=e.O()}]); 2//# sourceMappingURL=notification-preferences-530d2ab0a1934d1c.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.