BizInboxMessagePhoneNumberAutomationLightweightDialog.react",["fbt","BIZInboxClientLogger","BizInboxMessagePhoneNumberAutomationLightweightDialogQuery.graphql","BizInboxNavChannelUtils","BizInboxPhoneNumberAutomationEditView.react","BizInboxStateContext","BusinessAutomatedResponseLogger","CometRelay","GeoBaseText.react","GeoButton.react","GeoFlexbox.react","GeoModalFooter.react","GeoModalHeader.react","GeoModal_DEPRECATED.react","GeoSection.react","GeoSwitch.react","GeoToast.react","GeoTooltip.react","LayerHideSources","RelayHooks","geoMargin","react","requireDeferred","useGeoToaster"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k=j||(j=d("react"));e=j;var l=e.useContext,m=e.useState,n=c("requireDeferred")("BizInboxAutomationRuleMutation").__setRef("BizInboxMessagePhoneNumberAutomationLightweightDialog.react"),o=i!==void 0?i:i=b("BizInboxMessagePhoneNumberAutomationLightweightDialogQuery.graphql");function a(a){var b=a.props,e=b.onHide,f=b.isShown,g=b.onConfirmClickCallback,i=b.responseToSave,j=b.userMessage;b=a.queries;a=d("CometRelay").usePreloadedQuery(o,b.BizInboxMessagePhoneNumberAutomationLightweightDialogQueryReference);b=x(a);x=m(function(){return i});var p=x[0];x=x[1];var q=a.biz_inbox_automation_rule_query[0];a=(q==null?void 0:q.rule_id)!=null;a=m(a);var r=a[0];a=a[1];var s=l(c("BizInboxStateContext")),t=s.pageID,u=s.selectedThreadType,v=d("RelayHooks").useRelayEnvironment();s=c("useGeoToaster")();var w=s.add;function x(a){var b=[];(a=a.biz_inbox_supported_macros)==null||(a=a.macros)==null||a.forEach(function(a){a.description!=null&&a.example!=null&&a.title!=null&&a.is_available!=null&&a.key!=null&&b.push({description:a.description,example:a.example,instagramDescription:a.instagram_description,isAvailable:a.is_available,key:a.key,title:a.title,value:a.value})});return b}function y(a,b){Object.keys(a).length>0&&d("BusinessAutomatedResponseLogger").logFaqContentSave(t,a,b)}function z(){var a;if(p==="")return;var b={};b[j]=p;var f="MESSENGER",i={rule_id:(a=q==null?void 0:q.rule_id)!=null?a:null,page_id:t,rule_name:(a=q==null?void 0:q.rule_name)!=null?a:"Phone Number Automation - "+new Date().toISOString(),predefined_usecase:"PHONE_NUMBER",asset_type:[f],condition_type:"ALL_OF",condition_data:[{condition_field_type:"MESSAGE_PHONE_DETECTION"}],action_data:[{action_type:"SEND_MESSAGE",send_message_action_data:{attachments:[],ctas:[],dynamic_text:null,message_text:p}}].concat(r?[{action_type:"INITIATE_CALL",initiate_call_action_data:{is_enabled:!0}}]:[]),rule_status:null,trigger_type:null,followup_question_link_status:null,next_linked_automation_rule_id:null};n.onReady(function(a){a.commit(v,i,{onSuccess:function(){var a=u==="IG_MESSAGE"?"INSTAGRAM_DIRECT":"MESSENGER";y(b,a);d("BIZInboxClientLogger").logAutomationSave(t,[a],"PHONE_NUMBER","",!0,null);w(k.jsx(c("GeoToast.react"),{heading:h._(/*BTDS*/"Phone number automation saved"),description:h._(/*BTDS*/"Your automated response for phone number requests is now active."),status:"success"}));e(c("LayerHideSources").LAYER_HIDE_BUTTON)},onFailure:function(){var a=u==="IG_MESSAGE"?"INSTAGRAM_DIRECT":"MESSENGER";d("BIZInboxClientLogger").logAutomationSave(t,[a],"PHONE_NUMBER","",!1,null);w(k.jsx(c("GeoToast.react"),{heading:h._(/*BTDS*/"Failed to save automation"),description:h._(/*BTDS*/"There was an error saving your phone number automation. Please try again."),status:"error"}));g(!1,!1)}})})}s=function(a){e(a)};return k.jsx(c("GeoModal_DEPRECATED.react"),{"data-testid":void 0,logging:{surface:"inbox-phone-number-automation-lightweight-dialog-modal-addc"},footer:k.jsx(c("GeoModalFooter.react"),{primaryButton:k.jsx(c("GeoButton.react"),{"data-testid":void 0,logging:{surface:"phone-number-automation-lightweight-dialog-button-save-eccc"},label:h._(/*BTDS*/"Save"),onClick:z,variant:"primary",isDisabled:p===""})}),header:k.jsx(c("GeoModalHeader.react"),{heading:h._(/*BTDS*/"Set up phone number response"),description:h._(/*BTDS*/"Save this answer to respond automatically in the future when people send you a phone number or ask you to call them. To manage this response, go to {=m2} .",[h._implicitParam("=m2",k.jsx("a",{href:"#",onClick:function(){return d("BizInboxNavChannelUtils").redirectToAutomationOnNewTab(t)},children:h._(/*BTDS*/"Automations")}))])}),isShown:f,onHide:s,children:k.jsxs(c("GeoSection.react"),{children:[k.jsx(c("GeoBaseText.react"),{color:"heading",size:"header4",weight:"bold",children:h._(/*BTDS*/"When you receive a phone number from a customer:")}),k.jsx(c("GeoFlexbox.react"),{direction:"column",xstyle:c("geoMargin").top8,children:k.jsx(c("BizInboxPhoneNumberAutomationEditView.react"),{changeResponseToSave:x,initialResponse:i,supportedMacros:b})}),k.jsxs(c("GeoFlexbox.react"),{direction:"column",xstyle:c("geoMargin").top16,children:[k.jsxs(c("GeoFlexbox.react"),{justifyContent:"space-between",children:[k.jsxs("div",{children:[k.jsx(c("GeoBaseText.react"),{color:"heading",size:"header4",weight:"bold",children:h._(/*BTDS*/"Invite people to call you on Messenger")}),k.jsx(c("GeoTooltip.react"),{content:h._(/*BTDS*/"Encourage people to call you on Messenger after their first response.")})]}),k.jsx(c("GeoSwitch.react"),{"data-testid":void 0,isDisabled:!1,isLabelHidden:!1,label:r?h._(/*BTDS*/"On"):h._(/*BTDS*/"Off"),labelPosition:"prefix",value:r,onChange:a})]}),k.jsx(c("GeoBaseText.react"),{color:"headingDescription",size:"value",weight:"normal",children:h._(/*BTDS*/"When enabled, customers will see a call button along with your automated response, making it easy for them to call you directly.")})]})]})})}a.displayName=a.name+" [from "+f.id+"]";g["default"]=a}),226);
-----
BizInboxMessagePhoneNumberAutomationLightweightDialogQuery.graphql",["BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation","relay-runtime"],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"automationType"},c={defaultValue:null,kind:"LocalArgument",name:"pageID"},d={alias:null,args:[{kind:"Variable",name:"automation_type",variableName:"automationType"},{kind:"Variable",name:"page_id",variableName:"pageID"}],concreteType:"BizInboxSupportedMacros",kind:"LinkedField",name:"biz_inbox_supported_macros",plural:!1,selections:[{alias:null,args:null,concreteType:"BizInboxMacro",kind:"LinkedField",name:"macros",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"example",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"instagram_description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null},e=[{kind:"Variable",name:"asset_id",variableName:"pageID"},{kind:"Literal",name:"predefined_usecases",value:["PHONE_NUMBER"]}],f={alias:null,args:null,kind:"ScalarField",name:"rule_id",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"rule_name",storageKey:null},h={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"action_type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null}],type:"BizInboxAutomatedSendMessageActionResponse",abstractKey:null};return{fragment:{argumentDefinitions:[a,c],kind:"Fragment",metadata:null,name:"BizInboxMessagePhoneNumberAutomationLightweightDialogQuery",selections:[d,{alias:null,args:e,concreteType:"BizInboxAutomationRuleResponse",kind:"LinkedField",name:"biz_inbox_automation_rule_query",plural:!0,selections:[f,g,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"action_data_list",plural:!0,selections:[h],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[c,a],kind:"Operation",name:"BizInboxMessagePhoneNumberAutomationLightweightDialogQuery",selections:[d,{alias:null,args:e,concreteType:"BizInboxAutomationRuleResponse",kind:"LinkedField",name:"biz_inbox_automation_rule_query",plural:!0,selections:[f,g,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"action_data_list",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},h],storageKey:null}],storageKey:null}]},params:{id:b("BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation"),metadata:{},name:"BizInboxMessagePhoneNumberAutomationLightweightDialogQuery",operationKind:"query",text:null}}}();b("relay-runtime").PreloadableQueryRegistry.set(a.params.id,a);e.exports=a}),null);
-----
BizInboxMessagePhoneNumberAutomationLightweightDialog.entrypoint",["BizInboxMessagePhoneNumberAutomationLightweightDialogQuery$Parameters","JSResourceForInteraction"],(function(a,b,c,d,e,f,g){"use strict";a={getPreloadProps:function(a){var b=a.pageID;a=a.automationType;return{queries:{BizInboxMessagePhoneNumberAutomationLightweightDialogQueryReference:{parameters:c("BizInboxMessagePhoneNumberAutomationLightweightDialogQuery$Parameters"),variables:{pageID:b,automationType:a}}}}},root:c("JSResourceForInteraction")("BizInboxMessagePhoneNumberAutomationLightweightDialog.react").__setRef("BizInboxMessagePhoneNumberAutomationLightweightDialog.entrypoint")};g["default"]=a}),98);
-----
BizInboxMessagePhoneNumberAutomationLightweightDialogQuery$Parameters",["BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a={kind:"PreloadableConcreteRequest",params:{id:b("BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation"),metadata:{},name:"BizInboxMessagePhoneNumberAutomationLightweightDialogQuery",operationKind:"query",text:null}};e.exports=a}),null);
-----
BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24101337742870140"}),null);
-----
-----
BizInboxMessagePhoneNumberAutomationLightweightDialogQuery.graphql",["BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation","relay-runtime"],(function(a,b,c,d,e,f){"use strict";a=function(){var a={defaultValue:null,kind:"LocalArgument",name:"automationType"},c={defaultValue:null,kind:"LocalArgument",name:"pageID"},d={alias:null,args:[{kind:"Variable",name:"automation_type",variableName:"automationType"},{kind:"Variable",name:"page_id",variableName:"pageID"}],concreteType:"BizInboxSupportedMacros",kind:"LinkedField",name:"biz_inbox_supported_macros",plural:!1,selections:[{alias:null,args:null,concreteType:"BizInboxMacro",kind:"LinkedField",name:"macros",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"example",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"instagram_description",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"is_available",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"key",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"value",storageKey:null}],storageKey:null}],storageKey:null},e=[{kind:"Variable",name:"asset_id",variableName:"pageID"},{kind:"Literal",name:"predefined_usecases",value:["PHONE_NUMBER"]}],f={alias:null,args:null,kind:"ScalarField",name:"rule_id",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"rule_name",storageKey:null},h={kind:"InlineFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"action_type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"text",storageKey:null}],type:"BizInboxAutomatedSendMessageActionResponse",abstractKey:null};return{fragment:{argumentDefinitions:[a,c],kind:"Fragment",metadata:null,name:"BizInboxMessagePhoneNumberAutomationLightweightDialogQuery",selections:[d,{alias:null,args:e,concreteType:"BizInboxAutomationRuleResponse",kind:"LinkedField",name:"biz_inbox_automation_rule_query",plural:!0,selections:[f,g,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"action_data_list",plural:!0,selections:[h],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[c,a],kind:"Operation",name:"BizInboxMessagePhoneNumberAutomationLightweightDialogQuery",selections:[d,{alias:null,args:e,concreteType:"BizInboxAutomationRuleResponse",kind:"LinkedField",name:"biz_inbox_automation_rule_query",plural:!0,selections:[f,g,{alias:null,args:null,concreteType:null,kind:"LinkedField",name:"action_data_list",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null},h],storageKey:null}],storageKey:null}]},params:{id:b("BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation"),metadata:{},name:"BizInboxMessagePhoneNumberAutomationLightweightDialogQuery",operationKind:"query",text:null}}}();b("relay-runtime").PreloadableQueryRegistry.set(a.params.id,a);e.exports=a}),null);
-----
BizInboxMessagePhoneNumberAutomationLightweightDialog.entrypoint",["BizInboxMessagePhoneNumberAutomationLightweightDialogQuery$Parameters","JSResourceForInteraction"],(function(a,b,c,d,e,f,g){"use strict";a={getPreloadProps:function(a){var b=a.pageID;a=a.automationType;return{queries:{BizInboxMessagePhoneNumberAutomationLightweightDialogQueryReference:{parameters:c("BizInboxMessagePhoneNumberAutomationLightweightDialogQuery$Parameters"),variables:{pageID:b,automationType:a}}}}},root:c("JSResourceForInteraction")("BizInboxMessagePhoneNumberAutomationLightweightDialog.react").__setRef("BizInboxMessagePhoneNumberAutomationLightweightDialog.entrypoint")};g["default"]=a}),98);
-----
BizInboxMessagePhoneNumberAutomationLightweightDialogQuery$Parameters",["BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a={kind:"PreloadableConcreteRequest",params:{id:b("BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation"),metadata:{},name:"BizInboxMessagePhoneNumberAutomationLightweightDialogQuery",operationKind:"query",text:null}};e.exports=a}),null);
-----
BizInboxMessagePhoneNumberAutomationLightweightDialogQuery_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="24101337742870140"}),null);
-----