PageSourceSearch

https://apps.embluemail.com/r/ema-app-new-ui/17178e218daab1b5cb8a1…/SubjectButtons-BAKsmRCw.js

js embluemail.com collected 2026-09-24 17:20:32 UTC 7,279 bytes, 1 lines download raw bytes

1import{o as e}from"./chunk-DjMLQNh_.js";import{Bp as t,Df as n,Gd as r,Oi as i,Pm as a,Rp as o,Wu as s,Yp as c,ap as l,er as u,gd as d,kf as f,ki as p,md as m,mr as h,ot as g,qp as _,sf as v,tp as y}from"./components-Bq6XaUXv.js";import{t as b}from"./react-DzvcXMfQ.js";import{t as x}from"./jsx-runtime-HYD0D9MP.js";import{i as S}from"./Campaigns-MANqmcLp.js";import{t as C}from"./useCampaignsService-CJK1cy5Q.js";import{b as w}from"./actionsAtom-B1T1lw8y.js";import{r as T,t as E}from"./useCustomField-R7Rb0GhQ.js";import{a as D,i as O,n as k,o as A,r as j,t as M}from"./module-CbeRW6a0.js";var N=e(b()),P=x(),F=e(t()),I=c(!0);I.debugLabel=`atomGlobalLoadingAction`;var L=c(!1);L.debugLabel=`atomProcessingAction`;var R=u(void 0);R.debugLabel=`atomActionInfoEmail`;var z=u(void 0);z.debugLabel=`atomEmailAddresseesInfo`;var B=c(void 0);B.debugLabel=`atomActionEmailAddresseesByType`;var V=c({offset:0,groupQuantity:20,filterType:{user:!0,profile:!0,integration:!0,interest:!0}});V.debugLabel=`atomAddresseesListPayload`;var H=c(!1);H.debugLabel=`atomActionFinished`;var U=c(0);U.debugLabel=`atomTotalAddressees`;var W=c(!1);W.debugLabel=`atomTotalAddresseesLoading`;var G=c(!0);G.debugLabel=`atomDisableEditAction`;var K=u(!1);K.debugLabel=`atomIsActionInfoEmailErrors`;var q=(e,t)=>{let[n,r]=(0,N.useState)(!1),a=C(),o=h(),s=_(R),c=_(B),l=_(z),u=_(U),d=_(W),f=_(w),m=_(L),g=(0,N.useCallback)(t=>a.setInfoAction(t,e),[e,a]),v=(0,N.useCallback)(e=>e?.reduce((e,t)=>{let n=i[t.type];return e[n]||(e[n]=[]),e[n].push(t),e},{}),[]),y=(0,N.useCallback)(async()=>{r(!0);let n=await a.getEmailInfo(e,t);c(v(n?.groupsAndLists)||[]),s(n),r(!1)},[e,t,a,v,c,s]),b=(0,N.useCallback)(async()=>{r(!0),l(await a.getAddresseesInfo(e)),r(!1)},[e,a,l]),x=(0,N.useCallback)(e=>e?.map(e=>({id:e.id,tipo:p[e.type].toLowerCase()})),[]),T=(0,N.useCallback)(async e=>{let t={grupos:x(e),tipoAccion:S.EMAIL};u(await o.getTotalAddresseesByAction(t))},[x,o,u]),E=(0,N.useCallback)(async(e,t=100)=>{d(!0);try{let n={groups:e.map(e=>({groupId:e.id,type:e.type,systemQueryType:e.systemQueryType??0})),sendPercentageSample:t,approximatedLevel:0},r=await a.getImpactedAudience(n);r&&typeof r.impactedAudienceCount==`number`?u(r.impactedAudienceCount):u(0)}catch(e){console.error(`Error getting impacted audience:`,e),u(0)}finally{d(!1)}},[a,u,d]),D=(0,N.useCallback)(async e=>{u((await o.getSummaryTotalRecipientsV1(e))?.destinatarios)},[o,u]),O=(0,N.useCallback)(async()=>{r(!0),f(await a.getDeliveryAction({actionId:e})||{}),r(!1)},[a,e,f]),k=(0,N.useCallback)(async e=>await a.setDeliveryAction(e),[a]),A=(0,N.useCallback)(async({actionId:e,statusId:t})=>await a.setStateAction({actionId:e,statusId:t}),[a]);return{saveInfoAction:g,getEmailInfo:y,getAddresseesInfo:b,getTotalAddresseesByAction:T,getImpactedAudience:E,getSummaryTotalRecipients:D,setConfirmEmail:(0,N.useCallback)(async()=>{r(!0);let t=await a.confirmMail(e);return r(!1),t},[e,a]),pauseCancelEmail:(0,N.useCallback)(async(t=`pause`)=>{m(!0),t===`pause`?await a.pauseMail(e):await o.cancelReinforcementEmailV1(e),m(!1)},[e,a,o,m]),getDeliveryAction:O,saveDeliveryAction:k,setActionState:A,getShippingTags:(0,N.useCallback)(async()=>{r(!0);let e=await o.getV1ShippingTags();return r(!1),e.statusOK?e.tags.rulesTags:[]},[o]),getCustomField:(0,N.useCallback)(async()=>{try{return r(!0),await o.getListCustomFields()}finally{r(!1)}},[o]),deleteEmailTemplate:(0,N.useCallback)(async e=>{r(!0),await a.deleteMailContent(e),r(!1)},[a]),setTotalAddressees:u,loading:n,action:[]}},J=(0,N.memo)(({text:e})=>(0,P.jsx)(`div`,{className:`py-14`,children:(0,P.jsx)(v,{alignment:`center`,color:`gray`,renderHtml:e,variant:`text`})})),Y={es:O,pt:k,en:D,it:j},X=e=>Y[a(e)]??Y.en,Z=({id:e,disabled:t=!1,lang:n,menuOnTheLeft:r=!1,menuOnTop:i=!1,onSelectEmoji:a})=>{let s=(0,F.default)(`emoji-picker--container`),c=(0,F.default)(`absolute z-20 w-auto rounded-md bg-white outline-none`,{"right-0":r,"left-0":!r,"mt-2 mb-4 origin-top-right":!i,"mb-2 bottom-full origin-bottom-right":i}),u=(0,N.useMemo)(()=>X(n),[n]);return(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)(l,{as:`div`,className:`relative inline-block text-left`,"data-testid":`emoji-picker-component`,children:[(0,P.jsx)(l.Button,{as:`div`,children:(0,P.jsx)(o,{outline:!0,secondary:!0,standard:!0,disabled:t,iconRight:(0,P.jsx)(f,{svgComponent:(0,P.jsx)(m,{})}),id:`${e}__dropdown-button`})}),(0,P.jsx)(y,{as:N.Fragment,enter:`transition ease-out duration-100`,enterFrom:`transform opacity-0 scale-95`,enterTo:`transform opacity-100 scale-100`,leave:`transition ease-in duration-75`,leaveFrom:`transform opacity-100 scale-100`,leaveTo:`transform opacity-0 scale-95`,children:(0,P.jsx)(l.Items,{static:!0,className:c,children:(0,P.jsx)(`div`,{className:s,children:(0,P.jsx)(`div`,{className:`pb-5`,children:(0,P.jsx)(M,{data:A,emojiSize:24,height:150,i18n:u,id:`${e}__emoji-picker`,previewPosition:`none`,set:`native`,theme:`light`,onEmojiSelect:a})})})})})]})})},Q=function(e){return e.TAG=`tag`,e.CUSTOM_FIELD=`customField`,e.EMOJI=`emoji`,e.PREVIEW=`preview`,e}({}),$=({actionId:e,onChangeButtons:t})=>
1{let[n,r]=(0,N.useState)([]),{getShippingTags:i,loading:a}=q(Number(e)),{events:{getCustomFieldsByType:o,translateCustomField:s},state:{loading:c}}=E();(0,N.useEffect)(()=>{(async()=>{e&&r(await i())})()},[i,e]);let l=(0,N.useCallback)(({item:e,type:n})=>{let r=``;n===Q.TAG&&(r=`$RT{${String(e?.id)}${String(e?.label)}}`),n===Q.CUSTOM_FIELD&&(r=`$\{${String(e?.value)}#${String(e?.label)}}`),n===Q.EMOJI&&(r=String(e?.value)),t?.({item:r,type:n})},[t]),u=(0,N.useMemo)(()=>(n||[]).map(e=>({id:e.ruleId,label:`#${e.ruleId}º ${e.name}`,value:e.ruleId,onClick:e=>l({item:e,type:Q.TAG})})),[l,n]),d=(0,N.useMemo)(()=>o({type:T.ALL}).map(e=>({id:e.id,label:s(e.name),value:e.metadata.internalNumber,onClick:e=>l?.({item:e,type:Q.CUSTOM_FIELD})})),[o,l,s]);return{events:{onChangeButton:l},state:{loading:a||c,tagsItemsList:u,customFieldsList:d}}},ee=(0,N.memo)(({id:e,actionId:t,searchPlaceholder:i,disabled:a=!1,vertical:c=!1,exclude:l,onChangeButtons:u,menuOnTheLeft:p=!0,menuOnTop:m=!1})=>{let[h]=g(),{events:{onChangeButton:_},state:{loading:v,tagsItemsList:y,customFieldsList:b}}=$({actionId:t,onChangeButtons:u});return(0,P.jsxs)(`div`,{className:`flex gap-2 ${c?`flex-col`:``}`,children:[!l?.includes(Q.EMOJI)&&(0,P.jsx)(Z,{disabled:a,id:e,lang:h?.language||`en`,menuOnTheLeft:p,menuOnTop:m,onSelectEmoji:e=>_({item:{id:e.id,label:e.name,value:e.native},type:Q.EMOJI})}),!l?.includes(Q.CUSTOM_FIELD)&&(0,P.jsx)(n,{isScrollable:!0,withSearch:!0,disabled:a||v||b.length===0,dropdownItems:b,iconRight:(0,P.jsx)(f,{svgComponent:(0,P.jsx)(r,{})}),id:`${e}__custom-fields`,label:``,menuOnTheLeft:p,menuOnTop:m,searchPlaceholder:i}),!l?.includes(Q.TAG)&&(0,P.jsx)(n,{isScrollable:!0,withSearch:!0,disabled:a||v||y.length===0,dropdownItems:y,iconRight:(0,P.jsx)(f,{strokeColor:`secondary`,svgComponent:(0,P.jsx)(s,{})}),id:`${e}__tags`,label:``,menuOnTheLeft:p,menuOnTop:m,searchPlaceholder:i}),!l?.includes(Q.PREVIEW)&&(0,P.jsx)(o,{outline:!0,secondary:!0,standard:!0,iconRight:(0,P.jsx)(f,{svgComponent:(0,P.jsx)(d,{})}),id:`${e}__preview`,onClick:()=>u({item:`preview`,type:Q.PREVIEW})})]})});export{q as a,G as c,K as d,L as f,J as i,z as l,W as m,Q as n,B as o,U as p,Z as r,R as s,ee as t,I as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.