1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`20261001-39361-126a85bd`},e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:textmagic-web-app":!0});var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`d821d984-99f4-448c-9df7-9bf993b82654`,e._sentryDebugIdIdentifier=`sentry-dbid-d821d984-99f4-448c-9df7-9bf993b82654`)}catch{}})();import{Mr as e,jn as t}from"./D1KcagSz.js";import{E as n,Ft as r,H as i,kt as a,yt as o}from"./CPzLrubv.js";import{Aa as s,Io as c,_m as l,cs as u,gm as d,xa as f}from"./DAD6CFn-.js";import{$c as p,Br as m,C as h,Do as g,Fc as _,Kl as v,Mn as y,Vc as b,ac as x,pp as S}from"./TmSZSC_3.js";import{Ct as C,Y as w}from"./BHfckxVT.js";import{Kn as T,gt as E,ht as D,mt as O,pt as k,vt as A}from"./index_6BOmQYt5.js";import{t as j}from"./qwdaqbu9.js";import{i as M}from"./gjmHT5KH.js";i(),a();var N=(()=>{let e=S(),t=b(),i=p(),a=n(()=>e.getCurrentUserOrNull()),s=n(()=>a.value?a.value.balance:null),c={shortLink:r(``),isNotEnoughBalance:r(!1),isByocPlanLimitExceed:r(!1),isMaxLength:r(!1),are500canadianNumbersSelected:r(!1),hasAmericanRecipients:r(!1),isBulkSession:r(!1),isLargeBulkSession:r(!1),deficitCreditAmount:r(0),smsInfo:r({chars:0,maxChars:0,parts:0,maxParts:0,unicodeChars:[],isUnicodeText:!1,overflow:!1})},l=e=>t.getProperty(e),u=()=>(l(`recipientsCount`)??0)>100,d=()=>(l(`recipientsCount`)??0)>k,m=()=>(l(`canadianRecipientsCount`)??0)>500,g=()=>!!l(`americanRecipientsCount`),_={updateRecipientsCount:()=>{c.isBulkSession.value=u(),c.isLargeBulkSession.value=d(),c.are500canadianNumbersSelected.value=m(),c.hasAmericanRecipients.value=g()},updateTotalCost:()=>{if(s.value===null)return;let e=t.getProperty(`total`)??0,n=Math.max(e-s.value,0);c.isNotEnoughBalance.value=n>0,c.deficitCreditAmount.value=n},updateMessage:e=>{c.smsInfo.value=C(e),c.isMaxLength.value=c.smsInfo.value.overflow,c.shortLink.value=(T.exec(e)||``)[0]}},v=e=>{if(w(e))c.isByocPlanLimitExceed.value=!0;else{if(e instanceof h){i.notifyWarning(e.message);return}f(e)}},y=()=>{let e=n(()=>l(`recipientsCount`));o(e,()=>{_.updateRecipientsCount()},{immediate:!0})};return o(s,()=>{_.updateTotalCost()}),()=>({...c,..._,handleSubmitError:v,watchUpdateRecipientsCount:y})})(),P=()=>{let{open:e}=l(D);return{open:t=>e(t)}},F=()=>e=>l(E).open(e),I,L,R=()=>({open:e=>{L=d(u),L.open({...e,submitCallback:I})},setSubmitCallBack:e=>{I=e},init:()=>L.init()}),z=(n,i,a)=>{let o=b(),s=_(),c=g(),l=r(``),u=r(!1),d=async({recipients:e,text:t,from:n},r)=>
1{let i={...s.getRequestParamsFromRecipients(e),text:t?j(t):``,from:n??null,includeBlocked:!0};u.value=!0;try{await o.updateMessagesPrice(i,r),c.replaceRecipientsCount(o.getProperty(`recipientsCount`)??0),l.value=``}catch(e){e instanceof y&&(l.value=e.getData().data.errors?.common?.[0]??``)}u.value=!1},f=r(i.value);return e(i,()=>{let e=f.value;f.value=i.value;let n=f.value;n&&e&&(t(n.recipients,e?.recipients)&&n.text===e?.text&&n.from===e?.from||d(n,[...a]))},{immediate:!0,deep:!0,debounce:500}),{errorMessage:l,loading:u,refreshMessagesPrice:()=>{f.value&&d(f.value,[...a])}}},B=e=>{let{formService:t}=s(e),n=b(),r=v(),i=x(),{clearContent:a}=M(e),o=e=>e.filter(e=>!e.isDeleted),l=async n=>{let{recipients:r}=t.getFormData(),a={},o={},s=e=>`${e.entityType}:${e.entityId}`;r.forEach(e=>{o[s(e)]=e.entityType,e.value&&(a[e.value]=e.entityType)});let c=e=>o[s(e)]===e.entityType,l=e=>e.value?a[e.value]===e.entityType:!1,u=n.filter(e=>{if(e.entityType===`contact`||e.entityType===`contact_email`)return!c(e);if(e.entityType===`email`||e.entityType===`raw`)return!l(e);if(e.entityType===`filtered_view`||e.entityType===`list`)return!c(e);if(e.entityType===`reply`||e.entityType===`reply_email`)return!l(e);throw new m(e.entityType)});if(!u.length)return;let d=[...r,...u];t.onInput(A,d),await i.onInputAction(`${e}.${A}`,`input`,e)};return{addRawRecipients:e=>{e.length&&l(e.map(e=>r.makeRecipientOptionFromPhoneNumber(e)))},addRecipients:l,addContacts:e=>{l(o(e).filter(e=>!e.blocked).map(e=>r.makeRecipientOptionFromContact(e)))},addContactEmails:e=>{l(e.map(e=>r.makeRecipientOptionFromContactEmail(e)))},addEmails:e=>{l(e.map(e=>r.makeRecipientOptionFromEmail(e)))},addReplyEmails:e=>{l(e.map(e=>r.makeRecipientOptionFromReplyEmail(e)))},addLists:e=>{l(o(e).map(e=>r.makeRecipientOptionFromContactList(e)))},addFilteredViews:e=>{l(o(e).map(e=>r.makeRecipientOptionFromFilteredView(e)))},clearRecipients:()=>{t.onInput(A,[])},clearMessage:async()=>{t.onInput(O,c),a()},getMessagesPriceProperty:e=>n.getProperty(e)}},V=`messagesBulksProgressModal`;export{F as a,P as i,z as n,N as o,B as r,R as s,V as t}; 2//# sourceMappingURL=Bhqw0RQK.js.map
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.