"use strict";(self.webpackChunk_1js_people_in_taskbar=self.webpackChunk_1js_people_in_taskbar||[]).push([[7660],{22868:(e,t,o)=>{o.r(t),o.d(t,{RequestToJoinWithData:()=>D,default:()=>A});var r=o(43740),p=o(14926),n=o(96206),u=o(43938),s=o(30446),l=o(84957),i=o(29430),a=o(41893),c=o(71124),T=o(51634),d=o(8618);const x=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupTitle"),g=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupSubtext"),q=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupTextFieldPlaceholder"),b=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupCancelButtonLabel"),J=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupRequestButtonLabel"),E=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupOkButtonLabel"),P=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupErrorTitleText"),h=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupErrorSubtext"),m=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupRequestingLabel"),L=(0,T.Ex)("lpc-card-group-popup.requestToJoinPopupTextTooLargeErrorText");var k=o(576),C=o(47911),B=o(88609),S=o(42201),y=o(9930),R=o(69053),_=o(63736),f=o(72627),v=o(95852),F=o(59116),M=o(55492),N=o(42124);const j=(0,o(38217).J9)((e=>(0,N.l8)({dialog:{minHeight:"152px",borderRadius:"8px"},spinnerStyles:{padding:"0px 2px 0px 0px"},description:{fontWeight:400,fontSize:12,paddingBottom:"0px",paddingTop:"0px"},buttons:{borderRadius:"4px",padding:"0px 8px"}}))),w={padding:"10px 0px 0px 0px",childrenGap:5},z=e=>{let{setRequestToJoinMessage:t,requestToJoinMessage:o,title:r,errorDescription:p,warningMessage:n,textField:u,primaryButton:s,secondaryButton:l,processing:i}=e;const a=(0,C._)(),T=j(a),d={type:B.h.close,title:r},x={containerClassName:T.dialog},g=c.useCallback((()=>i?c.createElement("div",{className:T.spinnerStyles},c.createElement(S.y,{labelPosition:"left",size:y.H.small})):c.createElement(c.Fragment,null)),[i]);return c.createElement(k.O5,null,c.createElement(R.l,{minWidth:560,maxWidth:560,hidden:!1,onDismiss:null==l?void 0:l.onClick,modalProps:x,dialogContentProps:d},u&&c.createElement(_.A,{placeholder:u.placeholder,label:u.label,multiline:!0,resizable:!1,errorMessage:n,rows:4,value:o,onChange:(e,o)=>{t(o||"")}}),!u&&c.createElement(f.J,{className:T.description},p),c.createElement(v.B,{tokens:w,reversed:!0,horizontal:!0,verticalAlign:"center"}," ",l&&c.createElement(F.Y,{onClick:l.onClick,text:l.title,className:T.buttons,disabled:l.disabled}),s&&c.createElement(M.j,{onClick:s.onClick,text:s.title,onRenderIcon:g,className:T.buttons,disabled:s.disabled}))))},D=e=>{const t=(0,r.jE)(),o={requestToJoinPopupTitleText:(0,d.Lh)(x),requestToJoinPopupSubtextText:(0,d.Lh)(g),requestToJoinPopupTextFieldPlaceholderText:(0,d.Lh)(q),requestToJoinPopupCancelButtonLabelText:(0,d.Lh)(b),requestToJoinPopupRequestButtonLabelText:(0,d.Lh)(J),requestToJoinPopupOkButtonLabelText:(0,d.Lh)(E),requestToJoinPopupErrorTitleText:(0,d.Lh)(P),requestToJoinPopupErrorSubtextText:(0,d.Lh)(h),requestToJoinPopupRequestingLabelText:(0,d.Lh)(m),requestToJoinPopupTextTooLargeErrorText:(0,d.Lh)(L)},[,T]=(0,l.l)();T("Sticky");const[k,C]=(0,c.useState)(!1),[B,S]=(0,c.useState)(""),[y,R]=(0,c.useState)(!1),[_,f]=(0,c.useState)(!1),[v]=(0,s._A)(),F=(0,a.BB)(),[M,N]=(0,u.z)(F,v,B),j=(0,i.o3)(p.jK,(()=>{T("NonSticky"),e.onClose()})),w=(0,i.o3)(p.A_,(()=>{k||(C(!0),M(null))})),{trapFocus:D,untrapFocus:A}=(0,n.X)();return c.useEffect((()=>(A(),()=>{D()})),[]),c.useEffect((()=>{B.length>=256?(R(!0),f(!0)):(R(!1),f(!1))}),[B]),"success"===N.state?(t.invalidateQueries({queryKey:["group/about"]}),e.onClose(),c.createElement(c.Fragment,null)):"error"===N.state?c.createElement(z,{setRequestToJoinMessage:S,requestToJoinMessage:B,title:o.requestToJoinPopupErrorTitleText,errorDescription:o.requestToJoinPopupErrorSubtextText,secondaryButton:{title:o.requestToJoinPopupOkButtonLabelText,onClick:j},processing:!1}):c.createElement(z,{setRequestToJoinMessage:S,requestToJoinMessage:B,title:o.requestToJoinPopupTitleText,errorDescription:o.requestToJoinPopupErrorSubtextText,textField:{label:o.requestToJoinPopupSubtextText,placeholder:o.requestToJoinPopupTextFieldPlaceholderText},primaryButton:{title:o.requestToJoinPopupRequestButtonLabelText,onClick:w,disabled:y},secondaryButton:{title:o.requestToJoinPopupCancelButtonLabelText,onClick:j,disabled:y},processing:k,warningMessage:_?o.requestToJoinPopupTextTooLargeErrorText:void 0})},A=D}}]);