(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6946],{6807:()=>{},14051:(e,t,s)=>{e.exports=s(34701)()},14572:(e,t,s)=>{"use strict";s.d(t,{N:()=>x,s:()=>b});var i=s(95155),a=s(12115),r=s(29722),n=s(20197),u=s(46089),l=s(7596);let o={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},h={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},d=e=>a.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},a.createElement("path",{d:"M12.004 7.246A1.247 1.247 0 0110.75 6a1.25 1.25 0 111.254 1.247zM10.75 12c0 .686.559 1.252 1.254 1.247a1.252 1.252 0 001.246-1.25 1.25 1.25 0 10-2.5.003zm0 6c0 .686.559 1.253 1.254 1.247a1.252 1.252 0 001.246-1.25 1.25 1.25 0 10-2.5.003z",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:{...o,...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(d,{viewBox:"0 0 24 24",style:h}))}p.displayName="IconFdsDotsVerticalO";let c=(0,l.g)("navigation-chips","sc"),m=Object.freeze({wrapper:`${c}__wrapper`,gray:`${c}__variantGray`,white:`${c}__variantWhite`,container:`${c}__container`,chip:`${c}__chip`,more:`${c}__chip--more`,active:`${c}__chip--active`,icon:`${c}__icon`,label:`${c}__label`,hidden:`${c}__hidden`}),g={display:"inline-block",lineHeight:0,backfaceVisibility:"hidden"},f={width:"1em",height:"1em",overflowClipMargin:"content-box",overflow:"hidden"},k=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 _({className:e,style:t,boxSize:s,size:i,onClick:r}){return a.createElement("span",{className:e,style:{...g,...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(k,{viewBox:"0 0 24 24",style:f}))}_.displayName="IconFdsArrowUpRightSmallO";let v=(0,l.g)("navigation-content","sc"),b=Object.freeze({contentWrapper:`${v}__content-wrapper`,content:`${v}__content`,contentOpen:`${v}__content--open`,contentHeader:`${v}__content-header`,contentTitle:`${v}__content-title`,contentTitleUrl:`${v}__content-title--url`,contentTitleLink:`${v}__content-title--link`,contentTitleNew:`${v}__content-title--new`,new:`${v}__new`,newInline:`${v}__new-inline`,vip:`${v}__vip`,arrowIcon:`${v}__arrow-icon`,links:`${v}__links`,linksColumns:`${v}__links--columns`,linksTitleless:`${v}__links--titleless`,removed:`${v}__removed`,hidden:`${v}__content--hidden`}),C=({chip:e,hidden:t,onClick:s,refCallback:a,activeChipId:l})=>{let o=!!s,h=()=>{if(o)return null==s?void 0:s(e.url);(0,u.h)(n.D.chip,e.title,`${e.title}_${e.url}`)},d=(0,i.jsxs)(i.Fragment,{children:[e.icon&&(0,i.jsx)("span",{className:m.icon,"aria-hidden":"true",children:e.icon}),(0,i.jsx)("span",{className:m.label,children:e.title}),e.arrow&&(0,i.jsx)(_,{size:24})]}),p=(0,r.A)(m.chip,{[m.hidden]:t,[b.new]:!!e.new,[b.vip]:!!e.vip,[m.active]:e.url===l});return o?(0,i.jsx)("button",{type:"button",className:p,onClick:h,ref:a,children:d}):(0,i.jsx)("a",{href:e.url,className:p,onClick:h,ref:a,children:d})},x=({items:e=[],maxNumberOfLines:t,variant:s,className:l,activeChipId:o,onClick:h,moreButtonOptions:d})=>{let c=(0,a.useRef)(null),g=(0,a.useRef)(null),f=(0,a.useRef)({}),k=(null==d?void 0:d.label)??"Еще",_="Еще",v=(null==d?void 0:d.showIcon)??!0,b=(0,r.A)(m.chip,m.more,null==d?void 0:d.className),[x,A]=(0,a.useState)(!1),[y,E]=(0,a.useState)(e.length),[w,F]=(0,a.useState)(!1);(0,a.useMemo)(()=>{let t=f.current;e.forEach(e=>{e.url in t||(t[e.url]=null)}),Object.keys(t).forEach(s=>{e.find(e=>String(e.url)===String(s))||delete t[s]})},[e]);let S=(0,a.useCallback)(()=>{let s=c.current;if(!s)return;let i=e=>e?e.getBoundingClientRect().width:0,a=i(s),r=Math.max(Number(t)||0,0),n=()=>{E(e.length),F(!1)};if(x||0===r||a<=0)return void n();let u=(()=>{try{let e=getComputedStyle(s),t=parseFloat(e.columnGap||e.gap||"12");return Number.isNaN(t)?12:t}catch{return 12}})(),l=i(g.current),o=e.map(e=>i(f.current[e.url]));if(o.some(e=>0===e))return void n();let h=1,d=0,p=0;for(let e of o){let t=h===r?l+u:0,s=0===d?e:d+u+e;if(s+t<=a-.5)d=s,p++;else{if(++h>r)break;d=e,p++}}F(p<e.length),E(p)},[x,e,t]);(0,a.useLayoutEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(()=>{requestAnimationFrame(S)});return t.observe(e),requestAnimationFrame(S),()=>{t.disconnect()}},[S]),(0,a.useEffect)(()=>{requestAnimationFrame(S)},[S]);let D=x||(t??0)<=0||!w;return(0,i.jsx)("div",{className:(0,r.A)(l,m.wrapper,{[m.gray]:"gray"===s,[m.white]:"white"===s}),children:(0,i.jsxs)("div",{ref:c,className:m.container,children:[e.map((e,t)=>(0,i.jsx)(C,{chip:e,hidden:!D&&t>=y,activeChipId:o,onClick:h,refCallback:t=>{f.current[e.url]=t}},e.url)),!D&&w&&(0,i.jsxs)("button",{type:"button",ref:g,className:b,"aria-label":_,onClick:()=>{(0,u.h)(n.D.chip,_),A(!0)},children:[v&&(0,i.jsx)(p,{size:20}),(0,i.jsx)("span",{className:m.label,children:k})]}),(D||!w)&&(0,i.jsxs)("button",{type:"button",ref:g,className:(0,r.A)(b,m.hidden),tabIndex:-1,"aria-hidden":"true",children:[v&&(0,i.jsx)(p,{size:20}),(0,i.jsx)("span",{className:m.label,children:k})]})]})})}},15959:()=>{},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 u=(0,n.g)("tag"),l=Object.freeze({tag:u,label:`${u}__label`,icon:`${u}__icon`,rounded:`${u}--rounded`,variant:{primary:`${u}--primary`,secondary:`${u}--secondary`,outline:`${u}--outline`,tertiary:`${u}--tertiary`,pink:`${u}--pink`,red:`${u}--red`,green:`${u}--green`,blue:`${u}--blue`,orange:`${u}--orange`,purple:`${u}--purple`,violet:`${u}--violet`,blur:`${u}--blur`},size:{s:`${u}--s`,m:`${u}--m`,l:`${u}--l`},iconMargin:{left:`${u}__icon--left`,right:`${u}__icon--right`}}),o=(0,a.forwardRef)(({label:e,size:t="m",rounded:s,variant:a="primary",iconLeft:n,iconRight:u,onIconLeftClick:o,onIconRightClick:h,className:d,style:p,dataQa:c,dataId:m,...g},f)=>(0,i.jsx)(i.Fragment,{children:e&&(0,i.jsxs)("div",{ref:f,className:(0,r.A)(l.tag,l.variant[a],l.size[t],{[l.rounded]:s},d),style:p,...g,"data-id":m,"data-qa":c,children:[n&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(l.icon,l.iconMargin.left,{[l.size.l]:"l"===t}),onClick:e=>null==o?void 0:o(e),disabled:!o,children:n}),(0,i.jsx)("span",{className:(0,r.A)(l.label,l.size[t]),children:e}),u&&(0,i.jsx)("button",{type:"button",className:(0,r.A)(l.icon,l.iconMargin.right,{[l.size.l]:"l"===t}),onClick:e=>null==h?void 0:h(e),disabled:!h,children:u})]})}));o.displayName="Tag"},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 u=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 u.name="Invariant Violation",u}}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}},46089:(e,t,s)=>{"use strict";s.d(t,{H:()=>r,h:()=>o,i:()=>l,s:()=>n});var i=s(20197),a=s(56053);let r="finuslugi-header-height-change",n=(e,t,s)=>{if(typeof window>"u"||typeof document>"u")return;let i=document.getElementById("mainHomeBanner"),a=!1,n=0,u=0,l=window.innerWidth<768,o=()=>window.scrollY||document.documentElement.scrollTop,h=e=>{document.documentElement.style.setProperty("--new-header-height-desktop",e),document.documentElement.style.setProperty("--new-header-height-mobile",e)},d=()=>{let e=window.innerWidth<768;e!==l&&(l=e,u=0)},p=function(){let r=o(),l=document.getElementById("headerNotice");if((null==l?void 0:l.getAttribute("data-opening"))==="true")return;u||(()=>{let e=document.querySelector(":root");if(e){let t=parseFloat(window.getComputedStyle(e).getPropertyValue("--fixed-header-height"));u=Number.isNaN(t)?0:t,n=o()}})();let d=r<u,p=r<((null==i?void 0:i.clientHeight)||0);if(s&&p||d){a=!1,e(!1),t(!0),h(`${u}px`);return}e(a=r>n),a&&setTimeout(()=>t(!1),50),h(a?"0px":`${u}px`),n=r<=0?0:r},c=()=>{u=0,p()};return window.addEventListener("scroll",p),window.addEventListener("resize",d),window.addEventListener(r,c),()=>{window.removeEventListener("scroll",p),window.removeEventListener("resize",d),window.removeEventListener(r,c)}},u=(e,t,s)=>{let i=new Date;i.setTime(i.getTime()+864e5*s);let a=encodeURIComponent(JSON.stringify(t)),r=`;domain=.${window.location.hostname}`;document.cookie=`${e}=${a};expires=${i.toUTCString()};path=/;SameSite=Lax${r}`},l=()=>{setTimeout(()=>{if(!(typeof document>"u"||"string"!=typeof document.cookie))try{let e;(e=(()=>{let e=new URLSearchParams(window.location.search),t={};for(let[s,i]of Array.from(e.entries()))s.startsWith("utm_")&&(t[s]=i);return Object.keys(t).length>0?t:null})())&&!document.cookie.split(";").some(e=>e.trim().startsWith("utm_params="))&&u("utm_params",e,90),e&&u("utm_last",e,90)}catch(e){console.error("UTM tracking error:",e)}},0)},o=(e,t,s)=>(0,i.h)({eventCategory:a.H,eventActionType:e,eventActionText:t,eventLabel:s})},52708:(e,t,s)=>{"use strict";s.d(t,{D:()=>y,a:()=>D,g:()=>C,h:()=>B});var i=s(95155),a=s(83640),r=s(12115),n=s(29722),u=s(76701),l=s(4901),o=s(9683),h=s(37370),d=s(42879),p=s(92681),c=s(62849),m=s(26048);function g(){return"u"<typeof window}s(6807);let f=g()?r.useLayoutEffect:r.useEffect;function k(e,t=!1){return g()?t:window.matchMedia(e).matches}Object.freeze({divider:(0,a.g)("dropdown-divider")});let _=(0,a.g)("dropdown-group");Object.freeze({group:_,title:`${_}__title`,content:`${_}__content`});let v=(0,a.g)("dropdown-option"),b=Object.freeze({option:v,slot:`${v}__slot`,iconSlot:`${v}__slot--icon`,wrapper:`${v}__wrapper`,label:`${v}__label`,caption:`${v}__caption`,states:{danger:`${v}--danger`,success:`${v}--success`,focused:`${v}--focused`,disabled:`${v}--disabled`}});function C({as:e,label:t,caption:s,iconLeft:a,iconRight:u,prepend:l,append:o,variant:h="default",disabled:d=!1,focused:p=!1,className:c,onClick:m,...g}){let f=(0,n.A)(c,b.option,{[b.states.focused]:p,[b.states.success]:"success"===h,[b.states.danger]:"danger"===h,[b.states.disabled]:!!d}),k=(0,r.useCallback)(e=>{e.preventDefault(),d||null==m||m(e)},[d,m]);return(0,i.jsxs)(e||"div",{...g,className:f,"aria-disabled":d,onClick:k,children:[l&&(0,i.jsx)("span",{className:b.slot,children:l}),a&&(0,i.jsx)("span",{className:(0,n.A)(b.slot,b.iconSlot),children:a}),(0,i.jsxs)("div",{className:b.wrapper,children:[(0,i.jsx)("span",{className:b.label,children:t}),s&&(0,i.jsx)("span",{className:b.caption,children:s})]}),u&&(0,i.jsx)("span",{className:(0,n.A)(b.slot,b.iconSlot),children:u}),o&&(0,i.jsx)("span",{className:b.slot,children:o})]})}let x=(0,r.createContext)(null),A=()=>{let e=(0,r.useContext)(x);if(null===e)throw Error("Dropdown components must be wrapped in <Dropdown />");return e},y=({children:e,...t})=>{let s=function({placement:e="bottom",width:t="auto",desktopMaxHeight:s,mobileFullHeight:i=!1,title:a,description:n,opened:h,onToggle:d,heading:p,footer:c,dataQa:m,dataId:g}={}){let[f,k]=(0,r.useState)(!1),_=h??f,v=d??k,b=(0,u.we)({open:_,onOpenChange:v,placement:e,whileElementsMounted:l.ll,middleware:[(0,o.cY)(8),(0,o.UU)({fallbackAxisSideDirection:"none"}),(0,o.BN)({crossAxis:!1,padding:8})]});return(0,r.useMemo)(()=>({open:_,setOpen:v,...b,width:t,desktopMaxHeight:s,title:a,description:n,heading:p,footer:c,mobileFullHeight:i,dataQa:m,dataId:g}),[_,v,b,t,s,a,n,p,c,i,m,g])}(t);return(0,i.jsx)(x.Provider,{value:s,children:e})};y.displayName="Dropdown";let E=(0,a.g)("dropdown"),w=Object.freeze({dropdown:E,overlay:`${E}__overlay`,mobileHeading:`${E}__mobile-heading`,heading:`${E}__heading`,title:`${E}__title`,description:`${E}__description`,content:`${E}__content`,contentInner:`${E}__content-inner`,footer:`${E}__footer`,close:`${E}__close`,closeIcon:`${E}__close-icon`,states:{auto:`${E}--auto`,fullHeight:`${E}--full-height`}}),F=({footer:e,...t})=>e?(0,i.jsx)("div",{...t,className:w.footer,children:e}):null;F.displayName="DropdownFooter";let S=({title:e,description:t,heading:s,isDesktop:a,setOpen:n,...u})=>{let l=(0,r.useMemo)(()=>s||(a&&(e||t)?(0,i.jsxs)(i.Fragment,{children:[e&&(0,i.jsx)("div",{className:w.title,children:e}),t&&(0,i.jsx)("div",{className:w.description,children:t})]}):null),[t,s,a,e]);return(0,i.jsxs)(i.Fragment,{children:[!a&&(0,i.jsxs)("div",{...u,className:w.mobileHeading,children:[e&&(0,i.jsx)("div",{className:w.title,children:e}),t&&(0,i.jsx)("div",{className:w.description,children:t}),(0,i.jsx)("button",{className:w.close,type:"button",tabIndex:-1,"aria-label":"Закрыть окно",onClick:()=>n(!1),children:(0,i.jsx)(m.P,{"aria-hidden":"true",className:w.closeIcon,style:{display:"inline-flex"},children:(0,i.jsx)(c.S,{})})})]}),l&&(0,i.jsx)("div",{...u,className:w.heading,children:l})]})};S.displayName="DropdownHeader";let D=(0,r.forwardRef)(({style:e,contentInnerRef:t,...s},a)=>{var l,o;let{open:c,context:m,width:g,floatingStyles:_,refs:v,heading:b,title:C,description:x,footer:y,desktopMaxHeight:E,mobileFullHeight:D,dataQa:B,dataId:V,setOpen:M}=A(),I=(0,u.SV)([v.setFloating,a]),T=(0,r.useRef)(null),R=function(){let{minWidth:e}=d.a.s;return function(e,{defaultValue:t=!1,initializeWithValue:s=!0}={}){let[i,a]=(0,r.useState)(()=>s?k(e,t):t??!1);function n(){a(k(e))}return f(()=>{let t=window.matchMedia(e);return n(),"function"==typeof t.addListener?t.addListener(n):t.addEventListener("change",n),()=>{"function"==typeof t.removeListener?t.removeListener(n):t.removeEventListener("change",n)}},[e]),i}(`screen and (min-width: ${e}px)`)}(),{isMounted:P,styles:O}=(0,u.DL)(m,{initial:{opacity:.2,transform:R?"translate(0, 0)":"translate(0, 100%)"},open:{opacity:1,transform:"translate(0, 0)"},duration:{open:300,close:100}});if((0,r.useEffect)(()=>{let e=({target:e})=>{!c||[T.current,v.reference.current].some(t=>t===e||t&&t.contains(e))||M(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[c,v.reference,M]),!P)return null;let $=(0,i.jsxs)("div",{ref:T,className:(0,n.A)(w.dropdown,{[w.states.fullHeight]:D}),role:R?"popup":"dialog","aria-modal":!R,"data-id":V,"data-qa":B,style:O,children:[(0,i.jsx)(S,{title:C,description:x,heading:b,isDesktop:R,setOpen:M,"data-qa":(0,p.g)(`${B}-header`,!!B)}),(0,i.jsx)("div",{...s,className:w.content,"data-qa":(0,p.g)(`${B}-content`,!!B),children:(0,i.jsx)("div",{className:w.contentInner,style:{maxHeight:R?E:void 0},ref:t,children:s.children})}),(0,i.jsx)(F,{"data-qa":(0,p.g)(`${B}-header`,!!B),footer:y})]});if(R){let t;return"inherit"===g?t=null==(o=null==(l=null==v?void 0:v.reference)?void 0:l.current)?void 0:o.clientWidth:"auto"===g?t=void 0:"number"==typeof g&&(t=g),(0,i.jsx)("div",{className:(0,n.A)(w.overlay,{[w.states.auto]:"auto"===g}),style:{...e,..._,...void 0!==t&&{width:t}},ref:I,children:$})}return(0,i.jsx)(u.XF,{id:h.D,children:(0,i.jsx)(u.zR,{lockScroll:!0,className:(0,n.A)(w.overlay,{[w.states.auto]:"auto"===g}),style:e,ref:I,children:$})})});D.displayName="DropdownContent";let B=(0,r.forwardRef)(function({children:e,asChild:t=!1,disabled:s,...a},n){let{refs:l,open:o,setOpen:h}=A(),d=e.ref,p=(0,u.SV)([l.setReference,n,d]),c=(0,r.useCallback)(()=>{s||h(!o)},[s,o,h]);return t&&(0,r.isValidElement)(e)?(0,r.cloneElement)(e,{ref:p,disabled:s,onClick:c,...a,...e.props}):(0,i.jsx)("button",{ref:p,onClick:c,disabled:s,...a,type:"button",children:e})});B.displayName="DropdownTrigger"},56053:(e,t,s)=>{"use strict";s.d(t,{F:()=>h,H:()=>u,U:()=>r,a:()=>o,b:()=>l,c:()=>n,s:()=>a});let i=(0,s(7596).g)("header","sc"),a=Object.freeze({header:`${i}`,fixed:`${i}__fixed`,hidden:`${i}__fixed--hidden`,transparent:`${i}--transparent`,navigationOpen:`${i}__navigation-open`,container:`${i}__container`,leftRow:`${i}__left-row`,logo:`${i}__logo`,menuItems:`${i}__menu-items`,menuItemActive:`${i}__menu-item-active`,tabletMenuButton:`${i}__tablet-menu-button`,buttonGroup:`${i}__button-group`,chips:`${i}__chips`,menuButton:`${i}__menu-button`,moreButtons:`${i}__more-buttons`,auth:`${i}__auth`,whiteIcons:`${i}__white-icons`,close:`${i}__close`,removed:`${i}__removed`,overlay:`${i}__overlay`,overlayOpening:`${i}__overlay--opening`,overlayClosing:`${i}__overlay--closing`}),r="user_region",n="user_town",u="cb-header",l=[{id:"FINPRODUCTS",label:"Финпродукты"},{id:"NAVIGATOR",label:"Журнал"},{id:"ABOUT",label:"О маркетплейсе"}],o=l.reduce((e,t)=>(e[t.id]=t.label,e),{}),h=Object.freeze({mobile:56,desktop:80})},63154:()=>{},66627:(e,t,s)=>{"use strict";s.d(t,{l:()=>f});var i=s(95155),a=s(12115),r=s(29722);let n=(e,t,s)=>{if(e)return"object"!=typeof e?s:"function"==typeof t?t(e):e[t]};function u(e){return a.createElement("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},a.createElement("defs",null,a.createElement("clipPath",{id:"a"},a.createElement("path",{fill:"#fff",fillOpacity:0,d:"M0 0h24v24H0z"}))),a.createElement("g",{clipPath:"url(#a)"},a.createElement("path",{d:"m10.53 16.53 8.25-8.25a.743.743 0 0 0 0-1.06.743.743 0 0 0-1.06 0L10 14.94l-3.72-3.72a.743.743 0 0 0-1.06 0 .743.743 0 0 0 0 1.06l4.25 4.25c.146.147.323.22.53.22a.722.722 0 0 0 .53-.22Z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"})))}var l=s(26048),o=s(68224),h=s(70179),d=s(52708),p=s(83640);function c(e){return a.createElement("svg",{viewBox:"0 0 24 24",width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},a.createElement("path",{d:"m19.03 10.28-6.5 6.5a.75.75 0 0 1-1.06 0l-6.5-6.5a.75.75 0 1 1 1.06-1.06L12 15.19l5.97-5.97a.75.75 0 1 1 1.06 1.06Z",clipRule:"evenodd",fill:"currentColor",fillRule:"evenodd"}))}s(63154);let m=(0,p.g)("select"),g={select:m,activator:`${m}__activator`,activatorWrapper:`${m}__activator-wrapper`,placeholder:`${m}__placeholder`,selected:`${m}__selected`,label:`${m}__label`,rightLabel:`${m}__right-label`,icon:`${m}__icon`,options:`${m}__options`,optionIcon:`${m}__option-icon`,caption:`${m}__caption`,states:{primary:`${m}--primary`,secondary:`${m}--secondary`,small:`${m}--s`,medium:`${m}--m`,large:`${m}--l`,opened:`${m}--opened`,error:`${m}--error`,success:`${m}--success`,selected:`${m}--selected`,disabled:`${m}--disabled`}};function f({value:e,label:t,options:s=[],optionValue:p="value",optionLabel:m="label",optionCaption:k="caption",optionDisabled:_="disabled",variant:v="primary",state:b,size:C="m",icon:x,rightLabel:A,clearable:y=!1,multiple:E=!1,disabled:w=!1,caption:F,placeholder:S,className:D,dataId:B,dataQa:V,isOpen:M=!1,classnameTrigger:I,selectedValue:T,onChange:R,onToggle:P,onSelect:O,onUnselect:$,onFocus:N,onBlur:j,...L}){let[U,z]=(0,a.useState)(!1),[q,H]=(0,a.useState)(),[K,Y]=(0,a.useState)(),[W,Z]=(0,a.useState)(!1),G=(0,a.useRef)(null),X=(0,a.useId)(),J=(0,a.useId)(),Q=(0,a.useId)();(0,a.useEffect)(()=>{e?H(e):H(E?[]:void 0)},[E,e]);let ee=(0,a.useMemo)(()=>s.map((e,t)=>{let s=n(e,p,e),i=E&&Array.isArray(q)?q.map(e=>n(e,p,e)):n(q,p,q);return{index:t,value:s,label:n(e,m,e),caption:n(e,k),disabled:n(e,_,!1),selected:E?Array.isArray(i)&&i.includes(s):i===s,active:K===t,original:e,id:`${Q}-option-${t}`}}),[K,Q,q,E,k,_,m,p,s]),et=(0,a.useMemo)(()=>ee.filter(e=>e.selected),[ee]),es=(0,a.useMemo)(()=>(0,o.i)(K)&&ee[K].id,[K]),ei=(0,a.useCallback)(e=>{H(e),null==R||R(e)},[R]),ea=(0,a.useCallback)(()=>{if(G.current&&es){let{start:e,end:t}=(e=>{let{width:t,height:s}=e.getBoundingClientRect();return{x:{start:e.scrollLeft,end:Math.floor(e.scrollLeft+t)},y:{start:e.scrollTop,end:Math.floor(e.scrollTop+s)}}})(G.current).y,s=document.getElementById(es);if(s){let i=s.offsetTop+s.clientHeight-t,a=e-s.offsetTop;i>0?G.current.scrollTop+=i+8:a>0&&(G.current.scrollTop-=a+8)}}},[es]),er=e=>{z(e),null==P||P(e)},en=(0,a.useCallback)(e=>{if(!(0,o.i)(e))return 0;let t=0===e?ee.length-1:e-1;return ee[t].disabled?en(t):t},[ee]),eu=(0,a.useCallback)(e=>{if(!(0,o.i)(e))return 0;let t=e===ee.length-1?0:e+1;return ee[t].disabled?eu(t):t},[ee]),el=(0,a.useCallback)(e=>{let t=e&&e.index!==ee.length-1?ee[e.index+1]:ee[0];return t.disabled?el(t):t},[ee]),eo=(0,a.useCallback)(e=>{let t=e&&0!==e.index?ee[e.index-1]:ee[ee.length-1];return t.disabled?eo(t):t},[ee]),eh=()=>{er(!0),Y(et.length>0?et[0].index:0)},ed=()=>{er(!1),Y(void 0)},ep=(0,a.useCallback)(e=>{if(!E){ei(y&&e.selected?void 0:e.original),ed();return}if(e.selected&&Array.isArray(q)){ei(q.filter(t=>n(t,p,t)!==e.value)),null==$||$(e.original);return}Array.isArray(q)&&(ei([...q,e.original]),null==O||O(e.original))},[y,ed,q,E,O,$,p,ei]),ec=(0,a.useCallback)(e=>{e.preventDefault(),U?ed():(y||E)&&(et.forEach(e=>null==$?void 0:$(e.original)),ei(E?[]:void 0))},[y,ed,E,$,U,et,ei]),em=(0,a.useCallback)(()=>{U&&ed()},[ed,U]),eg=(0,a.useCallback)(e=>{(e.preventDefault(),U)?Y(en(K)):E||ei(eo(et[0]).original)},[K,en,eo,E,U,et,ei]),ef=(0,a.useCallback)(e=>{(e.preventDefault(),U)?Y(eu(K)):E?eh():ei(el(et[0]).original)},[K,eu,el,E,U,eh,et,ei]),ek=(0,a.useCallback)(e=>{switch(Z(!0),e.key){case"Escape":case"Esc":ec(e);break;case"Tab":em();break;case"ArrowDown":ef(e);break;case"ArrowUp":eg(e)}},[ef,eg,ec,em]),e_=(0,a.useCallback)(e=>{(e.preventDefault(),U)?((0,o.i)(K)&&ep(ee[K]),E||ed()):eh()},[K,ed,ep,ee,E,U,eh]),ev=(0,a.useCallback)(e=>{Z(!0),(" "===e.key||"Enter"===e.key)&&e_(e)},[e_]);(0,a.useEffect)(()=>{M&&(()=>{er(!0);let{value:t,label:s}=(Array.isArray(e)?e[0]:e)??{},i=ee.find(e=>e.value===t&&e.label===s);Y((null==i?void 0:i.index)??0)})()},[M]),(0,a.useEffect)(()=>{U&&ea()},[U,ea]),(0,a.useEffect)(()=>{if(!U)return;let e=e=>{ek(e)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[ek,U]);let eb=(0,r.A)(I,g.activator,{[g.states.primary]:"primary"===v,[g.states.secondary]:"secondary"===v,[g.states.small]:"s"===C,[g.states.medium]:"m"===C,[g.states.large]:"l"===C,[g.states.error]:"error"===b,[g.states.success]:"success"===b,[g.states.opened]:U,[g.states.disabled]:w}),eC=(0,a.useMemo)(()=>et.length>0?(0,i.jsxs)(i.Fragment,{children:["s"!==C&&(0,i.jsx)("div",{id:J,className:(0,r.A)(g.label,{[g.states.error]:"error"===b,[g.states.success]:"success"===b,[g.states.opened]:U,[g.states.disabled]:w}),children:t},"label"),(0,i.jsx)("div",{className:(0,r.A)(g.selected,{[g.states.disabled]:w}),children:(null==T?void 0:T(et.map(e=>e.original)))||et.map(({label:e})=>e).join(", ")})]}):(0,i.jsx)("div",{id:J,className:(0,r.A)(g.placeholder,{[g.states.error]:"error"===b,[g.states.success]:"success"===b,[g.states.opened]:U,[g.states.disabled]:w}),children:S||t},"placeholder"),[w,t,J,U,S,et,T,C,b]);return(0,i.jsx)("div",{className:(0,r.A)(D,g.select),children:(0,i.jsxs)(d.D,{opened:U,onToggle:()=>{U?ed():eh()},width:"inherit",placement:"bottom",children:[(0,i.jsx)(d.h,{asChild:!0,disabled:w,children:(0,i.jsxs)("div",{className:eb,id:X,tabIndex:w?-1:0,role:"combobox","aria-haspopup":"listbox","aria-labelledby":J,"aria-controls":Q,"aria-disabled":w,"aria-expanded":U,...!w&&{onFocus:e=>{null==N||N(e)},onBlur:e=>{null==j||j(e)},onKeyDownCapture:ev,onKeyDown:U?void 0:ek},...L,"data-id":B,"data-qa":V,children:[(0,i.jsx)("div",{className:g.activatorWrapper,children:eC}),A&&(0,i.jsx)("div",{"aria-label":A,className:(0,r.A)(g.rightLabel,{[g.states.disabled]:w}),children:A}),x&&(0,i.jsx)("div",{"aria-hidden":"true",className:(0,r.A)(g.icon,{[g.states.disabled]:w}),children:x}),(0,i.jsx)("div",{className:(0,r.A)(g.icon,{[g.states.disabled]:w,[g.states.opened]:U}),children:(0,i.jsx)(l.P,{style:{fontSize:24},"aria-expanded":U,children:(0,i.jsx)(c,{})})})]})}),F&&(0,i.jsx)("div",{className:(0,r.A)(g.caption,{[g.states.error]:"error"===b,[g.states.success]:"success"===b,[g.states.secondary]:"secondary"===v,[g.states.disabled]:w}),children:F}),(0,i.jsx)(d.a,{contentInnerRef:G,children:(0,i.jsx)("ul",{role:"listbox",id:Q,className:g.options,onMouseOver:()=>{W&&Z(!1)},children:ee.map(e=>(0,i.jsx)(d.g,{as:"li",disabled:e.disabled,label:e.label,caption:e.caption,focused:e.active&&W,onClick:()=>ep(e),prepend:E?(0,i.jsx)(h.C,{type:"checkbox",checked:e.selected,disabled:e.disabled}):void 0,append:E?void 0:(0,i.jsx)(l.P,{className:(0,r.A)(g.optionIcon,{[g.states.selected]:e.selected}),style:{fontSize:24},children:(0,i.jsx)(u,{})}),"aria-selected":e.selected,role:"option",id:e.id},JSON.stringify(e.value)))})})]})})}f.displayName="Select"},68224:(e,t,s)=>{"use strict";function i(e){return void 0!==e}s.d(t,{i:()=>i})},70179:(e,t,s)=>{"use strict";s.d(t,{C:()=>c});var i=s(95155),a=s(29722),r=s(12115),n=s(26048),u=s(83640);function l(e){return r.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M19.836 6.466a1.5 1.5 0 0 1-.051 2.12l-9.45 9a1.5 1.5 0 0 1-2.07 0l-4.05-3.857a1.5 1.5 0 1 1 2.07-2.172L9.3 14.429l8.415-8.015a1.5 1.5 0 0 1 2.121.052Z"}))}function o(e){return r.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("rect",{width:18,height:3,x:3,y:10.5,fill:"currentColor",rx:1.5}))}s(15959);let h=["checkbox"],d=(0,u.g)("common-marker"),p={marker:d,icon:`${d}__icon`,states:{checkbox:`${d}--checkbox`,radio:`${d}--radio`,toggle:`${d}--toggle`,error:`${d}--error`,checked:`${d}--checked`,disabled:`${d}--disabled`,inverted:`${d}--inverted`,indeterminate:`${d}--indeterminate`}},c=({as:e,state:t="default",type:s="checkbox",className:r,checked:u,inverted:d,disabled:c,...m})=>(0,i.jsx)(e||"span",{...m,className:(0,a.A)(r,p.marker,{[p.states.checkbox]:"checkbox"===s,[p.states.radio]:"radio"===s,[p.states.toggle]:"toggle"===s,[p.states.checked]:!!u,[p.states.indeterminate]:"indeterminate"===u,[p.states.error]:"error"===t,[p.states.inverted]:d,[p.states.disabled]:c}),children:h.includes(s)&&(0,i.jsx)(n.P,{className:(0,a.A)(p.icon,{[p.states.checked]:u,[p.states.inverted]:d,[p.states.error]:"error"===t,[p.states.disabled]:c}),children:"indeterminate"===u?(0,i.jsx)(o,{}):(0,i.jsx)(l,{})})});c.displayName="CommonMarker"},81143:(e,t,s)=>{"use strict";let i;s.d(t,{U:()=>Q});var a,r,n=s(95155),u=s(12115);function l(e){return"string"==typeof e||e instanceof String}function o(e){var t;return"object"==typeof e&&null!=e&&(null==e||null==(t=e.constructor)?void 0:t.name)==="Object"}let h="NONE",d="LEFT",p="FORCE_LEFT",c="RIGHT",m="FORCE_RIGHT";function g(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function f(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(!f(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 u=Object.keys(t);for(s=0;s<u.length;s++)if(!Object.prototype.hasOwnProperty.call(e,u[s]))return!1;for(s=0;s<u.length;s++)if(!f(e[u[s]],t[u[s]]))return!1;return!0}return!!t&&!!e&&"function"==typeof t&&"function"==typeof e&&t.toString()===e.toString()}class k{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?h:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?c:d}}function _(e,t){return new _.InputMask(e,t)}function v(e){if(null==e)throw Error("mask property should be defined");return e instanceof RegExp?_.MaskedRegExp:l(e)?_.MaskedPattern:e===Date?_.MaskedDate:e===Number?_.MaskedNumber:Array.isArray(e)||e===Array?_.MaskedDynamic:_.Masked&&e.prototype instanceof _.Masked?e:_.Masked&&e instanceof _.Masked?e.constructor:e instanceof Function?_.MaskedFunction:(console.warn("Mask not found for mask",e),_.Masked)}function b(e){if(!e)throw Error("Options in not defined");if(_.Masked){if(e.prototype instanceof _.Masked)return{mask:e};let{mask:t,...s}=e instanceof _.Masked?{mask:e}:o(e)&&e.mask instanceof _.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 o(e)?{...e}:{mask:e}}function C(e){if(_.Masked&&e instanceof _.Masked)return e;let t=b(e),s=v(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)}_.createMask=C;class x{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}}_.MaskElement=x;class A extends x{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={}}}_.HTMLMaskElement=A;class y extends A{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}}_.HTMLMaskElement=A;class E extends A{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}}_.HTMLContenteditableMaskElement=E;class w{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>w.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}}w.MAX_LENGTH=100;class F{constructor(e,t){this.el=e instanceof x?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new E(e):new y(e),this.masked=C(t),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new w,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 _.Masked)&&this.masked.constructor===v(e))return void this.masked.updateOptions({mask:e});let t=e instanceof _.Masked?e:C({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,d))}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 k({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:h,r=this.masked.nearestInputPos(t.startChangePos+i,a);a!==h&&(r=this.masked.nearestInputPos(r,h)),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}}_.InputMask=F;class S{static normalize(e){return Array.isArray(e)?e:[e,new S]}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}}_.ChangeDetails=S;class D{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 B{constructor(e){this._value="",this._update({...B.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 D(this.extractInput(e,t),e)}appendTail(e){return l(e)&&(e=new D(String(e))),e.appendTo(this)}_appendCharRaw(e,t){return e?(this._value+=e,new S({inserted:e,rawInserted:e})):new S}_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 S,this.state=a,s&&e&&(s.state=e))}return i}_appendPlaceholder(){return new S}_appendEager(){return new S}append(e,t,s){let i;if(!l(e))throw Error("value should be string");let a=l(s)?new D(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 S}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={}),S.normalize(this.prepare?this.prepare(e,this,t):e)}doPrepareChar(e,t){return void 0===t&&(t={}),S.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=h),void 0===a&&(a={input:!0});let n=e+t,u=this.extractTail(n),l=!0===this.eager||"remove"===this.eager;l&&(i=function(e){switch(e){case d:return p;case c:return m;default:return e}}(i),r=this.extractInput(0,n,{raw:!0}));let o=e,g=new S;if(i!==h&&(g.tailShift=(o=this.nearestInputPos(e,t>1&&0!==e&&!l?h:i))-e),g.aggregate(this.remove(o)),l&&i!==h&&r===this.rawInputValue)if(i===p){let e;for(;r===this.rawInputValue&&(e=this.displayValue.length);)g.aggregate(new S({tailShift:-1})).aggregate(this.remove(e-1))}else i===m&&u.unshift();return g.aggregate(this.append(s,a,u))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!f(this,e)}typedValueEquals(e){let t=this.typedValue;return e===t||B.EMPTY_VALUES.includes(e)&&B.EMPTY_VALUES.includes(t)||!!this.format&&this.format(e,this)===this.format(this.typedValue,this)}pad(e){return new S}}B.DEFAULTS={skipInvalid:!0},B.EMPTY_VALUES=[void 0,null,""],_.Masked=B;class V{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=l(e)?new D(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 D)s?t.extend(e.toString()):this.chunks.push(e);else if(e instanceof V){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 _.MaskedPattern))return new D(this.toString()).appendTo(e);let t=new S;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 V||e._stops.indexOf(n)>=0)&&t.aggregate(e._appendPlaceholder(n)),i=a instanceof V&&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 V:new D;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 M{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,p),0!==this.offset))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,d),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!this.block.isFixed&&(!this.block.isOptional||this.block.value))return this.offset=this.block.nearestInputPos(this.offset,d),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!this.block.isFixed&&this.block.value&&(this.offset=this.block.nearestInputPos(this.offset,m),this.offset!==this.block.value.length))return!0})}pushRightBeforeInput(){return this._pushRight(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,h),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!this.block.isFixed&&(!this.block.isOptional||this.block.value))return this.offset=this.block.nearestInputPos(this.offset,h),!0})}}class I{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 S}nearestInputPos(e,t){void 0===t&&(t=h);let s=this._value.length;switch(t){case d:case p: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 S;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 S({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 S;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new D("")}appendTail(e){return l(e)&&(e=new D(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 T{constructor(e){const{parent:t,isOptional:s,placeholderChar:i,displayChar:a,lazy:r,eager:n,...u}=e;this.masked=C(u),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 S}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 S;let s=this.masked.state,i=this.masked._appendChar(e,this.currentMaskFlags(t));return i.inserted&&!1===this.doValidate(t)&&(i=new S,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 S:(this.isFilled=!0,new S({inserted:this.placeholderChar}))}_appendEager(){return new S}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=h);let s=this.value.length,i=Math.min(Math.max(e,0),s);switch(t){case d:case p:return this.isComplete?i:0;case c:case m: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 S}}T.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 R extends B{updateOptions(e){super.updateOptions(e)}_update(e){let t=e.mask;t&&(e.validate=e=>e.search(t)>=0),super._update(e)}}_.MaskedRegExp=R;class P extends B{constructor(e){super({...P.DEFAULTS,...e,definitions:Object.assign({},T.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}=b(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 _.RepeatBlock(r):C(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===P.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===r||"}"===r){s=!s;continue}if("["===r||"]"===r){i=!i;continue}if(r===P.ESCAPE_CHAR){if(!(r=t[++a]))break;n=!1}let u=n?new T({isOptional:i,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...b(e[r]),parent:this}):new I({char:r,eager:this.eager,isUnmasking:s});this._blocks.push(u)}}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 S,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 S;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 V;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 V&&(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 S;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=h),!this._blocks.length)return 0;let s=new M(this,e);if(t===h)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(t===d||t===p){if(t===d){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),t===d){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===p?0:(s.popState(),s.ok||(s.popState(),s.ok))?s.pos:0}return t===c||t===m?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled())?s.pos:t===m?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok))?s.pos:this.nearestInputPos(e,d):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 S;return this._forEachBlocksInRange(0,this.displayValue.length,s=>t.aggregate(s.pad(e))),t}}P.DEFAULTS={...B.DEFAULTS,lazy:!0,placeholderChar:"_"},P.STOP_CHAR="`",P.ESCAPE_CHAR="\\",P.InputDefinition=T,P.FixedDefinition=I,_.MaskedPattern=P;class O extends P{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"),u=String(this.to).padStart(this.maxLength,"0"),l=0;for(;l<u.length&&u[l]===n[l];)++l;r.mask=u.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),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 S;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}}_.MaskedRange=O;class $ extends P{static extractPatternOptions(e){let{mask:t,pattern:s,...i}=e;return{...i,mask:l(t)?t:s}}constructor(e){super($.extractPatternOptions({...$.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){let{mask:t,pattern:s,blocks:i,...a}={...$.DEFAULTS,...e},r=Object.assign({},$.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:l(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($.extractPatternOptions(e))}}$.GET_DEFAULT_BLOCKS=()=>({d:{mask:O,from:1,to:31,maxLength:2},m:{mask:O,from:1,to:12,maxLength:2},Y:{mask:O,from:1900,to:9999}}),$.DEFAULTS={...P.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)}},_.MaskedDate=$;class N extends B{constructor(e){super({...N.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}=b(e),i=C({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),u=this.currentMask,l=new S,o=null==u?void 0:u.state;return this.currentMask=this.doDispatch(e,{...t},s),this.currentMask&&(this.currentMask!==u?(this.currentMask.reset(),r&&(this.currentMask.append(r,{raw:!0}),l.tailShift=this.currentMask.value.length-i.length),n&&(l.tailShift+=this.currentMask.append(n,{raw:!0,tail:!0}).tailShift)):o&&(this.currentMask.state=o)),l}_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 S;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 S;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 f(t,a)&&t.maskEquals(i)}):super.maskEquals(e)}typedValueEquals(e){var t;return!!(null==(t=this.currentMask)?void 0:t.typedValueEquals(e))}}N.DEFAULTS={...B.DEFAULTS,dispatch:(e,t,s,i)=>{if(!t.compiledMasks.length)return;let a=t.rawInputValue,r=t.compiledMasks.map((r,n)=>{let u=t.currentMask===r,l=u?r.displayValue.length:r.nearestInputPos(r.displayValue.length,p);return r.rawInputValue!==a?(r.reset(),r.append(a,{raw:!0})):u||r.remove(l),r.append(e,t.currentMaskFlags(s)),r.appendTail(i),{index:n,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(l,r.nearestInputPos(r.displayValue.length,p)))}});return r.sort((e,t)=>t.weight-e.weight||t.totalInputPositions-e.totalInputPositions),t.compiledMasks[r[0].index]}},_.MaskedDynamic=N;class j extends P{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,m),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 S({skip:!this.isComplete})}extractTail(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),new D("",e)}remove(e,t){let s;if(void 0===e&&(e=0),void 0===t&&(t=this.displayValue.length),e===t)return new S;let i=Math.min(super.nearestInputPos(0,m),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={...P.DEFAULTS,matchValue:(e,t,s)=>e.indexOf(t,s)===s},_.MaskedEnum=j;class L extends B{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}_.MaskedFunction=L;class U extends B{constructor(e){super({...U.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){let e="^"+(this.allowNegative?"[+|\\-]?":""),t=(this.scale?"("+g(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=RegExp(e+"\\d*"+t),this._mapToRadixRegExp=RegExp("["+this.mapToRadix.map(g).join("")+"]","g"),this._thousandsSeparatorRegExp=RegExp(g(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),u=!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(U.UNMASKED_RADIX,this.radix),u||(u=r===this._value&&!t.tail)):n=!1),n&&(n=!!this._value.match(this._numberRegExp))}n?s=new S({inserted:this._value.slice(r.length),rawInserted:u?"":e,skip:u}):(this._value=r,s=new S),this._value=this._insertThousandsSeparators(this._value);let l=t.tail&&t._beforeTailState?t._beforeTailState._value:this._value,o=this._separatorsCountFromSlice(l);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 S({tailShift:(this._separatorsCountFromSlice(s)-a)*this.thousandsSeparator.length})}nearestInputPos(e,t){if(!this.thousandsSeparator)return e;switch(t){case h:case d:case p:{let s=this._findSeparatorAround(e-1);if(s>=0){let i=s+this.thousandsSeparator.length;if(e<i||this.value.length<=i||t===p)return s}break}case c:case m:{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===U.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,U.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(U.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)||U.EMPTY_VALUES.includes(e)&&U.EMPTY_VALUES.includes(this.typedValue))&&(0!==e||""!==this.value)}}U.UNMASKED_RADIX=".",U.EMPTY_VALUES=[...B.EMPTY_VALUES,0],U.DEFAULTS={...B.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[U.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})},_.MaskedNumber=U;let z={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function q(e,t,s){void 0===t&&(t=z.MASKED),void 0===s&&(s=z.MASKED);let i=C(e);return e=>i.runIsolated(i=>(i[t]=e,i[s]))}_.PIPE_TYPE=z,_.createPipe=q,_.pipe=function(e,t,s,i){return q(t,s,i)(e)};class H extends P{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}=b(e);this._blockOpts=Object.assign({},this._blockOpts,r);let n=C(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(C(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(e,t){void 0===t&&(t={});let s=new S;for(let u=null!=(i=null==(a=this._mapPosToBlock(this.displayValue.length))?void 0:a.index)?i:Math.max(this._blocks.length-1,0),l,o;l=null!=(r=this._blocks[u])?r:o=!o&&this._allocateBlock(u);++u){var i,a,r,n;let h=l._appendChar(e,{...t,_beforeTailState:null==(n=t._beforeTailState)||null==(n=n._blocks)?void 0:n[u]});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}}_.RepeatBlock=H;try{globalThis.IMask=_}catch{}var K=s(14051);let Y={mask:K.oneOfType([K.array,K.func,K.string,K.instanceOf(RegExp),K.oneOf([Date,Number,_.Masked]),K.instanceOf(_.Masked)]),value:K.any,unmask:K.oneOfType([K.bool,K.oneOf(["typed"])]),prepare:K.func,prepareChar:K.func,validate:K.func,commit:K.func,overwrite:K.oneOfType([K.bool,K.oneOf(["shift"])]),eager:K.oneOfType([K.bool,K.oneOf(["append","remove"])]),skipInvalid:K.bool,onAccept:K.func,onComplete:K.func,placeholderChar:K.string,displayChar:K.string,lazy:K.bool,definitions:K.object,blocks:K.object,enum:K.arrayOf(K.string),maxLength:K.number,from:K.number,to:K.number,pattern:K.string,format:K.func,parse:K.func,autofix:K.oneOfType([K.bool,K.oneOf(["pad"])]),radix:K.string,thousandsSeparator:K.string,mapToRadix:K.arrayOf(K.string),scale:K.number,normalizeZeros:K.bool,padFractionalZeros:K.bool,min:K.oneOfType([K.number,K.instanceOf(Date)]),max:K.oneOfType([K.number,K.instanceOf(Date)]),dispatch:K.func,inputRef:K.oneOfType([K.func,K.shape({current:K.object})])},W=Object.keys(Y).filter(e=>"value"!==e),Z=["value","unmask","onAccept","onComplete","inputRef"],G=W.filter(e=>0>Z.indexOf(e)),X=(a=e=>{let{inputRef:t,...s}=e;return u.createElement("input",{...s,ref:t})},(r=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=_(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>G.indexOf(e)).forEach(e=>{delete t[e]}),t}_extractNonMaskProps(e){let{...t}=e;return W.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(a,{...this._extractNonMaskProps(this.props),inputRef:this._inputRef})}}).displayName=void 0,r.propTypes=void 0,(i=r).displayName="IMask("+(a.displayName||a.name||"Component")+")",i.propTypes=Y,u.forwardRef((e,t)=>u.createElement(i,{...e,ref:t})));u.forwardRef((e,t)=>u.createElement(X,{...e,ref:t}));var J=s(37637);let Q=(0,u.forwardRef)(({maskOpts:e,value:t="",autoFocus:s=!1,onChange:i,onKeyDown:a,...r},l)=>{let[o,h]=(0,u.useState)(""),{ref:d,setValue:p,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,d]=(0,u.useState)({}),[p,c]=(0,u.useState)(""),[m,g]=(0,u.useState)(""),[f,k]=(0,u.useState)(),v=(0,u.useCallback)(()=>{var e;null==(e=o.current)||e.destroy(),o.current=null},[]),b=(0,u.useCallback)(()=>{let e=o.current;e&&(d({value:e.value,unmaskedValue:e.unmaskedValue,typedValue:e.typedValue}),k(e.typedValue),g(e.unmaskedValue),c(e.value))},[]),C=(0,u.useCallback)(e=>{let t=o.current;t&&(b(),null==s||s(t.value,t,e))},[s]),x=(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!==p&&(e!==p&&(s.value=p,s.value!==p&&C()),d(t))},[p]),(0,u.useEffect)(()=>{let{unmaskedValue:e,...t}=h,s=o.current;s&&void 0!==m&&(e!==m&&(s.unmaskedValue=m,s.unmaskedValue!==m&&C()),d(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)||C()),d(t))},[f]),(0,u.useEffect)(()=>{let t=a.current;if(!t||!(null!=e&&e.mask))return v();let s=o.current;s?null==s||s.updateOptions(e):t&&null!=e&&e.mask&&(o.current=_(t,e),b(),void 0!==r&&c(r),void 0!==n&&g(n),void 0!==l&&k(l))},[e,v,C]),(0,u.useEffect)(()=>{if(!o.current)return;let e=o.current;return e.on("accept",C),e.on("complete",x),()=>{e.off("accept",C),e.off("complete",x)}},[C,x]),(0,u.useEffect)(()=>v,[v]),{ref:a,maskRef:o,value:p,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&&(p(t),h(t))},[t,p,c]),(0,u.useImperativeHandle)(l,()=>d.current),(0,n.jsx)(J.I,{...r,autoFocus:s,inputRef:d,value:o,onKeyDown:e=>{("Escape"===e.key||"Esc"===e.key)&&(e.preventDefault(),p(""),h(""),null==i||i("","")),null==a||a(e)}})});Q.displayName="InputMasked"},82114:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}}]);