(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[879],{3227:()=>{},5085:()=>{},14051:(e,t,s)=>{e.exports=s(34701)()},22855:(e,t,s)=>{"use strict";s.d(t,{C:()=>m});var i=s(95155),a=s(12115),r=s(55727),n=s(29722),l=s(7596);let u={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},o={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},h=e=>a.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},a.createElement("path",{d:"M9 8a.75.75 0 000 1.5h4.44l-5.22 5.22a.75.75 0 101.06 1.06l5.22-5.22v4.445a.75.75 0 101.5 0V8.75a.75.75 0 00-.75-.75H9z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function p({className:e,style:t,boxSize:s,size:i,onClick:r}){return a.createElement("span",{className:e,style:{...u,...r&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...r?{role:"button",tabIndex:"0",onClick:r}:{}},a.createElement(h,{viewBox:"0 0 24 24",style:o}))}p.displayName="IconFdsArrowUpRightSmallO";let d=(0,l.g)("check-all","sc"),c=Object.freeze({wrapper:`${d}__wrapper`,link:`${d}__link`,icon:`${d}__icon`,iconGray:`${d}__icon--gray`}),m=({children:e,className:t,linkClassName:s,iconGrayBackground:a,Link:l,event:u,href:o,dataLayerPush:h})=>{let d=l??r.N;return(0,i.jsx)("div",{className:(0,n.A)(c.wrapper,t),onClick:()=>{u&&h(u)},children:(0,i.jsxs)(d,{className:(0,n.A)(c.link,s),href:o,children:[e,(0,i.jsx)("span",{className:(0,n.A)(c.icon,{[c.iconGray]:a}),children:(0,i.jsx)(p,{size:24})})]})})}},24278:(e,t,s)=>{"use strict";s.d(t,{E:()=>u});var i=s(95155),a=s(29722),r=s(83640);s(3227);let n=(0,r.g)("skeleton"),l=Object.freeze({skeleton:n,states:{inline:`${n}--inline`,rounded:`${n}--rounded`,inverted:`${n}--inverted`,suspend:`${n}--suspend`}});function u({as:e,className:t="",width:s,height:r,inline:n=!1,rounded:o=!1,inverted:h=!1,suspend:p=!1,children:d,style:c,...m}){let g={...s&&{width:`${s}px`},...r&&{height:`${r}px`},...c};return(0,i.jsx)(e||"div",{className:(0,a.A)(l.skeleton,t,{[l.states.inline]:n,[l.states.rounded]:o,[l.states.inverted]:h,[l.states.suspend]:p}),style:g,"aria-hidden":"true",...m,children:d})}u.displayName="Skeleton"},24769:()=>{},24964:(e,t,s)=>{"use strict";s.d(t,{v:()=>o});var i=s(95155),a=s(12115),r=s(29722),n=s(83640);s(28994);let l=(0,n.g)("tag"),u=Object.freeze({tag:l,label:`${l}__label`,icon:`${l}__icon`,rounded:`${l}--rounded`,variant:{primary:`${l}--primary`,secondary:`${l}--secondary`,outline:`${l}--outline`,tertiary:`${l}--tertiary`,pink:`${l}--pink`,red:`${l}--red`,green:`${l}--green`,blue:`${l}--blue`,orange:`${l}--orange`,purple:`${l}--purple`,violet:`${l}--violet`,blur:`${l}--blur`},size:{s:`${l}--s`,m:`${l}--m`,l:`${l}--l`},iconMargin:{left:`${l}__icon--left`,right:`${l}__icon--right`}}),o=(0,a.forwardRef)(({label:e,size:t="m",rounded:s,variant:a="primary",iconLeft:n,iconRight:l,onIconLeftClick:o,onIconRightClick:h,className:p,style:d,dataQa:c,dataId:m,...g},f)=>(0,i.jsx)(i.Fragment,{children:e&&(0,i.jsxs)("div",{ref:f,className:(0,r.A)(u.tag,u.variant[a],u.size[t],{[u.rounded]:s},p),style:d,...g,"data-id":m,"data-qa":c,children:[n&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(u.icon,u.iconMargin.left,{[u.size.l]:"l"===t}),onClick:e=>null==o?void 0:o(e),disabled:!o,children:n}),(0,i.jsx)("span",{className:(0,r.A)(u.label,u.size[t]),children:e}),l&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(u.icon,u.iconMargin.right,{[u.size.l]:"l"===t}),onClick:e=>null==h?void 0:h(e),disabled:!h,children:l})]})}));o.displayName="Tag"},25007:()=>{},26111:(e,t,s)=>{"use strict";s.d(t,{E:()=>w}),s(89190);var i=s(95155),a=s(66216),r=s(63959),n=s(29722),l=s(12115),u=s(24691),o=s(14347),h=s(35959),p=s(7596);let d={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},c={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},m=e=>l.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},l.createElement("path",{d:"M9 8a.75.75 0 000 1.5h4.44l-5.22 5.22a.75.75 0 101.06 1.06l5.22-5.22v4.445a.75.75 0 101.5 0V8.75a.75.75 0 00-.75-.75H9z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function g({className:e,style:t,boxSize:s,size:i,onClick:a}){return l.createElement("span",{className:e,style:{...d,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},l.createElement(m,{viewBox:"0 0 24 24",style:c}))}g.displayName="IconFdsArrowUpRightSmallO";let f=(0,p.g)("support","sc"),k=Object.freeze({support:f,title:`${f}__title`,cardsContainer:`${f}__cards-container`}),_="cb-support",v=(0,p.g)("support-app-card","sc"),x=Object.freeze({supportAppCard:v,textWrapper:`${v}__text-wrapper`,imageContainer:`${v}__image-container`,title:`${v}__title`,description:`${v}__description`,button:`${v}__button`,imageWrapper:`${v}__image-wrapper`,image:`${v}__image`}),C=({title:e,linkUrl:t,s3Assets:s,description:a})=>{let r=(0,o.nu)("s");return(0,i.jsxs)("div",{className:x.supportAppCard,onClick:()=>{r&&((0,h.h)({eventCategory:_,eventActionType:h.D.banner,eventActionText:e,eventLabel:t}),window.open(t,"_blank","noreferrer"))},children:[(0,i.jsx)(u.$,{className:x.button,iconLeft:(0,i.jsx)(g,{size:24}),shape:"circle-icon",size:"xs"}),(0,i.jsxs)("div",{className:x.textWrapper,children:[(0,i.jsx)("div",{className:x.title,children:e}),!!a&&(0,i.jsx)("div",{className:x.description,children:a})]}),(0,i.jsx)("div",{className:x.imageContainer,children:(0,i.jsxs)("picture",{className:x.imageWrapper,children:[(0,i.jsx)("source",{media:"(max-width: 767px)",srcSet:`${s}/mp-assets/widgets/SupportBlock/mobile-app.png 1x, ${s}/mp-assets/widgets/SupportBlock/mobile-app@2x.png 2x`}),(0,i.jsx)("img",{className:x.image,loading:"lazy",src:`${s}/mp-assets/widgets/SupportBlock/qr-code-mobile-app.jpg`,srcSet:`${s}/mp-assets/widgets/SupportBlock/qr-code-mobile-app.jpg 1x, ${s}/mp-assets/widgets/SupportBlock/qr-code-mobile-app@2x.jpg 2x`})]})})]})},b=(0,p.g)("support-phone-card","sc"),y=Object.freeze({supportPhoneCard:b,contacts:`${b}__contacts`,contactsExtra:`${b}__contacts-extra`,phone:`${b}__phone`,phonesExtra:`${b}__phones-extra`,phoneExtra:`${b}__phone-extra`,chat:`${b}__chat`,text:`${b}__text`,image:`${b}__image`}),A=({phones:e,phonesExtra:t,description:s,s3Assets:a})=>{let r=(0,l.useCallback)(()=>{var e,t,s;null==(s=null==(t=null==(e=null==window?void 0:window.supportWidget)?void 0:e.craftTalk)?void 0:t.open)||s.call(t),(0,h.h)({eventCategory:_,eventActionType:h.D.button,eventActionText:"messenger",eventLabel:"chat"})},[]),n=e=>{let t=e.replace(/[\s-]/g,"");(0,h.h)({eventCategory:_,eventActionType:h.D.link,eventActionText:"phone",eventLabel:t})};return(0,i.jsxs)("div",{className:y.supportPhoneCard,children:[(0,i.jsxs)("div",{className:y.contacts,children:[e.map(e=>(0,i.jsx)("a",{className:y.phone,href:e.href,onClick:()=>n(e.label),children:e.label},e.label)),(0,i.jsx)("span",{className:y.chat,onClick:r,children:"Онлайн чат"})]}),(null==t?void 0:t.length)>0&&(0,i.jsxs)("div",{className:y.contactsExtra,children:[(0,i.jsx)("p",{className:y.text,children:"Дополнительные телефоны"}),(0,i.jsx)("div",{className:y.phonesExtra,children:t.map(e=>(0,i.jsx)("a",{className:y.phoneExtra,href:e.href,onClick:()=>n(e.label),children:e.label},e.label))})]}),(0,i.jsx)("p",{className:y.text,children:s}),(0,i.jsx)("img",{className:y.image,src:`${a}/mp-assets/widgets/SupportBlock/bannerSupportGirl.png`,loading:"lazy"})]})},E=({className:e,phoneCard:t,appCard:s,s3Assets:l})=>t&&s?(0,i.jsx)("section",{className:(0,n.A)(k.support,e),children:(0,i.jsxs)(a.m,{children:[(0,i.jsx)(r.D,{as:"h2",type:"display",weight:"bold",className:k.title,children:"Поддержка"}),(0,i.jsxs)("div",{className:k.cardsContainer,children:[(0,i.jsx)(A,{s3Assets:l,...t}),(0,i.jsx)(C,{s3Assets:l,...s})]})]})}):null;E.displayName="Support";let w=E},28994:()=>{},34701:(e,t,s)=>{"use strict";var i=s(82114);function a(){}function r(){}r.resetWarningCache=a,e.exports=function(){function e(e,t,s,a,r,n){if(n!==i){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var s={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:a};return s.PropTypes=s,s}},56082:(e,t,s)=>{"use strict";s.d(t,{H:()=>h});var i=s(95155),a=s(29722),r=s(86253),n=s(83640);s(95124);let l={display:"h1",hero:"h1",h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6"},u=(0,n.g)("heading"),o=Object.freeze({heading:u,states:Object.freeze({display:`${u}--display`,hero:`${u}--hero`,h1:`${u}--h1`,h2:`${u}--h2`,h3:`${u}--h3`,h4:`${u}--h4`,h5:`${u}--h5`,h6:`${u}--h6`})}),h=({as:e,children:t,weight:s,type:n,lineClamp:u,className:h,style:p,dataQa:d,dataId:c,...m})=>{var g;let f=e||l[n]||"div",k=/^h[1-6]$/.test(f),_=(null==(g=n.match(/\d+/))?void 0:g[0])||1;return(0,i.jsx)(f,{className:(0,a.A)(o.heading,o.states[n],h),style:{...s?{fontWeight:`var(--font-weight-${s})`}:void 0,...u?{WebkitLineClamp:u,lineClamp:u,...r.l}:void 0,...p},role:k?null:"heading","aria-level":k?null:_,...m,"data-id":c,"data-qa":d,children:t})};h.displayName="Heading"},63959:(e,t,s)=>{"use strict";s.d(t,{D:()=>i.H});var i=s(56082)},69679:(e,t,s)=>{"use strict";s.d(t,{s:()=>a,t:()=>r});let i=(0,s(83640).g)("tooltip"),a=Object.freeze({tooltip:i,text:`${i}__text`,wrapper:`${i}__wrapper`,inverted:`${i}--inverted`}),r="M8 10C6 12.58 3.43 16 0 16L16 16C12.58 16 10 12.58 8 10Z"},73321:(e,t,s)=>{"use strict";var i=s(74645);s.o(i,"notFound")&&s.d(t,{notFound:function(){return i.notFound}}),s.o(i,"usePathname")&&s.d(t,{usePathname:function(){return i.usePathname}}),s.o(i,"useRouter")&&s.d(t,{useRouter:function(){return i.useRouter}}),s.o(i,"useSearchParams")&&s.d(t,{useSearchParams:function(){return i.useSearchParams}})},82114:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},85972:(e,t,s)=>{"use strict";s.d(t,{m:()=>c});var i=s(95155),a=s(12115),r=s(76701),n=s(17294),l=s(9683),u=s(29722),o=s(37370),h=s(92681),p=s(69679);s(25007);let d=({children:e,moveToBody:t})=>t?(0,i.jsx)(r.XF,{id:o.T,children:e}):(0,i.jsx)(i.Fragment,{children:e}),c=(0,a.forwardRef)(({position:e="top",text:t,zIndex:s=1,inverted:o,withoutTail:c,children:m,boundingOffset:g=12,boundaryPadding:f,moveToBody:k=!1,hideWhenOutOfBounds:_=!1,style:v,className:x,dataQa:C,dataId:b,...y},A)=>{let[E,w]=(0,a.useState)(!1),F=(0,a.useRef)(null),{refs:S,floatingStyles:B,context:V,middlewareData:D}=(0,r.we)({open:E,onOpenChange:w,placement:e,whileElementsMounted:n.ll,middleware:[(0,l.cY)({mainAxis:g}),(0,l.UU)({fallbackAxisSideDirection:"start",crossAxis:!1,...void 0!==f&&{padding:f}}),(0,l.BN)({...void 0!==f&&{padding:f}}),(0,l.UE)({element:F,padding:8}),..._?[(0,l.jD)({strategy:"escaped",padding:-24})]:[]]}),I=(0,r.Mk)(V,{delay:300}),{getReferenceProps:M,getFloatingProps:T}=(0,r.bv)([I]),P=(0,r.DL)(V,{duration:300});return(0,a.useImperativeHandle)(A,()=>({getActivatorElement:S.reference,getTooltipElement:S.floating})),(0,a.useEffect)(()=>{var e;(null==(e=D.hide)?void 0:e.escaped)&&w(!1)},[D.hide]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{"data-qa":(0,h.g)(`${C}-activator`,!!C),ref:S.setReference,...M,className:p.s.wrapper,children:m}),P.isMounted&&(0,i.jsx)(d,{moveToBody:k,children:(0,i.jsxs)("div",{role:"tooltip",ref:S.setFloating,style:{...B,...P.styles,...v,zIndex:s},className:(0,u.A)(p.s.tooltip,x,{[p.s.inverted]:o}),...T,...y,"data-qa":C,"data-id":b,children:[(0,i.jsx)("span",{className:(0,u.A)(p.s.text,{[p.s.inverted]:o}),children:t}),!c&&(0,i.jsx)(r.ie,{ref:F,context:V,width:16,d:p.t,fill:o?"var(--color-white)":"var(--color-black-500)"})]})})]})});c.displayName="Tooltip"},89190:()=>{},89584:(e,t,s)=>{"use strict";s.d(t,{s:()=>c});var i=s(95155),a=s(12115),r=s(29722),n=s(66424),l=s(86969),u=s(70179),o=s(26048),h=s(83640);s(97903);let p=(0,h.g)("radio"),d=Object.freeze({radio:p,input:`${p}__input`,marker:`${p}__marker`,wrapper:`${p}__wrapper`,label:`${p}__label`,caption:`${p}__caption`,icon:`${p}__icon`,iconButton:`${p}__icon-button`,states:{error:`${p}--error`,disabled:`${p}--disabled`,inverted:`${p}--inverted`},sizes:{xs:`${p}--xs`,s:`${p}--s`,m:`${p}--m`},variants:{primary:`${p}--primary`,secondary:`${p}--secondary`}}),c=(0,a.forwardRef)(({value:e,variant:t="primary",checked:s=!1,state:h="default",label:p,disabled:c=!1,caption:m,className:g,style:f,icon:k,withIcon:_=!1,size:v="m",inverted:x=!1,children:C,inputRef:b,onChange:y,onIconClick:A,dataQa:E,dataId:w,...F},S)=>{let B=(0,a.useId)(),V=C||p;return(0,i.jsxs)("label",{ref:S,htmlFor:B,"data-marker-label":"",className:(0,r.A)(g,d.radio,{[d.states.disabled]:c,[d.states.inverted]:x,[d.states.error]:"error"===h,[d.sizes[v]]:!0,[d.variants[t]]:!0}),style:f,"data-id":w,"data-qa":E,children:[(0,i.jsx)("input",{id:B,value:e,checked:s,className:d.input,type:"radio",disabled:c,onChange:e=>{null==y||y(e.target.value,e)},ref:b,...F}),(0,i.jsx)("span",{className:d.marker,children:(0,i.jsx)(u.C,{type:"radio",checked:s,inverted:x,state:h,disabled:c})}),V&&(0,i.jsxs)("span",{className:d.wrapper,children:[(0,i.jsx)("span",{className:d.label,children:V}),m&&(0,i.jsx)(l.C,{className:d.caption,withoutIcon:!0,children:m})]}),_&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(d.iconButton),onClick:c?void 0:A,children:(0,i.jsx)(o.P,{className:(0,r.A)(d.icon),children:k?(0,i.jsx)(i.Fragment,{children:k}):(0,i.jsx)(n.S,{})})})]})});c.displayName="Radio"},91501:(e,t,s)=>{"use strict";s.d(t,{g:()=>i});let i=()=>Date.now().toString()+Math.random().toString(36).slice(2,9)},95124:()=>{},97903:()=>{},99639:(e,t,s)=>{"use strict";let i,a;s.d(t,{g3:()=>eQ}),s(24769);var r,n,l=s(95155),u=s(12115),o=s(66216),h=s(63959),p=s(43780),d=s(29722),c=s(22855),m=s(14572),g=s(8260),f=s(7596),k=s(24691),_=s(17194),v=s(85972),x=s(24964);function C(e){return"string"==typeof e||e instanceof String}function b(e){var t;return"object"==typeof e&&null!=e&&(null==e||null==(t=e.constructor)?void 0:t.name)==="Object"}let y="NONE",A="LEFT",E="FORCE_LEFT",w="RIGHT",F="FORCE_RIGHT";function S(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function B(e,t){let s;if(t===e)return!0;let i=Array.isArray(t),a=Array.isArray(e);if(i&&a){if(t.length!=e.length)return!1;for(s=0;s<t.length;s++)if(!B(t[s],e[s]))return!1;return!0}if(i!=a)return!1;if(t&&e&&"object"==typeof t&&"object"==typeof e){let i=t instanceof Date,a=e instanceof Date;if(i&&a)return t.getTime()==e.getTime();if(i!=a)return!1;let r=t instanceof RegExp,n=e instanceof RegExp;if(r&&n)return t.toString()==e.toString();if(r!=n)return!1;let l=Object.keys(t);for(s=0;s<l.length;s++)if(!Object.prototype.hasOwnProperty.call(e,l[s]))return!1;for(s=0;s<l.length;s++)if(!B(e[l[s]],t[l[s]]))return!1;return!0}return!!t&&!!e&&"function"==typeof t&&"function"==typeof e&&t.toString()===e.toString()}class V{constructor(e){for(Object.assign(this,e);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?y:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?w:A}}function D(e,t){return new D.InputMask(e,t)}function I(e){if(null==e)throw Error("mask property should be defined");return e instanceof RegExp?D.MaskedRegExp:C(e)?D.MaskedPattern:e===Date?D.MaskedDate:e===Number?D.MaskedNumber:Array.isArray(e)||e===Array?D.MaskedDynamic:D.Masked&&e.prototype instanceof D.Masked?e:D.Masked&&e instanceof D.Masked?e.constructor:e instanceof Function?D.MaskedFunction:(console.warn("Mask not found for mask",e),D.Masked)}function M(e){if(!e)throw Error("Options in not defined");if(D.Masked){if(e.prototype instanceof D.Masked)return{mask:e};let{mask:t,...s}=e instanceof D.Masked?{mask:e}:b(e)&&e.mask instanceof D.Masked?e:{};if(t){let e=t.mask;return{...function e(t,s){return Array.isArray(s)?e(t,(e,t)=>s.includes(t)):Object.entries(t).reduce((e,t)=>{let[i,a]=t;return s(a,i)&&(e[i]=a),e},{})}(t,(e,t)=>!t.startsWith("_")),mask:t.constructor,_mask:e,...s}}}return b(e)?{...e}:{mask:e}}function T(e){if(D.Masked&&e instanceof D.Masked)return e;let t=M(e),s=I(t.mask);if(!s)throw Error("Masked class is not found for provided mask "+t.mask+", appropriate module needs to be imported manually before creating mask.");return t.mask===s&&delete t.mask,t._mask&&(t.mask=t._mask,delete t._mask),new s(t)}D.createMask=T;class P{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return null!=e?e:this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return null!=e?e:this.value.length}select(e,t){if(null!=e&&null!=t&&(e!==this.selectionStart||t!==this.selectionEnd))try{this._unsafeSelect(e,t)}catch{}}get isActive(){return!1}}D.MaskElement=P;class R extends P{constructor(e){super(),this.input=e,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var e,t,s;return null!=(e=null==(t=(s=this.input).getRootNode)?void 0:t.call(s))?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){return this._handlers.redo&&(90===e.keyCode&&e.shiftKey&&(e.metaKey||e.ctrlKey)||89===e.keyCode&&e.ctrlKey)?(e.preventDefault(),this._handlers.redo(e)):this._handlers.undo&&90===e.keyCode&&(e.metaKey||e.ctrlKey)?(e.preventDefault(),this._handlers.undo(e)):void(!e.isComposing&&this._handlers.selectionChange(e))}_onBeforeinput(e){return"historyUndo"===e.inputType&&this._handlers.undo?(e.preventDefault(),this._handlers.undo(e)):"historyRedo"===e.inputType&&this._handlers.redo?(e.preventDefault(),this._handlers.redo(e)):void 0}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}D.HTMLMaskElement=R;class j extends R{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,t){this.input.setSelectionRange(e,t)}get value(){return this.input.value}set value(e){this.input.value=e}}D.HTMLMaskElement=R;class $ extends R{get _unsafeSelectionStart(){let e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,i=t&&t.focusOffset;return null==i||null==s||s<i?s:i}get _unsafeSelectionEnd(){let e=this.rootElement,t=e.getSelection&&e.getSelection(),s=t&&t.anchorOffset,i=t&&t.focusOffset;return null==i||null==s||s>i?s:i}_unsafeSelect(e,t){if(!this.rootElement.createRange)return;let s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,t);let i=this.rootElement,a=i.getSelection&&i.getSelection();a&&(a.removeAllRanges(),a.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}D.HTMLContenteditableMaskElement=$;class N{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>N.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}N.MAX_LENGTH=100;class O{constructor(e,t){this.el=e instanceof P?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new $(e):new j(e),this.masked=T(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new N,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this._onChange()}maskEquals(e){var t;return null==e||(null==(t=this.masked)?void 0:t.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof D.Masked)&&this.masked.constructor===I(e))return void this.masked.updateOptions({mask:e});let t=e instanceof D.Masked?e:T({mask:e});t.unmaskedValue=this.masked.unmaskedValue,this.masked=t}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(e,t){let s=this._listeners[e];s&&s.forEach(e=>e(t))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){this.el&&this.el.isActive&&(this.el.select(e,e),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(e){let t=this.masked.unmaskedValue,s=this.masked.value,i=this.masked.rawInputValue,a=this.displayValue,r=this.unmaskedValue!==t||this.value!==s||this._rawInputValue!==i;this._unmaskedValue=t,this._value=s,this._rawInputValue=i,this.el.value!==a&&(this.el.value=a),"auto"===e?this.alignCursor():null!=e&&(this.cursorPos=e),r&&this._fireChangeEvents(),!this._historyChanging&&(r||this.history.isEmpty)&&this.history.push({unmaskedValue:t,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){let{mask:t,...s}=e,i=!this.maskEquals(t),a=this.masked.optionsIsChanged(s);i&&(this.mask=t),a&&this.masked.updateOptions(s),(i||a)&&this.updateControl()}updateCursor(e){null!=e&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,this._cursorChanging=setTimeout(()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())},10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,A))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,t){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t),this}off(e,t){if(!this._listeners[e])return this;if(!t)return delete this._listeners[e],this;let s=this._listeners[e].indexOf(t);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();let t=new V({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,i=this.masked.splice(t.startChangePos,t.removed.length,t.inserted,t.removeDirection,{input:!0,raw:!0}).offset,a=s===this.masked.rawInputValue?t.removeDirection:y,r=this.masked.nearestInputPos(t.startChangePos+i,a);a!==y&&(r=this.masked.nearestInputPos(r,y)),this.updateControl(r),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}D.InputMask=O;class L{static normalize(e){return Array.isArray(e)?e:[e,new L]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}D.ChangeDetails=L;class z{constructor(e,t,s){void 0===e&&(e=""),void 0===t&&(t=0),this.value=e,this.from=t,this.stop=s}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||null!=e&&this.from>=e)return"";let t=this.value[0];return this.value=this.value.slice(1),t}shift(){if(!this.value.length)return"";let e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class U{constructor(e){this._value="",this._update({...U.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,t){void 0===t&&(t={input:!0}),this.reset(),this.append(e,t,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,t){return e}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),Math.min(this.displayValue.length,t-e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this.displayValue.slice(e,t)}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new z(this.extractInput(e,t),e)}appendTail(e){return C(e)&&(e=new z(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new L({inserted:e,rawInserted:e})):new L}_appendChar(e,t,s){let i;void 0===t&&(t={});let a=this.state;if([e,i]=this.doPrepareChar(e,t),e&&!(i=i.aggregate(this._appendCharRaw(e,t))).rawInserted&&"pad"===this.autofix){let s=this.state;this.state=a;let r=this.pad(t),n=this._appendCharRaw(e,t);r=r.aggregate(n),n.rawInserted||r.equals(i)?i=r:this.state=s}if(i.inserted){let e,r=!1!==this.doValidate(t);if(r&&null!=s){let t=this.state;if(!0===this.overwrite){e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.unshift(this.displayValue.length-i.tailShift)}let a=this.appendTail(s);if(!((r=a.rawInserted.length===s.toString().length)&&a.inserted)&&"shift"===this.overwrite){this.state=t,e=s.state;for(let e=0;e<i.rawInserted.length;++e)s.shift();r=(a=this.appendTail(s)).rawInserted.length===s.toString().length}r&&a.inserted&&(this.state=t)}!r&&(i=new L,this.state=a,s&&e&&(s.state=e))}return i}_appendPlaceholder(){return new L}_appendEager(){return new L}append(e,t,s){let i;if(!C(e))throw Error("value should be string");let a=C(s)?new z(String(s)):s;null!=t&&t.tail&&(t._beforeTailState=this.state),[e,i]=this.doPrepare(e,t);for(let s=0;s<e.length;++s){let r=this._appendChar(e[s],t,a);if(!r.rawInserted&&!this.doSkipInvalid(e[s],t,a))break;i.aggregate(r)}return(!0===this.eager||"append"===this.eager)&&null!=t&&t.input&&e&&i.aggregate(this._appendEager()),null!=a&&(i.tailShift+=this.appendTail(a).tailShift),i}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(t),new L}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;let t=this.rawInputValue,s=this.value,i=e();return this.rawInputValue=t,this.value&&this.value!==s&&0===s.indexOf(this.value)&&(this.append(s.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,i}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;let t=this.state,s=e(this);return this.state=t,delete this._isolated,s}doSkipInvalid(e,t,s){return!!this.skipInvalid}doPrepare(e,t){return void 0===t&&(t={}),L.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return void 0===t&&(t={}),L.normalize(this.prepareChar?this.prepareChar(e,this,t):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,t,s,i,a){let r;void 0===s&&(s=""),void 0===i&&(i=y),void 0===a&&(a={input:!0});let n=e+t,l=this.extractTail(n),u=!0===this.eager||"remove"===this.eager;u&&(i=function(e){switch(e){case A:return E;case w:return F;default:return e}}(i),r=this.extractInput(0,n,{raw:!0}));let o=e,h=new L;if(i!==y&&(h.tailShift=(o=this.nearestInputPos(e,t>1&&0!==e&&!u?y:i))-e),h.aggregate(this.remove(o)),u&&i!==y&&r===this.rawInputValue)if(i===E){let e;for(;r===this.rawInputValue&&(e=this.displayValue.length);)h.aggregate(new L({tailShift:-1})).aggregate(this.remove(e-1))}else i===F&&l.unshift();return h.aggregate(this.append(s,a,l))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!B(this,e)}typedValueEquals(e){let t=this.typedValue;return e===t||U.EMPTY_VALUES.includes(e)&&U.EMPTY_VALUES.includes(t)||!!this.format&&this.format(e,this)===this.format(this.typedValue,this)}pad(e){return new L}}U.DEFAULTS={skipInvalid:!0},U.EMPTY_VALUES=[void 0,null,""],D.Masked=U;class q{constructor(e,t){void 0===e&&(e=[]),void 0===t&&(t=0),this.chunks=e,this.from=t}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=C(e)?new z(String(e)):e;let t=this.chunks[this.chunks.length-1],s=t&&(t.stop===e.stop||null==e.stop)&&e.from===t.from+t.toString().length;if(e instanceof z)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof q){if(null==e.stop){let t;for(;e.chunks.length&&null==e.chunks[0].stop;)t=e.chunks.shift(),t.from+=e.from,this.extend(t)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof D.MaskedPattern))return new z(this.toString()).appendTo(e);let t=new L;for(let s=0;s<this.chunks.length;++s){let i,a=this.chunks[s],r=e._mapPosToBlock(e.displayValue.length),n=a.stop;if(null!=n&&(!r||r.index<=n)&&((a instanceof q||e._stops.indexOf(n)>=0)&&t.aggregate(e._appendPlaceholder(n)),i=a instanceof q&&e._blocks[n]),i){let s=i.appendTail(a);t.aggregate(s);let r=a.toString().slice(s.rawInserted.length);r&&t.aggregate(e.append(r,{tail:!0}))}else t.aggregate(e.append(a.toString(),{tail:!0}))}return t}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){let{chunks:t,...s}=e;Object.assign(this,s),this.chunks=t.map(e=>{let t="chunks"in e?new q:new z;return t.state=e,t})}unshift(e){if(!this.chunks.length||null!=e&&this.from>=e)return"";let t=null!=e?e-this.from:e,s=0;for(;s<this.chunks.length;){let e=this.chunks[s],i=e.unshift(t);if(e.toString()){if(!i)break;++s}else this.chunks.splice(s,1);if(i)return i}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){let t=this.chunks[e],s=t.shift();if(t.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class W{constructor(e,t){this.masked=e,this._log=[];const{offset:s,index:i}=e._mapPosToBlock(t)||(t<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=i,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){let e=this._log.pop();return e&&(this.state=e),e}bindBlock(){!this.block&&(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(t=this.block)?void 0:t.displayValue.length)||0){var t;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft(()=>{if(!this.block.isFixed&&this.block.value&&(this.offset=this.block.nearestInputPos(this.offset,E),0!==this.offset))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,A),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!this.block.isFixed&&(!this.block.isOptional||this.block.value))return this.offset=this.block.nearestInputPos(this.offset,A),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value&&(this.offset=this.block.nearestInputPos(this.offset,F),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,y),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!this.block.isFixed&&(!this.block.isOptional||this.block.value))return this.offset=this.block.nearestInputPos(this.offset,y),!0})}}class H{constructor(e){Object.assign(this,e),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(t),this._value||(this._isRawInput=!1),new L}nearestInputPos(e,t){void 0===t&&(t=y);let s=this._value.length;switch(t){case A:case E:return 0;default:return s}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),this._isRawInput?t-e:0}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this._value.length),void 0===s&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,t)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new L;let s=!0===this.eager||"append"===this.eager,i=this.char===e&&(this.isUnmasking||t.input||t.raw)&&(!t.raw||!s)&&!t.tail,a=new L({inserted:this.char,rawInserted:i?this.char:""});return this._value=this.char,this._isRawInput=i&&(t.raw||t.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){let e=new L;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new z("")}appendTail(e){return C(e)&&(e=new z(String(e))),e.appendTo(this)}append(e,t,s){let i=this._appendChar(e[0],t);return null!=s&&(i.tailShift+=this.appendTail(s).tailShift),i}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class K{constructor(e){const{parent:t,isOptional:s,placeholderChar:i,displayChar:a,lazy:r,eager:n,...l}=e;this.masked=T(l),Object.assign(this,{parent:t,isOptional:s,placeholderChar:i,displayChar:a,lazy:r,eager:n})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.value.length),0===e&&t>=1)?(this.isFilled=!1,this.masked.remove(e,t)):new L}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return!!this.masked.value||this.isOptional}_appendChar(e,t){if(void 0===t&&(t={}),this.isFilled)return new L;let s=this.masked.state,i=this.masked._appendChar(e,this.currentMaskFlags(t));return i.inserted&&!1===this.doValidate(t)&&(i=new L,this.masked.state=s),i.inserted||this.isOptional||this.lazy||t.input||(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=!!i.inserted,i}append(e,t,s){return this.masked.append(e,this.currentMaskFlags(t),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new L:(this.isFilled=!0,new L({inserted:this.placeholderChar}))}_appendEager(){return new L}extractTail(e,t){return this.masked.extractTail(e,t)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.masked.extractInput(e,t,s)}nearestInputPos(e,t){void 0===t&&(t=y);let s=this.value.length,i=Math.min(Math.max(e,0),s);switch(t){case A:case E:return this.isComplete?i:0;case w:case F:return this.isComplete?i:s;default:return i}}totalInputPositions(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.value.length),this.value.slice(e,t).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var t;return{...e,_beforeTailState:(null==e||null==(t=e._beforeTailState)?void 0:t.masked)||(null==e?void 0:e._beforeTailState)}}pad(e){return new L}}K.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};class Y extends U{updateOptions(e){super.updateOptions(e)}_update(e){let t=e.mask;t&&(e.validate=e=>e.search(t)>=0),super._update(e)}}D.MaskedRegExp=Y;class G extends U{constructor(e){super({...G.DEFAULTS,...e,definitions:Object.assign({},K.DEFAULT_DEFINITIONS,null==e?void 0:e.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){let e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};let t=this.mask;if(!t||!e)return;let s=!1,i=!1;for(let a=0;a<t.length;++a){if(this.blocks){let e=t.slice(a),s=Object.keys(this.blocks).filter(t=>0===e.indexOf(t));s.sort((e,t)=>t.length-e.length);let i=s[0];if(i){let{expose:e,repeat:t,...s}=M(this.blocks[i]),r={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...s,repeat:t,parent:this},n=null!=t?new D.RepeatBlock(r):T(r);n&&(this._blocks.push(n),e&&(this.exposeBlock=n),this._maskedBlocks[i]||(this._maskedBlocks[i]=[]),this._maskedBlocks[i].push(this._blocks.length-1)),a+=i.length-1;continue}}let r=t[a],n=r in e;if(r===G.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===r||"}"===r){s=!s;continue}if("["===r||"]"===r){i=!i;continue}if(r===G.ESCAPE_CHAR){if(!(r=t[++a]))break;n=!1}let l=n?new K({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...M(e[r]),parent:this}):new H({char:r,eager:this.eager,isUnmasking:s});this._blocks.push(l)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e)return void this.reset();let{_blocks:t,...s}=e;this._blocks.forEach((e,s)=>e.state=t[s]),super.state=s}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,t)=>e+=t.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(t),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,t)=>e+=t.value,"")}set value(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(t),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){let t=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(t),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,t)=>e+=t.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;let t=new L,s=null==(e=this._mapPosToBlock(this.displayValue.length))?void 0:e.index;if(null==s)return t;this._blocks[s].isFilled&&++s;for(let e=s;e<this._blocks.length;++e){let s=this._blocks[e]._appendEager();if(!s.inserted)break;t.aggregate(s)}return t}_appendCharRaw(e,t){void 0===t&&(t={});let s=this._mapPosToBlock(this.displayValue.length),i=new L;if(!s)return i;for(let r=s.index,n;n=this._blocks[r];++r){var a;let s=n._appendChar(e,{...t,_beforeTailState:null==(a=t._beforeTailState)||null==(a=a._blocks)?void 0:a[r]});if(i.aggregate(s),s.consumed)break}return i}extractTail(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=new q;return e===t||this._forEachBlocksInRange(e,t,(e,t,i,a)=>{let r=e.extractTail(i,a);r.stop=this._findStopBefore(t),r.from=this._blockStartPos(t),r instanceof q&&(r.blockIndex=t),s.extend(r)}),s}extractInput(e,t,s){if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),void 0===s&&(s={}),e===t)return"";let i="";return this._forEachBlocksInRange(e,t,(e,t,a,r)=>{i+=e.extractInput(a,r,s)}),i}_findStopBefore(e){let t;for(let s=0;s<this._stops.length;++s){let i=this._stops[s];if(i<=e)t=i;else break}return t}_appendPlaceholder(e){let t=new L;if(this.lazy&&null==e)return t;let s=this._mapPosToBlock(this.displayValue.length);if(!s)return t;let i=s.index,a=null!=e?e:this._blocks.length;return this._blocks.slice(i,a).forEach(s=>{if(!s.lazy||null!=e){var i;t.aggregate(s._appendPlaceholder(null==(i=s._blocks)?void 0:i.length))}}),t}_mapPosToBlock(e){let t="";for(let s=0;s<this._blocks.length;++s){let i=this._blocks[s],a=t.length;if(e<=(t+=i.displayValue).length)return{index:s,offset:e-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((e,t)=>e+=t.displayValue.length,0)}_forEachBlocksInRange(e,t,s){void 0===t&&(t=this.displayValue.length);let i=this._mapPosToBlock(e);if(i){let e=this._mapPosToBlock(t),a=e&&i.index===e.index,r=i.offset,n=e&&a?e.offset:this._blocks[i.index].displayValue.length;if(s(this._blocks[i.index],i.index,r,n),e&&!a){for(let t=i.index+1;t<e.index;++t)s(this._blocks[t],t,0,this._blocks[t].displayValue.length);s(this._blocks[e.index],e.index,0,e.offset)}}}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=super.remove(e,t);return this._forEachBlocksInRange(e,t,(e,t,i,a)=>{s.aggregate(e.remove(i,a))}),s}nearestInputPos(e,t){if(void 0===t&&(t=y),!this._blocks.length)return 0;let s=new W(this,e);if(t===y)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(t===A||t===E){if(t===A){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===A){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e||(s.popState(),s.ok&&s.pos<=e))return s.pos;s.popState()}return s.ok?s.pos:t===E?0:(s.popState(),s.ok||(s.popState(),s.ok))?s.pos:0}return t===w||t===F?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled())?s.pos:t===F?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok))?s.pos:this.nearestInputPos(e,A):e}totalInputPositions(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,t,(e,t,i,a)=>{s+=e.totalInputPositions(i,a)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){let t=this._maskedBlocks[e];return t?t.map(e=>this._blocks[e]):[]}pad(e){let t=new L;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}G.DEFAULTS={...U.DEFAULTS,lazy:!0,placeholderChar:"_"},G.STOP_CHAR="`",G.ESCAPE_CHAR="\\",G.InputDefinition=K,G.FixedDefinition=H,D.MaskedPattern=G;class X extends G{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){let{to:t=this.to||0,from:s=this.from||0,maxLength:i=this.maxLength||0,autofix:a=this.autofix,...r}=e;this.to=t,this.from=s,this.maxLength=Math.max(String(t).length,i),this.autofix=a;let n=String(this.from).padStart(this.maxLength,"0"),l=String(this.to).padStart(this.maxLength,"0"),u=0;for(;u<l.length&&l[u]===n[u];)++u;r.mask=l.slice(0,u).replace(/0/g,"\\0")+"0".repeat(this.maxLength-u),super._update(r)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let t="",s="",[,i,a]=e.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(t="0".repeat(i.length)+a,s="9".repeat(i.length)+a),[t=t.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9")]}doPrepareChar(e,t){let s;return void 0===t&&(t={}),[e,s]=super.doPrepareChar(e.replace(/\D/g,""),t),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,t){if(void 0===t&&(t={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,t);let s=String(this.from).padStart(this.maxLength,"0"),i=String(this.to).padStart(this.maxLength,"0"),[a,r]=this.boundaries(this.value+e);return Number(r)<this.from?super._appendCharRaw(s[this.value.length],t):Number(a)>this.to?!t.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],t).aggregate(this._appendCharRaw(e,t)):super._appendCharRaw(i[this.value.length],t):super._appendCharRaw(e,t)}doValidate(e){let t=this.value;if(-1===t.search(/[^0]/)&&t.length<=this._matchFrom)return!0;let[s,i]=this.boundaries(t);return this.from<=Number(i)&&Number(s)<=this.to&&super.doValidate(e)}pad(e){let t=new L;if(this.value.length===this.maxLength)return t;let s=this.value,i=this.maxLength-this.value.length;if(i){this.reset();for(let s=0;s<i;++s)t.aggregate(super._appendCharRaw("0",e));s.split("").forEach(e=>this._appendCharRaw(e))}return t}}D.MaskedRange=X;class Z extends G{static extractPatternOptions(e){let{mask:t,pattern:s,...i}=e;return{...i,mask:C(t)?t:s}}constructor(e){super(Z.extractPatternOptions({...Z.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){let{mask:t,pattern:s,blocks:i,...a}={...Z.DEFAULTS,...e},r=Object.assign({},Z.GET_DEFAULT_BLOCKS());e.min&&(r.Y.from=e.min.getFullYear()),e.max&&(r.Y.to=e.max.getFullYear()),e.min&&e.max&&r.Y.from===r.Y.to&&(r.m.from=e.min.getMonth()+1,r.m.to=e.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=e.min.getDate(),r.d.to=e.max.getDate())),Object.assign(r,this.blocks,i),super._update({...a,mask:C(t)?t:s,blocks:r})}doValidate(e){let t=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&null!=t&&(null==this.min||this.min<=t)&&(null==this.max||t<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(Z.extractPatternOptions(e))}}Z.GET_DEFAULT_BLOCKS=()=>({d:{mask:X,from:1,to:31,maxLength:2},m:{mask:X,from:1,to:12,maxLength:2},Y:{mask:X,from:1900,to:9999}}),Z.DEFAULTS={...G.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(e,t)=>e?[String(e.getDate()).padStart(2,"0"),String(e.getMonth()+1).padStart(2,"0"),e.getFullYear()].join("."):"",parse:(e,t)=>{let[s,i,a]=e.split(".").map(Number);return new Date(a,i-1,s)}},D.MaskedDate=Z;class Q extends U{constructor(e){super({...Q.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(e=>{let{expose:t,...s}=M(e),i=T({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...s});return t&&(this.exposeMask=i),i}):[])}_appendCharRaw(e,t){void 0===t&&(t={});let s=this._applyDispatch(e,t);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(t))),s}_applyDispatch(e,t,s){void 0===e&&(e=""),void 0===t&&(t={}),void 0===s&&(s="");let i=t.tail&&null!=t._beforeTailState?t._beforeTailState._value:this.value,a=this.rawInputValue,r=t.tail&&null!=t._beforeTailState?t._beforeTailState._rawInputValue:a,n=a.slice(r.length),l=this.currentMask,u=new L,o=null==l?void 0:l.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==l?(this.currentMask.reset(),r&&(this.currentMask.append(r,{raw:!0}),u.tailShift=this.currentMask.value.length-i.length),n&&(u.tailShift+=this.currentMask.append(n,{raw:!0,tail:!0}).tailShift)):o&&(this.currentMask.state=o)),u}_appendPlaceholder(){let e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){let e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){let t=new L;return e&&t.aggregate(this._applyDispatch("",{},e)),t.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var t,s;return{...e,_beforeTailState:(null==(t=e._beforeTailState)?void 0:t.currentMaskRef)===this.currentMask&&(null==(s=e._beforeTailState)?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,t,s){return void 0===t&&(t={}),void 0===s&&(s=""),this.dispatch(e,this,t,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,t){void 0===t&&(t={});let[s,i]=super.doPrepare(e,t);if(this.currentMask){let e;[s,e]=super.doPrepare(s,this.currentMaskFlags(t)),i=i.aggregate(e)}return[s,i]}doPrepareChar(e,t){void 0===t&&(t={});let[s,i]=super.doPrepareChar(e,t);if(this.currentMask){let e;[s,e]=super.doPrepareChar(s,this.currentMaskFlags(t)),i=i.aggregate(e)}return[s,i]}reset(){var e;null==(e=this.currentMask)||e.reset(),this.compiledMasks.forEach(e=>e.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let t=String(e);this.currentMask&&(this.currentMask.typedValue=e,t=this.currentMask.unmaskedValue),this.unmaskedValue=t}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!(null==(e=this.currentMask)?void 0:e.isComplete)}get isFilled(){var e;return!!(null==(e=this.currentMask)?void 0:e.isFilled)}remove(e,t){let s=new L;return this.currentMask&&s.aggregate(this.currentMask.remove(e,t)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(e=>e.state),currentMaskRef:this.currentMask,currentMask:null==(e=this.currentMask)?void 0:e.state}}set state(e){let{compiledMasks:t,currentMaskRef:s,currentMask:i,...a}=e;t&&this.compiledMasks.forEach((e,s)=>e.state=t[s]),null!=s&&(this.currentMask=s,this.currentMask.state=i),super.state=a}extractInput(e,t,s){return this.currentMask?this.currentMask.extractInput(e,t,s):""}extractTail(e,t){return this.currentMask?this.currentMask.extractTail(e,t):super.extractTail(e,t)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,t){return this.currentMask?this.currentMask.nearestInputPos(e,t):super.nearestInputPos(e,t)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((t,s)=>{if(!e[s])return;let{mask:i,...a}=e[s];return B(t,a)&&t.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!(null==(t=this.currentMask)?void 0:t.typedValueEquals(e))}}Q.DEFAULTS={...U.DEFAULTS,dispatch:(e,t,s,i)=>{if(!t.compiledMasks.length)return;let a=t.rawInputValue,r=t.compiledMasks.map((r,n)=>{let l=t.currentMask===r,u=l?r.displayValue.length:r.nearestInputPos(r.displayValue.length,E);return r.rawInputValue!==a?(r.reset(),r.append(a,{raw:!0})):l||r.remove(u),r.append(e,t.currentMaskFlags(s)),r.appendTail(i),{index:n,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(u,r.nearestInputPos(r.displayValue.length,E)))}});return r.sort((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions),t.compiledMasks[r[0].index]}},D.MaskedDynamic=Q;class J extends G{constructor(e){super({...J.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){let{enum:t,...s}=e;if(t){let e=t.map(e=>e.length),i=Math.min(...e),a=Math.max(...e)-i;s.mask="*".repeat(i),a&&(s.mask+="["+"*".repeat(a)+"]"),this.enum=t}super._update(s)}_appendCharRaw(e,t){void 0===t&&(t={});let s=Math.min(this.nearestInputPos(0,F),this.value.length),i=this.enum.filter(t=>this.matchValue(t,this.unmaskedValue+e,s));if(i.length){1===i.length&&this._forEachBlocksInRange(0,this.value.length,(e,s)=>{let a=i[0][s];s>=this.value.length||a===e.value||(e.reset(),e._appendChar(a,t))});let e=super._appendCharRaw(i[0][this.value.length],t);return 1===i.length&&i[0].slice(this.unmaskedValue.length).split("").forEach(t=>e.aggregate(super._appendCharRaw(t))),e}return new L({skip:!this.isComplete})}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new z("",e)}remove(e,t){let s;if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),e===t)return new L;let i=Math.min(super.nearestInputPos(0,F),this.value.length);for(s=e;s>=0&&!(this.enum.filter(e=>this.matchValue(e,this.value.slice(i,s),i)).length>1);--s);let a=super.remove(s,t);return a.tailShift+=s-e,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}J.DEFAULTS={...G.DEFAULTS,matchValue:(e,t,s)=>e.indexOf(t,s)===s},D.MaskedEnum=J;class ee extends U{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}D.MaskedFunction=ee;class et extends U{constructor(e){super({...et.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){let e="^"+(this.allowNegative?"[+|\\-]?":""),t=(this.scale?"("+S(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=RegExp(e+"\\d*"+t),this._mapToRadixRegExp=RegExp("["+this.mapToRadix.map(S).join("")+"]","g"),this._thousandsSeparatorRegExp=RegExp(S(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){let t=e.split(this.radix);return t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),t.join(this.radix)}doPrepareChar(e,t){void 0===t&&(t={});let[s,i]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(t.input&&t.raw||!t.input&&!t.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),t);return e&&!s&&(i.skip=!0),!s||this.allowPositive||this.value||"-"===s||i.aggregate(this._appendChar("-")),[s,i]}_separatorsCount(e,t){void 0===t&&(t=!1);let s=0;for(let i=0;i<e;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++s,t&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return void 0===e&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,t,s){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t),this._removeThousandsSeparators(super.extractInput(e,t,s))}_appendCharRaw(e,t){let s;void 0===t&&(t={});let i=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,a=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);let r=this._value;this._value+=e;let n=!isNaN(this.number),l=!1;if(n){let e;null!=this.min&&this.min<0&&this.number<this.min&&(e=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(e=this.max),null!=e&&(this.autofix?(this._value=this.format(e,this).replace(et.UNMASKED_RADIX,this.radix),l||(l=r===this._value&&!t.tail)):n=!1),n&&(n=!!this._value.match(this._numberRegExp))}n?s=new L({inserted:this._value.slice(r.length),rawInserted:l?"":e,skip:l}):(this._value=r,s=new L),this._value=this._insertThousandsSeparators(this._value);let u=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,o=this._separatorsCountFromSlice(u);return s.tailShift+=(o-a)*this.thousandsSeparator.length,s}_findSeparatorAround(e){if(this.thousandsSeparator){let t=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,t);if(s<=e)return s}return -1}_adjustRangeWithSeparators(e,t){let s=this._findSeparatorAround(e);s>=0&&(e=s);let i=this._findSeparatorAround(t);return i>=0&&(t=i+this.thousandsSeparator.length),[e,t]}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),[e,t]=this._adjustRangeWithSeparators(e,t);let s=this.value.slice(0,e),i=this.value.slice(t),a=this._separatorsCount(s.length);return this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+i)),new L({tailShift:(this._separatorsCountFromSlice(s)-a)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case y:case A:case E:{let s=this._findSeparatorAround(e-1);if(s>=0){let i=s+this.thousandsSeparator.length;if(e<i||this.value.length<=i||t===E)return s}break}case w:case F:{let t=this._findSeparatorAround(e);if(t>=0)return t+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){let e=this.number,t=e;null!=this.min&&(t=Math.max(t,this.min)),null!=this.max&&(t=Math.min(t,this.max)),t!==e&&(this.unmaskedValue=this.format(t,this));let s=this.value;this.normalizeZeros&&(s=this._normalizeZeros(s)),this.padFractionalZeros&&this.scale>0&&(s=this._padFractionalZeros(s)),this._value=s}super.doCommit()}_normalizeZeros(e){let t=this._removeThousandsSeparators(e).split(this.radix);return t[0]=t[0].replace(/^(\D*)(0*)(\d*)/,(e,t,s,i)=>t+i),e.length&&!/\d$/.test(t[0])&&(t[0]=t[0]+"0"),t.length>1&&(t[1]=t[1].replace(/0*$/,""),t[1].length||(t.length=1)),this._insertThousandsSeparators(t.join(this.radix))}_padFractionalZeros(e){if(!e)return e;let t=e.split(this.radix);return t.length<2&&t.push(""),t[1]=t[1].padEnd(this.scale,"0"),t.join(this.radix)}doSkipInvalid(e,t,s){void 0===t&&(t={});let i=0===this.scale&&e!==this.thousandsSeparator&&(e===this.radix||e===et.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,t,s)&&!i}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,et.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(et.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(e){return(super.typedValueEquals(e)||et.EMPTY_VALUES.includes(e)&&et.EMPTY_VALUES.includes(this.typedValue))&&(0!==e||""!==this.value)}}et.UNMASKED_RADIX=".",et.EMPTY_VALUES=[...U.EMPTY_VALUES,0],et.DEFAULTS={...U.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[et.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:e=>e.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},D.MaskedNumber=et;let es={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function ei(e,t,s){void 0===t&&(t=es.MASKED),void 0===s&&(s=es.MASKED);let i=T(e);return e=>i.runIsolated(i=>(i[t]=e,i[s]))}D.PIPE_TYPE=es,D.createPipe=ei,D.pipe=function(e,t,s,i){return ei(t,s,i)(e)};class ea extends G{get repeatFrom(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?e:0}get repeatTo(){var e;return null!=(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var t,s,i;let{repeat:a,...r}=M(e);this._blockOpts=Object.assign({},this._blockOpts,r);let n=T(this._blockOpts);this.repeat=null!=(t=null!=(s=null!=a?a:n.repeat)?s:this.repeat)?t:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(i=this._blocks)?void 0:i.length)||0,this.repeatFrom)),blocks:{m:n},eager:n.eager,overwrite:n.overwrite,skipInvalid:n.skipInvalid,lazy:n.lazy,placeholderChar:n.placeholderChar,displayChar:n.displayChar})}_allocateBlock(e){return e<this._blocks.length?this._blocks[e]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(T(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(e,t){void 0===t&&(t={});let s=new L;for(let l=null!=(i=null==(a=this._mapPosToBlock(this.displayValue.length))?void 0:a.index)?i:Math.max(this._blocks.length-1,0),u,o;u=null!=(r=this._blocks[l])?r:o=!o&&this._allocateBlock(l);++l){var i,a,r,n;let h=u._appendChar(e,{...t,_beforeTailState:null==(n=t._beforeTailState)||null==(n=n._blocks)?void 0:n[l]});if(h.skip&&o){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(h),h.consumed)break}return s}_trimEmptyTail(e,t){var s,i;let a;void 0===e&&(e=0);let r=Math.max((null==(s=this._mapPosToBlock(e))?void 0:s.index)||0,this.repeatFrom,0);null!=t&&(a=null==(i=this._mapPosToBlock(t))?void 0:i.index),null==a&&(a=this._blocks.length-1);let n=0;for(let e=a;r<=e&&!this._blocks[e].unmaskedValue;--e,++n);n&&(this._blocks.splice(a-n+1,n),this.mask=this.mask.slice(n))}reset(){super.reset(),this._trimEmptyTail()}remove(e,t){void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length);let s=super.remove(e,t);return this._trimEmptyTail(e,t),s}totalInputPositions(e,t){return(void 0===e&&(e=0),null==t&&this.repeatTo===1/0)?1/0:super.totalInputPositions(e,t)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}D.RepeatBlock=ea;try{globalThis.IMask=D}catch{}var er=s(14051);let en={mask:er.oneOfType([er.array,er.func,er.string,er.instanceOf(RegExp),er.oneOf([Date,Number,D.Masked]),er.instanceOf(D.Masked)]),value:er.any,unmask:er.oneOfType([er.bool,er.oneOf(["typed"])]),prepare:er.func,prepareChar:er.func,validate:er.func,commit:er.func,overwrite:er.oneOfType([er.bool,er.oneOf(["shift"])]),eager:er.oneOfType([er.bool,er.oneOf(["append","remove"])]),skipInvalid:er.bool,onAccept:er.func,onComplete:er.func,placeholderChar:er.string,displayChar:er.string,lazy:er.bool,definitions:er.object,blocks:er.object,enum:er.arrayOf(er.string),maxLength:er.number,from:er.number,to:er.number,pattern:er.string,format:er.func,parse:er.func,autofix:er.oneOfType([er.bool,er.oneOf(["pad"])]),radix:er.string,thousandsSeparator:er.string,mapToRadix:er.arrayOf(er.string),scale:er.number,normalizeZeros:er.bool,padFractionalZeros:er.bool,min:er.oneOfType([er.number,er.instanceOf(Date)]),max:er.oneOfType([er.number,er.instanceOf(Date)]),dispatch:er.func,inputRef:er.oneOfType([er.func,er.shape({current:er.object})])},el=Object.keys(en).filter(e=>"value"!==e),eu=["value","unmask","onAccept","onComplete","inputRef"],eo=el.filter(e=>0>eu.indexOf(e)),eh=(r=e=>{let{inputRef:t,...s}=e;return u.createElement("input",{...s,ref:t})},(n=class extends u.Component{constructor(e){super(e),this._inputRef=this._inputRef.bind(this)}componentDidMount(){this.props.mask&&this.initMask()}componentDidUpdate(){let e=this.props,t=this._extractMaskOptionsFromProps(e);if(t.mask)this.maskRef?(this.maskRef.updateOptions(t),"value"in e&&void 0!==e.value&&(this.maskValue=e.value)):this.initMask(t);else if(this.destroyMask(),"value"in e&&void 0!==e.value){var s;null!=(s=this.element)&&s.isContentEditable&&"INPUT"!==this.element.tagName&&"TEXTAREA"!==this.element.tagName?this.element.textContent=e.value:this.element.value=e.value}}componentWillUnmount(){this.destroyMask()}_inputRef(e){this.element=e,this.props.inputRef&&(Object.prototype.hasOwnProperty.call(this.props.inputRef,"current")?this.props.inputRef.current=e:this.props.inputRef(e))}initMask(e){void 0===e&&(e=this._extractMaskOptionsFromProps(this.props)),this.maskRef=D(this.element,e).on("accept",this._onAccept.bind(this)).on("complete",this._onComplete.bind(this)),"value"in this.props&&void 0!==this.props.value&&(this.maskValue=this.props.value)}destroyMask(){this.maskRef&&(this.maskRef.destroy(),delete this.maskRef)}_extractMaskOptionsFromProps(e){let{...t}=e;return Object.keys(t).filter(e=>0>eo.indexOf(e)).forEach(e=>{delete t[e]}),t}_extractNonMaskProps(e){let{...t}=e;return el.forEach(e=>{"maxLength"!==e&&delete t[e]}),"defaultValue"in t||(t.defaultValue=e.mask?"":t.value),delete t.value,t}get maskValue(){return this.maskRef?"typed"===this.props.unmask?this.maskRef.typedValue:this.props.unmask?this.maskRef.unmaskedValue:this.maskRef.value:""}set maskValue(e){this.maskRef&&(e=null==e&&"typed"!==this.props.unmask?"":e,"typed"===this.props.unmask?this.maskRef.typedValue=e:this.props.unmask?this.maskRef.unmaskedValue=e:this.maskRef.value=e)}_onAccept(e){this.props.onAccept&&this.maskRef&&this.props.onAccept(this.maskValue,this.maskRef,e)}_onComplete(e){this.props.onComplete&&this.maskRef&&this.props.onComplete(this.maskValue,this.maskRef,e)}render(){return u.createElement(r,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}}).displayName=void 0,n.propTypes=void 0,(i=n).displayName="IMask("+(r.displayName||r.name||"Component")+")",i.propTypes=en,u.forwardRef((e,t)=>u.createElement(i,{...e,ref:t})));u.forwardRef((e,t)=>u.createElement(eh,{...e,ref:t}));var ep=s(37637);let ed=(0,u.forwardRef)(({maskOpts:e,value:t="",autoFocus:s=!1,onChange:i,onKeyDown:a,...r},n)=>{let[o,h]=(0,u.useState)(""),{ref:p,setValue:d,unmaskedValue:c}=function(e,t){let{onAccept:s,onComplete:i,ref:a=(0,u.useRef)(null),defaultValue:r,defaultUnmaskedValue:n,defaultTypedValue:l}=void 0===t?{}:t,o=(0,u.useRef)(null),[h,p]=(0,u.useState)({}),[d,c]=(0,u.useState)(""),[m,g]=(0,u.useState)(""),[f,k]=(0,u.useState)(),_=(0,u.useCallback)(()=>{var e;null==(e=o.current)||e.destroy(),o.current=null},[]),v=(0,u.useCallback)(()=>{let e=o.current;e&&(p({value:e.value,unmaskedValue:e.unmaskedValue,typedValue:e.typedValue}),k(e.typedValue),g(e.unmaskedValue),c(e.value))},[]),x=(0,u.useCallback)(e=>{let t=o.current;t&&(v(),null==s||s(t.value,t,e))},[s]),C=(0,u.useCallback)(e=>o.current&&(null==i?void 0:i(o.current.value,o.current,e)),[i]);return(0,u.useEffect)(()=>{let{value:e,...t}=h,s=o.current;s&&void 0!==d&&(e!==d&&(s.value=d,s.value!==d&&x()),p(t))},[d]),(0,u.useEffect)(()=>{let{unmaskedValue:e,...t}=h,s=o.current;s&&void 0!==m&&(e!==m&&(s.unmaskedValue=m,s.unmaskedValue!==m&&x()),p(t))},[m]),(0,u.useEffect)(()=>{let{typedValue:e,...t}=h,s=o.current;s&&void 0!==f&&(e!==f&&(s.typedValue=f,s.masked.typedValueEquals(f)||x()),p(t))},[f]),(0,u.useEffect)(()=>{let t=a.current;if(!t||!(null!=e&&e.mask))return _();let s=o.current;s?null==s||s.updateOptions(e):t&&null!=e&&e.mask&&(o.current=D(t,e),v(),void 0!==r&&c(r),void 0!==n&&g(n),void 0!==l&&k(l))},[e,_,x]),(0,u.useEffect)(()=>{if(!o.current)return;let e=o.current;return e.on("accept",x),e.on("complete",C),()=>{e.off("accept",x),e.off("complete",C)}},[x,C]),(0,u.useEffect)(()=>_,[_]),{ref:a,maskRef:o,value:d,setValue:c,unmaskedValue:m,setUnmaskedValue:g,typedValue:f,setTypedValue:k}}(e,{onAccept:(e,t)=>{h(e),null==i||i(t.unmaskedValue,e)}});return(0,u.useEffect)(()=>{t!==c&&(d(t),h(t))},[t,d,c]),(0,u.useImperativeHandle)(n,()=>p.current),(0,l.jsx)(ep.I,{...r,autoFocus:s,inputRef:p,value:o,onKeyDown:e=>{("Escape"===e.key||"Esc"===e.key)&&(e.preventDefault(),d(""),h(""),null==i||i("","")),null==a||a(e)}})});ed.displayName="InputMasked";var ec=s(55727),em=s(66627),eg=s(17806);let ef={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},ek={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},e_=e=>u.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},u.createElement("path",{d:"M9 8a.75.75 0 000 1.5h4.44l-5.22 5.22a.75.75 0 101.06 1.06l5.22-5.22v4.445a.75.75 0 101.5 0V8.75a.75.75 0 00-.75-.75H9z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function ev({className:e,style:t,boxSize:s,size:i,onClick:a}){return u.createElement("span",{className:e,style:{...ef,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&{width:`${s}px`,height:`${s}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"},...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},u.createElement(e_,{viewBox:"0 0 24 24",style:ek}))}ev.displayName="IconFdsArrowUpRightSmallO";var ex=((a=ex||{}).light="light",a.gray="gray",a);let eC=(0,f.g)("best-offers-banner","sc"),eb=Object.freeze({bestOffersBaner:eC,wrapper:`${eC}__wrapper`,wideWrapper:`${eC}__wrapper--wide`,whiteWrapper:`${eC}__wrapper--white`,content:`${eC}__content`,header:`${eC}__header`,title:`${eC}__title`,subtitle:`${eC}__subtitle`,icon:`${eC}__icon`,iconBlack:`${eC}__icon--black`,iconWhite:`${eC}__icon--white`,image:`${eC}__image`}),ey=({title:e,image:t,url:s,description:i,backgroundColor:a,textColor:r,wide:n,theme:u,handleBannerDataLayerPush:o,className:h})=>{let c=u===ex.gray,m={"--bg-base":(null==a?void 0:a.base)??(c?"var(--color-white)":"var(--color-gray-400)"),"--bg-hover":(null==a?void 0:a.hover)??"var(--color-gray-500)"};return(0,l.jsxs)("div",{className:(0,d.A)(eb.wrapper,h,{[eb.wideWrapper]:n}),style:m,onClick:()=>{o(),window.open(s,"_blank")},children:[(0,l.jsxs)("div",{className:eb.content,children:[(0,l.jsxs)("div",{className:eb.header,children:[(0,l.jsx)(p.E,{weight:"medium",size:"24",className:eb.title,style:{color:r},children:e}),(0,l.jsx)("div",{className:(0,d.A)(eb.icon,{[eb.iconBlack]:c&&!(null!=r&&r.includes("color-white")),[eb.iconWhite]:c&&!!(null!=r&&r.includes("color-white"))}),children:(0,l.jsx)(ev,{size:32})})]}),i&&(0,l.jsx)(p.E,{size:"16",style:{color:r},children:i})]}),(null==t?void 0:t.url)&&(0,l.jsx)("picture",{className:eb.image,children:(0,l.jsx)("img",{src:t.url,width:t.width??150,height:t.height??"auto",alt:`Баннер ${e}`,loading:"lazy"})})]})},eA=(0,f.g)("offer-card","sc"),eE=Object.freeze({offerCard:eA,wrapper:`${eA}__wrapper`,whiteWrapper:`${eA}__wrapper--white`,bankInfo:`${eA}__bankInfo`,units:`${eA}__units`,unitsColumn:`${eA}__units--column`,unit:`${eA}__unit`,unitRow:`${eA}__unit--row`,unitTitleWrapper:`${eA}__unitTitleWrapper`,unitTitle:`${eA}__unitTitle`,tooltipIcon:`${eA}__tooltipIcon`,unitValue:`${eA}__unitValue`,bottomBlock:`${eA}__bottomBlock`,tags:`${eA}__tags`,tag:`${eA}__tag`,button:`${eA}__button`,buttonRounded:`${eA}__button--rounded`,buttonAdditional:`${eA}__button--additional`}),ew={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},eF={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"};function eS(e){return{width:`${e}px`,height:`${e}px`,display:"inline-flex",alignItems:"center",justifyContent:"center"}}let eB=e=>u.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},u.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10a9.971 9.971 0 007.071-2.929A9.97 9.97 0 0022 12c0-5.523-4.477-10-10-10zM3.5 12a8.5 8.5 0 1117 0 8.5 8.5 0 01-17 0zm8.872-4.977C13.657 7.18 15 8.15 15 9.761c0 .698-.179 1.238-.504 1.665-.307.401-.704.644-.98.812-.313.191-.477.293-.595.43-.083.096-.17.246-.17.584a.75.75 0 01-1.5 0c0-.66.193-1.164.531-1.558.28-.326.64-.544.89-.695l.062-.037c.287-.175.452-.29.568-.442.096-.126.198-.335.198-.759 0-.633-.532-1.158-1.309-1.252-.716-.087-1.454.236-1.717 1.2a.75.75 0 01-1.447-.394c.486-1.78 1.998-2.454 3.345-2.292zM11.999 15a1 1 0 10.002 2 1 1 0 00-.002-2z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function eV({className:e,style:t,boxSize:s,size:i,onClick:a}){return u.createElement("span",{className:e,style:{...ew,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&eS(s),...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},u.createElement(eB,{viewBox:"0 0 24 24",style:eF}))}eV.displayName="IconFdsQuestionCircleO";let eD=e=>u.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},u.createElement("path",{d:"M13.328 2.869a1.444 1.444 0 00-2.65 0A694.174 694.174 0 008.47 7.85a648.96 648.96 0 00-5.196.656c-1.266.165-1.673 1.722-.823 2.553a641.289 641.289 0 003.856 3.748A704.06 704.06 0 005.29 20.22c-.214 1.16.995 2.24 2.15 1.572a650.04 650.04 0 004.562-2.66c1.504.887 3.346 1.956 4.564 2.66 1.154.667 2.363-.411 2.15-1.572a702.887 702.887 0 00-1.017-5.412 664.068 664.068 0 003.856-3.748c.85-.832.443-2.389-.824-2.553-1.383-.18-3.479-.45-5.195-.657a696.41 696.41 0 00-2.208-4.982z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}));function eI({className:e,style:t,boxSize:s,size:i,onClick:a}){return u.createElement("span",{className:e,style:{...ew,...a&&{cursor:"pointer"},...i&&{fontSize:`${i}px`},...s&&eS(s),...t},...a?{role:"button",tabIndex:"0",onClick:a}:{}},u.createElement(eD,{viewBox:"0 0 24 24",style:eF}))}eI.displayName="IconFdsStarF";let eM=({title:e,value:t,tooltip:s,textColor:i,unitsAsColumn:a,isTitleUnit:r})=>{let n;return(0,l.jsxs)("div",{className:(0,d.A)(eE.unit,{[eE.unitRow]:a}),children:[(0,l.jsxs)("div",{className:eE.unitTitleWrapper,children:[(0,l.jsx)(p.E,{size:"14",className:eE.unitTitle,children:e}),s&&(0,l.jsx)(v.m,{text:s,children:(0,l.jsx)(eV,{className:eE.tooltipIcon})})]}),(0,l.jsx)(p.E,{weight:"medium",size:r?"18":a?"16":"24",className:eE.unitValue,style:{color:i},children:e.includes("Рейтинг")?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(eI,{size:16,style:{color:"var(--color-orange-400)"}}),t]}):(n=t.split("₽")).map((e,t)=>(0,l.jsxs)(u.Fragment,{children:[e,t<n.length-1&&(0,l.jsx)(p.E,{weight:"regular",children:"₽"})]},`${e}-${t}`))})]})},eT=({tags:e,isGrayTheme:t})=>{let s=t?"secondary":"primary";return(0,l.jsx)("div",{className:eE.tags,children:e.sort((e,t)=>e.order-t.order).map(e=>(0,l.jsx)(x.v,{className:eE.tag,label:e.label,variant:e.variant?e.variant:s,rounded:!0},e.label))})},eP=({companyName:e,name:t,url:s,logo:i,units:a,tags:r,additionalButton:n,unitsAsColumn:u,dataLayerPush:o,eventCategory:h,productType:p,theme:c,buttonClassName:m,eventValueByUnitTitle:g})=>{let f=c===ex.gray,v=s=>{let i={event:"data-event",eventCategory:h,eventAction:`click_button_${(0,_.t)(s)}_${p}`,eventLabel:(0,_.t)(`${e}_${t}`)};if(g){let e=a.find(e=>e.title.toLowerCase()===g.toLowerCase());e&&(i.eventValue=(0,_.t)(e.value))}o(i)};return(0,l.jsxs)("div",{className:(0,d.A)(eE.wrapper,{[eE.whiteWrapper]:f}),children:[(0,l.jsxs)("div",{className:eE.bankInfo,children:[i&&(0,l.jsx)("img",{src:i,width:56,height:56,alt:`${e} logo`,loading:"lazy"}),(0,l.jsx)(eM,{title:t,value:e,isTitleUnit:!0})]}),(0,l.jsx)("div",{className:(0,d.A)(eE.units,{[eE.unitsColumn]:u}),children:a.map(e=>(0,l.jsx)(eM,{title:e.title,value:e.value,tooltip:e.tooltip,textColor:e.textColor,unitsAsColumn:u},`${e.title}-${e.value}`))}),(0,l.jsxs)("div",{className:eE.bottomBlock,children:[r&&(0,l.jsx)(eT,{tags:r,isGrayTheme:f}),n&&n.text.trim().length>0&&(0,l.jsx)(k.$,{as:"a",className:(0,d.A)(eE.button,eE.buttonRounded,eE.buttonAdditional),size:"xs",label:n.text,href:null==n?void 0:n.url,variant:f?"secondary":"white",onClick:()=>v(n.text)}),(0,l.jsx)(k.$,{as:"a",className:(0,d.A)(eE.button,m),size:"xs",label:"Подробнее",href:s,onClick:()=>v("podrobnee_o_kartochke_iz")})]})]})},eR=(0,f.g)("offers-list","sc"),ej=Object.freeze({offersList:eR,wrapper:`${eR}__wrapper`,sliderWrapper:`${eR}__sliderWrapper`,offerItem:`${eR}__offerItem`,compact:`${eR}__offerItem--compact`,bannerItem:`${eR}__bannerItem`}),e$=({offers:e,banner:t,dataLayerPush:s,eventCategory:i,productType:a,theme:r,singleProduct:n})=>{let u=e.length<=2;return(0,l.jsxs)(g.A,{options:{slidesPerView:"auto",spaceBetween:0,autoplay:{delay:3e3,disableOnInteraction:!1}},breakpoints:{xl:{autoplay:!1}},className:ej.sliderWrapper,pagination:!0,children:[e.slice(0,3).map(e=>(0,l.jsx)(g.D,{className:(0,d.A)(ej.offerItem,{[ej.compact]:n}),children:(0,l.jsx)(eP,{...e,dataLayerPush:s,eventCategory:i,productType:a,theme:r})},e.id)),t&&(0,l.jsx)(g.D,{className:ej.bannerItem,children:(0,l.jsx)(ey,{...t,handleBannerDataLayerPush:()=>{s({event:"data-event",eventCategory:i,eventAction:"click_bnr_banner_top_predlozheniy",eventLabel:a})},wide:u,theme:r})})]},a)},eN=(0,f.g)("osago-tab","sc"),eO=Object.freeze({osagoTab:eN,wrapper:`${eN}__wrapper`,card:`${eN}__card`,whiteCard:`${eN}__card--white`,image:`${eN}__image`,content:`${eN}__content`,inputWrapper:`${eN}__inputWrapper`,select:`${eN}__select`,input:`${eN}__input`,buttonLinkWrapper:`${eN}__buttonLinkWrapper`,button:`${eN}__button`,banner:`${eN}__banner`}),eL={kasko:{title:"Рассчет Каско за минуту",description:"Выберите лучшие условия для оформления полиса",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}},osago:{title:"ОСАГО с экономией до 78%",description:"Предварительная цена после ввода номера ТС",backgroundColor:{base:"#f1f5ff",hover:"#a3ceec"}}},ez=[{label:"Мотоцикл",value:"moto"},{label:"Автомобиль",value:"auto"}],eU=Object.fromEntries(ez.map(e=>[e.value,e])),eq={auto:{mask:"a 000 aa 00",placeholder:"A 000 AA 00"},moto:{mask:"0000 aa 00",placeholder:"0000 AA 00"}},eW="АВЕКМНОРСТУХ",eH=RegExp(`[${eW}]`,"i"),eK=RegExp(`[^0-9${eW}]`,"gi"),eY=({type:e,baseUrl:t,s3Assets:s,banner:i,dataLayerPush:a,eventCategory:r,theme:n})=>{let o="osago"===e,c=(0,eg.oq)(t,"osago"),m=(0,eg.oq)(c,"step-car"),g=(0,eg.oq)(t,"kasko"),f=(0,eg.oq)(g,"vehicle"),v=o?m:f,[x,C]=(0,u.useState)(""),[b,y]=(0,u.useState)("auto"),{mask:A,placeholder:E}=eq[b],w=n===ex.gray,F=`?${new URLSearchParams({type:o?b:"auto",license:x})}`,S=(0,eg.oq)(v,F),B=i??{...eL[e],url:o?c:g,image:s?{url:(0,eg.oq)(s,`widgets/BestOffers/${o?"icon_osago":"icons_car"}.png`),width:204,height:160}:void 0},V=eU[b].label,D=(t,s)=>{a({event:"data-event",eventCategory:r,eventAction:t,eventLabel:s??e})};return(0,l.jsxs)("div",{className:eO.wrapper,children:[(0,l.jsxs)("div",{className:(0,d.A)(eO.card,{[eO.whiteCard]:w}),children:[s&&(0,l.jsx)("picture",{children:(0,l.jsx)("img",{src:`${s}/widgets/BestOffers/auto_bg.png`,alt:"Автомобиль",loading:"lazy",className:eO.image})}),(0,l.jsxs)("div",{className:eO.content,children:[(0,l.jsxs)(h.D,{as:"h3",type:"h3",children:["Онлайн калькулятор ",o?"ОСАГО":"Каско"]}),(0,l.jsxs)("div",{className:eO.inputWrapper,children:[o&&(0,l.jsx)(em.l,{options:ez,value:eU[b],label:"Тип транспорта",variant:w?"primary":"secondary",className:eO.select,onChange:e=>{C(""),y(e.value),D(`selector_item_${(0,_.t)(e.label)}`)}}),(0,l.jsx)(ed,{label:"Госномер",variant:w?"primary":"secondary",maskOpts:{mask:A,definitions:{a:eH}},maskPlaceholder:E,value:x,className:eO.input,onChange:(e,t)=>{C(t.replace(eK,"").toUpperCase())},onClick:()=>D(`message_field_${(0,_.t)(V)}`),onBlur:()=>D(`on_message_field_${(0,_.t)(V)}`)}),(0,l.jsxs)(p.E,{children:["У меня"," ",(0,l.jsx)(ec.N,{href:v,onClick:()=>{D("click_link_net_nomera",v)},children:"нет номера"})]})]}),(0,l.jsx)(k.$,{as:"a",href:S,size:"s",className:eO.button,onClick:()=>{D(`click_button_rasschitat_${(0,_.t)(V)}`,S)},children:"Рассчитать"})]})]}),(0,l.jsx)("div",{className:eO.banner,children:(0,l.jsx)(ey,{...B,theme:n,handleBannerDataLayerPush:()=>{D("click_bnr_banner_top_predlozheniy")}})})]})},eG=(0,f.g)("best-offers","sc"),eX=Object.freeze({bestOffers:eG,graySection:`${eG}--gray`,singleProduct:`${eG}--singleProduct`,titleWrapper:`${eG}__title-wrapper`,singleProductTitleWrapper:`${eG}__title-wrapper--singleProduct`,title:`${eG}__title`,singleProductTitle:`${eG}__title--singleProduct`,chips:`${eG}__chips`,warning:`${eG}__warning`,allOffersLink:`${eG}__allOffersLink`}),eZ={вклады:"вкладам",облигации:"облигациям",кредиты:"кредитам",займы:"займам","Кредитные карты":"кредитным картам",каско:"каско",осаго:"ОСАГО","дебетовые карты":"дебетовым картам",ипотека:"ипотеке",автокредиты:"автокредитам"},eQ=({tabs:e,baseUrl:t,s3Assets:s,eventCategory:i="best-offers",dataLayerPush:a,singleProduct:r=!1,theme:n=ex.light,className:g,initialActiveChipId:f})=>{var k;let _,v=n===ex.gray,x=Array.isArray(e)?e.filter(({banner:e,offers:t,productType:s})=>!!e||!!(null!=t&&t.length)||"osago"===s||"kasko"===s).map(e=>({...e,offers:Array.isArray(e.offers)?e.offers:[]})):[],C=x.map(e=>({url:e.productType,title:e.name})),b=(null==(k=C[0])?void 0:k.url)??"",[y,A]=(0,u.useState)(f??b),E=y&&x.some(e=>e.productType===y)?y:b,w=x.find(e=>e.productType===E)??x[0];if(!w)return null;let F=eZ[w.name.toLowerCase()],S=F?`по ${F}`:w.name,B=("kasko"===(_=null==w?void 0:w.productType)||"osago"===_)&&t?(0,l.jsx)(eY,{type:w.productType,banner:w.banner,baseUrl:t,s3Assets:s,dataLayerPush:a,eventCategory:i,theme:n}):null;return(0,l.jsx)("section",{className:(0,d.A)(eX.bestOffers,g,{[eX.singleProduct]:r,[eX.graySection]:v}),children:(0,l.jsxs)(o.m,{children:[(0,l.jsx)("div",{className:(0,d.A)(eX.titleWrapper,r&&eX.singleProductTitleWrapper),children:(0,l.jsxs)(h.D,{as:"h2",type:r?"h2":"display",className:(0,d.A)(eX.title,r&&eX.singleProductTitle),children:["Лучшие предложения ",r?S:"сегодня"]})}),!r&&(0,l.jsx)(m.N,{items:C,maxNumberOfLines:2,activeChipId:E,variant:v?"white":"gray",className:eX.chips,onClick:e=>{A(e);let t=x.find(t=>t.productType===e);a({event:"data-event",eventCategory:i,eventAction:"click_chip_top_predlozheniy_vybor",eventLabel:null==t?void 0:t.productType})}}),(0,l.jsxs)("div",{children:[B??(0,l.jsx)(e$,{offers:w.offers,banner:w.banner,dataLayerPush:a,eventCategory:i,productType:w.productType,theme:n,singleProduct:r}),w.hasWarning&&(0,l.jsx)(p.E,{as:"p",size:"16",className:eX.warning,children:w.warningCustomText??"Оценивайте свои финансовые возможности и риски. Изучите все условия кредита (займа)"})]}),w.checkAllUrl&&(0,l.jsx)(c.C,{href:w.checkAllUrl,event:{event:"data-event",eventCategory:i,eventAction:"link",eventLabel:`Показать все предложения ${w.productType}`},dataLayerPush:a,iconGrayBackground:!v,className:eX.allOffersLink,linkClassName:w.checkAllLinkClassName,children:"Показать все предложения"})]})})}}}]);