(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[473],{5293:function(e){!function(){"use strict";var t={864:function(e){var t,n="object"==typeof Reflect?Reflect:null,a=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(n,a){function r(n){e.removeListener(t,s),a(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}f(e,t,s,{once:!0}),"error"!==t&&"function"==typeof e.on&&f(e,"error",r,{once:!0})})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var i=10;function l(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function o(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,n,a){if(l(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),i=s[t]),void 0===i)i=s[t]=n,++e._eventsCount;else if("function"==typeof i?i=s[t]=a?[n,i]:[i,n]:a?i.unshift(n):i.push(n),(r=o(e))>0&&i.length>r&&!i.warned){i.warned=!0;var r,s,i,c=Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=i.length,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var a={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=u.bind(a);return r.listener=n,a.wrapFn=r,r}function p(e,t,n){var a=e._events;if(void 0===a)return[];var r=a[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):m(r,r.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=Array(t),a=0;a<t;++a)n[a]=e[a];return n}function f(e,t,n,a){if("function"==typeof e.on)a.once?e.once(t,n):e.on(t,n);else if("function"==typeof e.addEventListener)e.addEventListener(t,function r(s){a.once&&e.removeEventListener(t,r),n(s)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||r(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),s.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return o(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,s=this._events;if(void 0!==s)r=r&&void 0===s.error;else if(!r)return!1;if(r){if(t.length>0&&(i=t[0]),i instanceof Error)throw i;var i,l=Error("Unhandled error."+(i?" ("+i.message+")":""));throw l.context=i,l}var o=s[e];if(void 0===o)return!1;if("function"==typeof o)a(o,this,t);else for(var c=o.length,u=m(o,c),n=0;n<c;++n)a(u[n],this,t);return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return l(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,a,r,s,i;if(l(t),void 0===(a=this._events)||void 0===(n=a[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete a[e],a.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){i=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(a[e]=n[0]),void 0!==a.removeListener&&this.emit("removeListener",e,i||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,a;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0==arguments.length){var r,s=Object.keys(n);for(a=0;a<s.length;++a)"removeListener"!==(r=s[a])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(a=t.length-1;a>=0;a--)this.removeListener(e,t[a]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}}},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var s=n[e]={exports:{}},i=!0;try{t[e](s,s.exports,a),i=!1}finally{i&&delete n[e]}return s.exports}a.ab="//";var r=a(864);e.exports=r}()},6002:function(e,t,n){"use strict";n.d(t,{MJ:function(){return Z}});var a,r=n(5893),s=n(6535),i=n(4588),l=n(6010),o=n(7294),c=n(9194),u=n(4941);let d=(0,u.g)("check-all","sc"),p=Object.freeze({wrapper:`${d}__wrapper`,link:`${d}__link`,icon:`${d}__icon`,iconGray:`${d}__icon--gray`}),h=({children:e,className:t,linkClassName:n,iconGrayBackground:a,Link:s=i.rU,event:o,href:u,dataLayerPush:d})=>(0,r.jsx)("div",{className:(0,l.Z)(p.wrapper,t),onClick:()=>{o&&d(o)},children:(0,r.jsxs)(s,{className:(0,l.Z)(p.link,n),href:u,children:[e,(0,r.jsx)("span",{className:(0,l.Z)(p.icon,{[p.iconGray]:a}),children:(0,r.jsx)(c.IconFdsArrowUpRightSmallO,{size:24})})]})});var m=n(171),f=n(1069),v=n(7769),x=((a=x||{}).light="light",a.gray="gray",a);let _=e=>"kasko"===e||"osago"===e,g=(0,u.g)("best-offers-banner","sc"),b=Object.freeze({bestOffersBaner:g,wrapper:`${g}__wrapper`,wideWrapper:`${g}__wrapper--wide`,whiteWrapper:`${g}__wrapper--white`,content:`${g}__content`,header:`${g}__header`,title:`${g}__title`,subtitle:`${g}__subtitle`,icon:`${g}__icon`,iconBlack:`${g}__icon--black`,image:`${g}__image`}),y=({title:e,image:t,url:n,description:a,backgroundColor:i,wide:o,theme:u,handleBannerDataLayerPush:d,className:p})=>{let h=u===x.gray,m={"--bg-base":(null==i?void 0:i.base)??(h?"var(--color-white)":"var(--color-gray-400)"),"--bg-hover":(null==i?void 0:i.hover)??"var(--color-gray-500)"};return(0,r.jsxs)("div",{className:(0,l.Z)(b.wrapper,p,{[b.wideWrapper]:o}),style:m,onClick:()=>{d(),window.open(n,"_blank")},children:[(0,r.jsxs)("div",{className:b.content,children:[(0,r.jsxs)("div",{className:b.header,children:[(0,r.jsx)(s.xv,{weight:"medium",size:"24",className:b.title,children:e}),(0,r.jsx)("div",{className:(0,l.Z)(b.icon,{[b.iconBlack]:h}),children:(0,r.jsx)(c.IconFdsArrowUpRightSmallO,{size:32})})]}),a&&(0,r.jsx)(s.xv,{size:"16",children:a})]}),(null==t?void 0:t.url)&&(0,r.jsx)("picture",{className:b.image,children:(0,r.jsx)("img",{src:t.url,width:t.width??150,height:t.height??"auto",alt:`Баннер ${e}`,loading:"lazy"})})]})},j=(0,u.g)("offer-card","sc"),w=Object.freeze({offerCard:j,wrapper:`${j}__wrapper`,whiteWrapper:`${j}__wrapper--white`,bankInfo:`${j}__bankInfo`,units:`${j}__units`,unitsColumn:`${j}__units--column`,unit:`${j}__unit`,unitRow:`${j}__unit--row`,unitTitleWrapper:`${j}__unitTitleWrapper`,unitTitle:`${j}__unitTitle`,tooltipIcon:`${j}__tooltipIcon`,unitValue:`${j}__unitValue`,button:`${j}__button`,buttonRounded:`${j}__button--rounded`}),$=e=>{let t=e.split("₽");return t.map((e,n)=>(0,r.jsxs)(o.Fragment,{children:[e,n<t.length-1&&(0,r.jsx)(s.xv,{fontFamily:"primary",weight:"regular",children:"₽"})]},`${e}-${n}`))},N=({title:e,value:t,tooltip:n,unitsAsColumn:a,isTitleUnit:o})=>(0,r.jsxs)("div",{className:(0,l.Z)(w.unit,{[w.unitRow]:a}),children:[(0,r.jsxs)("div",{className:w.unitTitleWrapper,children:[(0,r.jsx)(s.xv,{size:"14",className:w.unitTitle,children:e}),n&&(0,r.jsx)(i.u,{text:n,children:(0,r.jsx)(c.IconFdsQuestionCircleO,{className:w.tooltipIcon})})]}),(0,r.jsx)(s.xv,{weight:"medium",size:o?"18":a?"16":"24",className:w.unitValue,children:e.includes("Рейтинг")?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.IconFdsStarF,{size:16,style:{color:"var(--color-orange-400)"}}),t]}):$(t)})]}),C=({companyName:e,name:t,url:n,logo:a,units:s,unitsAsColumn:o,additionalButton:c,dataLayerPush:u,eventCategory:d,productType:p,theme:h,buttonClassName:m,eventValueByUnitTitle:v})=>{let _=n=>{let a={event:"data-event",eventCategory:d,eventAction:`click_button_${(0,f.t)(n)}_${p}`,eventLabel:(0,f.t)(`${e}_${t}`)};if(v){let e=s.find(e=>e.title.toLowerCase()===v.toLowerCase());e&&(a.eventValue=(0,f.t)(e.value))}u(a)};return(0,r.jsxs)("div",{className:(0,l.Z)(w.wrapper,{[w.whiteWrapper]:h===x.gray}),children:[(0,r.jsxs)("div",{className:w.bankInfo,children:[a&&(0,r.jsx)("img",{src:a,width:56,height:56,alt:`${e} logo`}),(0,r.jsx)(N,{title:t,value:e,isTitleUnit:!0})]}),(0,r.jsx)("div",{className:(0,l.Z)(w.units,{[w.unitsColumn]:o}),children:s.map(e=>(0,r.jsx)(N,{title:e.title,value:e.value,tooltip:e.tooltip,unitsAsColumn:o},`${e.title}-${e.value}`))}),c&&(0,r.jsx)(i.zx,{as:"a",className:(0,l.Z)(w.button,w.buttonRounded),size:"xs",label:c.text,href:c.url,variant:"white",onClick:()=>_(c.text)}),(0,r.jsx)(i.zx,{as:"a",className:(0,l.Z)(w.button,m),size:"xs",label:"Подробнее",href:n,onClick:()=>_("podrobnee_o_kartochke_iz")})]})},k=(0,u.g)("offers-list","sc"),L=Object.freeze({offersList:k,wrapper:`${k}__wrapper`,sliderWrapper:`${k}__sliderWrapper`,offerItem:`${k}__offerItem`,compact:`${k}__offerItem--compact`,bannerItem:`${k}__bannerItem`}),R=({offers:e,banner:t,dataLayerPush:n,eventCategory:a,productType:s,theme:o,singleProduct:c})=>{let u=e.length<=2;return(0,r.jsxs)(i.iR,{options:{slidesPerView:"auto",spaceBetween:0,autoplay:{delay:3e3,disableOnInteraction:!1}},breakpoints:{xl:{autoplay:!1}},className:L.sliderWrapper,pagination:!0,children:[e.slice(0,3).map(e=>(0,r.jsx)(i.wI,{className:(0,l.Z)(L.offerItem,{[L.compact]:c}),children:(0,r.jsx)(C,{...e,dataLayerPush:n,eventCategory:a,productType:s,theme:o})},e.id)),t&&(0,r.jsx)(i.wI,{className:L.bannerItem,children:(0,r.jsx)(y,{...t,handleBannerDataLayerPush:()=>{n({event:"data-event",eventCategory:a,eventAction:"click_bnr_banner_top_predlozheniy",eventLabel:s})},wide:u,theme:o})})]})},P=(0,u.g)("osago-tab","sc"),z=Object.freeze({osagoTab:P,wrapper:`${P}__wrapper`,card:`${P}__card`,whiteCard:`${P}__card--white`,image:`${P}__image`,content:`${P}__content`,inputWrapper:`${P}__inputWrapper`,select:`${P}__select`,input:`${P}__input`,buttonLinkWrapper:`${P}__buttonLinkWrapper`,button:`${P}__button`,banner:`${P}__banner`}),O={kasko:{title:"Рассчет Каско за минуту",description:"Выберите лучшие условия для оформления полиса",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}},osago:{title:"ОСАГО с экономией до 78%",description:"Предварительная цена после ввода номера ТС",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}}},F=[{label:"Мотоцикл",value:"moto"},{label:"Автомобиль",value:"auto"}],T=Object.fromEntries(F.map(e=>[e.value,e])),A={auto:{mask:"a 000 aa 00",placeholder:"A 000 AA 00"},moto:{mask:"0000 aa 00",placeholder:"0000 AA 00"}},M="АВЕКМНОРСТУХ",I=RegExp(`[${M}]`,"i"),B=RegExp(`[^0-9${M}]`,"gi"),E=({type:e,baseUrl:t,s3Assets:n,banner:a,dataLayerPush:c,eventCategory:u,theme:d})=>{let p="osago"===e,h=(0,v.xn)(t,"osago"),m=(0,v.xn)(h,"step-car"),_=(0,v.xn)(t,"kasko"),g=(0,v.xn)(_,"vehicle"),b=p?m:g,[j,w]=(0,o.useState)(""),[$,N]=(0,o.useState)("auto"),{mask:C,placeholder:k}=A[$],L=d===x.gray,R=`?${new URLSearchParams({type:p?$:"auto",license:j})}`,P=(0,v.xn)(b,R),M=a??{...O[e],url:p?h:_,image:n?{url:(0,v.xn)(n,`pl-common-blocks-renderer/topOffers/${p?"icon_osago":"icons_car"}.png`),width:204,height:160}:void 0},E=T[$].label,W=(t,n)=>{c({event:"data-event",eventCategory:u,eventAction:t,eventLabel:n??e})};return(0,r.jsxs)("div",{className:z.wrapper,children:[(0,r.jsxs)("div",{className:(0,l.Z)(z.card,{[z.whiteCard]:L}),children:[n&&(0,r.jsx)("picture",{children:(0,r.jsx)("img",{src:`${n}/pl-common-blocks-renderer/topOffers/auto_bg.png`,alt:"Автомобиль",loading:"lazy",className:z.image})}),(0,r.jsxs)("div",{className:z.content,children:[(0,r.jsxs)(s.X6,{as:"h3",type:"h3",children:["Онлайн калькулятор ",p?"ОСАГО":"Каско"]}),(0,r.jsxs)("div",{className:z.inputWrapper,children:[p&&(0,r.jsx)(i.Ph,{options:F,value:T[$],label:"Тип транспорта",variant:L?"primary":"secondary",className:z.select,onChange:e=>{w(""),N(e.value),W(`selector_item_${(0,f.t)(e.label)}`)}}),(0,r.jsx)(i.An,{label:"Госномер",variant:L?"primary":"secondary",maskOpts:{mask:C,definitions:{a:I}},maskPlaceholder:k,value:j,className:z.input,onChange:(e,t)=>{let n=t.replace(B,"");w(n.toUpperCase())},onClick:()=>W(`message_field_${(0,f.t)(E)}`),onBlur:()=>W(`on_message_field_${(0,f.t)(E)}`)}),(0,r.jsxs)(s.xv,{children:["У меня"," ",(0,r.jsx)(i.rU,{href:b,onClick:()=>{W("click_link_net_nomera",b)},children:"нет номера"})]})]}),(0,r.jsx)(i.zx,{as:"a",href:P,size:"s",className:z.button,onClick:()=>{W(`click_button_rasschitat_${(0,f.t)(E)}`,P)},children:"Рассчитать"})]})]}),(0,r.jsx)("div",{className:z.banner,children:(0,r.jsx)(y,{...M,handleBannerDataLayerPush:()=>{W("click_bnr_banner_top_predlozheniy")}})})]})},W=(0,u.g)("best-offers","sc"),S=Object.freeze({bestOffers:W,graySection:`${W}--gray`,singleProduct:`${W}--singleProduct`,title:`${W}__title`,singleProductTitle:`${W}__title--singleProduct`,chips:`${W}__chips`,warning:`${W}__warning`,allOffersLink:`${W}__allOffersLink`}),U={вклады:"вкладам",облигации:"облигациям",кредиты:"кредитам",займы:"займам","Кредитные карты":"кредитным картам",каско:"каско",осаго:"ОСАГО","дебетовые карты":"дебетовым картам",ипотека:"ипотеке",автокредиты:"автокредитам"},Z=({tabs:e,baseUrl:t,s3Assets:n,eventCategory:a="best-offers",dataLayerPush:c,singleProduct:u=!1,theme:d=x.light})=>{let p=d===x.gray,f=e.map(e=>({url:e.productType,title:e.name})),[v,g]=(0,o.useState)(f[0].url),b=e.find(e=>e.productType===v)??e[0],y=(0,i._m)("xl"),j=U[b.name.toLowerCase()],w=j?`по ${j}`:b.name,$=_(null==b?void 0:b.productType)&&t?(0,r.jsx)(E,{type:b.productType,banner:b.banner,baseUrl:t,s3Assets:n,dataLayerPush:c,eventCategory:a,theme:d}):null;return(0,r.jsx)("section",{className:(0,l.Z)(S.bestOffers,{[S.singleProduct]:u,[S.graySection]:p}),children:(0,r.jsxs)(s.W2,{children:[(0,r.jsxs)(s.X6,{as:"h2",type:u?"h2":"display",className:(0,l.Z)(S.title,!u&&(y?"mb-8":"mb-6"),u&&(0,l.Z)("mb-0",S.singleProductTitle)),children:["Лучшие предложения ",u?w:"сегодня"]}),!u&&(0,r.jsx)(m.N,{items:f,maxNumberOfLines:2,activeChipId:v,variant:p?"white":"gray",className:S.chips,onClick:t=>{g(t);let n=e.find(e=>e.productType===t);c({event:"data-event",eventCategory:a,eventAction:"click_chip_top_predlozheniy_vybor",eventLabel:null==n?void 0:n.productType})}}),(0,r.jsxs)("div",{children:[$??(0,r.jsx)(R,{offers:b.offers,banner:b.banner,dataLayerPush:c,eventCategory:a,productType:b.productType,theme:d,singleProduct:u}),b.hasWarning&&(0,r.jsx)(s.xv,{as:"p",size:"16",className:S.warning,children:b.warningCustomText??"Оценивайте свои финансовые возможности и риски. Изучите все условия кредита (займа)"})]}),b.checkAllUrl&&(0,r.jsx)(h,{href:b.checkAllUrl,event:{event:"data-event",eventCategory:a,eventAction:"link",eventLabel:`Показать все предложения ${b.productType}`},dataLayerPush:c,iconGrayBackground:!p,className:S.allOffersLink,linkClassName:b.checkAllLinkClassName,children:"Показать все предложения"})]})})}},9685:function(e,t,n){"use strict";n.d(t,{$:function(){return S}});var a=n(5893),r=n(6010),s=n(7294),i=n(6535),l=n(4588),o=n(4941),c=n(9194);let u=(e,t)=>(t>0&&!Number.isInteger(e)&&!Number.isNaN(e)&&String(e).split(".")[1].length>t&&(e=+e.toFixed(t)),e),d=(e,t=-1)=>(e=u(e,t),new Intl.NumberFormat("ru-RU").format(e)),p=({type:e="text",unit:t,format:n,defaultValue:a="",maxLength:r=-1}={})=>{let[l,o]=(0,s.useState)(a),c=(0,s.useRef)(l),[u,p]=(0,s.useState)(!1),h=(0,s.useCallback)((t,n)=>{"function"==typeof t&&(t=t(c.current));let a=String(t);if(!(r>-1&&a.length>r)){if(["int","float"].includes(e)){if(isNaN(+t)||"int"===e&&a.includes(".")||a.includes(" "))return;a=String(""===t?"":+t)}c.current=a,o(a),null==n||n(a)}},[r,e]),m=(0,s.useMemo)(()=>({onChange:e=>{h(e)},onFocus:()=>p(!0),onBlur:()=>p(!1)}),[h]),f=(0,s.useMemo)(()=>{let a=l,r=null;switch("currency"===n&&["int","float"].includes(e)&&""!==l&&(a=d(+l)),t){case"year":r=""===a?"":(0,i._6)(+l,"год","года","лет");break;case"day":r=""===a?"":(0,i._6)(+l,"день","дня","дней");break;default:r=""!==a&&t?t:""}return r&&["int","float"].includes(e)?`${a} ${r}`:a},[n,e,t,l]);return(0,s.useMemo)(()=>({events:m,value:l,formattedValue:f,isFocused:u,handleChange:h}),[m,f,h,u,l])},h=(0,o.g)("tax-calculator-banner","sc"),m=Object.freeze({taxCalculatorBaner:h,widget:`${h}--widget`,wrapper:`${h}__wrapper`,content:`${h}__content`,image:`${h}__image`,title:`${h}__title`,subtitle:`${h}__subtitle`,button:`${h}__button`}),f=({isFullPage:e,buttonUrl:t,assets:n})=>(0,a.jsxs)("div",{className:(0,r.Z)(m.wrapper,{[m.widget]:!e}),children:[(0,a.jsxs)("picture",{className:m.image,children:[n.mobile&&(0,a.jsx)("source",{srcSet:n.mobile,media:"(max-width: 1023.02px)"}),(0,a.jsx)("img",{src:n.desktop,alt:"Калькулятор НДФЛ",loading:e?"eager":"lazy"})]}),(0,a.jsxs)("div",{className:m.content,children:[(0,a.jsx)("p",{className:m.title,children:"Оформи налоговый вычет"}),(0,a.jsx)("p",{className:m.subtitle,children:"Вы можете подать заявление на возврат НДФЛ за прошлый год с помощью наших партнеров"}),(0,a.jsx)(l.zx,{stretch:!0,className:m.button,label:"Подать заявление",size:"s",onClick:()=>{window.open(t,"_blank")}})]})]}),v=e=>s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},s.createElement("path",{fill:"#6c6d78",d:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-18a8 8 0 1 1 0 16 8 8 0 0 1 0-16Z"}),s.createElement("path",{fill:"#6c6d78",d:"M11.62 17.915a1 1 0 0 0 .76 0 1 1 0 0 0 .33-.21c.088-.097.16-.209.21-.33a.84.84 0 0 0 .08-.38 1 1 0 0 0-.29-.71 1.152 1.152 0 0 0-.33-.21 1 1 0 0 0-1.38.92c.004.265.107.518.29.71a.999.999 0 0 0 .33.21Z"}),s.createElement("path",{fill:"#6c6d78",fillRule:"evenodd",d:"M8 9.584C8 7.47 9.935 6 12 6s4 1.47 4 3.584c0 1.632-1.222 2.45-1.981 2.89h-.002c-.74.43-1.017.745-1.017 1.203V14a1 1 0 1 1-2 0v-.323c0-1.653 1.237-2.482 2.015-2.933.722-.42.985-.723.985-1.16C14 8.844 13.25 8 12 8s-2 .844-2 1.584a1 1 0 0 1-2 0Z",clipRule:"evenodd"})),x=(0,o.g)("tax-calculator","sc"),_=Object.freeze({taxCalculator:x,widget:`${x}--widget`,fullPage:`${x}--full-page`,wrapper:`${x}__wrapper`,row:`${x}__row`}),g={Январь:{num:1,genitive:"января",prepositional:"январе"},Февраль:{num:2,genitive:"февраля",prepositional:"феврале"},Март:{num:3,genitive:"марта",prepositional:"марте"},Апрель:{num:4,genitive:"апреля",prepositional:"апреле"},Май:{num:5,genitive:"мая",prepositional:"мае"},Июнь:{num:6,genitive:"июня",prepositional:"июне"},Июль:{num:7,genitive:"июля",prepositional:"июле"},Август:{num:8,genitive:"августа",prepositional:"августе"},Сентябрь:{num:9,genitive:"сентября",prepositional:"сентябре"},Октябрь:{num:10,genitive:"октября",prepositional:"октябре"},Ноябрь:{num:11,genitive:"ноября",prepositional:"ноябре"},Декабрь:{num:12,genitive:"декабря",prepositional:"декабре"}},b=[{limit:24e5,rate:.13},{limit:5e6,rate:.15},{limit:2e7,rate:.18},{limit:5e7,rate:.2},{limit:1/0,rate:.22}];b[0].limit,b[0].rate;let y=b[0].rate,j=(0,o.g)("tax-calculator-form-bonus","sc"),w=Object.freeze({taxCalculatorFormBonus:j,removeButton:`${j}__remove-button`}),$=({bonus:e,index:t,selectedMonths:n,onRemove:r,onUpdate:s})=>{let i=p({defaultValue:()=>e.value,type:"int",maxLength:20,unit:"₽",format:"currency"});return(0,a.jsxs)("div",{className:w.taxCalculatorFormBonus,children:[(0,a.jsx)(l.MA,{size:"m",label:"Сумма до налогов",value:i.isFocused?i.value:i.formattedValue,variant:"secondary",...i.events,onChange:n=>{i.events.onChange(n),s(t,{...e,value:n})}}),(0,a.jsx)(l.Ph,{options:Object.keys(g).filter(t=>!n.includes(t)||t===e.month),variant:"secondary",label:"Месяц",value:e.month,onChange:n=>s(t,{...e,month:n})}),(0,a.jsx)(l.zx,{onClick:()=>r(t),label:"Удалить",appearance:"ghost",variant:"purple",size:"xs",className:w.removeButton})]})},N=(0,o.g)("tax-calculator-form","sc"),C=Object.freeze({taxCalculatorForm:N,fullPage:`${N}--full-page`,wrapper:`${N}__wrapper`,title:`${N}__title`,subtitle:`${N}__subtitle`,fields:`${N}__fields`,bonusToggle:`${N}__bonus-toggle`,addBonusButton:`${N}__add-bonus-button`,iconPlus:`${N}__icon-plus`,tooltip:`${N}__tooltip`}),k=({salary:e,bonuses:t,setBonuses:n,isFullPage:i})=>{let[o,u]=(0,s.useState)(!1),d=t.map(e=>e.month),p=()=>{var e;let n=t.map(e=>g[e.month].num).sort((e,t)=>e-t),a=Object.keys(g).map(e=>({monthName:e,monthIndex:g[e].num})).sort((e,t)=>e.monthIndex-t.monthIndex),r=n[n.length-1],s=a.find(({monthIndex:e})=>e>r&&!n.includes(e));return s?s.monthName:(null==(e=a.find(({monthIndex:e})=>!n.includes(e)))?void 0:e.monthName)??null},h=e=>{n(t=>{let n=t.filter((t,n)=>n!==e);return n.length||u(!1),n})},m=(e,t)=>{n(n=>n.map((n,a)=>a===e?t:n))};return(0,a.jsx)("div",{className:(0,r.Z)(C.taxCalculatorForm,i&&C.fullPage),children:(0,a.jsxs)("div",{className:C.wrapper,children:[(0,a.jsx)(i?"h1":"p",{className:C.title,children:"Калькулятор НДФЛ"}),(0,a.jsx)("p",{className:C.subtitle,children:"Сервис поможет рассчитать новый размер НДФЛ по прогрессивной шкале"}),(0,a.jsxs)("div",{className:C.fields,children:[(0,a.jsx)(l.MA,{size:"m",label:"Оклад до налогов",value:e.isFocused?e.value:e.formattedValue,icon:(0,a.jsx)(l.u,{text:"Указывается сумма заработной платы до удержания налогов",position:"top",children:(0,a.jsx)(v,{className:C.tooltip})}),...e.events}),(0,a.jsx)(l.ZD,{label:"Получаю премию",value:o,onChange:()=>{if(u(e=>!e),o)n([]);else{let e=p();e&&n([{value:"100000",month:e}])}},className:C.bonusToggle,flipped:!0}),o&&(0,a.jsxs)("div",{children:[t.map((e,t)=>(0,a.jsx)($,{bonus:e,index:t,selectedMonths:d,onRemove:h,onUpdate:m},e.month)),(0,a.jsx)(l.zx,{onClick:()=>{let e=p();e&&n(t=>[...t,{value:"100000",month:e}])},disabled:null===p(),className:C.addBonusButton,label:"Добавить еще премию",iconLeft:(0,a.jsx)(c.IconFdsPlusO,{}),appearance:"ghost",variant:"purple",size:"xs"})]})]})]})})},L=e=>{let t=Object.entries(g).find(([t,n])=>n.num===e);return t?t[0]:""},R=(e,t)=>{let n=0,a=0,r=t,s=`${100*t}%`;for(let i of b){if(e<=n)break;let l=Math.min(e-n,i.limit-n);a+=l*i.rate,n=i.limit,(r=i.rate)>t&&(s=`${100*t}%—${100*r}%`)}return{tax:a,currentRate:r,rateString:s}},P=e=>{let t=[],n=null,a=null;for(let r of e){let e=r.bonusAmount>0;n&&n.taxRate===r.taxRate&&a===e?n.endMonth=r.endMonth:(n&&t.push(n),n={...r},a=e)}return n&&t.push(n),t},z=e=>{let t=[],n=[],a=null;for(let r of e)a===r.taxRate?n.push(r):(n.length>0&&t.push(...P(n)),n=[r],a=r.taxRate);return n.length>0&&t.push(...P(n)),t},O=(e,t)=>{let n=0,a=0,r=b[0].rate,s={};t.forEach(({month:e,value:t})=>{s[g[e].num]=Math.round(Number(t))});let i=[];for(let t=g.Январь.num;t<=g.Декабрь.num;t++){let l=s[t]||0,o=e+l;n+=o;let{tax:c,currentRate:u,rateString:d}=R(n,r),p=Math.round(c-a);a=c;let h=Math.round(e/o*p),m=p-h;l>0&&(m=p-(h=Math.min(h,Math.round(e*r))));let f=e-h,v=l-m;i.push({startMonth:L(t),endMonth:L(t),income:f,taxRate:d,tax:p,bonusAmount:v}),r=u}let l=z(i),o=Math.round(n*y),c=Math.round(a-o);return{taxFixed:o,taxProgressive:Math.round(a),taxDiff:c,monthlyTaxGroups:l}},F=e=>new Intl.NumberFormat("ru-RU").format(e),T=({size:e=24})=>(0,a.jsx)("span",{style:{fontFamily:"var(--font-family-primary)",fontSize:`${e}px`},children:"₽"}),A=(0,o.g)("tax-calculator-result-head","sc"),M=Object.freeze({taxCalculatorResultHead:A,title:`${A}__title`,titleTaxAmount:`${A}__title--tax-amount`,subtitle:`${A}__subtitle`}),I=({data:e})=>{let{taxFixed:t,taxProgressive:n,taxDiff:r}=e,s=new Date().getFullYear(),i="Сумма НДФЛ не изменится",l=F(t),o=(0,a.jsxs)(a.Fragment,{children:["Ставка НДФЛ в ",s," году останется прежней — 13%"]});return 0!==r&&(i="Доход станет меньше",l=`на ${F(r)}`,o=(0,a.jsxs)(a.Fragment,{children:["В ",s," году на уплату НДФЛ уйдет ",F(n)," ",(0,a.jsx)(T,{size:18}),", а в 2024 году — ",F(t)," ",(0,a.jsx)(T,{size:18})," при той же зарплате."]})),(0,a.jsxs)("div",{className:M.taxCalculatorResultHead,children:[(0,a.jsxs)("p",{className:M.title,children:[i,(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:M.titleTaxAmount,children:l})," ",(0,a.jsx)(T,{size:24}),0!==r&&"/год"]}),(0,a.jsx)("p",{className:M.subtitle,children:o})]})},B=(0,o.g)("tax-calculator-result","sc"),E=Object.freeze({taxCalculatorResult:B,taxCalculatorResultFullPage:`${B}--full-page`,title:`${B}__title`,titleTaxAmount:`${B}__title--tax-amount`,subtitle:`${B}__subtitle`,tableWrapper:`${B}__table-wrapper`,tableTitle:`${B}__table-title`,tableBody:`${B}__table-body`,tableBlock:`${B}__table-block`,tableRow:`${B}__table-row`,tableRowDottedLine:`${B}__table-row--dotted-line`,tableRowRowValue:`${B}__table-row--row-value`,tableRowFinalValue:`${B}__table-row--final-value`,tableRowRed:`${B}__table-row--red`,ndflRow:`${B}__ndfl-row`,tooltipIcon:`${B}__tooltip-icon`}),W=({taxData:e,isFullPage:t})=>{let{taxDiff:n,monthlyTaxGroups:s,taxProgressive:i}=e;return(0,a.jsxs)("div",{className:(0,r.W)(E.taxCalculatorResult,{[E.taxCalculatorResultFullPage]:t}),children:[(0,a.jsx)(I,{data:e}),(0,a.jsx)("div",{children:0!==n&&(0,a.jsxs)("div",{className:E.tableWrapper,children:[(0,a.jsxs)("p",{className:E.tableTitle,children:["Получите доход в ",new Date().getFullYear()," году "]}),(0,a.jsxs)("div",{className:E.tableBody,children:[s.map(e=>{let t=g[e.startMonth],n=e.endMonth.toLowerCase(),s=e.startMonth===e.endMonth?`В ${t.prepositional}`:`С ${t.genitive} по ${n}`;return(0,a.jsxs)("div",{className:E.tableBlock,children:[(0,a.jsxs)("div",{className:E.tableRow,children:[(0,a.jsx)("p",{children:s}),(0,a.jsx)("div",{className:E.tableRowDottedLine}),(0,a.jsxs)("p",{className:(0,r.W)(E.tableRowRowValue,{[E.tableRowRed]:"13%"!==e.taxRate}),children:[F(e.income)," ",(0,a.jsx)(T,{size:18})]})]}),e.bonusAmount>0&&(0,a.jsxs)("div",{className:E.tableRow,children:[(0,a.jsx)("p",{children:"Премия"}),(0,a.jsx)("div",{className:E.tableRowDottedLine}),(0,a.jsxs)("div",{className:E.tableRowRowValue,children:[F(e.bonusAmount)," ",(0,a.jsx)(T,{size:18})]})]}),(0,a.jsxs)("div",{className:E.tableRow,children:[(0,a.jsxs)("div",{className:E.ndflRow,children:["НДФЛ ",e.taxRate,e.taxRate.includes("—")&&(0,a.jsx)(l.u,{text:"Повышенная ставка применяется не ко всему доходу, а только к превышению над пороговым значением",position:"top",children:(0,a.jsx)("span",{className:E.tooltipIcon,children:(0,a.jsx)(v,{})})})]}),(0,a.jsx)("div",{className:E.tableRowDottedLine}),(0,a.jsxs)("p",{className:E.tableRowRowValue,children:[F(e.tax)," ",(0,a.jsx)(T,{size:18})]})]})]},n)}),(0,a.jsxs)("div",{className:E.tableRow,children:[(0,a.jsx)("p",{className:E.tableRowRowValue,children:"Итого НДФЛ"}),(0,a.jsx)("div",{className:E.tableRowDottedLine}),(0,a.jsxs)("p",{className:(0,r.W)(E.tableRowRowValue,E.tableRowFinalValue),children:[F(i)," ",(0,a.jsx)(T,{size:18})]})]})]})]})})]})},S=({className:e,isFullPage:t,bannerButtonUrl:n,assets:i})=>{let l=p({defaultValue:()=>"100000",type:"int",maxLength:20,unit:"₽",format:"currency"}),[o,c]=(0,s.useState)([]),u=O(Number(l.value),o);return(0,a.jsx)("div",{className:(0,r.Z)(_.taxCalculator,t?_.fullPage:_.widget,e),children:(0,a.jsxs)("div",{className:_.wrapper,children:[(0,a.jsxs)("div",{className:_.row,children:[(0,a.jsx)(k,{salary:l,bonuses:o,setBonuses:c,isFullPage:t}),(0,a.jsx)(W,{taxData:u,isFullPage:t})]}),(0,a.jsx)(f,{buttonUrl:n,isFullPage:t,assets:i})]})})}}}]);