PageSourceSearch

https://botify.ai/static/js/6753.5a089d7c.chunk.js

js botify.ai collected 2026-09-24 09:18:51 UTC 27,171 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunklanding_v3=self.webpackChunklanding_v3||[]).push([[6753],{61993(e,a,t){t.d(a,{Ih:()=>p});var r=t(46676);const i="CommonDialog_modal__cs+Au",n="CommonDialog_modalContainer__xS12b",s="CommonDialog_title__AuT86",o="CommonDialog_dialogMobile__djrgg";var l=t(73629),c=t(17912),d=t(9950),h=t(79600),u=t(96607),_=t(44414);const m="common-dialog",g="common-dialog_container",p=e=>{let a=e.title,t=e.onClose,p=e.children,C=e.className,v=void 0===C?"":C,x=e.disableEnforceFocus,b=e["data-testid"];const f=(0,d.useContext)(h.BR).isMobile;return(0,u.y)(!0),f?(0,_.jsx)(c.D,{title:a,opened:!0,onClose:t,className:"".concat(o," ").concat(v," ").concat(m," ").concat(g),"data-testid":b,children:p}):(0,_.jsx)(r.A,{open:!0,onClose:t,disableEnforceFocus:x,children:(0,_.jsxs)("div",{className:"".concat(i," ").concat(m," ").concat(v),"data-testid":b,children:[(0,_.jsxs)("div",{className:"".concat(n," ").concat(g),children:[(0,_.jsx)("h2",{className:s,children:a}),p]}),(0,_.jsx)(l._K,{onClose:t})]})})}},75370(e,a,t){t.d(a,{D:()=>I});var r=t(89379),i=t(5544),n=t(9950),s=t(46676),o=t(8881);
1const l="BackgroundAiGen_mobileContent__hmrH3",c="BackgroundAiGen_imageContainer__mscuv",d="BackgroundAiGen_image__4NiuF",h="BackgroundAiGen_placeholder__dKyTi",u="BackgroundAiGen_spinnerContainer__i3tYM",_="BackgroundAiGen_textArea__yG1FT",m="BackgroundAiGen_buttonG__z7o8O",g="BackgroundAiGen_btnsRow__HcGE9",p="BackgroundAiGen_buttonRefresh__+OoeR",C="BackgroundAiGen_refreshImg__7KMgt",v="BackgroundAiGen_modal__JrbGh",x="BackgroundAiGen_container__THAKN",b="BackgroundAiGen_title__dASXB",f="BackgroundAiGen_close__cpBD-";var k=t(79600),j=t(59063),N=t(15125),A=t(82015),y=t(97597),w=t(70152),P=t(38232),G=t(83765),D=t(44414);const S=e=>{let a=e.text,t=e.image,r=e.isLoading,i=e.handleChangeText,n=e.handleGenerate,s=e.handleDone;return(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("div",{className:c,children:r?(0,D.jsx)("div",{className:u,children:(0,D.jsx)(y.y,{withLayout:!1})}):t?(0,D.jsx)("img",{src:t,alt:"background",className:d}):(0,D.jsx)("div",{className:h})}),(0,D.jsx)(N.I,{value:a,onChange:i,onCheck:()=>{},maxLength:200,className:_,placeholder:"Describe the chat background scene, e.g. cozy rainy city street at night"}),!t||r?(0,D.jsx)(A.Y,{id:"generate-bg",isFilled:!0,className:m,onClick:n,isDisabled:!a.trim()||r,loading:r,children:r?(0,D.jsx)(D.Fragment,{children:"Loading"}):(0,D.jsx)(D.Fragment,{children:"Generate"})}):(0,D.jsxs)("div",{className:g,children:[(0,D.jsxs)(A.Y,{id:"regenerate-bg",className:p,onClick:n,isDisabled:r,children:[(0,D.jsx)(P.h,{className:C}),(0,D.jsx)("p",{children:"Regenerate"})]}),(0,D.jsx)(A.Y,{id:"save-bg",isFilled:!0,className:m,onClick:s,isDisabled:r,children:"Done"})]})]})},I=e=>{const a=(0,n.useContext)(k.BR).isMobile,t=e.opened,c=e.onClose,d=(e=>{let a=e.onClose,t=e.onChange;const r=(0,o.dh)().enqueueSnackbar,s=(0,n.useState)(""),l=(0,i.A)(s,2),c=l[0],d=l[1],h=(0,n.use
1State)(null),u=(0,i.A)(h,2),_=u[0],m=u[1],g=(0,n.useState)(!1),p=(0,i.A)(g,2),C=p[0],v=p[1];return{text:c,image:_,isLoading:C,handleChangeText:e=>{d(e),m(null)},handleGenerate:async()=>{if(!C&&c.trim()){v(!0);try{const e=await j.FH.generateBackgroundFromText(c.trim()),a=(null===e||void 0===e?void 0:e.media_url)||(null===e||void 0===e?void 0:e.mediaUrl);a?m(a):r((null===e||void 0===e?void 0:e.error)||(null===e||void 0===e?void 0:e.message)||"Something went wrong. Try again or change prompt",{variant:"error"})}catch(e){console.error(e),r("Something went wrong",{variant:"error"})}finally{v(!1)}}},handleDone:()=>{_&&t(null,_),a()}}})(e);return a?(0,D.jsx)(w.x,{opened:t,onClose:c,title:"Generate with AI",contentClassName:l,children:(0,D.jsx)(S,(0,r.A)({},d))}):(0,D.jsx)(s.A,{open:t,onClose:c,children:(0,D.jsx)("div",{className:v,children:(0,D.jsxs)("div",{className:x,children:[(0,D.jsx)("h2",{className:b,children:"Background with AI"}),(0,D.jsx)(S,(0,r.A)({},d)),(0,D.jsx)(G.h,{className:f,onClick:c})]})})})}},17912(e,a,t){t.d(a,{D:()=>S,$:()=>D});var r=t(5544),i=t(89379),n=t(48205),s=t(63464);const o="TextAreaDialog_dialog__d-CjR",l="TextAreaDialog_container__luZzL",c="TextAreaDialog_content__q3IZG",d="TextAreaDialog_header__kvnqQ",h="TextAreaDialog_back__mEnZ6",u="TextAreaDialog_title__OyuRv",_="TextAreaDialog_headerCol__qpSx8",m="TextAreaDialog_textArea__hQZKc",g="TextAreaDialog_btn__Ov2Yq",p="TextAreaDialog_box__gMKMt",C="TextAreaDialog_progress__1vFY1",v="TextAreaDialog_rectangle__3xSUr",x="TextAreaDialog_error__QvSuY";var b=t(9950),f=t(66160),k=t(82015),j=t(95371),N=t(48738),A=t.n(N),y=t(52182),w=t(96607),P=t(44414);const G=b.forwardRef(function(e,a){return(0,P.jsx)(n.A,(0,i.A)({direction:"up",ref:a},e))}),D=e=>{let a=e.opened,t=e.onClose,i=e.isLoading,n=e.title,N=e.placeholder,D=e.onSubmit,S=e.value,I=e.type,T=e.error,B=e.optional;const L=(0,b.useState)(S||""),E=(0,r.A)(L,2),O=E[0],M=E[1],F=(0,b.useState)(!1),R=(0,r.A)(F,2),U=R[0],H=R[1];(0,w.y)(a),(0,b.useEffect)(()=>{H(!!T)},[T]),(0,b.useEffect)(()=>{M(S)},[S]);const Z=(0,j.Fq)(I,O.length),Y="exampleMessages"===I?j.TP:j.ai[I];return(0,P.jsx)(s.A,{fullScreen:!0,open:a,onClose:t,TransitionComponent:G,sx:{height:"100dvh",backgroundColor:"black",boxSizing:"border-box",width:"100%"},className:o,children:(0,P.jsxs)("div",{className:l,children:[(0,P.jsxs)("div",{className:d,onClick:t,children:[(0,P.jsx)(y.zt,{className:h}),(0,P.jsxs)("div",{className:_,children:[(0,P.jsx)("h2",{className:u,children:n}),(0,P.jsx)("div",{className:p,children:(0,P.jsx)("div",{className:C,children:(0,P.jsx)("div",{style:{width:"".concat(Z,"%")},className:v})})})]})]}),(0,P.jsxs)("div",{className:c,children:[(0,P.jsx)(f.f,{maxLength:Y||1e4,placeholder:N,className:m,onChange:e=>{M(e),H(!1)},value:O,showError:!!T,disabled:i}),T&&(0,P.jsx)("p",{className:x,children:T||"Inappropriated content. Please, change text"}),(0,P.jsx)(k.Y,{className:A()(g),id:"dialog-submit",isDisabled:!O.trim()&&!B||U,onClick:()=>{D(O)},loading:i,children:i?(0,P.jsx)(P.Fragment,{children:"Loading"}):(0,P.jsx)(P.Fragment,{children:"Done"})})]})]})})},S=e=>{let a=e.opened,t=e.onClose,r=e.title,i=e.children,n=e.percentage,m=e.className;return(0,w.y)(a),(0,P.jsx)(s.A,{fullScreen:!0,open:a,onClose:t,TransitionComponent:G,sx:{height:"100dvh",backgroundColor:"black",boxSizing:"border-box",width:"100%"},className:o,children:(0,P.jsxs)("div",{className:l,children:[(0,P.jsxs)("div",{className:d,onClick:t,children:[(0,P.jsx)(y.zt,{className:h}),(0,P.jsxs)("div",{className:_,children:["string"===typeof r?(0,P.jsx)("h2",{className:u,children:r}):r,void 0!==n&&(0,P.jsx)("div",{className:p,children:(0,P.jsx)("div",{className:C,children:(0,P.jsx)("div",{style:{width:"".concat(n,"%")},className:v})})})]})]}),(0,P.jsx)("div",{className:A()(c,m),children:i})]})})}},62541(e,a,t){t.d(a,{CreateGroupChat:()=>U});var r=t(5544),i=t(89379),n=t(48205),s=t(63464),o=t(9950);const l={dialog:"CreateGroupChat_dialog__-DAzn",container:"CreateGroupChat_container__SFP0K",header:"CreateGroupChat_header__iZR+T",back:"CreateGroupChat_back__D-woW",title:"CreateGroupChat_title__7UDLA",block:"CreateGroupChat_block__vmVAT",oneLine:"CreateGroupChat_oneLine__TVrl-",participantsBlock:"CreateGroupChat_participantsBlock__qPf1+",blockTitle:"CreateGroupChat_blockTitle__WlGI5",avatarBlock:"CreateGroupChat_avatarBlock__EvKz-",participantsHeader:"CreateGroupChat_participantsHeader__QVEi4",manageBtn:"CreateGroupChat_manageBtn__tBGID",selectedList:"CreateGroupChat_selectedList__CMssU",shake:"CreateGroupChat_shake__XxpUQ",selectedChip:"CreateGroupChat_selectedChip__X7AZM",avatar:"CreateGroupChat_avatar__1sZQX",avatarPlaceholder:"CreateGroupChat_avatarPlaceholder__9G0Ib",chipText:"CreateGroupChat_chipText__jXqSG",hint:"CreateGroupChat_hint__hl5sW",chipClose:"CreateGroupChat_chipClose__FOq3c",searchRow:"CreateGroupChat_searchRow__OrDKU",searchInput:"CreateGroupChat_searchInput__QBhI6",list:"CreateGroupChat_list__jkjGM",section:"CreateGroupChat_section__Gn1Cu",item:"CreateGroupChat_item__GB8VR",itemSelected:"CreateGroupChat_itemSelected__Z-OjX",itemAvatar:"CreateGroupChat_itemAvatar__gZ9Yj",itemAvatarPlaceholder:"CreateGroupChat_itemAvatarPlaceholder__6OmxE",itemName:"CreateGroupChat_itemName__D2AzO",loading:"CreateGroupChat_loading__lFQsz",footer:"CreateGroupChat_footer__V2h5-",nextBtn:"CreateGroupChat_nextBtn__7gCqC",textInput:"CreateGroupChat_textInput__YXpan",textarea:"CreateGroupChat_textarea__SVTV9",twoCols:"CreateGroupChat_tw
1oCols__r35i+",subLabel:"CreateGroupChat_subLabel__wHG11",mediaPicker:"CreateGroupChat_mediaPicker__V5p9I",bgPicker:"CreateGroupChat_bgPicker__spYER"};var c=t(48738),d=t.n(c),h=t(61993),u=t(79600),_=t(83581),m=t(35843);const g={dialog:"ParticipantsPickerDialog_dialog__ukF4V",container:"ParticipantsPickerDialog_container__jlC0R",selectedList:"ParticipantsPickerDialog_selectedList__5CJco",shake:"ParticipantsPickerDialog_shake__INuZO",selectedChip:"ParticipantsPickerDialog_selectedChip__yAZJV",avatar:"ParticipantsPickerDialog_avatar__N2ghH",avatarPlaceholder:"ParticipantsPickerDialog_avatarPlaceholder__5AxJM",chipText:"ParticipantsPickerDialog_chipText__lXLk3",chipClose:"ParticipantsPickerDialog_chipClose__kUJ3h",hint:"ParticipantsPickerDialog_hint__fyUiy",searchRow:"ParticipantsPickerDialog_searchRow__7l2C-",searchInput:"ParticipantsPickerDialog_searchInput__J-751",list:"ParticipantsPickerDialog_list__6-DgD",listContainer:"ParticipantsPickerDialog_listContainer__v2kEs",section:"ParticipantsPickerDialog_section__Gh5ou",item:"ParticipantsPickerDialog_item__TK1Th",itemAvatar:"ParticipantsPickerDialog_itemAvatar__cOyBR",itemAvatarPlaceholder:"ParticipantsPickerDialog_itemAvatarPlaceholder__C3Vt1",itemName:"ParticipantsPickerDialog_itemName__gczQS",itemTextCol:"ParticipantsPickerDialog_itemTextCol__6pj71",itemBio:"ParticipantsPickerDialog_itemBio__mjahI",qty:"ParticipantsPickerDialog_qty__qebDF",loading:"ParticipantsPickerDialog_loading__n-Cee",itemAction:"ParticipantsPickerDialog_itemAction__0frjG",itemActionAdd:"ParticipantsPickerDialog_itemActionAdd__pY1IW",itemActionSelected:"ParticipantsPickerDialog_itemActionSelected__30NMa",spinner:"ParticipantsPickerDialog_spinner__4PnVH",footer:"ParticipantsPickerDialog_footer__zlGrX",continueBtn:"ParticipantsPickerDialog_continueBtn__aGTC2"};var p=t(97597),C=t(54402),v=t(8881),x=t(44414);const b=e=>{let a=e.bot,t=e.isSelected,r=e.onClick;return(0,x.jsxs)("div",{className:d()(g.item,{[g.itemSelected]:t}),onClick:r,children:[a.avatarUrl?(0,x.jsx)("img",{className:g.itemAvatar,src:a.avatarUrl,alt:a.name}):(0,x.jsx)("div",{className:g.itemAvatarPlaceholder}),(0,x.jsxs)("div",{className:g.itemTextCol,children:[(0,x.jsx)("div",{className:g.itemName,children:a.name}),(a.bio||"number"===typeof a.messagesCount)&&(0,x.jsxs)("div",{children:[a.bio&&(0,x.jsx)("p",{className:g.itemBio,children:a.bio}),"number"===typeof a.messagesCount&&(0,x.jsx)(C.d,{messagesQty:a.messagesCount,className:d()("bot-tile__messages-qty",g.qty)})]})]}),(0,x.jsx)("div",{className:d()(g.itemAction,t?g.itemActionSelected:g.itemActionAdd)})]})},f=e=>
1{let a=e.opened,t=e.onClose,n=e.selected,s=e.onChangeSelected;const l=(0,o.useContext)(u.BR).visitedChats,c=(0,o.useState)(""),C=(0,r.A)(c,2),f=C[0],k=C[1],j=(0,o.useState)(!1),N=(0,r.A)(j,2),A=N[0],y=N[1],w=(0,o.useState)([]),P=(0,r.A)(w,2),G=P[0],D=P[1],S=(0,o.useState)(!1),I=(0,r.A)(S,2),T=I[0],B=I[1],L=(0,o.useRef)(null),E=(0,o.useRef)(null),O=(0,o.useRef)(null),M=(0,v.dh)().enqueueSnackbar,F=(0,o.useState)(1),R=(0,r.A)(F,2),U=R[0],H=R[1],Z=(0,o.useState)(!1),Y=(0,r.A)(Z,2),q=Y[0],z=Y[1],V=(0,o.useState)([]),Q=(0,r.A)(V,2),K=Q[0],X=Q[1];(0,o.useEffect)(()=>()=>{L.current&&window.clearTimeout(L.current)},[]);const J=(0,o.useMemo)(()=>{const e=new Map;return l.forEach(a=>{var t;if(a.type===_.sL)return;const r=null===(t=a.botIds)||void 0===t?void 0:t[0];r&&(e.has(r)||e.set(r,{botId:r,name:a.name||"",avatarUrl:a.avatarUrl||null,bio:void 0,messagesCount:void 0}))}),Array.from(e.values())},[l]);(0,o.useEffect)(()=>{let e=!1;return(async()=>{if(0!==J.length)try{const a=J.map(e=>String(e.botId)),t=await m.r.getBotsByIds({ids:a,fields:["bio","messagesCount"]});if(e)return;const r=new Map(t.data.map(e=>[e.id,{bio:e.attributes.bio,messagesCount:e.attributes.messagesCount}])),n=J.map(e=>{const a=r.get(e.botId);return(0,i.A)((0,i.A)({},e),{},{bio:null===a||void 0===a?void 0:a.bio,messagesCount:null===a||void 0===a?void 0:a.messagesCount})});X(n)}catch(a){console.error("Failed to load bots info:",a),X(J)}else X([])})(),()=>{e=!0}},[J]);const W=f.trim().length>0,$=J.length,ee=Math.max(0,10-$),ae=!W&&ee>0,te=(0,o.useMemo)(()=>new Set(K.map(e=>e.botId)),[K]),re=(0,o.useMemo)(()=>{if(W)return G;const e=K.slice(0,10);if(e.length>=10)return e;const a=10-e.length,t=G.slice(0,a);return[...e,...t]},[W,G,K]);(0,o.useEffect)(()=>{H(1),z(!1),D([]),y(!1)},[f,ae]),(0,o.useEffect)(()=>{let e=!1;const a=window.setTimeout(async()=>{if(!W&&!ae)return D([]),void y(!1);y(!0);try{const t=W?f.trim():"",r=W?10:Math.max(0,ee);if(!W&&0===r)return void(e||(D([]),y(!1)));const i=await m.r.searchByName({name:t,page:W?U:1,pageSize:r});if(e)return;let n=((null===i||void 0===i?void 0:i.data)||[]).map(e=>({botId:e.id,name:e.name,avatarUrl:e.avatarUrl||null,bio:e.bio,messagesCount:e.messagesCount}));if(W){var a;z(((null===i||void 0===i||null===(a=i.data)||void 0===a?void 0:a.length)||0)<r),D(e=>1===U?n:[...e,...n])}else{const e=new Set(K.map(e=>e.botId));n=n.filter(a=>!e.has(a.botId)).slice(0,ee),z(!0),D(n)}}catch(t){e||M("Failed to search bots",{variant:"error"})}finally{e||y(!1)}},W&&1===U?250:0);return()=>{e=!0,window.clearTimeout(a)}},[f,W,U,ae,ee,K,M]),(0,o.useEffect)(()=>{if(!W)return;if(!E.current||!O.current)return;const e=E.current,a=new IntersectionObserver(e=>{e[0].isIntersecting&&W&&!A&&!q&&G.length>0&&H(e=>e+1)},{root:e,threshold:1});return a.observe(O.current),()=>{a.disconnect()}},[W,A,q,G.length]);const ie=e=>n.some(a=>a.botId===e),ne=e=>{if(!ie(e.botId))return n.length>=5?(B(!0),L.current&&window.clearTimeout(L.current),void(L.current=window.setTimeout(()=>B(!1),600))):void s([...n,e])},se=e=>{s(n.filter(a=>a.botId!==e))},oe=e=>{ne(e),k("")};return a?(0,x.jsx)(h.Ih,{title:"Add participants",onClose:t,className:g.dialog,children:(0,x.jsxs)("div",{className:g.container,children:[(0,x.jsx)("div",{className:g.searchRow,children:(0,x.jsx)("input",{value:f,onChange:e=>{k(e.target.value),H(1),z(!1),D([]),y(!0),E.current&&E.current.scrollTo({top:0})},placeholder:"Search bots",className:g.searchInput})}),n.length>0&&(0,x.jsx)("div",{className:d()(g.selectedList,{[g.shake]:T}),children:n.map(e=>(0,x.jsxs)("div",{className:g.selectedChip,onClick:()=>se(e.botId),children:[e.avatarUrl?(0,x.jsx)("img",{className:g.avatar,src:e.avatarUrl,alt:e.name}):(0,x.jsx)("div",{className:g.avatarPlaceholder}),(0,x.jsx)("span",{className:g.chipText,children:e.name}),(0,x.jsx)("div",{className:g.chipClose,onClick:a=>{a.stopPropagation(),se(e.botId)}})]},e.botId))}),(0,x.jsx)("div",{className:g.listContainer,children:(0,x.jsx)("div",{ref:E,className:g.list,children:(0,x.jsxs)("div",{className:g.section,children:[W&&A&&1===U&&(0,x.jsx)(p.y,{withLayout:!1,noTopMargin:!0,className:g.spinner}),re.map(e=>{const a=W?"s":te.has(e.botId)?"v":"r",t=W?()=>oe(e):te.has(e.botId)?()=>{var a;
1ie((a=e).botId)?se(a.botId):ne(a)}:()=>oe(e);return(0,x.jsx)(b,{bot:e,isSelected:ie(e.botId),onClick:t},"".concat(a,"-").concat(e.botId))}),W&&A&&U>1&&(0,x.jsx)(p.y,{withLayout:!1,noTopMargin:!0,className:g.spinner}),W&&(0,x.jsx)("div",{ref:O})]})})}),(0,x.jsx)("div",{className:g.footer,children:(0,x.jsx)("button",{className:g.continueBtn,onClick:t,children:"Add"})})]})}):null};var k=t(42763),j=t(15125),N=t(32009),A=t(65346),y=t(82015),w=t(11531),P=t(59063),G=t(68327),D=t(75370);const S=t.p+"static/media/group-avatar.9933df08cb05cd314a5b.webp",I=t.p+"static/media/bg-placeholder.4ed1c6749f02cc653f0b.webp";var T;const B=["title","titleId"];function L(){return L=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},L.apply(null,arguments)}function E(e,a){let t=e.title,r=e.titleId,i=function(e,a){if(null==e)return{};var t,r,i=function(e,a){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==a.indexOf(r))continue;t[r]=e[r]}return t}(e,a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)t=n[r],-1===a.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,B);return o.createElement("svg",L({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",ref:a,"aria-labelledby":r},i),t?o.createElement("title",{id:r},t):null,T||(T=o.createElement("path",{d:"M11.9893 1C18.0069 1.00002 23 5.98237 23 12C23 18.0069 18.0176 23 12 23C5.99314 23 1 18.0069 1 12C1 5.98235 5.9824 1 11.9893 1ZM12 6.10742C11.3881 6.10742 10.8926 6.60397 10.8926 7.21582V10.8926H7.21582C6.60397 10.8926 6.10743 11.3882 6.10742 12C6.10742 12.6119 6.60397 13.1074 7.21582 13.1074H10.8926V16.7842C10.8926 17.396 11.3881 17.8926 12 17.8926C12.6119 17.8926 13.1074 17.396 13.1074 16.7842V13.1074H16.7842C17.396 13.1074 17.8926 12.6119 17.8926 12C17.8926 11.3882 17.396 10.8926 16.7842 10.8926H13.1074V7.21582C13.1074 6.60397 12.6119 6.10742 12 6.10742Z",fill:"white"})))}const O=o.forwardRef(E);t.p;var M=t(12329),F=t(8130);const R=o.forwardRef(function(e,a){return(0,x.jsx)(n.A,(0,i.A)({direction:"up",ref:a},e))}),U=e=>{let a=e.opened,t=e.onClose,i=e.chat,n=e.initialSelected;const c=(0,o.useState)([]),h=(0,r.A)(c,2),u=h[0],_=h[1],m=(0,o.useState)(!1),g=(0,r.A)(m,2),C=g[0],b=g[1],T=(0,v.dh)().enqueueSnackbar,B=(0,o.useState)(""),L=(0,r.A)(B,2),E=L[0],U=L[1],H=(0,o.useState)(!1),Z=(0,r.A)(H,2),Y=Z[0],q=Z[1],z=(0,M.N)().isMobile;(0,o.useEffect)(()=>{if(!Y){const e=u.map(e=>e.name).join(", ").slice(0,255);U(e)}},[u,Y]),(0,o.useEffect)(()=>{i&&(U(i.name||""),q(!0),X(i.avatarUrl||null),le(i.backgroundUrl||null),ke(i.backstory||""))},[i]),(0,o.useEffect)(()=>{n&&n.length&&0===u.length&&_(n)},[n]);const V=(0,o.useState)(null),Q=(0,r.A)(V,2),K=Q[0],X=Q[1],J=(0,o.useState)(null),W=(0,r.A)(J,2),$=W[0],ee=W[1],ae=(0,o.useState)(!1),te=(0,r.A)(ae,2),re=te[0],ie=te[1],ne=(0,o.useState)(null),se=(0,r.A)(ne,2),oe=se[0],le=se[1],ce=(0,o.useState)(null),de=(0,r.A)(ce,2),he=de[0],ue=de[1],_e=(0,o.useState)(!1),me=(0,r.A)(_e,2),ge=me[0],pe=me[1],Ce=(e,a)=>{ee(e),X(a)},ve=(e,a)=>{(e||a||!oe)&&(ue(e),le(a))},xe=(0,o.useState)(""),be=(0,r.A)(xe,2),fe=be[0],ke=be[1],je=(0,o.useState)(!1),Ne=(0,r.A)(je,2),Ae=Ne[0],ye=Ne[1],we=!!i,Pe=(0,o.useMemo)(()=>{const e=E.trim(),a=e.length>=1&&e.length<=255;return we&&0===u.length?a:a&&u.length>=2},[E,u.length,we]),Ge=(0,o.useRef)(!1);(0,o.useEffect)(()=>{a&&!we&&F._w.groupchatCreateStarted()},[a,we]),(0,o.useEffect)(()=>{Ge.current&&!C&&!we&&u.length>=2&&F._w.groupchatCreatePickedBots({bots_count:u.length}),Ge.current=C},[C,we,u.length]);return(0,x.jsx)(s.A,{fullScreen:!0,open:a,onClose:t,TransitionComponent:R,sx:{backgroundColor:"var(--b2c-bg-color-secondary)"},className:l.dialog,PaperProps:{style:{backgroundColor:"var(--b2c-bg-color-secondary)"}},children:(0,x.jsxs)("div",{className:l.container,children:[Ae&&(0,x.jsx)(p.y,{withLayout:!0}),(0,x.jsxs)("div",{className:l.header,children:[z?(0,x.jsx)(A.CO,{onClick:t,className:l.back}):(0,x.jsx)(A.xQ,{onClick:t,className:l.back}),(0,x.jsx)("h2",{className:l.title,children:we?"Edit group chat":"Create group chat"})]}),(0,x.jsxs)("div",{className:d()(l.block,l.participantsBlock),children:[(0,x.jsx)("div",{className:l.participantsHeader,children:(0,x.jsxs)("h3",{className:l.blockTitle,children:["Participants (",u.length,"/5)"]})}),(0,x.jsxs)("div",{className:l.selectedList,children:[(0,x.jsxs)("div",{className:l.manageBtn,onClick:()=>b(!0),children:[(0,x.jsx)(O,{}),(0,x.jsx)("p",{children:"Add"})]}),u.map(e=>(0,x.jsxs)("div",{className:l.selectedChip,onClick:()=>_(u.filter(a=>a.botId!==e.botId)),children:[e.avatarUrl?(0,x.jsx)("img",{className:l.avatar,src:e.avatarUrl,alt:e.name}):(0,x.jsx)("div",{className:l.avatarPlaceholder}),(0,x.jsx)("span",{className:l.chipText,children:e.name}),(0,x.jsx)("div",{className:l.chipClose,onClick:a=>{a.stopPropagation(),_(u.filter(a=>a.botId!==e.botId))}})]},e.botId))]})]}),(0,x.jsx)("div",{className:d()(l.block,l.avatarBlock),children:(0,x.jsxs)("div",{className:l.twoCols,children:[(0,x.jsxs)("div",{className:l.col,children:[(0,x.jsx)("div",{className:l.subLabel,children:"Avatar"}),(0,x.jsx)(k.p,{showError:!1,onGenerateClick:()=>ie(!0),value:K,onChange:Ce,loading:!1,avatarData:null,className:l.mediaPicker,placeholder:S,type:"persona"})]}),(0,x.jsxs)("div",{className:l.col,children:[(0,x.jsx)("div",{className:l.subLabel,children:"Chat background"}),(0,x.jsx)(k.p,{showError:!1,onGenerateClick:()=>pe(!0),value:oe,onChange:ve,loading:!1,avatarData:null,className:d()(l.mediaPicker,l.bgPicker),placeholder:I,type:"persona"})]})]})}),(0,x.jsxs)("div",{className:l.block,children:[(0,x.jsx)("h3",{className:l.blockTitle,children:"Group name"}),(0,x.jsx)(j.I,{value:E,onChange:e=>{U(e),q(!0)},onCheck:()=>{},placeholder:u.length?u.map(e=>e.name).join(", "):"Enter group name",className:d()(N.A.oneLine,l.oneLine),maxLength:255})]}),(0,x.jsxs)("div",{className:l.block,children:[(0,x.jsx)("h3",{className:l.blockTitle,children:"Backstory"}),(0,x.jsx)(j.I,{value:fe,onChange:ke,onCheck:()=>{},placeholder:"Describe details of your bot's personality and backstory. Describe the situation you want them in and the kinds of things they want to talk about"})]}),(0,x.jsx)("div",{className:l.footer,children:(0,x.jsx)(y.Y,{id:"create-group-button",isFilled:!0,className:d()(l.nextBtn,"zoomtr"),isDisabled:!Pe||Ae,loading:Ae,onClick:async()=>
1{if(Pe&&!Ae){ye(!0);try{const e=$?P.FH.uploadAvatar($).then(e=>(null===e||void 0===e?void 0:e.image_url)||K||"").catch(e=>(console.error("Avatar upload failed",e),T("Failed to upload avatar",{variant:"error"}),K||"")):Promise.resolve(K||""),a=he?P.FH.uploadAvatar(he).then(e=>null!==e&&void 0!==e&&e.image_url?e.image_url:(T("Failed to upload background",{variant:"error"}),(null===i||void 0===i?void 0:i.backgroundUrl)||"")).catch(e=>(console.error("Background upload failed",e),T("Failed to upload background",{variant:"error"}),(null===i||void 0===i?void 0:i.backgroundUrl)||"")):Promise.resolve(oe||""),t=await Promise.all([e,a]),n=(0,r.A)(t,2),s=n[0],o=n[1];if(we){const e={name:E.trim(),avatarUrl:s,backstory:fe.trim(),backgroundUrl:o};if(u.length&&(e.botIds=u.map(e=>e.botId)),i){if(await w.d.updateChat(i.id,e),"group-chat"===i.type){const e=u.length>0?u.length:i.botIds.length;F._w.groupchatModified({bots_count:e})}window.location.href="/chat_".concat(i.id,"/chat")}else ye(!1)}else{const e={bot_ids:u.map(e=>String(e.botId)),avatar_url:s,type:"group-chat",name:E.trim(),backstory:fe.trim()||void 0,backgroundUrl:o||void 0},a=await w.d.createChat(e),t=null===a||void 0===a?void 0:a.id;t?(F._w.groupchatCreated({bots_count:u.length}),window.location.href="/chat_".concat(t,"/chat")):(T("Failed to create chat",{variant:"error"}),ye(!1))}}catch(e){console.error(e),T("Failed to save chat",{variant:"error"}),ye(!1)}}},children:we?"Save":"Create group chat"})}),(0,x.jsx)(f,{opened:C,onClose:()=>b(!1),selected:u,onChangeSelected:_}),re&&(0,x.jsx)(G.GW,{opened:re,onClose:()=>ie(!1),onChange:(e,a)=>Ce(e,a)}),ge&&(0,x.jsx)(D.D,{opened:ge,onClose:()=>pe(!1),onChange:(e,a)=>ve(e,a)})]})})}},65346(e,a,t){t.d(a,{xQ:()=>c,CO:()=>d.h,bm:()=>h.h});var r,i,n=t(9950);const s=["title","titleId"];function o(){return o=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},o.apply(null,arguments)}function l(e,a){let t=e.title,l=e.titleId,c=function(e,a){if(null==e)return{};var t,r,i=function(e,a){if(null==e)return{};var t={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==a.indexOf(r))continue;t[r]=e[r]}return t}(e,a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)t=n[r],-1===a.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}(e,s);return n.createElement("svg",o({width:32,height:33,viewBox:"0 0 32 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:a,"aria-labelledby":l},c),t?n.createElement("title",{id:l},t):null,r||(r=n.createElement("path",{d:"M16 32.6562C7.29688 32.6562 0.0625 25.4219 0.0625 16.7188C0.0625 8 7.28125 0.78125 15.9844 0.78125C24.7031 0.78125 31.9375 8 31.9375 16.7188C31.9375 25.4219 24.7188 32.6562 16 32.6562ZM16 30C23.375 30 29.2812 24.0938 29.2812 16.7188C29.2812 9.34375 23.3594 3.4375 15.9844 3.4375C8.60938 3.4375 2.73438 9.34375 2.73438 16.7188C2.73438 24.0938 8.625 30 16 30ZM7.96875 16.7031C7.9687
15 16.3594 8.09375 16.1094 8.40625 15.7969L13.6875 10.4844C13.8906 10.2812 14.1719 10.1719 14.5 10.1719C15.1406 10.1719 15.625 10.6562 15.625 11.2969C15.625 11.6406 15.4844 11.9219 15.2812 12.1406L13.3281 14.0781L11.4531 15.6562L14.75 15.5312H22.8906C23.5625 15.5312 24.0625 16.0156 24.0625 16.7031C24.0625 17.375 23.5781 17.8594 22.8906 17.8594H14.75L11.4375 17.75L13.3281 19.3281L15.2812 21.2656C15.5 21.4688 15.625 21.75 15.625 22.0938C15.625 22.7344 15.1406 23.2344 14.5 23.2344C14.1719 23.2344 13.8906 23.1094 13.6875 22.9062L8.40625 17.6094C8.125 17.3281 7.96875 17.0469 7.96875 16.7031Z",fill:"var(--secondary-color)"})),i||(i=n.createElement("path",{d:"M16 32.6562C7.29688 32.6562 0.0625 25.4219 0.0625 16.7188C0.0625 8 7.28125 0.78125 15.9844 0.78125C24.7031 0.78125 31.9375 8 31.9375 16.7188C31.9375 25.4219 24.7188 32.6562 16 32.6562ZM16 30C23.375 30 29.2812 24.0938 29.2812 16.7188C29.2812 9.34375 23.3594 3.4375 15.9844 3.4375C8.60938 3.4375 2.73438 9.34375 2.73438 16.7188C2.73438 24.0938 8.625 30 16 30ZM7.96875 16.7031C7.9687
15 16.3594 8.09375 16.1094 8.40625 15.7969L13.6875 10.4844C13.8906 10.2812 14.1719 10.1719 14.5 10.1719C15.1406 10.1719 15.625 10.6562 15.625 11.2969C15.625 11.6406 15.4844 11.9219 15.2812 12.1406L13.3281 14.0781L11.4531 15.6562L14.75 15.5312H22.8906C23.5625 15.5312 24.0625 16.0156 24.0625 16.7031C24.0625 17.375 23.5781 17.8594 22.8906 17.8594H14.75L11.4375 17.75L13.3281 19.3281L15.2812 21.2656C15.5 21.4688 15.625 21.75 15.625 22.0938C15.625 22.7344 15.1406 23.2344 14.5 23.2344C14.1719 23.2344 13.8906 23.1094 13.6875 22.9062L8.40625 17.6094C8.125 17.3281 7.96875 17.0469 7.96875 16.7031Z",fill:"#41C5F2"})))}const c=n.forwardRef(l);t.p;var d=t(43899),h=t(41786)},96607(e,a,t){t.d(a,{y:()=>i});var r=t(9950);const i=e=>{const a=(0,r.useId)();(0,r.useEffect)(()=>{if(!e)return;const t=(()=>{const e=window;return e.__bodyScrollLockState__||(e.__bodyScrollLockState__={locks:new Set,scrollY:0}),e.__bodyScrollLockState__})(),r=0===t.locks.size;return t.locks.add(a),r&&(e=>{e.scrollY=window.scrollY;const a=document.body;a.style.position="fixed",a.style.top="-".concat(e.scrollY,"px"),a.style.left="0",a.style.right="0",a.style.width="100%",a.style.overflow="hidden"})(t),()=>{t.locks.delete(a),0===t.locks.size&&(e=>{const a=document.body;a.style.position="",a.style.top="",a.style.left="",a.style.right="",a.style.width="",a.style.overflow="",window.scrollTo(0,e.scrollY)})(t)}},[e,a])}}}]);

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.