Loading
function(e,t,n){"use strict";n.d(t,{p:()=>c});var i=n(308528),r=n(493336),s=n(355622),a=n(428249),o=n(451909),l=n(734057),u=n(806150),d=n(381941);async function c(e){let{userId:t,content:n,location:c,openChannel:_=!0,whenReady:h=!1,entry:f,nonce:E}=e,{valid:p,failureReason:m}=await (0,u.i)({type:s.oU.NORMAL,content:n,channel:null});if(!p)throw Error(m);let g=_?await i.A.openPrivateChannel({recipientIds:t,location:c}):await i.A.getOrEnsurePrivateChannel(t),A=l.A.getChannel(g);if(null==A)throw Error("Failed to open private channel");if(null!=f)(0,a.d)({channel:A,content:n,entry:f,whenReady:h,doNotNotifyOnError:!1,location:d.Hx.USER_PROFILE});else{let e=o.Ay.parse(A,n);return r.A.sendMessage(A.id,e,h,{location:d.Hx.USER_PROFILE,nonce:E})}}}