(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3941],{4319:()=>{},5667:(e,t,n)=>{"use strict";n.d(t,{D:()=>N,a:()=>A,g:()=>w,h:()=>E});var a=n(37876),o=n(9789),c=n(14232),l=n(69241),r=n(42036),s=n(50698),i=n(94882),d=n(43509),u=n(73044),h=n(68086),m=n(68990),p=n(14595);n(20321);let f=c.useEffect;function v(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],window.matchMedia(e).matches}Object.freeze({divider:(0,o.g)("dropdown-divider")});let _=(0,o.g)("dropdown-group");Object.freeze({group:_,title:"".concat(_,"__title"),content:"".concat(_,"__content")});let x=(0,o.g)("dropdown-option"),g=Object.freeze({option:x,slot:"".concat(x,"__slot"),iconSlot:"".concat(x,"__slot--icon"),wrapper:"".concat(x,"__wrapper"),label:"".concat(x,"__label"),caption:"".concat(x,"__caption"),states:{danger:"".concat(x,"--danger"),success:"".concat(x,"--success"),focused:"".concat(x,"--focused"),disabled:"".concat(x,"--disabled")}});function w(e){let{as:t,label:n,caption:o,iconLeft:r,iconRight:s,prepend:i,append:d,variant:u="default",disabled:h=!1,focused:m=!1,className:p,onClick:f,...v}=e,_=(0,l.A)(p,g.option,{[g.states.focused]:m,[g.states.success]:"success"===u,[g.states.danger]:"danger"===u,[g.states.disabled]:!!h}),x=(0,c.useCallback)(e=>{e.preventDefault(),h||null==f||f(e)},[h,f]);return(0,a.jsxs)(t||"div",{...v,className:_,"aria-disabled":h,onClick:x,children:[i&&(0,a.jsx)("span",{className:g.slot,children:i}),r&&(0,a.jsx)("span",{className:(0,l.A)(g.slot,g.iconSlot),children:r}),(0,a.jsxs)("div",{className:g.wrapper,children:[(0,a.jsx)("span",{className:g.label,children:n}),o&&(0,a.jsx)("span",{className:g.caption,children:o})]}),s&&(0,a.jsx)("span",{className:(0,l.A)(g.slot,g.iconSlot),children:s}),d&&(0,a.jsx)("span",{className:g.slot,children:d})]})}let j=(0,c.createContext)(null),b=()=>{let e=(0,c.useContext)(j);if(null===e)throw Error("Dropdown components must be wrapped in <Dropdown />");return e},N=e=>{let{children:t,...n}=e,o=function(){let{placement:e="bottom",width:t="auto",desktopMaxHeight:n,mobileFullHeight:a=!1,title:o,description:l,opened:d,onToggle:u,heading:h,footer:m,dataQa:p,dataId:f}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[v,_]=(0,c.useState)(!1),x=null!=d?d:v,g=null!=u?u:_,w=(0,r.we)({open:x,onOpenChange:g,placement:e,whileElementsMounted:s.ll,middleware:[(0,i.cY)(8),(0,i.UU)({fallbackAxisSideDirection:"none"}),(0,i.BN)({crossAxis:!1,padding:8})]});return(0,c.useMemo)(()=>({open:x,setOpen:g,...w,width:t,desktopMaxHeight:n,title:o,description:l,heading:h,footer:m,mobileFullHeight:a,dataQa:p,dataId:f}),[x,g,w,t,n,o,l,h,m,a,p,f])}(n);return(0,a.jsx)(j.Provider,{value:o,children:t})};N.displayName="Dropdown";let y=(0,o.g)("dropdown"),k=Object.freeze({dropdown:y,overlay:"".concat(y,"__overlay"),mobileHeading:"".concat(y,"__mobile-heading"),heading:"".concat(y,"__heading"),title:"".concat(y,"__title"),description:"".concat(y,"__description"),content:"".concat(y,"__content"),contentInner:"".concat(y,"__content-inner"),footer:"".concat(y,"__footer"),close:"".concat(y,"__close"),closeIcon:"".concat(y,"__close-icon"),states:{auto:"".concat(y,"--auto"),fullHeight:"".concat(y,"--full-height")}}),C=e=>{let{footer:t,...n}=e;return t?(0,a.jsx)("div",{...n,className:k.footer,children:t}):null};C.displayName="DropdownFooter";let S=e=>{let{title:t,description:n,heading:o,isDesktop:l,setOpen:r,...s}=e,i=(0,c.useMemo)(()=>o||(l&&(t||n)?(0,a.jsxs)(a.Fragment,{children:[t&&(0,a.jsx)("div",{className:k.title,children:t}),n&&(0,a.jsx)("div",{className:k.description,children:n})]}):null),[n,o,l,t]);return(0,a.jsxs)(a.Fragment,{children:[!l&&(0,a.jsxs)("div",{...s,className:k.mobileHeading,children:[t&&(0,a.jsx)("div",{className:k.title,children:t}),n&&(0,a.jsx)("div",{className:k.description,children:n}),(0,a.jsx)("button",{className:k.close,type:"button",tabIndex:-1,"aria-label":"Закрыть окно",onClick:()=>r(!1),children:(0,a.jsx)(p.P,{"aria-hidden":"true",className:k.closeIcon,style:{display:"inline-flex"},children:(0,a.jsx)(m.S,{})})})]}),i&&(0,a.jsx)("div",{...s,className:k.heading,children:i})]})};S.displayName="DropdownHeader";let A=(0,c.forwardRef)((e,t)=>{var n,o;let{style:s,contentInnerRef:i,...m}=e,{open:p,context:_,width:x,floatingStyles:g,refs:w,heading:j,title:N,description:y,footer:A,desktopMaxHeight:E,mobileFullHeight:B,dataQa:T,dataId:q,setOpen:D}=b(),L=(0,r.SV)([w.setFloating,t]),F=(0,c.useRef)(null),z=function(e){let{minWidth:t}=u.a.s;return function(e){let{defaultValue:t=!1,initializeWithValue:n=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[a,o]=(0,c.useState)(()=>n?v(e,t):null!=t&&t);function l(){o(v(e))}return f(()=>{let t=window.matchMedia(e);return l(),"function"==typeof t.addListener?t.addListener(l):t.addEventListener("change",l),()=>{"function"==typeof t.removeListener?t.removeListener(l):t.removeEventListener("change",l)}},[e]),a}("screen and (min-width: ".concat(t,"px)"))}(0),{isMounted:R,styles:H}=(0,r.DL)(_,{initial:{opacity:.2,transform:z?"translate(0, 0)":"translate(0, 100%)"},open:{opacity:1,transform:"translate(0, 0)"},duration:{open:300,close:100}});if((0,c.useEffect)(()=>{let e=e=>{let{target:t}=e;p&&([F.current,w.reference.current].some(e=>e===t||e&&e.contains(t))||D(!1))};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[p,w.reference,D]),!R)return null;let M=(0,a.jsxs)("div",{ref:F,className:(0,l.A)(k.dropdown,{[k.states.fullHeight]:B}),role:z?"popup":"dialog","aria-modal":!z,"data-id":q,"data-qa":T,style:H,children:[(0,a.jsx)(S,{title:N,description:y,heading:j,isDesktop:z,setOpen:D,"data-qa":(0,h.g)("".concat(T,"-header"),!!T)}),(0,a.jsx)("div",{...m,className:k.content,"data-qa":(0,h.g)("".concat(T,"-content"),!!T),children:(0,a.jsx)("div",{className:k.contentInner,style:{maxHeight:z?E:void 0},ref:i,children:m.children})}),(0,a.jsx)(C,{"data-qa":(0,h.g)("".concat(T,"-header"),!!T),footer:A})]});if(z){let e;return"inherit"===x?e=null==(o=null==(n=null==w?void 0:w.reference)?void 0:n.current)?void 0:o.clientWidth:"auto"===x?e=void 0:"number"==typeof x&&(e=x),(0,a.jsx)("div",{className:(0,l.A)(k.overlay,{[k.states.auto]:"auto"===x}),style:{...s,...g,...void 0!==e&&{width:e}},ref:L,children:M})}return(0,a.jsx)(r.XF,{id:d.D,children:(0,a.jsx)(r.zR,{lockScroll:!0,className:(0,l.A)(k.overlay,{[k.states.auto]:"auto"===x}),style:s,ref:L,children:M})})});A.displayName="DropdownContent";let E=(0,c.forwardRef)(function(e,t){let{children:n,asChild:o=!1,disabled:l,...s}=e,{refs:i,open:d,setOpen:u}=b(),h=n.ref,m=(0,r.SV)([i.setReference,t,h]),p=(0,c.useCallback)(()=>{l||u(!d)},[l,d,u]);return o&&(0,c.isValidElement)(n)?(0,c.cloneElement)(n,{ref:m,disabled:l,onClick:p,...s,...n.props}):(0,a.jsx)("button",{ref:m,onClick:p,disabled:l,...s,type:"button",children:n})});E.displayName="DropdownTrigger"},11251:(e,t,n)=>{"use strict";n.d(t,{ms:()=>a.D,n5:()=>a.g,pm:()=>a.a,uu:()=>a.h});var a=n(5667)},20321:()=>{},42195:(e,t,n)=>{"use strict";n.d(t,{a:()=>x});var a=n(37876),o=n(14232),c=n(42036),l=n(69241),r=n(43509),s=n(68086),i=n(9789),d=n(83815),u=n(68741),h=n(68990),m=n(14595);n(4319);let p=(0,i.g)("modal"),f=Object.freeze({modal:p,overlay:"".concat(p,"__overlay"),withoutFooter:"".concat(p,"--without-footer"),noContent:"".concat(p,"--no-content"),open:"".concat(p,"--open"),overlayOpen:"".concat(p,"__overlay--open"),height:{medium:"".concat(p,"--height-medium"),full:"".concat(p,"--height-full")},size:{s:"".concat(p,"--s"),m:"".concat(p,"--m"),l:"".concat(p,"--l"),xl:"".concat(p,"--xl")},header:"".concat(p,"__header"),headerText:"".concat(p,"__header-text"),headerTitle:"".concat(p,"__header-title"),headerSubtitle:"".concat(p,"__header-subtitle"),closeIcon:"".concat(p,"__close-icon"),backButton:"".concat(p,"__back-button"),backButtonText:"".concat(p,"__back-button-text"),headerStates:{centered:"".concat(p,"__header--centered"),withLongBtn:"".concat(p,"__header--with-long-btn"),defaultHeight:"".concat(p,"__header--default-height")},content:"".concat(p,"__content"),withoutPadding:"".concat(p,"__content--without-padding"),withScroll:"".concat(p,"__content--with-scroll"),footer:"".concat(p,"__footer"),footerContainer:"".concat(p,"__footer-container"),footerBtn:"".concat(p,"__footer-btn"),footerDescription:"".concat(p,"__footer-description"),divider:"".concat(p,"__divider"),dividerTop:"".concat(p,"__divider--top"),dividerBottom:"".concat(p,"__divider--bottom")}),v=e=>{let{primaryBtnText:t,onPrimary:n,secondaryBtnText:o,onSecondary:c,thirdBtnText:r,onThird:i,description:u,children:h,noContent:m,dataQa:p}=e;return(0,a.jsxs)("div",{"data-qa":(0,s.g)("".concat(p,"-footer"),!!p),className:(0,l.A)(f.footer,{[f.noContent]:m}),children:[!m&&(0,a.jsx)("div",{className:(0,l.A)(f.divider,f.dividerTop)}),h||(0,a.jsxs)("div",{className:f.footerContainer,children:[r&&(0,a.jsx)(d.a,{dataQa:(0,s.g)("".concat(p,"-footer-third-btn"),!!p),label:r,variant:"secondary",size:"s",className:f.footerBtn,onClick:i}),o&&(0,a.jsx)(d.a,{dataQa:(0,s.g)("".concat(p,"-footer-secondary-btn"),!!p),label:o,variant:"secondary",size:"s",className:f.footerBtn,onClick:c}),t&&(0,a.jsx)(d.a,{dataQa:(0,s.g)("".concat(p,"-footer-primary-btn"),!!p),label:t,size:"s",className:f.footerBtn,onClick:n})]}),u&&(0,a.jsx)("span",{"data-qa":(0,s.g)("".concat(p,"-footer-description"),!!p),className:f.footerDescription,children:u})]})},_=e=>{let{text:t,title:n,subtitle:o,align:c="left",backBtnVariant:r,onBack:i,onClose:d,noContent:p,dataQa:v,withoutCloseBtn:_=!1}=e;return(0,a.jsxs)("div",{"data-qa":(0,s.g)("".concat(v,"-header"),!!v),className:(0,l.A)(f.header,{[f.headerStates.centered]:"center"===c||!!r,[f.headerStates.withLongBtn]:"long"===r,[f.headerStates.defaultHeight]:!t&&!n&&!o}),children:[t&&(0,a.jsx)("span",{"data-qa":(0,s.g)("".concat(v,"-header-text"),!!v),className:f.headerText,children:t}),n&&(0,a.jsx)("span",{"data-qa":(0,s.g)("".concat(v,"-header-title"),!!v),className:f.headerTitle,children:n}),o&&(0,a.jsx)("span",{"data-qa":(0,s.g)("".concat(v,"-header-subtitle"),!!v),className:f.headerSubtitle,children:o}),!_&&(0,a.jsx)("button",{"data-qa":(0,s.g)("".concat(v,"-header-close"),!!v),type:"button",className:f.closeIcon,onClick:d,children:(0,a.jsx)(m.P,{children:(0,a.jsx)(h.S,{})})}),r&&(0,a.jsxs)("button",{"data-qa":(0,s.g)("".concat(v,"-header-back"),!!v),type:"button",className:f.backButton,onClick:i,children:[(0,a.jsx)(m.P,{children:(0,a.jsx)(u.S,{})}),"long"===r&&(0,a.jsx)("span",{className:f.backButtonText,children:"Назад"})]}),!p&&(0,a.jsx)("div",{className:(0,l.A)(f.divider,f.dividerBottom)})]})},x=(0,o.forwardRef)((e,t)=>{let{header:n,footer:i,open:d=!1,size:u="m",noPadding:h=!1,height:m="full",onClose:p,children:x,className:g,style:w,dataQa:j,dataId:b,dismissDisabled:N=!1,...y}=e,[k,C]=(0,o.useState)(!1),[S,A]=(0,o.useState)(!1),E=(0,o.useRef)(null);(0,o.useEffect)(()=>()=>{E.current&&cancelAnimationFrame(E.current)},[]),(0,o.useEffect)(()=>{if(E.current&&cancelAnimationFrame(E.current),d)return C(!0),E.current=requestAnimationFrame(()=>{requestAnimationFrame(()=>{A(!0)})}),()=>{E.current&&cancelAnimationFrame(E.current)};{A(!1);let e=setTimeout(()=>{C(!1)},300);return()=>{clearTimeout(e),E.current&&cancelAnimationFrame(E.current)}}},[d]);let B=()=>{A(!1);let e=setTimeout(()=>{null==p||p(),C(!1)},300);return()=>clearTimeout(e)},{context:T}=(0,c.we)({open:k,onOpenChange:e=>{e||B()}}),q=(0,c.s9)(T,{outsidePressEvent:"mousedown",outsidePress:!N,escapeKey:!N}),D=(0,c.It)(T,{role:"dialog"}),{getFloatingProps:L}=(0,c.bv)([q,D]),[F,z]=(0,o.useState)(!1),R=(0,o.useCallback)(e=>{e&&new ResizeObserver(()=>{z(e.scrollHeight>e.clientHeight)}).observe(e)},[]);return k?(0,a.jsx)(c.XF,{id:r.M,children:(0,a.jsx)(c.zR,{lockScroll:!0,className:(0,l.A)(f.overlay,{[f.overlayOpen]:S}),children:(0,a.jsx)(c.s3,{context:T,children:(0,a.jsxs)("div",{ref:t,className:(0,l.A)(f.modal,f.size[u],f.height[m],{[f.withoutFooter]:!(null==i?void 0:i.primaryBtnText)&&!(null==i?void 0:i.children),[f.open]:S},g),style:w,...L(),...y,"data-id":b,"data-qa":j,children:[(0,a.jsx)(_,{...n,dataQa:j,noContent:!x,onClose:B}),x&&(0,a.jsx)("div",{"data-qa":(0,s.g)("".concat(j,"-content"),!!j),ref:R,className:(0,l.A)(f.content,{[f.withoutFooter]:!(null==i?void 0:i.primaryBtnText)&&!(null==i?void 0:i.children),[f.withoutPadding]:h,[f.withScroll]:F}),children:x}),((null==i?void 0:i.primaryBtnText)||(null==i?void 0:i.children))&&(0,a.jsx)(v,{...i,dataQa:j,noContent:!x})]})})})}):null});x.displayName="Modal"},43509:(e,t,n)=>{"use strict";n.d(t,{D:()=>c,M:()=>a,T:()=>o});let a="finkit-modals",o="finkit-tooltips",c="finkit-dropdown"},68741:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var a=n(14232);function o(e){return a.createElement("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},a.createElement("path",{d:"M7.22 12.53a.75.75 0 0 1 0-1.06l6.5-6.5a.75.75 0 1 1 1.06 1.06L8.81 12l5.97 5.97a.75.75 0 1 1-1.06 1.06l-6.5-6.5Z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}))}},68990:(e,t,n)=>{"use strict";n.d(t,{S:()=>o});var a=n(14232);function o(e){return a.createElement("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},a.createElement("path",{d:"M7.22 7.22a.743.743 0 0 1 1.06 0L12 10.94l3.72-3.72a.743.743 0 0 1 1.06 0 .742.742 0 0 1 0 1.06L13.061 12l3.72 3.72a.743.743 0 0 1 0 1.06.743.743 0 0 1-1.061 0L12 13.06l-3.72 3.72a.743.743 0 0 1-1.06 0 .743.743 0 0 1 0-1.06L10.94 12 7.22 8.28a.743.743 0 0 1 0-1.06Z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}))}}}]);