OCAccountCommunicationsSettings.react",["fbt","OCAccountButtonContainer.react","OCAccountChangeEmailSubscriptionsMutation","OCAccountCommunicationsSettingsSection.react","OCAccountCommunicationsSettings_all_categories.graphql","OCAccountCommunicationsSettings_user.graphql","OCDSButton.react","OCDSSpacer.react","OCDSText.react","OCWWWAnalyticsLoggingMyPrivacyCommunicationsUpdateAttempt.log","RelayHooks","asyncToGeneratorRuntime","nullthrows","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k,l=k||(k=d("react"));e=k;var m=e.useCallback,n=e.useMemo,o=e.useState,p="OCAccountCommunicationsSettings",q={header:{marginTop:"x11fxgd9",marginBottom:"x4n8cb0",$$css:!0}};function a(a){var e=a.allCategoriesFragment;a=a.userFragment;var f=o(!1),g=f[0],i=f[1];f=o(!1);var j=f[0],k=f[1];f=o(!1);var t=f[0],u=f[1];f=o(!1);var v=f[0],w=f[1],x=d("RelayHooks").useFragment(r,a),y=(f=d("RelayHooks").useFragment(s,e))==null?void 0:f.categories;a=n(function(){var b=[],a=[],c=[];y==null?void 0:y.map(function(d){d.category_type==="PRODUCT_NOTIFICATIONS"?b.push(d):d.category_type==="CONSUMER_MARKETING"?a.push(d):d.category_type==="USER_RESEARCH"&&c.push(d)});return{product_notifications:b,consumer_marketing:a,user_research:c}},[y]);var z=a.consumer_marketing,A=a.product_notifications,B=a.user_research,C=n(function(){var a=new Map();x==null?void 0:x.email_subscription_categories.map(function(b){a.set(c("nullthrows")(b.id),!0)});return a},[x==null?void 0:x.email_subscription_categories]),D=m(function(a,b){C.set(a,b),k(!0)},[C]);e=n(function(){return A.length?l.jsx(c("OCAccountCommunicationsSettingsSection.react"),{categories:A,headerText:h._("Product notifications"),subscriptions:C,onChange:D}):null},[D,A,C]);f=n(function(){var a;return z.length?l.jsx(c("OCAccountCommunicationsSettingsSection.react"),{categories:z,disableForSalsa:(a=x==null?void 0:x.is_salsa)!=null?a:!1,headerText:h._("Marketing emails"),subscriptions:C,onChange:D}):null},[z,D,C,x==null?void 0:x.is_salsa]);a=n(function(){var a;return B.length?l.jsx(c("OCAccountCommunicationsSettingsSection.react"),{categories:B,disableForSalsa:(a=x==null?void 0:x.is_salsa)!=null?a:!1,headerText:h._("User research"),subscriptions:C,onChange:D}):null},[B,x==null?void 0:x.is_salsa,C,D]);var E=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){a.preventDefault();u(!0);i(!1);w(!1);a=c("nullthrows")(y).map(function(a){var b=a.display_name;a=a.id;return{text:b,value:(a=C.get((b=a)!=null?b:""))!=null?a:!1}});c("OCWWWAnalyticsLoggingMyPrivacyCommunicationsUpdateAttempt.log")(p,{subscriptions:a});try{yield d("OCAccountChangeEmailSubscriptionsMutation").commit(C),u(!1),w(!0),k(!1)}catch(a){u(!1),w(!1),i(!0)}});return function(b){return a.apply(this,arguments)}}();return l.jsx("div",{children:l.jsxs("div",{children:[l.jsx(c("OCDSText.react"),{display:"block",type:"body2",xstyle:q.header,children:h._("Manage your newsletter subscriptions.")}),g&&l.jsx(c("OCDSSpacer.react"),{bottomSize:"small",children:l.jsx(c("OCDSText.react"),{color:"error",display:"block",textAlign:"center",type:"body2",children:h._("Something went wrong. Please try again.")})}),v&&l.jsx(c("OCDSSpacer.react"),{bottomSize:"small",children:l.jsx(c("OCDSText.react"),{color:"success",display:"block",textAlign:"center",type:"body2",children:h._("Your account has been updated.")})}),l.jsxs("form",{method:"post",onSubmit:E,children:[l.jsxs("div",{children:[e,f,a]}),l.jsx(c("OCAccountButtonContainer.react"),{children:l.jsx(c("OCDSButton.react"),{isDisabled:t||!j,isLoading:t,label:h._("UPDATE"),type:"secondary",variant:"outline"})})]})]})})}a.displayName=a.name+" [from "+f.id+"]";var r=i!==void 0?i:i=b("OCAccountCommunicationsSettings_user.graphql"),s=j!==void 0?j:j=b("OCAccountCommunicationsSettings_all_categories.graphql");g["default"]=a}),226);
-----
OCAccountChangeEmailSubscriptionsMutation",["OCAccountChangeEmailSubscriptionsMutation.graphql","OCRelayModern","Promise","RelayFBEnvironment"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j=h!==void 0?h:h=b("OCAccountChangeEmailSubscriptionsMutation.graphql");function a(a){var d=[],e=[];a.forEach(function(a,b){a?d.push(b):e.push(b)});return new(i||(i=b("Promise")))(function(a,b){return c("OCRelayModern").commitMutation(c("RelayFBEnvironment"),{mutation:j,variables:{input:{email_subscription_categories_add:d,email_subscription_categories_remove:e}},onCompleted:function(b){return a(b)},onError:function(a){return b(a)}})})}g.commit=a}),98);
-----
OCAccountChangeEmailSubscriptionsMutation.graphql",["OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{kind:"Variable",name:"data",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,concreteType:"EmailSubscriptionCategory",kind:"LinkedField",name:"email_subscription_categories",plural:!0,selections:[d],storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"OCAccountChangeEmailSubscriptionsMutation",selections:[{alias:null,args:c,concreteType:"UserEditResponsePayload",kind:"LinkedField",name:"user_edit",plural:!1,selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[e],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"OCAccountChangeEmailSubscriptionsMutation",selections:[{alias:null,args:c,concreteType:"UserEditResponsePayload",kind:"LinkedField",name:"user_edit",plural:!1,selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[e,d],storageKey:null}],storageKey:null}]},params:{id:b("OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation"),metadata:{},name:"OCAccountChangeEmailSubscriptionsMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation",[],(function(a,b,c,d,e,f){e.exports="7104960989574118"}),null);
-----
OCAccountCommunicationsSettings.react",["fbt","OCAccountButtonContainer.react","OCAccountChangeEmailSubscriptionsMutation","OCAccountCommunicationsSettings_all_categories.graphql","OCAccountCommunicationsSettings_viewer.graphql","OCDSButton.react","OCDSCheckboxInput.react","OCDSHeading.react","OCDSResponsiveRow.react","OCDSResponsiveRowItem.react","OCDSSpacer.react","OCDSText.react","OCRelayModern","OCWWWAnalyticsLoggingMyPrivacyCommunicationsUpdateAttempt.log","nullthrows","react","regeneratorRuntime"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=d("react"),l={header:{marginTop:"x11fxgd9",marginBottom:"x4n8cb0",$$css:!0},row:{borderBottom:"x1wfzsf3",marginBottom:"xieb3on",paddingBottom:"xx6bls6",":last-child_borderBottom":"x1rix2v9",$$css:!0}},m="OCAccountCommunicationsSettings";a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;for(var g=arguments.length,h=new Array(g),i=0;i-----
OCAccountChangeEmailSubscriptionsMutation",["OCAccountChangeEmailSubscriptionsMutation.graphql","OCRelayModern","Promise","RelayFBEnvironment"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h!==void 0?h:h=b("OCAccountChangeEmailSubscriptionsMutation.graphql");function a(a){var d=[],e=[];a.forEach(function(a,b){a?d.push(b):e.push(b)});return new(b("Promise"))(function(a,b){return c("OCRelayModern").commitMutation(c("RelayFBEnvironment"),{mutation:i,variables:{input:{email_subscription_categories_add:d,email_subscription_categories_remove:e}},onCompleted:function(b){return a(b)},onError:function(a){return b(a)}})})}g.commit=a}),98);
-----
OCAccountChangeEmailSubscriptionsMutation.graphql",["OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{kind:"Variable",name:"data",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,concreteType:"EmailSubscriptionCategory",kind:"LinkedField",name:"email_subscription_categories",plural:!0,selections:[d],storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"OCAccountChangeEmailSubscriptionsMutation",selections:[{alias:null,args:c,concreteType:"UserEditResponsePayload",kind:"LinkedField",name:"user_edit",plural:!1,selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[e],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"OCAccountChangeEmailSubscriptionsMutation",selections:[{alias:null,args:c,concreteType:"UserEditResponsePayload",kind:"LinkedField",name:"user_edit",plural:!1,selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[e,d],storageKey:null}],storageKey:null}]},params:{id:b("OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation"),metadata:{},name:"OCAccountChangeEmailSubscriptionsMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation",[],(function(a,b,c,d,e,f){e.exports="7104960989574118"}),null);
-----
-----
OCAccountChangeEmailSubscriptionsMutation",["OCAccountChangeEmailSubscriptionsMutation.graphql","OCRelayModern","Promise","RelayFBEnvironment"],(function(a,b,c,d,e,f,g){"use strict";var h,i,j=h!==void 0?h:h=b("OCAccountChangeEmailSubscriptionsMutation.graphql");function a(a){var d=[],e=[];a.forEach(function(a,b){a?d.push(b):e.push(b)});return new(i||(i=b("Promise")))(function(a,b){return c("OCRelayModern").commitMutation(c("RelayFBEnvironment"),{mutation:j,variables:{input:{email_subscription_categories_add:d,email_subscription_categories_remove:e}},onCompleted:function(b){return a(b)},onError:function(a){return b(a)}})})}g.commit=a}),98);
-----
OCAccountChangeEmailSubscriptionsMutation.graphql",["OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{kind:"Variable",name:"data",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,concreteType:"EmailSubscriptionCategory",kind:"LinkedField",name:"email_subscription_categories",plural:!0,selections:[d],storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"OCAccountChangeEmailSubscriptionsMutation",selections:[{alias:null,args:c,concreteType:"UserEditResponsePayload",kind:"LinkedField",name:"user_edit",plural:!1,selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[e],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"OCAccountChangeEmailSubscriptionsMutation",selections:[{alias:null,args:c,concreteType:"UserEditResponsePayload",kind:"LinkedField",name:"user_edit",plural:!1,selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[e,d],storageKey:null}],storageKey:null}]},params:{id:b("OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation"),metadata:{},name:"OCAccountChangeEmailSubscriptionsMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation",[],(function(a,b,c,d,e,f){e.exports="7104960989574118"}),null);
-----
OCAccountCommunicationsSettings.react",["fbt","OCAccountButtonContainer.react","OCAccountChangeEmailSubscriptionsMutation","OCAccountCommunicationsSettings_all_categories.graphql","OCAccountCommunicationsSettings_viewer.graphql","OCDSButton.react","OCDSCheckboxInput.react","OCDSHeading.react","OCDSResponsiveRow.react","OCDSResponsiveRowItem.react","OCDSSpacer.react","OCDSText.react","OCRelayModern","OCWWWAnalyticsLoggingMyPrivacyCommunicationsUpdateAttempt.log","nullthrows","react","regeneratorRuntime"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=d("react"),l={header:{marginTop:"x11fxgd9",marginBottom:"x4n8cb0",$$css:!0},row:{borderBottom:"x1wfzsf3",marginBottom:"xieb3on",paddingBottom:"xx6bls6",":last-child_borderBottom":"x1rix2v9",$$css:!0}},m="OCAccountCommunicationsSettings";a=function(a){babelHelpers.inheritsLoose(e,a);function e(){var e,f;for(var g=arguments.length,h=new Array(g),i=0;i
OCAccountChangeEmailSubscriptionsMutation",["OCAccountChangeEmailSubscriptionsMutation.graphql","OCRelayModern","Promise","RelayFBEnvironment"],(function(a,b,c,d,e,f,g){"use strict";var h,i=h!==void 0?h:h=b("OCAccountChangeEmailSubscriptionsMutation.graphql");function a(a){var d=[],e=[];a.forEach(function(a,b){a?d.push(b):e.push(b)});return new(b("Promise"))(function(a,b){return c("OCRelayModern").commitMutation(c("RelayFBEnvironment"),{mutation:i,variables:{input:{email_subscription_categories_add:d,email_subscription_categories_remove:e}},onCompleted:function(b){return a(b)},onError:function(a){return b(a)}})})}g.commit=a}),98);
-----
OCAccountChangeEmailSubscriptionsMutation.graphql",["OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{kind:"Variable",name:"data",variableName:"input"}],d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,concreteType:"EmailSubscriptionCategory",kind:"LinkedField",name:"email_subscription_categories",plural:!0,selections:[d],storageKey:null};return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"OCAccountChangeEmailSubscriptionsMutation",selections:[{alias:null,args:c,concreteType:"UserEditResponsePayload",kind:"LinkedField",name:"user_edit",plural:!1,selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[e],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"OCAccountChangeEmailSubscriptionsMutation",selections:[{alias:null,args:c,concreteType:"UserEditResponsePayload",kind:"LinkedField",name:"user_edit",plural:!1,selections:[{alias:null,args:null,concreteType:"User",kind:"LinkedField",name:"user",plural:!1,selections:[e,d],storageKey:null}],storageKey:null}]},params:{id:b("OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation"),metadata:{},name:"OCAccountChangeEmailSubscriptionsMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
OCAccountChangeEmailSubscriptionsMutation_oculusRelayOperation",[],(function(a,b,c,d,e,f){e.exports="7104960989574118"}),null);
-----