import{e as a}from"./main-few-lands-burn.js";const r=n=>({$:t,e})=>{t.setThisComponent(o=>{o.value=e}),t.setDb(o=>{o[n]=e})},s=n=>({addConnectionHelpingText:a('To get access token and business ID information, please visit <a target="_blank" class="text-blue-600 underline" rel="noopener noreferrer nofollow" href="https://developers.facebook.com/docs/whatsapp/business-management-api/get-started">WhatsApp Business API</a>'),componentName:n.componentName.connection,connectionsTypes:[{encryptKeys:["token"],label:a("WhatsApp Business API"),type:"bearer_token",verifyConnection:{headers:{Authorization:""},method:"GET",responseKeyMatch:["id","name"],url:""}}],extraComponents:[{componentName:n.componentName.input,id:"business-id",label:a("Business ID"),onChange:"HANDLE_BUSINESS_ID",render:!0,required:!0,value:void 0,wrapperClassName:"mb-2"},{componentName:n.componentName.input,fieldType:"config",id:"phone-number-id",label:a("Phone Number ID "),onChange:"SET_PHONE_NUMBER_ID",path:"phoneNumberId",render:!0,required:!0,value:void 0,wrapperClassName:"mb-2"}],extraData:{},fieldType:"config",id:"connection-id",label:a("Select Connection"),onConnectionAddChange:"CONNECTION_ADD_CHANGE",onConnectionChange:"SET_CONNECTION",render:!0,value:void 0}),c=({$:n,e:t})=>{n.setThisComponent(e=>{n.util.isConnectionComponent(e)&&e.connectionsTypes.forEach(o=>{o.type==="bearer_token"&&o.verifyConnection?.headers&&t.token&&(o.verifyConnection.headers.Authorization="Bearer "+t.token)})})},u=({$:n,e:t})=>{n.setThisComponent(e=>{e.value=t.target.value}),n.setDb(e=>{e.businessId=t.target.value}),n.setComponent("connection-id",e=>{n.util.isConnectionComponent(e)&&(e.connectionsTypes[0]?.verifyConnection&&(e.connectionsTypes[0].verifyConnection.url=`https://graph.facebook.com/v19.0/${t.target.value}`),e.extraData||(e.extraData={}),e.extraData.businessId=t.target.value)})},p=({$:n,e:t})=>{n.setThisComponent(e=>{e.value=t.target.value}),n.setDb(e=>{e.phoneNumberId=t.target.value}),n.setComponent("connection-id",e=>{n.util.isConnectionComponent(e)&&(e.extraData||(e.extraData={}),e.extraData.phoneNumberId=t.target.value)})},m=n=>({componentName:n.componentName.mixInput,helperText:a("Enter the recipient phone number in international format with country code, without using ' + '. Ex: 919822012345. you must preregister the receiver's phone number in Meta's developer console."),id:"recipient-phone-number",label:a("Recipient Phone Number"),onChange:"SET_RECIPIENT_NUMBER",path:"to",render:"IF_CONNECTION_SELECTED",required:!0,value:[]});export{u as a,c as b,r as c,s as d,p as h,m as r};
