PageSourceSearch

https://moleculs.ai/_next/static/chunks/bce09142542a2305.js

js moleculs.ai collected 2026-10-05 13:39:57 UTC 45,876 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,319613,e=>{"use strict";var t=e.i(60532);e.s(["filterSellablePlans",0,e=>{let{plans:a,currentPlanSlug:l}=e;return a.filter(e=>!(0,t.isArchivedTariff)(e)||e.slug===l)}])},822691,e=>{"use strict";var t=e.i(765223);e.s(["getPromoOfferDiscount",0,e=>{let a=null==e?void 0:e.promo_offer;if(!e||!a||!(0,t.isPromoOfferLive)(a))return null;let l=Number(a.regular_amount),r=Number(a.amount),n=Number.isFinite(l)&&Number.isFinite(r)&&r>0&&r<l,s=Math.round(r)===Math.round(null!=e.discounted_price?Number(e.discounted_price):Number(e.amount));return n&&s?{baseAmount:l,promoAmount:r,percent:Math.round(a.discount_percent)}:null}])},663298,e=>{"use strict";e.s(["isMemberLimitExhausted",0,e=>null!=e.credits_limit&&e.credits_used>=e.credits_limit])},63880,457112,e=>{"use strict";var t=e.i(124104),a=e.i(44743),l=e.i(891074),r=e.i(565313),n=e.i(446461);e.i(970459);var s=e.i(447640);let i=()=>{let e=(0,a.useTranslations)(),i=(0,n.useAppDispatch)();return(0,t.jsx)(s.Button,{className:"hidden shrink-0 max-tablet:inline-flex",onClick:()=>i((0,r.setIsDashboardSidebarOpen)(!0)),variant:"light",size:"s",isIconOnly:!0,"aria-label":e("Открыть боковую панель"),children:(0,t.jsx)(l.TbLayoutSidebarLeftExpand,{className:"text-14"})})};e.s(["OpenSidebarButton",()=>i],457112),e.s([],63880)},309743,e=>{"use strict";var t=e.i(378911);let a="pending-chat-mode";e.s(["consumePendingChatMode",0,()=>{let e=t.safeSessionStorage.getItem(a);return"molecula"!==e&&"text"!==e?null:(t.safeSessionStorage.removeItem(a),e)},"requestChatMode",0,e=>{t.safeSessionStorage.setItem(a,e)}])},801476,e=>{e.v({active:"ChatTypeSelect-module__f5C8eq__active",button:"ChatTypeSelect-module__f5C8eq__button",crownIcon:"ChatTypeSelect-module__f5C8eq__crownIcon",molecula:"ChatTypeSelect-module__f5C8eq__molecula",wrapper:"ChatTypeSelect-module__f5C8eq__wrapper"})},550010,e=>{"use strict";var t=e.i(124104),a=e.i(44743),l=e.i(514219),r=e.i(398485);e.i(808730);var n=e.i(492786),s=e.i(267277),i=e.i(520133),o=e.i(801476),d=e.i(399171),u=e.i(715394),c=e.i(277351),p=e.i(464143),m=e.i(565313),x=e.i(139235),h=e.i(446461),f=e.i(221466),v=e.i(453990),g=e.i(309743),b=e.i(378911),_=e.i(578924),y=e.i(144665),j=e.i(737629);let w=()=>{let e=(0,a.useTranslations)(),w=(0,i.usePathname)(),k=(0,r.useIsMobile)(1240),{chatType:N,isActive:C,handleSelect:S,tabs:M}=(()=>{let e,t,a,r=(0,h.useAppDispatch)(),n=(0,h.useAppSelector)(x.selectChatType),s=(0,h.useAppSelector)(x.selectIsMoleculaMode),i=(0,h.useAppSelector)(x.selectSelectedAiModel),{data:o}=(0,c.useGetAiModelsQuery)(),w=null==o?void 0:o.results.find(e=>e.model_id===_.MOLECULA_MODEL_ID),k=!!w,N=(e=(0,h.useAppDispatch)(),t=(0,f.useLocale)(),a=(0,d.useRef)(!1),(0,d.useEffect)(()=>{if("carousel"===n){(0,v.isCarouselAvailableFor)(t)||e((0,m.setChatType)("text"));return}let l=(0,g.consumePendingChatMode)();if(l){a.current=!0,e((0,m.setChatType)("text")),e((0,m.setIsMoleculaMode)("molecula"===l));return}let r=b.safeSessionStorage.getItem("chatType");r&&"carousel"!==r&&r!==n&&e((0,m.setChatType)(r))},[]),a),C=(0,u.useSearchParams)().get("model"),S=!!C&&!(0,y.isMoleculaModelParam)(C);return(0,d.useEffect)(()=>{if(!k){s&&r((0,m.setIsMoleculaMode)(!1));return}if("text"!==n||s||N.current||S)return;let e=(0,j.isMoleculaModeRemembered)(),t="1"===p.default.get(_.MOLECULA_PRESELECT_COOKIE);(e||t)&&(r((0,m.setIsMoleculaMode)(!0)),t&&(b.safeSessionStorage.setItem("chatType","text"),(0,j.rememberMoleculaMode)(!0),p.default.remove(_.MOLECULA_PRESELECT_COOKIE,{path:"/"})))},[r,k,S,n,s,N]),(0,d.useEffect)(()=>{s&&w&&(null==i?void 0:i.model_id)!==_.MOLECULA_MODEL_ID&&r((0,m.setSelectedAiModel)(w))},[r,s,w,i]),{chatType:n,isActive:e=>"molecula"===e?"text"===n&&s:"text"===e?"text"===n&&!s:n===e,handleSelect:e=>{let t="molecula"===e;b.safeSessionStorage.setItem("chatType",t?"text":e),(0,j.rememberMoleculaMode)(t),r((0,m.setChatType)(t?"text":e)),r((0,m.setIsMoleculaMode)(t))},tabs:l.CHAT_TABS.filter(e=>"molecula"===e.value?k:"transcribe"!==e.value||v.SHOW_TRANSCRIBE_TAB)}})();return"carousel"===N&&w!==l.DASHBOARD_INDEX_PATH?null:(0,t.jsx)("nav",{id:"tour-chat-type",className:o.default.wrapper,children:M.map(a=>{let l=C(a.value),r="molecula"===a.value,i=k&&!r;return(0,t.jsxs)("div",{className:"relative",children:[r?(0,t.jsx)(n.NewBadge,{className:"absolute -right-1 -top-1 z-1",children:e("Beta")}):null,(0,t.jsxs)(s.Button,{isIconOnly:i,className:"".concat(o.default.button," ").concat(l?o.default.active:""," ").concat(r?o.default.molecula:""),size:"s",variant:l?"primary":"light",onClick:()=>{S(a.value)},"aria-label":i?e(a.label):void 0,children:[(0,t.jsx)(a.Icon,{}),!i&&e(a.label)]})]},a.value)})})};e.s(["ChatTypeSelect",()=>w],550010)},797054,540309,e=>{"use strict";var t=e.i(124104),a=e.i(44743),l=e.i(39115);e.i(206676);var r=e.i(369966),n=e.i(520133);let s=e=>{let{project:s}=e,i=(0,a.useTranslations)();return s?(0,t.jsxs)(n.Link,{href:"/dashboard/projects/".concat(s.id),title:i("chat-project-badge-hint"),className:"inline-flex max-w-full items-center gap-[6px] self-start rounded-full border-[1.5px] border-border-soft px-3 py-1 font-manrope text-12 font-semibold text-text-primary no-underline transition-colors hover:bg-bg-soft-gray",children:[(0,t.jsx)(l.LuChevronLeft,{className:"shrink-0 text-14 text-text-gray"}),(0,t.jsx)(r.ProjectIcon,{icon:s.icon,color:s.color,className:"text-14"}),(0,t.jsx)("span",{className:"truncate max-tablet:hidden",children:s.name})]}):null};e.s(["ChatProjectBadge",()=>s],540309),e.s([],797054)},681405,e=>{"use strict";var t=e.i(124104);e.i(797054);var a=e.i(540309),l=e.i(550010),r=e.i(434913);let n=(0,r.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);var s=e.i(44743),i=e.i(432731);let o=()=>
1(0,t.jsx)("span",{"aria-hidden":!0,className:"absolute -left-1 -top-1 grid size-4 place-items-center rounded-full bg-[var(--text-primary-on-dark)] text-primary animate-gift-pop",children:(0,t.jsx)(i.Gift,{className:"size-3.5 animate-gift-wiggle [transform-origin:50%_65%] motion-reduce:animate-none"})});var d=e.i(399171),u=e.i(221466);let c=(0,r.default)("coins",[["path",{d:"M13.744 17.736a6 6 0 1 1-7.48-7.48",key:"bq4yh3"}],["path",{d:"M15 6h1v4",key:"11y1tn"}],["path",{d:"m6.134 14.768.866-.5 2 3.464",key:"17snzx"}],["circle",{cx:"16",cy:"8",r:"6",key:"14bfc9"}]]);var p=e.i(180860);e.i(194753);var m=e.i(15886),x=e.i(120168),h=e.i(511765),f=e.i(303631);let v="size-[18px] shrink-0",g={renewal_failed:"danger",payment_failed:"danger",subscription_expired:"danger",corporate_subscription_expired:"danger",corporate_invitation_failed:"danger",corporate_member_limit_exhausted:"danger",card_update_needed:"danger",low_balance:"warning",renewal_soon:"warning",trial_ending:"warning",price_changed:"warning",payment_success:"success",subscription_renewed:"success",corporate_member_added:"success",corporate_invitation:"success"},b={generation:"generation",marketing:"promo",billing:"neutral"},_={danger:{icon:(0,t.jsx)(m.NotifyDangerIcon,{className:v}),action:"button",hasStripe:!0,isPinned:!0},warning:{icon:(0,t.jsx)(f.NotifyWarningIcon,{className:v}),action:"button",hasStripe:!1,isPinned:!1},success:{icon:(0,t.jsx)(h.NotifySuccessIcon,{className:v}),action:"none",hasStripe:!1,isPinned:!1},generation:{icon:(0,t.jsx)("span",{className:"flex size-[18px] shrink-0 items-center justify-center rounded-[4px] bg-primary",children:(0,t.jsx)(p.Sparkles,{className:"size-3 text-white"})}),action:"arrow",hasStripe:!1,isPinned:!1},promo:{icon:(0,t.jsx)(x.NotifyGiftIcon,{className:v}),action:"button",hasStripe:!1,isPinned:!1},neutral:{icon:(0,t.jsx)(c,{className:"size-[18px] shrink-0 text-primary"}),action:"button",hasStripe:!1,isPinned:!1}};var y=e.i(56419),j=e.i(925617),w=e.i(749437),k=e.i(171293),N=e.i(155768);let C=(0,k.cn)("flex h-8 shrink-0 cursor-pointer items-center justify-center self-start","rounded-pill border-0 bg-primary px-4 font-manrope text-12 font-semibold","text-white transition-opacity hover:opacity-90"),S=e=>{var a;let l,r=(0,s.useTranslations)(),n=(0,u.useNow)(),{notification:i,onCtaClick:o}=e,{title:d,body:c,cta_label:p,is_read:m,created_at:x}=i,{visual:h,action:f,isInteractive:v,readProps:S}=(e=>{var t;let a,{notification:l,onCtaClick:r,onRead:n}=e,s=_[null!=(t=null!=(a=l.template_key?g[l.template_key]:void 0)?a:b[l.category])?t:"neutral"],i=null!==(0,y.resolveCtaTarget)(l.cta_url)?s.action:"none",o=()=>{"none"===i?n(l):r(l)},d="none"!==i||!l.is_read;return{visual:s,action:i,isInteractive:d,readProps:d?{role:"button",tabIndex:0,onClick:o,onKeyDown:e=>{e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o())}}:{}}})(e),M=(a=(0,N.parseServerDate)(x),(l=Math.max(0,n.getTime()-a.getTime()))<6e4?{key:"notification-age-sec",count:Math.floor(l/1e3)}:l<36e5?{key:"notification-age-min",count:Math.floor(l/6e4)}:l<864e5?{key:"notification-age-hour",count:Math.floor(l/36e5)}:{key:"notification-age-day",count:Math.floor(l/864e5)});return(0,t.jsxs)("div",{...S,className:(0,k.cn)("group relative flex items-center gap-3 bg-white px-4 py-3.5","transition-colors duration-150 hover:bg-bg-soft-gray",v&&"cursor-pointer",h.hasStripe&&"border-l-2 border-error",!m&&"bg-primary-light/40"),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,t.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-full bg-bg-soft-gray transition-colors duration-150 group-hover:bg-bg-light-gray",children:h.icon}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-3 pt-0.5",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1 font-manrope text-14 font-semibold",children:[(0,t.jsx)("p",{className:"[word-break:break-word] text-14 text-text-primary",children:d}),(0,t.jsx)("p",{className:"text-14 text-text-gray",children:"•"}),(0,t.jsx)("time",{className:"text-14 text-text-gray",children:r(M.key,{count:M.count})})]}),(0,t.jsx)("p",{className:"[word-break:break-word] font-manrope text-12 font-medium text-text-gray",children:c})]}),"button"===f?(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),o(i)},className:C,children:p||r("Открыть")}):null]})]}),"arrow"===f?(0,t.jsx)(j.NotifyArrowIcon,{className:"size-[18px] shrink-0 text-text-gray"}):null,h.isPinned?(0,t.jsx)(w.NotifyPinIcon,{className:"absolute right-3 top-3 size-3 text-bg-light-gray transition-colors group-hover:text-text-gray"}):null]})};var M=e.i(974438);e.i(210896);var T=e.i(453751);e.i(584549);var L=e.i(76034);let P=e=>{let{notifications:a,isLoading:l,isFetchingMore:r,hasMore:i,onLoadMore:o,onCtaClick:u,onRead:c}=e,p=(0,s.useTranslations)(),m=(0,d.useRef)(null),x=(0,d.useRef)(null),h=!l&&0===a.length;
1return(0,M.useInfiniteScroll)({rootRef:m,targetRef:x,enabled:i&&!r&&!l,onIntersect:o}),(0,t.jsxs)("div",{ref:m,className:"overflow-y-auto",children:[l?(0,t.jsx)("div",{className:"flex justify-center py-8",children:(0,t.jsx)(L.Spinner,{variant:"primary",size:"l"})}):null,h?(0,t.jsx)(T.EmptyState,{size:"sm",icon:(0,t.jsx)(n,{className:"size-5"}),title:p("Пока тихо"),description:p("Новые уведомления появятся здесь")}):null,a.map(e=>(0,t.jsx)(S,{notification:e,onCtaClick:u,onRead:c},e.id)),i&&!h?(0,t.jsx)("div",{ref:x,className:"flex justify-center py-3",children:r?(0,t.jsx)(L.Spinner,{variant:"primary",size:"m"}):null}):null]})};var I=e.i(277351),E=e.i(551961),A=e.i(246418);let R=(0,r.default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),O="notifications",D="promos",z="partner";e.i(513518);var F=e.i(379145),G=e.i(128659);e.i(718582);var B=e.i(447640);e.i(377934);var U=e.i(72419);let H=e=>{var a;let{isActive:l,onNavigate:r}=e,n=(0,s.useTranslations)(),{copy:i,isCopied:o}=(0,G.useCopy)(),{data:d,isLoading:u}=(0,I.usePartnerDashboardQuery)(void 0,{skip:!l}),c=null!=(a=null==d?void 0:d.profile.ref_url)?a:"";return(0,t.jsxs)("div",{className:"flex flex-col gap-3 px-4 pb-4 pt-1",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("span",{className:"flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",children:(0,t.jsx)(R,{className:"size-4"})}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("h6",{className:"m-0 font-manrope text-14 font-semibold text-text-primary",children:n("Вам доступен 1-й уровень партнёрской программы")}),(0,t.jsx)("p",{className:"m-0 font-manrope text-12 font-medium leading-[1.35] text-text-gray",children:n("Приглашайте друзей по своей ссылке и получайте вознаграждение за их покупки")})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-2xl bg-bg-light-gray p-3",children:[u?(0,t.jsx)(U.Skeleton,{className:"h-5 w-full rounded-lg"}):(0,t.jsx)("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap font-manrope text-12 font-semibold text-primary",children:c}),(0,t.jsxs)(B.Button,{variant:"primary",size:"s",isFullWidth:!0,onClick:()=>{i(c),(0,F.trackPartnerLinkCopy)("notifications")},disabled:o||!c,children:[o?(0,t.jsx)(E.Check,{className:"size-3.5"}):(0,t.jsx)(A.Copy,{className:"size-3.5"}),n(o?"Ссылка скопирована":"Скопировать")]})]}),(0,t.jsx)(B.Button,{variant:"light",size:"s",isFullWidth:!0,onClick:()=>{(0,F.trackPartnerProgramOpen)("notifications"),r("/dashboard/profile/bonus")},children:n("Открыть партнёрскую программу")})]})};e.i(683787);var q=e.i(813620);e.i(806004);var K=e.i(950793);let Q="h-auto shrink-0 rounded-none bg-transparent px-0 pb-1.5 shadow-none border-b-2 border-transparent",W="border-primary text-text-primary",V=e=>{let{activeTab:a,onTabChange:l,hasPromos:r,promo:n,onNavigate:o,...d}=e,u=(0,s.useTranslations)();return(0,t.jsxs)(K.Tabs,{value:a,onChange:l,size:"sm",className:"max-h-[70vh] w-[406px] overflow-hidden rounded-2xl border border-border-soft bg-[var(--text-primary-on-dark)] shadow-[0_8px_32px_rgb(16_16_32/12%)] max-mobile-lg:w-[calc(100vw-32px)]",children:[(0,t.jsxs)("div",{className:"flex flex-col px-4 pt-3",children:[(0,t.jsxs)(K.TabsList,{className:"min-w-0 gap-3 overflow-x-auto rounded-none bg-transparent p-0 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[(0,t.jsx)(K.TabsTrigger,{value:O,className:"".concat(Q," ").concat(a===O?W:""),children:u("Уведомления")}),(0,t.jsxs)(K.TabsTrigger,{value:D,className:"".concat(Q," ").concat(a===D?W:""),children:[u("Акции"),r?(0,t.jsx)(i.Gift,{"data-testid":"tab-gift",className:"ml-1 size-3.5 text-primary"}):null]}),(0,t.jsx)(K.TabsTrigger,{value:z,className:"".concat(Q," ").concat(a===z?W:""),children:u("Партнёрская программа")})]}),a===O&&d.notifications.length>0?(0,t.jsx)("button",{type:"button",onClick:d.onMarkAll,className:"cursor-pointer self-end border-0 bg-transparent p-0 pt-2 font-manrope text-12 font-semibold text-primary hover:opacity-80",children:u("Прочитать все")}):null]}),(0,t.jsx)(K.TabsPanel,{value:O,className:"pt-2",children:(0,t.jsx)(P,{...d})}),(0,t.jsx)(K.TabsPanel,{value:D,className:"pt-0",children:(0,t.jsx)(q.PromoGiftPanel,{offers:n.offers,onSelect:n.onSelect,isLaunching:n.isLaunching})}),(0,t.jsx)(K.TabsPanel,{value:z,className:"pt-2",children:(0,t.jsx)(H,{isActive:a===z,onNavigate:o})})]})};var X=e.i(507474),Y=e.i(446461),Z=e.i(31681),J=e.i(520133),$=e.i(455125);e.i(866758);var ee=e.i(240368);e.i(165595);var et=e.i(273864);let ea=()=>{let e=(0,s.useTranslations)(),{isAuth:a,isOpen:l,setOpen:r,notifications:i,unreadCount:c,isLoading:p,isFetchingMore:m,hasMore:x,loadMore:h,markAll:f,markOne:v,handleCtaClick:g}=(()=>{var e,t,a;let l=(0,J.useRouter)(),r=(0,u.useLocale)(),n=(0,Z.useIsAuth)(),[s,i]=(0,d.useState)(!1),[o,c]=(0,d.useState)(1),{data:p}=(0,I.useGetUnreadCountQuery)(void 0,{pollingInterval:3e4,skipPollingIfUnfocused:!0,skip:!n}),{data:m,isLoading:x,isFetching:h}=(0,I.useGetNotificationsQuery)({page:o,lang:r},{skip:!n||!s}
1),{markOne:f,markAll:v}=(()=>{let e=(0,u.useLocale)(),t=(0,Y.useAppDispatch)(),[a]=(0,I.useMarkNotificationsReadMutation)(),l=(l,r)=>{let n=t(X.notificationsApi.util.updateQueryData("getNotifications",{page:1,lang:e},e=>{e.results.forEach(e=>{r(e)&&(e.is_read=!0)})}));a(l).unwrap().catch(()=>n.undo())};return{markOne:e=>{e.is_read||l({ids:[e.id]},t=>t.id===e.id)},markAll:()=>{l({all:!0},()=>!0)}}})(),g=null!=(e=null==m?void 0:m.results)?e:[];return{isAuth:n,isOpen:s,setOpen:e=>{i(e),e||c(1)},notifications:g,unreadCount:null!=(t=null==p?void 0:p.count)?t:0,isLoading:x,isFetchingMore:h&&!x,hasMore:(null!=(a=null==m?void 0:m.next)?a:null)!==null,loadMore:()=>c(e=>e+1),markAll:v,markOne:f,handleCtaClick:e=>{f(e);let t=(0,y.resolveCtaTarget)(e.cta_url);if(t){if(i(!1),"internal"===t.type)return void l.push(t.url);window.open(t.url,"_blank","noopener,noreferrer")}}}})(),b=(0,$.usePromoGift)(),{tab:_,handleOpenChange:j,handleTabChange:w,handleNavigate:k}=(e=>{let{hasPromos:t,setOpen:a}=e,l=(0,J.useRouter)(),[r,n]=(0,d.useState)(O);return{tab:r,handleOpenChange:e=>{e&&n(t?D:O),a(e)},handleTabChange:e=>{n(e),e===z&&(0,F.trackPartnerTabOpen)()},handleNavigate:e=>{a(!1),l.push(e)}}})({hasPromos:b.isVisible,setOpen:r});return a?(0,t.jsxs)(et.Popover,{open:l,onOpenChange:j,children:[(0,t.jsx)(et.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)(ee.HeaderIconButton,{"aria-label":e("Уведомления"),children:[(0,t.jsx)(n,{className:"size-4"}),b.isVisible?(0,t.jsx)(o,{}):null,c>0?(0,t.jsx)("span",{className:"absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-pill bg-primary px-1 font-manrope text-10 font-bold text-text-on-dark",children:c>99?"".concat(99,"+"):c}):null]})}),(0,t.jsx)(et.PopoverContent,{bare:!0,align:"end",sideOffset:8,collisionPadding:16,onOpenAutoFocus:e=>e.preventDefault(),children:(0,t.jsx)(V,{activeTab:_,onTabChange:w,hasPromos:b.isVisible,onNavigate:k,promo:b,notifications:i,isLoading:p,isFetchingMore:m,hasMore:x,onLoadMore:h,onMarkAll:f,onCtaClick:g,onRead:v})})]}):null};
1e.i(63880);var el=e.i(457112),er=e.i(771906);let en=function(){let{withTypeTabs:e=!0,project:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,t.jsxs)("header",{className:"absolute top-0 z-2 flex items-center justify-between gap-2 w-full bg-[linear-gradient(var(--text-primary-on-dark),transparent)] pb-[1.5em] pt-2.5",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-[8px]",children:[(0,t.jsx)(el.OpenSidebarButton,{}),(0,t.jsx)(a.ChatProjectBadge,{project:r}),e?(0,t.jsx)("div",{className:"min-w-0 overflow-x-auto py-1.5 -my-1.5 pr-1.5 -mr-1.5 [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]",children:(0,t.jsx)(l.ChatTypeSelect,{})}):null]}),(0,t.jsxs)("div",{className:"flex shrink-0 items-center gap-1 tablet:gap-2",children:[(0,t.jsx)(ea,{}),(0,t.jsx)(er.ChatHeaderBalance,{})]})]})};e.s(["ChatHeader",()=>en],681405)},533867,e=>{"use strict";e.s(["SCENARIO_COST_RANGE",0,"4-15","SCENE_REGEN_COST_RANGE",0,"3-10","TOKENS_PER_SCENARIO",0,4,"TOKENS_PER_SLIDE",0,20,"TOKENS_PER_SLIDE_REGEN",0,20,"estimateCarouselTokens",0,e=>20*Math.max(0,Math.round(e))])},133205,411428,e=>{"use strict";var t=e.i(124104),a=e.i(82498),l=e.i(221466),r=e.i(44743);e.i(303124);var n=e.i(1);e.i(462020);var s=e.i(45793),i=e.i(825101);let o="max-h-full max-w-full rounded-3xl object-contain animate-viewer-in motion-reduce:animate-none",d=e=>{let{videoUrl:a,coverUrl:l,alt:r}=e;return a?(0,t.jsx)("video",{src:a,className:o,controls:!0,autoPlay:!0,loop:!0}):l?(0,t.jsx)("img",{src:l,alt:r,className:o}):null},u=e=>{var o;let{isOpen:u,onClose:c,coverUrl:p,videoUrl:m,prompt:x,title:h,action:f}=e,v=(0,r.useTranslations)(),g=(0,l.useLocale)();return(0,t.jsxs)(s.Modal,{isOpen:u,onClose:c,overlayClassName:"bg-[rgba(247,247,247,0.85)] backdrop-blur-[24px] data-[state=open]:animate-viewer-fade-in",className:"fixed inset-0 left-0 top-0 flex h-dvh max-h-none w-screen max-w-none translate-x-0 translate-y-0 flex-col rounded-none tablet:w-screen tablet:max-w-none tablet:rounded-none desktop:w-screen desktop:max-w-none desktop:rounded-none bg-transparent p-3 tablet:p-4 desktop:p-4 shadow-none outline-none overflow-hidden overscroll-contain data-[state=open]:animate-viewer-fade-in",children:[(0,t.jsxs)("header",{className:"relative flex h-10 shrink-0 items-center gap-2 tablet:h-12",children:[(0,t.jsx)(a.default,{src:(0,i.localizedAsset)("/images/logo.webp",g),alt:"",width:120,height:32,className:"h-6 w-auto shrink-0 object-contain tablet:h-7"}),h?(0,t.jsx)("p",{className:"min-w-0 truncate font-manrope text-16 font-semibold text-text-primary tablet:absolute tablet:left-1/2 tablet:-translate-x-1/2 tablet:text-18",children:h}):null,(0,t.jsx)(n.CloseButton,{size:"md",onClick:c,className:"ml-auto shrink-0 border-0 shadow-[0_4px_16px_rgba(0,0,0,0.12)]"})]}),(0,t.jsx)("div",{className:"flex min-h-0 flex-1 items-center justify-center py-4 tablet:py-6",children:(0,t.jsx)(d,{videoUrl:m,coverUrl:p,alt:null!=(o=null!=h?h:x)?o:""})}),x||f?(0,t.jsxs)("footer",{className:"mx-auto flex w-full max-w-[955px] shrink-0 items-start gap-4 pb-[env(safe-area-inset-bottom)] max-tablet:flex-col max-tablet:gap-3",children:[x?(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 gap-4 max-tablet:w-full max-tablet:flex-col max-tablet:gap-1",children:[(0,t.jsx)("span",{className:"shrink-0 font-manrope text-14 font-semibold text-text-gray-contrast",children:v("dashboard-examples-carousel-prompt-label")}),(0,t.jsx)("p",{className:"line-clamp-2 min-w-0 whitespace-pre-line font-manrope text-16 font-medium leading-normal text-text-primary max-tablet:line-clamp-3 desktop:text-14",children:x})]}):null,f?(0,t.jsx)("div",{className:"flex shrink-0 justify-center max-tablet:w-full max-tablet:[&>*]:w-full",children:f}):null]}):null]})};e.s(["MediaViewerShell",()=>u],411428),e.s([],133205)},608383,720787,e=>{"use strict";var t=e.i(399171),a=e.i(277351);e.i(765675);var l=e.i(994886),r=e.i(137253);function n(e,t,a){if(!t)return e;let l=new Set(a);return e.map(e=>({...e,isLocked:e.isLocked||!l.has(e.modelId)}))}var s=e.i(532460);e.s(["useAvailableAudioModels",0,()=>{let{data:e,isLoading:i}
1=(0,a.useGetKieAudioModelsQuery)(),o=(0,l.useEffectivePlan)(),{freeAudioModels:d}=(0,r.useMeModelAccess)(),u=(0,t.useMemo)(()=>{var t;let a={};for(let l of null!=(t=null==e?void 0:e.models)?t:[])a[l.model_id]=l;return a},[e]);return{models:(0,t.useMemo)(()=>{var t;let a=null!=(t=null==e?void 0:e.models)?t:[],l=[];for(let e of a){if("audio"!==e.kind)continue;let t=s.AUDIO_REGISTRY[e.model_id];t&&l.push({modelId:e.model_id,name:e.name||t.name,description:e.description,config:t,pricing:e,isLocked:!0===e.is_locked,unavailable_reason:e.unavailable_reason,min_plan:e.min_plan,hasMinPlanKey:"min_plan"in e})}return n(l.length>0?l:s.AUDIO_MODEL_IDS.map(e=>{let t=s.AUDIO_REGISTRY[e];return{modelId:e,name:t.name,description:"",config:t,pricing:null,isLocked:!1,hasMinPlanKey:!1}}),o,(null!=d?d:[]).map(e=>e.model_id))},[e,o,d]),isLoading:i,pricingByModelId:u}}],608383);var i=e.i(710289);e.s(["useAvailableVideoModels",0,()=>{let{data:e,isLoading:s}=(0,a.useGetKieVideoModelsQuery)(),o=(0,l.useEffectivePlan)(),{freeVideoModels:d}=(0,r.useMeModelAccess)(),u=(0,t.useMemo)(()=>{var t;let a={};for(let l of null!=(t=null==e?void 0:e.models)?t:[])a[l.model_id]=l;return a},[e]);return{models:(0,t.useMemo)(()=>{var t;let a=null!=(t=null==e?void 0:e.models)?t:[],l=[];for(let e of a){let t=(0,i.getVideoConfig)(e.model_id);t&&l.push({modelId:e.model_id,name:t.name,description:e.description,config:t,pricing:e,isLocked:!0===e.is_locked,unavailable_reason:e.unavailable_reason,min_plan:e.min_plan,hasMinPlanKey:"min_plan"in e})}return n(l.length>0?l:i.VIDEO_MODEL_IDS.map(e=>{let t=i.VIDEO_REGISTRY[e];return{modelId:e,name:t.name,description:"",config:t,pricing:null,isLocked:!1,hasMinPlanKey:!1}}),o,(null!=d?d:[]).map(e=>e.model_id))},[e,o,d]),isLoading:s,pricingByModelId:u}}],720787)},825924,189075,893358,586150,748927,26864,586709,890973,e=>{"use strict";var t=e.i(124104),a=e.i(44743),l=e.i(578924);e.i(718582);var r=e.i(447640);e.i(462020);var n=e.i(45793),s=e.i(520133);let i=e=>{let{plan:i,isOpen:o,onClose:d}=e,u=(0,a.useTranslations)(),c=(0,s.useRouter)();return(0,t.jsx)(n.Modal,{isOpen:o,onClose:d,size:"small",withCloseButton:!0,className:"max-w-[500px]",title:u("paid-model-upgrade-title",{plan:i.name}
1),description:u("paid-model-upgrade-description"),children:(0,t.jsx)(r.Button,{variant:"primary",size:"s",isFullWidth:!0,onClick:()=>{d(),c.push("".concat(l.GUEST_TARIFFS_PATH,"?tab=plans&plan=").concat(encodeURIComponent(i.slug)))},children:u("paid-model-upgrade-cta",{plan:i.name})})})};var o=e.i(106107);let d=e=>{let{isVisible:r}=e,n=(0,a.useTranslations)();return r?(0,t.jsxs)("p",{className:"flex flex-wrap items-center gap-x-1 gap-y-0.5 border-t border-border-soft px-3 py-2 font-manrope text-12 font-medium leading-[1.35] text-text-gray",children:[(0,t.jsx)(o.MdLock,{className:"shrink-0 fill-text-gray"}),n("Модели с замком доступны на более высоких тарифах"),(0,t.jsx)(s.Link,{href:"".concat(l.GUEST_TARIFFS_PATH,"?tab=plans"),className:"text-primary underline",children:n("Посмотреть тарифы")})]}):null};e.s(["PaidModelsHint",()=>d],189075),e.i(550170);var u=e.i(7898);let c=e=>{let{className:l,hint:r}=e,n=(0,a.useTranslations)();return(0,t.jsx)(u.TooltipQuick,{content:null===r?void 0:null!=r?r:n("dashboard-model-locked-hint"),children:(0,t.jsx)("span",{"data-keep-open":!0,className:"inline-flex",children:(0,t.jsx)(o.MdLock,{className:l,"aria-label":n("Платная модель")})})})};e.s(["PaidModelLock",()=>c],893358);var p=e.i(399171),m=e.i(277351);let x=e=>({unavailable_reason:e.unavailable_reason,min_plan:e.min_plan,hasMinPlanKey:"min_plan"in e}),h=e=>{let{data:t}=(0,m.useGetPublicAiModelsQuery)(void 0,{skip:"text"!==e}),{data:a}=(0,m.useGetPublicImageAiModelsQuery)(void 0,{skip:"image"!==e}),{data:l}=(0,m.useGetKieVideoModelsQuery)(void 0,{skip:"video"!==e}),{data:r}=(0,m.useGetKieAudioModelsQuery)(void 0,{skip:"audio"!==e});return(0,p.useCallback)(n=>{if("text"===e||"image"===e){let l="text"===e?null==t?void 0:t.results:null==a?void 0:a.results,r=null==l?void 0:l.find(e=>e.model_id===n);return r?x(r):void 0}let s="video"===e?null==l?void 0:l.models:null==r?void 0:r.models,i=null==s?void 0:s.find(e=>e.model_id===n);return i?x(i):void 0},[r,a,e,t,l])};e.s(["useModelCatalogLookup",0,h],586150);let f=e=>{var t;if(!e.isLocked)return{plan:null,canOpenUpgrade:!1,useLegacyToast:!1,showPlanHint:!1};if(!(null!=(t=e.hasMinPlanKey)?t:"min_plan"in e))return{plan:null,canOpenUpgrade:!1,useLegacyToast:!0,showPlanHint:!0};let a=e.unavailable_reason;if(a&&"model_restricted_on_plan"!==a)return{plan:null,canOpenUpgrade:!1,useLegacyToast:!1,showPlanHint:!1};let l=e.min_plan;return(null==l?void 0:l.slug)&&l.name?{plan:l,canOpenUpgrade:!0,useLegacyToast:!1,showPlanHint:!0}:{plan:null,canOpenUpgrade:!1,useLegacyToast:!1,showPlanHint:!1}};e.i(765675);var v=e.i(377627),g=e.i(319613);let b=e=>{let t=e.prices.filter(e=>"month"===e.period_type).map(e=>Number(e.amount)).filter(e=>Number.isFinite(e));return t.length?Math.min(...t):1/0},_=(e,t,a)=>{if(!a.length)return;if(!e)return a[0];let l=a.find(a=>{var l;return null===(l="image"===t?a.allowed_image_models:"text"===t?a.allowed_text_models:void 0)||void 0===l?void 0:l.some(t=>t.model_id===e)});return null!=l?l:a[0]},y=e=>{let{data:t}=(0,m.useGetTariffsQuery)(),a=(0,v.useMeSubscription)(),l=h(e),r=(0,g.filterSellablePlans)({plans:(null!=t?t:[]).filter(e=>!e.is_free),currentPlanSlug:null==a?void 0:a.plan_slug}).slice().sort((e,t)=>b(e)-b(t));return t=>{if(!t)return _(t,e,r);let a=l(t);if(a){let e=f({isLocked:!0,...a});if(e.plan){let t=r.find(t=>{var a;return t.slug===(null==(a=e.plan)?void 0:a.slug)});return t||{slug:e.plan.slug,name:e.plan.name,description:"",is_free:!1,prices:[],allowed_text_models:[],allowed_image_models:[]}}if(!e.useLegacyToast)return}return _(t,e,r)}};e.s(["useRequiredPlan",0,(e,t)=>y(t)(e),"useRequiredPlanResolver",0,y],748927);let j=e=>{let t=(0,a.useTranslations)(),l=y(e),r=h(e);return e=>{if(!e)return t("dashboard-model-locked-hint");let a=r(e);if(a){let e=f({isLocked:!0,...a});if(!e.showPlanHint)return null;if(e.plan)return t("paid-model-plan-required",{plan:e.plan.name});if(!e.useLegacyToast)return null}let n=l(e);return n?t("paid-model-plan-required",{plan:n.name}):t("dashboard-model-locked-hint")}};e.s(["usePaidModelHint",0,(e,t)=>j(t)(e),"usePaidModelHintResolver",0,j],26864);var w=e.i(532452);let k=()=>{let e=(0,a.useTranslations)(),t=(0,s.useRouter)();return a=>{(0,w.TOAST_WARNING)(null!=a?a:e("Недоступно на вашем тарифе"),"paid-model-toast",{label:e("Выбрать тариф"),onClick:()=>{t.push("".concat(l.GUEST_TARIFFS_PATH,"?tab=plans"))}})}};e.s(["usePaidModelToast",0,k],586709),e.s(["usePaidModelUpgrade",0,e=>{let[a,l]=(0,p.useState)(null),r=k(),n=j(e),s=(0,p.useCallback)(e=>{let t=f(e);
1if(t.canOpenUpgrade&&t.plan)return void l(t.plan);if(t.useLegacyToast){let t=n(e.modelId);r(null!=t?t:void 0)}},[n,r]),o=(0,p.useCallback)(()=>{l(null)},[]);return{handleLockedModelClick:s,upgradeModal:a?(0,t.jsx)(i,{plan:a,isOpen:!0,onClose:o}):null}}],890973),e.s([],825924)},236656,e=>{"use strict";var t=e.i(399171),a=e.i(277351);let l={isFreeUser:!1,remaining:0,used:0,limit:0,allowedModelIds:[],isExhausted:!1};function r(){let{freeModels:e,used:r,remaining:n,topupCredits:s,carryoverCredits:i}=(0,a.useMeQuery)(void 0,{selectFromResult:e=>{var t,a;let{data:l}=e;return{freeModels:null==l?void 0:l.free_image_models,used:null==l?void 0:l.free_image_gens_used,remaining:null==l?void 0:l.free_image_gens_remaining,topupCredits:null==l||null==(t=l.subscription)?void 0:t.topup_credits_remaining,carryoverCredits:null==l||null==(a=l.subscription)?void 0:a.carryover_credits_remaining}}});return(0,t.useMemo)(()=>{if(!e)return l;let t=e.length>0,a=null!=r?r:0,o=null!=n?n:0,d=(null!=s?s:0)+(null!=i?i:0);return{isFreeUser:t,remaining:o,used:a,limit:a+o,allowedModelIds:e.map(e=>e.model_id),isExhausted:t&&0===o&&d<=0}},[e,r,n,s,i])}e.s(["useFreeImageQuota",()=>r])},699296,e=>{"use strict";var t=e.i(399171),a=e.i(277351);function l(){let{freeModels:e,planModels:l}=(0,a.useMeQuery)(void 0,{selectFromResult:e=>{let{data:t}=e;return{freeModels:null==t?void 0:t.free_text_models,planModels:null==t?void 0:t.text_models}}});return(0,t.useMemo)(()=>{let t=null!=e?e:[],a=new Set([...t.map(e=>e.model_id),...(null!=l?l:[]).map(e=>e.model_id)]);return{isFreeUser:t.length>0,allowedModelIds:[...a]}},[e,l])}e.s(["useFreeTextModels",()=>l])},346701,e=>{"use strict";let t=(0,e.i(434913).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],346701)},38105,e=>{e.v({closeButton:"ChatTextareaFilesItem-module__dt2Npq__closeButton",content:"ChatTextareaFilesItem-module__dt2Npq__content",image:"ChatTextareaFilesItem-module__dt2Npq__image",withImage:"ChatTextareaFilesItem-module__dt2Npq__withImage",wrapper:"ChatTextareaFilesItem-module__dt2Npq__wrapper"})},217651,e=>{e.v({wrapper:"ChatTextareaFilesPlaceholder-module__61umjW__wrapper"})},667816,e=>{e.v({arrow:"Slider-module__c6tGPa__arrow",big:"Slider-module__c6tGPa__big",draggable:"Slider-module__c6tGPa__draggable",left:"Slider-module__c6tGPa__left",leftArrow:"Slider-module__c6tGPa__leftArrow",right:"Slider-module__c6tGPa__right",rightArrow:"Slider-module__c6tGPa__rightArrow",shadow:"Slider-module__c6tGPa__shadow",slider:"Slider-module__c6tGPa__slider",wrapper:"Slider-module__c6tGPa__wrapper"})},597285,e=>{e.v({wrapper:"ChatTextareaFiles-module__c4Wiza__wrapper"})},338041,238727,e=>{"use strict";var t=e.i(124104),a=e.i(399171),l=e.i(121679),r=e.i(39115),n=e.i(38105);let s=e=>{let{data:s,onRemove:i}=e,{type:o,name:d}=s,u=o.startsWith("image/"),c=(0,a.useMemo)(()=>u?URL.createObjectURL(s):null,[s,u]);return((0,a.useEffect)(()=>()=>{c&&URL.revokeObjectURL(c)},[c]),u)?(0,t.jsx)("div",{className:"".concat(n.default.wrapper," ").concat(n.default.withImage),style:c?{backgroundImage:"url(".concat(c,")")}:{},children:i?(0,t.jsx)("button",{type:"button",className:n.default.closeButton,onClick:i,"aria-label":"Remove file",children:(0,t.jsx)(l.IoClose,{})}):null}):(0,t.jsxs)("div",{className:n.default.wrapper,children:[i?(0,t.jsx)("button",{type:"button",className:n.default.closeButton,onClick:i,"aria-label":"Remove file",children:(0,t.jsx)(l.IoClose,{})}):null,(0,t.jsx)("div",{className:n.default.image,style:{background:o.startsWith("video/")?"var(--primary)":"var(--error)"},children:o.startsWith("video/")?(0,t.jsx)(r.LuFileVideo2,{}):(0,t.jsx)(r.LuFileText,{})}),(0,t.jsxs)("div",{className:n.default.content,children:[(0,t.jsx)("b",{className:n.default.name,children:d}),(0,t.jsx)("small",{className:n.default.type,children:o||"file"})]})]})};var i=e.i(338208),o=e.i(217651);let d=()=>(0,t.jsx)("div",{className:o.default.wrapper,children:(0,t.jsx)(i.Spinner,{size:"s",variant:"primary"})});var u=e.i(44743),c=e.i(667816);let p=e=>{let{cards:r,className:n,isShowArrows:s,shadowColor:i}=e,o=(0,u.useTranslations)(),d=(0,a.useRef)(null),[p,m]=(0,a.useState)(!1),[x,h]=(0,a.useState)(0),[f,v]=(0,a.useState)(0),[g,b]=(0,a.useState)(!1),[_,y]=(0,a.useState)(!1),[j,w]=(0,a.useState)(!1),k=()=>{m(!1),setTimeout(()=>{b(!1)},50)},N=()=>{let e=d.current;if(!e)return;let{scrollLeft:t,scrollWidth:a,clientWidth:l}=e;y(t>5),w(t+l<a-5)};return(0,a.useEffect)(()=>{let e=d.current;if(!e)return;N();let t=new ResizeObserver(N),a=()=>
1{t.disconnect(),Array.from(e.children).forEach(e=>{t.observe(e)})};a();let l=new MutationObserver(()=>{a(),N()});return l.observe(e,{childList:!0}),e.addEventListener("scroll",N),window.addEventListener("resize",N),()=>{t.disconnect(),l.disconnect(),e.removeEventListener("scroll",N),window.removeEventListener("resize",N)}},[]),(0,t.jsxs)("div",{className:c.default.wrapper,children:[_?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"".concat(c.default.shadow," ").concat(c.default.left," ").concat(s?c.default.big:""),style:i?{background:"linear-gradient(to right, ".concat(i,", transparent)")}:void 0}),s?(0,t.jsx)("button",{type:"button",className:"".concat(c.default.arrow," ").concat(c.default.leftArrow),onClick:()=>{var e;return null==(e=d.current)?void 0:e.scrollBy({left:-300,behavior:"smooth"})},"aria-label":o("Прокрутить влево"),children:(0,t.jsx)(l.IoChevronBack,{})}):null]}):null,j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"".concat(c.default.shadow," ").concat(c.default.right," ").concat(s?c.default.big:""),style:i?{background:"linear-gradient(to left, ".concat(i,", transparent)")}:void 0}),s?(0,t.jsx)("button",{type:"button",className:"".concat(c.default.arrow," ").concat(c.default.rightArrow),onClick:()=>{var e;return null==(e=d.current)?void 0:e.scrollBy({left:300,behavior:"smooth"})},"aria-label":o("Прокрутить вправо"),children:(0,t.jsx)(l.IoChevronForward,{})}):null]}):null,(0,t.jsx)("div",{ref:d,className:"".concat(c.default.slider," ").concat(null!=n?n:""," ").concat(_||j?c.default.draggable:""),role:"group","aria-label":"slider",tabIndex:0,onKeyDown:e=>{var t,a;"ArrowLeft"===e.key?null==(t=d.current)||t.scrollBy({left:-100,behavior:"smooth"}):"ArrowRight"===e.key&&(null==(a=d.current)||a.scrollBy({left:100,behavior:"smooth"}))},onMouseDown:e=>{var t,a,l,r;m(!0),b(!1),h(e.pageX-(null!=(l=null==(t=d.current)?void 0:t.offsetLeft)?l:0)),v(null!=(r=null==(a=d.current)?void 0:a.scrollLeft)?r:0)},onMouseMove:e=>{if(!p||!d.current)return;let t=e.pageX-(d.current.offsetLeft||0)-x;d.current.scrollLeft=f-t,Math.abs(t)>5&&b(!0)},onMouseUp:k,onMouseLeave:k,onTouchStart:e=>{var t,a,l,r;let n=e.touches[0];m(!0),b(!1),h(n.pageX-(null!=(l=null==(t=d.current)?void 0:t.offsetLeft)?l:0)),v(null!=(r=null==(a=d.current)?void 0:a.scrollLeft)?r:0)},onTouchMove:e=>{if(!p||!d.current)return;let t=e.touches[0].pageX-(d.current.offsetLeft||0)-x;d.current.scrollLeft=f-t,Math.abs(t)>5&&b(!0)},onTouchEnd:k,onClickCapture:e=>{g&&(e.preventDefault(),e.stopPropagation())},children:r.map((e,a)=>{let l=null!==e&&"object"==typeof e&&"key"in e&&null!==e.key?e.key:"slider-card-".concat(String(a));return(0,t.jsx)("div",{className:c.default.card,children:e},l)})})]})};e.s(["Slider",()=>p],238727);var m=e.i(597285);let x=e=>{let{files:a,onFileRemove:l,processingCount:r=0}=e,n=Array.from({length:r},(e,a)=>(0,t.jsx)(d,{},"placeholder-".concat(a))),i=a.map((e,a)=>(0,t.jsx)(s,{onRemove:()=>{l(a)},data:e},e.name));return(0,t.jsx)(p,{className:m.default.wrapper,cards:[...i,...n]})};e.s(["ChatTextareaFiles",()=>x],338041)},548179,e=>{"use strict";var t=e.i(399171);function a(e){let a=(0,t.useRef)(null),[l,r]=(0,t.useState)(!1),n=e=>{var t;return null==(t=a.current)?void 0:t.contains(e.target)};return{dropZoneRef:a,isDragging:l,events:{handleDragOver:e=>{n(e)&&(e.preventDefault(),r(!0))},handleDragLeave:e=>{n(e)||r(!1)},handleDrop:t=>{n(t)&&(t.preventDefault(),r(!1),e(t.dataTransfer.files))},handlePaste:t=>{n(t)&&t.clipboardData.files.length&&(e(t.clipboardData.files),t.preventDefault())}}}}e.s(["useDropPasteZone",()=>a])},909211,325753,e=>{"use strict";var t=e.i(124104),a=e.i(399171),l=e.i(277351),r=e.i(44743),n=e.i(39115),s=e.i(17146),i=e.i(32483),o=e.i(106107),d=e.i(171293);let u=e=>{let{isSelected:a,onSelect:l}=e,s=(0,r.useTranslations)();return(0,t.jsxs)("button",{type:"button",onClick:l,className:(0,d.cn)("flex w-full cursor-pointer items-center gap-3 rounded-2xl border-0 p-3 text-left","bg-bg-soft-gray transition-colors duration-150 hover:bg-hover-bg",a&&"bg-primary-light"),children:[(0,t.jsx)("span",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-white text-text-gray",children:(0,t.jsx)(n.LuMessageCircle,{className:"text-18"})}),(0,t.jsxs)("span",{className:"flex min-w-0 grow flex-col",children:[(0,t.jsx)("span",{className:"font-manrope text-14 font-semibold text-text-primary",children:s("role-picker-none")}),(0,t.jsx)("span",{className:"truncate font-manrope text-12 font-semibold text-text-gray",children:s("role-picker-none-hint")})]}),a?(0,t.jsx)(o.MdDone,{className:"shrink-0 text-16 fill-primary"}):null]})};var c=e.i(149672);e.i(303124);var p=e.i(1);e.i(526693);var m=e.i(497501);let x=e=>{let{group:a,onGroupChange:l,query:n,onQueryChange:s,onClose:i}=e,o=(0,r.useTranslations)();return(0,t.jsxs)("div",{className:"flex flex-col gap-3 desktop:flex-row desktop:items-center desktop:justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h2",{className:"grow font-manrope text-16 font-semibold text-text-primary desktop:hidden",children:o("role-picker-title")}),(0,t.jsx)(p.CloseButton,{onClick:i,className:"shrink-0 desktop:hidden"})]}),(0,t.jsx)("div",{className:"min-w-0 desktop:order-1 desktop:grow",children:(0,t.jsx)(c.RolePickerTabs,{value:a,onChange:l})}),(0,t.jsxs)("div",{className:"flex items-center gap-2 desktop:order-2 desktop:shrink-0",children:[(0,t.jsx)("div",{className:"min-w-0 grow desktop:w-[240px] desktop:grow-0",children:(0,t.jsx)(m.SearchInput,{value:n,onChange:s,placeholder:o("role-picker-search"),hasLeftIcon:!0})}),(0,t.jsx)(p.CloseButton,{onClick:i,className:"max-desktop:hidden"})]})]})};var h=e.i(221791),f=e.i(286430);e.i(210896);var v=e.i(453751);e.i(462020);var g=e.i(45793);e.i(584549);var b=e.i(76034);let _=e=>{let{isOpen:o,onClose:c,selectedId:p,onSelect:m,onExample:_}=e,y=(0,r.useTranslations)(),{roles:j,isLoading:w,isError:k}=(0,h.usePickerRoles)(),{defaultRoleId:N}=(0,l.useMeQuery)(void 0,{selectFromResult:e=>{var t,a;let{data:l}=e;return{defaultRoleId:null!=(a=null==l||null==(t=l.default_role)?void 0:t.id)?a:null}}}),C=(0,f.useRoleFilters)(j,N),[S,M]=(0,a.useState)(null),T=()=>{M(null),c()},L=e=>{m(e),T()};return(0,t.jsxs)(g.Modal,{isOpen:o,onClose:T,className:(0,d.cn)("flex max-h-[92dvh] flex-col gap-5 p-4","max-tablet:inset-x-0 max-tablet:bottom-0 max-tablet:top-auto","max-tablet:w-full max-tablet:max-w-none max-tablet:translate-none","max-tablet:rounded-b-none max-tablet:max-h-[88dvh]","tablet:w-[calc(100%-48px)] tablet:max-w-[1000px] tablet:p-6","desktop:w-[calc(100%-64px)] desktop:max-w-[1440px] desktop:p-6"),children:[(0,t.jsx)("span",{"aria-hidden":!0,
1className:"mx-auto h-1 w-9 shrink-0 rounded-full bg-border-soft tablet:hidden"}),S?(0,t.jsx)("div",{className:"min-h-0 overflow-y-auto overscroll-contain",children:(0,t.jsx)(s.RoleDetails,{role:S,ctaLabel:y("role-picker-choose"),onBack:()=>{M(null)},onChoose:L,onExample:(e,t)=>{null==_||_(e,t),T()}})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(x,{group:C.group,onGroupChange:C.setGroup,query:C.query,onQueryChange:C.setQuery,onClose:T}),(0,t.jsxs)("div",{className:"flex min-h-0 grow flex-col gap-2 overflow-y-auto overscroll-contain desktop:min-h-[520px]",children:[k?(0,t.jsx)(v.EmptyState,{icon:(0,t.jsx)(n.LuTriangleAlert,{}),title:y("role-picker-error")}):null,w?(0,t.jsx)("div",{className:"flex justify-center py-16",children:(0,t.jsx)(b.Spinner,{})}):null,w||k?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{isSelected:!p,onSelect:()=>{L(null)}}),(0,t.jsx)(i.RoleList,{myDefault:C.myDefault,featured:C.featured,rest:C.rest,isEmpty:C.isEmpty,selectedId:p,onSelect:M})]})]})]})]})};var y=e.i(565313),j=e.i(139235),w=e.i(446461),k=e.i(747615);let N=function(){let{chatId:e,onExamplePrompt:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,r.useTranslations)(),i=(0,w.useAppDispatch)(),o=(0,k.useRoleChoice)(),u=(0,w.useAppSelector)(j.selectSelectedRole),[c,p]=(0,a.useState)(!1),m=t=>{o(t),e&&i((0,y.markRoleDirty)(e))},x=!!u;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:(0,d.cn)("flex h-8 shrink-0 items-center gap-2 rounded-full pl-3",x?"bg-primary-light pr-1.5":"bg-bg-soft-gray pr-3"),children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{p(!0)},className:(0,d.cn)("flex min-w-0 cursor-pointer items-center gap-2 border-0 bg-transparent p-0","font-manrope text-12 font-semibold",x?"text-primary":"text-text-primary"),children:[(0,t.jsx)(n.LuSignpost,{className:"shrink-0 text-14"}),(0,t.jsx)("span",{className:"max-w-[160px] truncate",children:u?u.name:s("role-picker-open")})]}),x?(0,t.jsx)("button",{type:"button","aria-label":s("role-picker-reset"),onClick:()=>{m(null)},className:"flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent text-primary hover:bg-white/60",children:(0,t.jsx)(n.LuX,{className:"text-14"})}):null]}),(0,t.jsx)(_,{isOpen:c,onClose:()=>{p(!1)},selectedId:null==u?void 0:u.id,onSelect:m,onExample:(e,t)=>{m(e),null==l||l(t)}})]})};e.s(["RoleChip",()=>N],325753),e.i(337268),e.s([],909211)},252583,e=>{"use strict";var t=e.i(399171);e.s(["useDragToScroll",0,(e,a)=>{let l=(0,t.useRef)(!1);(0,t.useEffect)(()=>{let t=e.current;if(!t)return;let a=0,r=0,n=()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",n),t.style.userSelect="",t.style.scrollSnapType=""},s=e=>{if(0===e.buttons)return void n();let s=e.clientX-a;Math.abs(s)>3&&(l.current=!0),t.scrollLeft=r-s},i=e=>{0===e.button&&(l.current=!1,a=e.clientX,r=t.scrollLeft,t.style.userSelect="none",t.style.scrollSnapType="none",window.addEventListener("mousemove",s),window.addEventListener("mouseup",n))},o=e=>{l.current&&(e.preventDefault(),e.stopPropagation(),l.current=!1)},d=e=>{e.preventDefault()};return t.addEventListener("mousedown",i),t.addEventListener("click",o,!0),t.addEventListener("dragstart",d),()=>{t.removeEventListener("mousedown",i),t.removeEventListener("click",o,!0),t.removeEventListener("dragstart",d),window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",n)}},[e,a])}])},681132,281712,e=>{"use strict";var t=e.i(124104),a=e.i(44743),l=e.i(715025),r=e.i(873634);let n="attach-button-tooltip",s=e=>{let{isDisabled:s,tooltipText:i,onAttach:o}=e,d=(0,a.useTranslations)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button","aria-disabled":s,"aria-label":d("Прикрепить"),"data-tooltip-id":i?n:void 0,"data-tooltip-content":null!=i?i:void 0,onClick:e=>{e.preventDefault(),o()},className:"flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-full border-0 bg-transparent text-text-primary transition-colors hover:bg-text-on-dark-soft-hover aria-disabled:cursor-not-allowed aria-disabled:opacity-40 aria-disabled:hover:bg-transparent",children:(0,t.jsx)(l.HiOutlinePaperClip,{size:14})}),(0,t.jsx)(r.Tooltip,{id:n,place:"top",variant:"light",style:{maxWidth:"260px",padding:"4px 6px",fontFamily:"Manrope, sans-serif",fontWeight:600,fontSize:"12px",whiteSpace:"wrap",borderRadius:"8px",background:"var(--text-secondary-on-dark)"}})]})};e.s(["AttachButton",()=>s],281712),e.s([],681132)},284619,e=>{"use strict";var t=e.i(399171);e.s(["useAutoGrowTextarea",0,(e,a)=>{let l=(0,t.useRef)(null);return(0,t.useEffect)(()=>{let e=l.current;if(!e)return;let t=()=>{e.style.height="".concat(String((e=>{if(e.style.height="auto",e.value||!e.placeholder)return e.scrollHeight;e.value=e.placeholder;let t=e.scrollHeight;return e.value="",t})(e)),"px")};return t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[e,a]),l}])},47592,e=>{e.v(t=>Promise.all(["static/chunks/074558d52bf220d6.js"].map(t=>e.l(t))).then(()=>t(832409)))},694553,e=>{e.v(t=>Promise.all(["static/chunks/55d5e5f47916a6e4.js"].map(t=>e.l(t))).then(()=>t(167389)))}]);

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.