CTWAAutoReplyCTADropdown.react",["fbt","$InternalEnum","AdsInterfacesLogger","AdsMessengerConstants","AdsWhatsAppUtils","GeoBaseText.react","GeoFlexbox.react","GeoSelector.react","GeoSelectorItem.react","GeoTextInput.react","GeoTextPairing.react","URI","ads-lib-urllib","adsMessengerDataModelClone","adsMessengerDataModelGetCTWAAutoReplyFirstCTA","adsMessengerDataModelGetCTWAAutoReplyFirstCTAURL","adsMessengerDataModelSetCTWAAutoReplyCTA","first","react","setByPath","useDebouncedOnChange"],(function(a,b,c,d,e,f,g,h){var i,j,k=j||(j=d("react")),l=j.useState,m=b("$InternalEnum").Mirrored(["NONE","CTA_RTC_VOICE_CALL","CTA_URL","CTA_CATALOG"]),n=h._("Website URL"),o=h._("WhatsApp number"),p=h._("WhatsApp catalogue"),q=h._("Use the catalogue associated with my WhatsApp Business account."),r=750;function a(a){var b=a.adgroupIDs,e=a.onWelcomeMessageJSONChange,f=a.page,g=a.pageID,h=a.pageWhatsAppNumberID,i=a.welcomeMessageJSON;a=l((a=m.cast(c("adsMessengerDataModelGetCTWAAutoReplyFirstCTA")(i)))!=null?a:m.NONE);var j=a[0],n=a[1];return k.jsxs("div",{children:[k.jsx("div",{className:"x1e56ztr",children:k.jsxs(c("GeoSelector.react"),{"data-testid":void 0,isLabelHidden:!0,label:"CTA Dropdown menu",value:j,onChange:function(a){n(a),e(c("adsMessengerDataModelSetCTWAAutoReplyCTA")(i,a)),t(a,g,b)},children:[k.jsx(c("GeoSelectorItem.react"),{"data-testid":void 0,label:d("AdsMessengerConstants").AUTO_REPLY_CTA_LABELS.NONE,value:m.NONE}),k.jsx(c("GeoSelectorItem.react"),{"data-testid":void 0,label:d("AdsMessengerConstants").AUTO_REPLY_CTA_LABELS.CTA_RTC_VOICE_CALL,value:m.CTA_RTC_VOICE_CALL}),k.jsx(c("GeoSelectorItem.react"),{"data-testid":void 0,label:d("AdsMessengerConstants").AUTO_REPLY_CTA_LABELS.CTA_URL,value:m.CTA_URL}),k.jsx(c("GeoSelectorItem.react"),{"data-testid":void 0,label:d("AdsMessengerConstants").AUTO_REPLY_CTA_LABELS.CTA_CATALOG,value:m.CTA_CATALOG})]})}),k.jsxs(c("GeoFlexbox.react"),{children:[j===m.CTA_RTC_VOICE_CALL&&k.jsx(w,{page:f,pageWhatsAppNumberID:h}),j===m.CTA_CATALOG&&k.jsx(x,{}),j===m.CTA_URL&&k.jsx(v,{welcomeMessageJSON:i,onWelcomeMessageJSONChange:e})]})]})}a.displayName=a.name+" [from "+f.id+"]";function s(a,b,d){c("AdsInterfacesLogger").log({eventName:a,data:(a={},a.adgroup_id=c("first")(d),a.page_id=b,a)})}function t(a,b,c){switch(a){case m.NONE:s("ctwa_auto_reply_cta_none",b,c);return;case m.CTA_RTC_VOICE_CALL:s("ctwa_auto_reply_cta_rtc_voice_call",b,c);return;case m.CTA_URL:s("ctwa_auto_reply_cta_url",b,c);return;case m.CTA_CATALOG:s("ctwa_auto_reply_cta_catalog",b,c);return}}var u=function(a){return c("ads-lib-urllib").isUrl(a)&&(i||(i=c("URI"))).isValidURI(c("ads-lib-urllib").normalize(a))};function v(a){var b=a.onWelcomeMessageJSONChange,d=a.welcomeMessageJSON;a=(a=c("adsMessengerDataModelGetCTWAAutoReplyFirstCTAURL")(d))!=null?a:"";function e(a){var e,f=c("adsMessengerDataModelClone")(d);e=(e=c("adsMessengerDataModelGetCTWAAutoReplyFirstCTAURL")(f))!=null?e:"";if(e===a)return;c("setByPath")(f,["auto_reply","buttons","0","url"],a);b(f)}a=c("useDebouncedOnChange")(a,e,r);e=a[0];a=a[1];return k.jsxs("div",{className:"xh8yej3",children:[k.jsx(c("GeoBaseText.react"),{color:"value",size:"value",children:n}),k.jsx("div",{className:"xh8yej3 x1ok221b",children:k.jsx(c("GeoTextInput.react"),{"data-testid":void 0,description:"website",errorMessage:u(e)?null:h._("URL can"t be used: The URL that you entered doesn"t direct to a website. Please check your website URL and try again."),isLabelHidden:!0,label:"website url",maxLength:200,placeholder:"www.example.com",value:e,onChange:a})})]})}v.displayName=v.name+" [from "+f.id+"]";function w(a){var b=a.page;a=a.pageWhatsAppNumberID;var e=null;b!=null&&(e=d("AdsWhatsAppUtils").getWhatsAppNumberFormatted(b,a));return k.jsx("div",{className:"xydt3hl x1a2cdl4 xnhgr82 x1qt0ttw xgk8upj xh8yej3 x1y1aw1k x1sln4lm xwib8y2",children:k.jsx(c("GeoTextPairing.react"),{description:e,heading:o,size:"header4"})})}w.displayName=w.name+" [from "+f.id+"]";function x(){return k.jsx("div",{className:"xydt3hl x1a2cdl4 xnhgr82 x1qt0ttw xgk8upj xh8yej3 x1y1aw1k x1sln4lm xwib8y2",children:k.jsx(c("GeoTextPairing.react"),{description:q,heading:p,size:"header4"})})}x.displayName=x.name+" [from "+f.id+"]";g["default"]=a}),226);
-----
adsMessengerDataModelGetCTWAAutoReplyFirstCTAURL",[],(function(a,b,c,d,e,f){"use strict";function a(a){return(a=a.auto_reply)==null?void 0:(a=a.buttons)==null?void 0:(a=a.at(0))==null?void 0:a.url}f["default"]=a}),66);
-----
adsMessengerDataModelGetCTWAAutoReplyFirstCTAURL",[],(function(a,b,c,d,e,f){"use strict";function a(a){return(a=a.auto_reply)==null?void 0:(a=a.buttons)==null?void 0:(a=a.at(0))==null?void 0:a.url}f["default"]=a}),66);
-----