Module 625928

2,634 characters · in f08fed5b39d8e5b5.js
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>R});var l=n(627968),i=n(64700),s=n(503698),r=n.n(s),a=n(14877),o=n(17928),c=n(990078),u=n(403581),d=n(834730),h=n(140735),m=n(793574),p=n(688810),f=n(135621),g=n(287809),x=n(428262),A=n(192308),C=n(939249),E=n(404374),I=n(734057),y=n(309010),S=n(174459),v=n(652215),N=n(375708),_=n(341867);function T(){(0,A.openModalLazy)(async()=>{let{default:e}=await Promise.all([n.e("35257"),n.e("66920")]).then(n.bind(n,220763));return t=>(0,l.jsx)(e,{...t})})}function j(e){let{className:t,iconOnly:n}=e,s=(0,o.bG)([y.A,I.A],()=>{let e=I.A.getChannel(y.A.getChannelId());return e?.isPrivate()?v.liQ.DM_CHANNEL:v.liQ.GUILD_CHANNEL}),{analyticsLocations:a}=(0,p.Ay)(m.A.PREMIUM_UPSELL);return i.useEffect(()=>{S.default.track(v.HAw.PREMIUM_UPSELL_VIEWED,{type:"longer messages inline",location:{location_page:s,location_section:v.JJy.CHANNEL_TEXT_AREA},location_stack:a})},[s,a]),n?(0,l.jsx)(C.D,{className:_.e7,onClick:()=>T(),children:(0,l.jsx)(c.m,{text:N.intl.string(N.t["+eFIjX"]),position:"top",children:(0,l.jsx)(u.t,{size:"md",color:"currentColor",className:_.M2})})}):(0,l.jsxs)("div",{className:r()(_.zr,t),children:[(0,l.jsx)(u.t,{size:"md",className:_.M2,color:E.k0.PREMIUM_TIER_2}),(0,l.jsx)(d.E,{className:_.Qq,variant:"text-sm/normal",children:N.intl.format(N.t.BNAIBU,{onLearnMore:T})})]})}var b=n(481395);function R(e){let{type:t,textValue:n,maxCharacterCount:i,showRemainingCharsAfterCount:s,className:A}=e,C=(0,o.bG)([g.default],()=>x.Ay.canUseIncreasedMessageLength(g.default.getCurrentUser())),E=(0,f.A)(),I=i??E,y=s??i??E/10,S=n.length,_=null!=t.upsellLongMessages&&(S??0)>v.uvi&&C,T=null!=t.upsellLongMessages&&!C,R=I-S,O=R>y;(0,a.$)({currentLength:S,maxLength:I,message:N.intl.string(N.t.c2Jqed)});let M=0===R?N.intl.string(N.t.tU6YQ7):R>0?N.intl.formatToPlainString(N.t.qH8uFW,{count:R}):N.intl.string(N.t.YSRIqa),{analyticsLocations:L}=(0,p.Ay)(m.A.CHARACTER_COUNT);if(!(_&&R>=0||!O||T&&!O))return null;let w=R>=0;return(0,l.jsx)(p.f5,{value:L,children:(0,l.jsxs)("div",{className:r()(A,b.Dq),children:[(0,l.jsxs)("div",{className:b.SW,children:[_&&w?(0,l.jsx)(c.m,{text:N.intl.formatToPlainString(N.t.vcvHa0,{maxLength:I}),position:"top",children:(0,l.jsx)(u.t,{size:"md",color:"currentColor",className:b.y})}):null,O?null:(0,l.jsx)(c.m,{text:M,position:"top",children:(0,l.jsx)(d.E,{variant:"text-sm/semibold",tabularNumbers:!0,"aria-hidden":!0,color:w?"text-default":"text-feedback-critical",children:R})})]}),(0,l.jsx)(h.A,{children:N.intl.format(N.t.qH8uFW,{count:R})}),T&&!O?(0,l.jsx)(j,{className:b.UX,iconOnly:t.upsellLongMessages?.iconOnly||!1,remaining:R}):null]})})}}