var f=Object.defineProperty;var g=Object.getOwnPropertySymbols;var l=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var r=(a,e,t)=>e in a?f(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,c=(a,e)=>{for(var t in e||(e={}))l.call(e,t)&&r(a,t,e[t]);if(g)for(var t of g(e))k.call(e,t)&&r(a,t,e[t]);return a};import{_ as o,b as _}from"./main.2.9.0.js";const w=(a,e,t)=>{const n=c({},e),{name:i}=a.target;a.target.value!==""?n[i]=a.target.value:delete n[i],t(c({},n))},y=(a,e,t,n,i,h)=>{if(!a.accessToken){t({accessToken:a.accessToken?"":o("Access Token can't be empty","bit-integrations")});return}t({}),i(!0);const u={accessToken:a.accessToken};_(u,"slack_authorization_and_fetch_channels").then(s=>s).then(s=>{if(s&&s.success){const d=c({},a);d.tokenDetails=s.data,e(d),n(!0),h({show:!0,msg:o("Authorized Successfully","bit-integrations")})}else s&&s.data&&s.data.data||!s.success&&typeof s.data=="string"?h({show:!0,msg:`${o("Authorization failed Cause:","bit-integrations")}${s.data.data||s.data}. ${o("please try again","bit-integrations")}`}):h({show:!0,msg:o("Authorization failed. please try again","bit-integrations")});i(!1)})};export{y as a,w as h};
