text: !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).IMask={})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(t){return t&&t.Math==Math&&t},u=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")(),r={},i=function(t){try{return!!t()}catch(t){return!0}},a=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s={},o={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,h=l&&!o.call({1:2},1);s.f=h?function(t){var e=l(this,t);return!!e&&e.enumerable}:o;var c=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},f={}.toString,p=function(t){return f.call(t).slice(8,-1)},d="".split,v=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==p(t)?d.call(t,""):Object(t)}:Object,g=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},k=v,y=g,m=function(t){return k(y(t))},_=function(t){return"object"==typeof t?null!==t:"function"==typeof t},A=_,b=function(t,e){if(!A(t))return t;var n,u;if(e&&"function"==typeof(n=t.toString)&&!A(u=n.call(t)))return u;if("function"==typeof(n=t.valueOf)&&!A(u=n.call(t)))return u;if(!e&&"function"==typeof(n=t.toString)&&!A(u=n.call(t)))return u;throw TypeError("Can't convert object to primitive value")},C=g,E=function(t){return Object(C(t))},F=E,S={}.hasOwnProperty,D=Object.hasOwn||function(t,e){return S.call(F(t),e)},B=_,w=u.document,M=B(w)&&B(w.createElement),x=function(t){return M?w.createElement(t):{}},P=!a&&!i((function(){return 7!=Object.defineProperty(x("div"),"a",{get:function(){return 7}}).a})),O=a,T=s,I=c,j=m,V=b,R=D,L=P,N=Object.getOwnPropertyDescriptor;r.f=O?N:function(t,e){if(t=j(t),e=V(e,!0),L)try{return N(t,e)}catch(t){}if(R(t,e))return I(!T.f.call(t,e),t[e])};var z={},U=_,H=function(t){if(!U(t))throw TypeError(String(t)+" is not an object");return t},Y=a,Z=P,K=H,G=b,W=Object.defineProperty;z.f=Y?W:function(t,e,n){if(K(t),e=G(e,!0),K(n),Z)try{return W(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var $=z,q=c,X=a?function(t,e,n){return $.f(t,e,q(1,n))}:function(t,e,n){return t[e]=n,t},J={exports:{}},Q=u,tt=X,et=function(t,e){try{tt(Q,t,e)}catch(n){Q[t]=e}return e},nt=et,ut="__core-js_shared__",rt=u[ut]||nt(ut,{}),it=rt,at=Function.toString;"function"!=typeof it.inspectSource&&(it.inspectSource=function(t){return at.call(t)});var st=it.inspectSource,ot=st,lt=u.WeakMap,ht="function"==typeof lt&&/native code/.test(ot(lt)),ct={exports:{}},ft=rt;(ct.exports=function(t,e){return ft[t]||(ft[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.15.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var pt,dt,vt,gt=0,kt=Math.random(),yt=ct.exports,mt=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++gt+kt).toString(36)},_t=yt("keys"),At={},bt=ht,Ct=_,Et=X,Ft=D,St=rt,Dt=function(t){return _t[t]||(_t[t]=mt(t))},Bt=At,wt="Object already initialized",Mt=u.WeakMap;if(bt||St.state){var xt=St.state||(St.state=new Mt),Pt=xt.get,Ot=xt.has,Tt=xt.set;pt=function(t,e){if(Ot.call(xt,t))throw new TypeError(wt);return e.facade=t,Tt.call(xt,t,e),e},dt=function(t){return Pt.call(xt,t)||{}},vt=function(t){return Ot.call(xt,t)}}else{var It=Dt("state");Bt[It]=!0,pt=function(t,e){if(Ft(t,It))throw new TypeError(wt);return e.facade=t,Et(t,It,e),e},dt=function(t){return Ft(t,It)?t[It]:{}},vt=function(t){return Ft(t,It)}}var jt={set:pt,get:dt,has:vt,enforce:function(t){return vt(t)?dt(t):pt(t,{})},getterFor:function(t){return function(e){var n;if(!Ct(e)||(n=dt(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},Vt=u,Rt=X,Lt=D,Nt=et,zt=st,Ut=jt.get,Ht=jt.enforce,Yt=String(String).split("String");(J.exports=function(t,e,n,u){var r,i=!!u&&!!u.unsafe,a=!!u&&!!u.enumerable,s=!!u&&!!u.noTargetGet;"function"==typeof n&&("string"!=typeof e||Lt(n,"name")||Rt(n,"name",e),(r=Ht(n)).source||(r.source=Yt.join("string"==typeof e?e:""))),t!==Vt?(i?!s&&t[e]&&(a=!0):delete t[e],a?t[e]=n:Rt(t,e,n)):a?t[e]=n:Nt(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Ut(this).source||zt(this)}));var Zt=u,Kt=u,Gt=function(t){return"function"==typeof t?t:void 0},Wt=function(t,e){return arguments.length<2?Gt(Zt[t])||Gt(Kt[t]):Zt[t]&&Zt[t][e]||Kt[t]&&Kt[t][e]},$t={},qt=Math.ceil,Xt=Math.floor,Jt=function(t){return isNaN(t=+t)?0:(t>0?Xt:qt)(t)},Qt=Jt,te=Math.min,ee=function(t){return t>0?te(Qt(t),9007199254740991):0},ne=Jt,ue=Math.max,re=Math.min,ie=m,ae=ee,se=function(t,e){var n=ne(t);return n<0?ue(n+e,0):re(n,e)},oe=function(t){return function(e,n,u){var r,i=ie(e),a=ae(i.length),s=se(u,a);if(t&&n!=n){for(;a>s;)if((r=i[s++])!=r)return!0}else for(;a>s;s++)if((t||s in i)&&i[s]===n)return t||s||0;return!t&&-1}},le={includes:oe(!0),indexOf:oe(!1)},he=D,ce=m,fe=le.indexOf,pe=At,de=function(t,e){var n,u=ce(t),r=0,i=[];for(n in u)!he(pe,n)&&he(u,n)&&i.push(n);for(;e.length>r;)he(u,n=e[r++])&&(~fe(i,n)||i.push(n));return i},ve=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ge=de,ke=ve.concat("length","prototype");$t.f=Object.getOwnPropertyNames||function(t){return ge(t,ke)};var ye={};ye.f=Object.getOwnPropertySymbols;var me=$t,_e=ye,Ae=H,be=Wt("Reflect","ownKeys")||function(t){var e=me.f(Ae(t)),n=_e.f;return n?e.concat(n(t)):e},Ce=D,Ee=be,Fe=r,Se=z,De=i,Be=/#|\.prototype\./,we=function(t,e){var n=xe[Me(t)];return n==Oe||n!=Pe&&("function"==typeof e?De(e):!!e)},Me=we.normalize=function(t){return String(t).replace(Be,".").toLowerCase()},xe=we.data={},Pe=we.NATIVE="N",Oe=we.POLYFILL="P",Te=we,Ie=u,je=r.f,Ve=X,Re=J.exports,Le=et,Ne=function(t,e){for(var n=Ee(e),u=Se.f,r=Fe.f,i=0;i<n.length;i++){var a=n[i];Ce(t,a)||u(t,a,r(e,a))}},ze=Te,Ue=function(t,e){var n,u,r,i,a,s=t.target,o=t.global,l=t.stat;if(n=o?Ie:l?Ie[s]||Le(s,{}):(Ie[s]||{}).prototype)for(u in e){if(i=e[u],r=t.noTargetGet?(a=je(n,u))&&a.value:n[u],!ze(o?u:s+(l?".":"#")+u,t.forced)&&void 0!==r){if(typeof i==typeof r)continue;Ne(i,r)}(t.sham||r&&r.sham)&&Ve(i,"sham",!0),Re(n,u,i,t)}},He=de,Ye=ve,Ze=Object.keys||function(t){return He(t,Ye)},Ke=a,Ge=i,We=Ze,$e=ye,qe=s,Xe=E,Je=v,Qe=Object.assign,tn=Object.defineProperty,en=!Qe||Ge((function(){if(Ke&&1!==Qe({b:1},Qe(tn({},"a",{enumerable:!0,get:function(){tn(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),u="abcdefghijklmnopqrst";return t[n]=7,u.split("").forEach((function(t){e[t]=t})),7!=Qe({},t)[n]||We(Qe({},e)).join("")!=u}))?function(t,e){for(var n=Xe(t),u=arguments.length,r=1,i=$e.f,a=qe.f;u>r;)for(var s,o=Je(arguments[r++]),l=i?We(o).concat(i(o)):We(o),h=l.length,c=0;h>c;)s=l[c++],Ke&&!a.call(o,s)||(n[s]=o[s]);return n}:Qe;Ue({target:"Object",stat:!0,forced:Object.assign!==en},{assign:en});var nn=Jt,un=g,rn=function(t){var e=String(un(this)),n="",u=nn(t);if(u<0||u==1/0)throw RangeError("Wrong number of repetitions");for(;u>0;(u>>>=1)&&(e+=e))1&u&&(n+=e);return n};Ue({target:"String",proto:!0},{repeat:rn});var an=ee,sn=rn,on=g,ln=Math.ceil,hn=function(t){return function(e,n,u){var r,i,a=String(on(e)),s=a.length,o=void 0===u?" ":String(u),l=an(n);return l<=s||""==o?a:(r=l-s,(i=sn.call(o,ln(r/o.length))).length>r&&(i=i.slice(0,r)),t?a+i:i+a)}},cn={start:hn(!1),end:hn(!0)},fn=Wt("navigator","userAgent")||"",pn=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(fn),dn=cn.start;Ue({target:"String",proto:!0,forced:pn},{padStart:function(t){return dn(this,t,arguments.length>1?arguments[1]:void 0)}});var vn=cn.end;function gn(t){return(gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yn(t,e){for(var n=0;n<e.length;n++){var u=e[n];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(t,u.key,u)}}function mn(t,e,n){return e&&yn(t.prototype,e),n&&yn(t,n),t}function _n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&bn(t,e)}function An(t){return(An=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function bn(t,e){return(bn=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Cn(t,e){if(null==t)return{};var n,u,r=function(t,e){if(null==t)return{};var n,u,r={},i=Object.keys(t);for(u=0;u<i.length;u++)n=i[u],e.indexOf(n)>=0||(r[n]=t[n]);return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(u=0;u<i.length;u++)n=i[u],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function En(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Fn(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,u=An(t);if(e){var r=An(this).constructor;n=Reflect.construct(u,arguments,r)}else n=u.apply(this,arguments);return En(this,n)}}function Sn(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=An(t)););return t}function Dn(t,e,n){return(Dn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var u=Sn(t,e);if(u){var r=Object.getOwnPropertyDescriptor(u,e);return r.get?r.get.call(n):r.value}})(t,e,n||t)}function Bn(t,e,n,u){return(Bn="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,n,u){var r,i=Sn(t,e);if(i){if((r=Object.getOwnPropertyDescriptor(i,e)).set)return r.set.call(u,n),!0;if(!r.writable)return!1}if(r=Object.getOwnPropertyDescriptor(u,e)){if(!r.writable)return!1;r.value=n,Object.defineProperty(u,e,r)}else!function(t,e,n){e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(u,e,n);return!0})(t,e,n,u)}function wn(t,e,n,u,r){if(!Bn(t,e,n,u||t)&&r)throw new Error("failed to set property");return n}function Mn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var u,r,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(u=n.next()).done)&&(i.push(u.value),!e||i.length!==e);a=!0);}catch(t){s=!0,r=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw r}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return xn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return xn(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,u=new Array(e);n<e;n++)u[n]=t[n];return u}function Pn(t){return"string"==typeof t||t instanceof String}Ue({target:"String",proto:!0,forced:pn},{padEnd:function(t){return vn(this,t,arguments.length>1?arguments[1]:void 0)}}),Ue({global:!0},{globalThis:u});var On="NONE",Tn="LEFT",In="FORCE_LEFT",jn="RIGHT",Vn="FORCE_RIGHT";function Rn(t){switch(t){case Tn:return In;case jn:return Vn;default:return t}}function Ln(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function Nn(t,e){if(e===t)return!0;var n,u=Array.isArray(e),r=Array.isArray(t);if(u&&r){if(e.length!=t.length)return!1;for(n=0;n<e.length;n++)if(!Nn(e[n],t[n]))return!1;return!0}if(u!=r)return!1;if(e&&t&&"object"===gn(e)&&"object"===gn(t)){var i=e instanceof Date,a=t instanceof Date;if(i&&a)return e.getTime()==t.getTime();if(i!=a)return!1;var s=e instanceof RegExp,o=t instanceof RegExp;if(s&&o)return e.toString()==t.toString();if(s!=o)return!1;var l=Object.keys(e);for(n=0;n<l.length;n++)if(!Object.prototype.hasOwnProperty.call(t,l[n]))return!1;for(n=0;n<l.length;n++)if(!Nn(t[l[n]],e[l[n]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}var zn=function(){function t(e,n,u,r){for(kn(this,t),this.value=e,this.cursorPos=n,this.oldValue=u,this.oldSelection=r;this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}return mn(t,[{key:"startChangePos",get:function(){return Math.min(this.cursorPos,this.oldSelection.start)}},{key:"insertedCount",get:function(){return this.cursorPos-this.startChangePos}},{key:"inserted",get:function(){return this.value.substr(this.startChangePos,this.insertedCount)}},{key:"removedCount",get:function(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}},{key:"removed",get:function(){return this.oldValue.substr(this.startChangePos,this.removedCount)}},{key:"head",get:function(){return this.value.substring(0,this.startChangePos)}},{key:"tail",get:function(){return this.value.substring(this.startChangePos+this.insertedCount)}},{key:"removeDirection",get:function(){return!this.removedCount||this.insertedCount?On:this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos?jn:Tn}}]),t}(),Un=function(){function t(e){kn(this,t),Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}return mn(t,[{key:"aggregate",value:function(t){return this.rawInserted+=t.rawInserted,this.skip=this.skip||t.skip,this.inserted+=t.inserted,this.tailShift+=t.tailShift,this}},{key:"offset",get:function(){return this.tailShift+this.inserted.length}}]),t}(),Hn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=arguments.length>2?arguments[2]:void 0;kn(this,t),this.value=e,this.from=n,this.stop=u}return mn(t,[{key:"toString",value:function(){return this.value}},{key:"extend",value:function(t){this.value+=String(t)}},{key:"appendTo",value:function(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}},{key:"state",get:function(){return{value:this.value,from:this.from,stop:this.stop}},set:function(t){Object.assign(this,t)}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.value.length)return"";var e=this.value[0];return this.value=this.value.slice(1),e}}]),t}();function Yn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Yn.InputMask(t,e)}var Zn=function(){function t(e){kn(this,t),this._value="",this._update(Object.assign({},t.DEFAULTS,e)),this.isInitialized=!0}return mn(t,[{key:"updateOptions",value:function(t){Object.keys(t).length&&this.withValueRefresh(this._update.bind(this,t))}},{key:"_update",value:function(t){Object.assign(this,t)}},{key:"state",get:function(){return{_value:this.value}},set:function(t){this._value=t._value}},{key:"reset",value:function(){this._value=""}},{key:"value",get:function(){return this._value},set:function(t){this.resolve(t)}},{key:"resolve",value:function(t){return this.reset(),this.append(t,{input:!0},""),this.doCommit(),this.value}},{key:"unmaskedValue",get:function(){return this.value},set:function(t){this.reset(),this.append(t,{},""),this.doCommit()}},{key:"typedValue",get:function(){return this.doParse(this.value)},set:function(t){this.value=this.doFormat(t)}},{key:"rawInputValue",get:function(){return this.extractInput(0,this.value.length,{raw:!0})},set:function(t){this.reset(),this.append(t,{raw:!0},""),this.doCommit()}},{key:"isComplete",get:function(){return!0}},{key:"nearestInputPos",value:function(t,e){return t}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this.value.slice(t,e)}},{key:"extractTail",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return new Hn(this.extractInput(t,e),t)}},{key:"appendTail",value:function(t){return Pn(t)&&(t=new Hn(String(t))),t.appendTo(this)}},{key:"_appendCharRaw",value:function(t){return t?(this._value+=t,new Un({inserted:t,rawInserted:t})):new Un}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,u=this.state,r=this._appendCharRaw(this.doPrepare(t,e),e);if(r.inserted){var i,a=!1!==this.doValidate(e);if(a&&null!=n){var s=this.state;this.overwrite&&(i=n.state,n.shiftBefore(this.value.length));var o=this.appendTail(n);(a=o.rawInserted===n.toString())&&o.inserted&&(this.state=s)}a||(r=new Un,this.state=u,n&&i&&(n.state=i))}return r}},{key:"_appendPlaceholder",value:function(){return new Un}},{key:"append",value:function(t,e,n){if(!Pn(t))throw new Error("value should be string");var u=new Un,r=Pn(n)?new Hn(String(n)):n;e&&e.tail&&(e._beforeTailState=this.state);for(var i=0;i<t.length;++i)u.aggregate(this._appendChar(t[i],e,r));return null!=r&&(u.tailShift+=this.appendTail(r).tailShift),u}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return this._value=this.value.slice(0,t)+this.value.slice(e),new Un}},{key:"withValueRefresh",value:function(t){if(this._refreshing||!this.isInitialized)return t();this._refreshing=!0;var e=this.rawInputValue,n=this.value,u=t();return this.rawInputValue=e,this.value&&this.value!==n&&0===n.indexOf(this.value)&&this.append(n.slice(this.value.length),{},""),delete this._refreshing,u}},{key:"runIsolated",value:function(t){if(this._isolated||!this.isInitialized)return t(this);this._isolated=!0;var e=this.state,n=t(this);return this.state=e,delete this._isolated,n}},{key:"doPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.prepare?this.prepare(t,this,e):t}},{key:"doValidate",value:function(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}},{key:"doCommit",value:function(){this.commit&&this.commit(this.value,this)}},{key:"doFormat",value:function(t){return this.format?this.format(t,this):t}},{key:"doParse",value:function(t){return this.parse?this.parse(t,this):t}},{key:"splice",value:function(t,e,n,u){var r=t+e,i=this.extractTail(r),a=this.nearestInputPos(t,u);return new Un({tailShift:a-t}).aggregate(this.remove(a)).aggregate(this.append(n,{input:!0},i))}}]),t}();function Kn(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?Yn.MaskedRegExp:Pn(t)?Yn.MaskedPattern:t instanceof Date||t===Date?Yn.MaskedDate:t instanceof Number||"number"==typeof t||t===Number?Yn.MaskedNumber:Array.isArray(t)||t===Array?Yn.MaskedDynamic:Yn.Masked&&t.prototype instanceof Yn.Masked?t:t instanceof Function?Yn.MaskedFunction:t instanceof Yn.Masked?t.constructor:(console.warn("Mask not found for mask",t),Yn.Masked)}function Gn(t){if(Yn.Masked&&t instanceof Yn.Masked)return t;var e=(t=Object.assign({},t)).mask;if(Yn.Masked&&e instanceof Yn.Masked)return e;var n=Kn(e);if(!n)throw new Error("Masked class is not found for provided mask, appropriate module needs to be import manually before creating mask.");return new n(t)}Zn.DEFAULTS={format:function(t){return t},parse:function(t){return t}},Yn.Masked=Zn,Yn.createMask=Gn;var Wn=["mask"],$n={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]/,"*":/./},qn=function(){function t(e){kn(this,t);var n=e.mask,u=Cn(e,Wn);this.masked=Gn({mask:n}),Object.assign(this,u)}return mn(t,[{key:"reset",value:function(){this._isFilled=!1,this.masked.reset()}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length;return 0===t&&e>=1?(this._isFilled=!1,this.masked.remove(t,e)):new Un}},{key:"value",get:function(){return this.masked.value||(this._isFilled&&!this.isOptional?this.placeholderChar:"")}},{key:"unmaskedValue",get:function(){return this.masked.unmaskedValue}},{key:"isComplete",get:function(){return Boolean(this.masked.value)||this.isOptional}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._isFilled)return new Un;var n=this.masked.state,u=this.masked._appendChar(t,e);return u.inserted&&!1===this.doValidate(e)&&(u.inserted=u.rawInserted="",this.masked.state=n),u.inserted||this.isOptional||this.lazy||e.input||(u.inserted=this.placeholderChar),u.skip=!u.inserted&&!this.isOptional,this._isFilled=Boolean(u.inserted),u}},{key:"append",value:function(){var t;return(t=this.masked).append.apply(t,arguments)}},{key:"_appendPlaceholder",value:function(){var t=new Un;return this._isFilled||this.isOptional||(this._isFilled=!0,t.inserted=this.placeholderChar),t}},{key:"extractTail",value:function(){var t;return(t=this.masked).extractTail.apply(t,arguments)}},{key:"appendTail",value:function(){var t;return(t=this.masked).appendTail.apply(t,arguments)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0;return this.masked.extractInput(t,e,n)}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:On,n=0,u=this.value.length,r=Math.min(Math.max(t,n),u);switch(e){case Tn:case In:return this.isComplete?r:n;case jn:case Vn:return this.isComplete?r:u;case On:default:return r}}},{key:"doValidate",value:function(){var t,e;return(t=this.masked).doValidate.apply(t,arguments)&&(!this.parent||(e=this.parent).doValidate.apply(e,arguments))}},{key:"doCommit",value:function(){this.masked.doCommit()}},{key:"state",get:function(){return{masked:this.masked.state,_isFilled:this._isFilled}},set:function(t){this.masked.state=t.masked,this._isFilled=t._isFilled}}]),t}(),Xn=function(){function t(e){kn(this,t),Object.assign(this,e),this._value=""}return mn(t,[{key:"value",get:function(){return this._value}},{key:"unmaskedValue",get:function(){return this.isUnmasking?this.value:""}},{key:"reset",value:function(){this._isRawInput=!1,this._value=""}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length;return this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new Un}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:On,n=0,u=this._value.length;switch(e){case Tn:case In:return n;case On:case jn:case Vn:default:return u}}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this._value.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.raw&&this._isRawInput&&this._value.slice(t,e)||""}},{key:"isComplete",get:function(){return!0}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new Un;if(this._value)return n;var u=this.char===t[0],r=u&&(this.isUnmasking||e.input||e.raw)&&!e.tail;return r&&(n.rawInserted=this.char),this._value=n.inserted=this.char,this._isRawInput=r&&(e.raw||e.input),n}},{key:"_appendPlaceholder",value:function(){var t=new Un;return this._value||(this._value=t.inserted=this.char),t}},{key:"extractTail",value:function(){return arguments.length>1&&void 0!==arguments[1]||this.value.length,new Hn("")}},{key:"appendTail",value:function(t){return Pn(t)&&(t=new Hn(String(t))),t.appendTo(this)}},{key:"append",value:function(t,e,n){var u=this._appendChar(t,e);return null!=n&&(u.tailShift+=this.appendTail(n).tailShift),u}},{key:"doCommit",value:function(){}},{key:"state",get:function(){return{_value:this._value,_isRawInput:this._isRawInput}},set:function(t){Object.assign(this,t)}}]),t}(),Jn=["chunks"],Qn=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;kn(this,t),this.chunks=e,this.from=n}return mn(t,[{key:"toString",value:function(){return this.chunks.map(String).join("")}},{key:"extend",value:function(e){if(String(e)){Pn(e)&&(e=new Hn(String(e)));var n=this.chunks[this.chunks.length-1],u=n&&(n.stop===e.stop||null==e.stop)&&e.from===n.from+n.toString().length;if(e instanceof Hn)u?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof t){if(null==e.stop)for(var r;e.chunks.length&&null==e.chunks[0].stop;)(r=e.chunks.shift()).from+=e.from,this.extend(r);e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}}},{key:"appendTo",value:function(e){if(!(e instanceof Yn.MaskedPattern))return new Hn(this.toString()).appendTo(e);for(var n=new Un,u=0;u<this.chunks.length&&!n.skip;++u){var r=this.chunks[u],i=e._mapPosToBlock(e.value.length),a=r.stop,s=void 0;if(null!=a&&(!i||i.index<=a)&&((r instanceof t||e._stops.indexOf(a)>=0)&&n.aggregate(e._appendPlaceholder(a)),s=r instanceof t&&e._blocks[a]),s){var o=s.appendTail(r);o.skip=!1,n.aggregate(o),e._value+=o.inserted;var l=r.toString().slice(o.rawInserted.length);l&&n.aggregate(e.append(l,{tail:!0}))}else n.aggregate(e.append(r.toString(),{tail:!0}))}return n}},{key:"state",get:function(){return{chunks:this.chunks.map((function(t){return t.state})),from:this.from,stop:this.stop,blockIndex:this.blockIndex}},set:function(e){var n=e.chunks,u=Cn(e,Jn);Object.assign(this,u),this.chunks=n.map((function(e){var n="chunks"in e?new t:new Hn;return n.state=e,n}))}},{key:"shiftBefore",value:function(t){if(this.from>=t||!this.chunks.length)return"";for(var e=t-this.from,n=0;n<this.chunks.length;){var u=this.chunks[n],r=u.shiftBefore(e);if(u.toString()){if(!r)break;++n}else this.chunks.splice(n,1);if(r)return r}return""}}]),t}(),tu=function(t){_n(n,t);var e=Fn(n);function n(){return kn(this,n),e.apply(this,arguments)}return mn(n,[{key:"_update",value:function(t){t.mask&&(t.validate=function(e){return e.search(t.mask)>=0}),Dn(An(n.prototype),"_update",this).call(this,t)}}]),n}(Zn);Yn.MaskedRegExp=tu;var eu=["_blocks"],nu=function(t){_n(n,t);var e=Fn(n);function n(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return kn(this,n),t.definitions=Object.assign({},$n,t.definitions),e.call(this,Object.assign({},n.DEFAULTS,t))}return mn(n,[{key:"_update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.definitions=Object.assign({},this.definitions,t.definitions),Dn(An(n.prototype),"_update",this).call(this,t),this._rebuildMask()}},{key:"_rebuildMask",value:function(){var t=this,e=this.definitions;this._blocks=[],this._stops=[],this._maskedBlocks={};var u=this.mask;if(u&&e)for(var r=!1,i=!1,a=0;a<u.length;++a){if(this.blocks)if("continue"===function(){var e=u.slice(a),n=Object.keys(t.blocks).filter((function(t){return 0===e.indexOf(t)}));n.sort((function(t,e){return e.length-t.length}));var r=n[0];if(r){var i=Gn(Object.assign({parent:t,lazy:t.lazy,placeholderChar:t.placeholderChar,overwrite:t.overwrite},t.blocks[r]));return i&&(t._blocks.push(i),t._maskedBlocks[r]||(t._maskedBlocks[r]=[]),t._maskedBlocks[r].push(t._blocks.length-1)),a+=r.length-1,"continue"}}())continue;var s=u[a],o=s in e;if(s!==n.STOP_CHAR)if("{"!==s&&"}"!==s)if("["!==s&&"]"!==s){if(s===n.ESCAPE_CHAR){if(++a,!(s=u[a]))break;o=!1}var l=o?new qn({parent:this,lazy:this.lazy,placeholderChar:this.placeholderChar,mask:e[s],isOptional:i}):new Xn({char:s,isUnmasking:r});this._blocks.push(l)}else i=!i;else r=!r;else this._stops.push(this._blocks.length)}}},{key:"state",get:function(){return Object.assign({},Dn(An(n.prototype),"state",this),{_blocks:this._blocks.map((function(t){return t.state}))})},set:function(t){var e=t._blocks,u=Cn(t,eu);this._blocks.forEach((function(t,n){return t.state=e[n]})),wn(An(n.prototype),"state",u,this,!0)}},{key:"reset",value:function(){Dn(An(n.prototype),"reset",this).call(this),this._blocks.forEach((function(t){return t.reset()}))}},{key:"isComplete",get:function(){return this._blocks.every((function(t){return t.isComplete}))}},{key:"doCommit",value:function(){this._blocks.forEach((function(t){return t.doCommit()})),Dn(An(n.prototype),"doCommit",this).call(this)}},{key:"unmaskedValue",get:function(){return this._blocks.reduce((function(t,e){return t+e.unmaskedValue}),"")},set:function(t){wn(An(n.prototype),"unmaskedValue",t,this,!0)}},{key:"value",get:function(){return this._blocks.reduce((function(t,e){return t+e.value}),"")},set:function(t){wn(An(n.prototype),"value",t,this,!0)}},{key:"appendTail",value:function(t){return Dn(An(n.prototype),"appendTail",this).call(this,t).aggregate(this._appendPlaceholder())}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this._mapPosToBlock(this.value.length),u=new Un;if(!n)return u;for(var r=n.index;;++r){var i=this._blocks[r];if(!i)break;var a=i._appendChar(t,e),s=a.skip;if(u.aggregate(a),s||a.rawInserted)break}return u}},{key:"extractTail",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,u=new Qn;return e===n||this._forEachBlocksInRange(e,n,(function(e,n,r,i){var a=e.extractTail(r,i);a.stop=t._findStopBefore(n),a.from=t._blockStartPos(n),a instanceof Qn&&(a.blockIndex=n),u.extend(a)})),u}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t===e)return"";var u="";return this._forEachBlocksInRange(t,e,(function(t,e,r,i){u+=t.extractInput(r,i,n)})),u}},{key:"_findStopBefore",value:function(t){for(var e,n=0;n<this._stops.length;++n){var u=this._stops[n];if(!(u<=t))break;e=u}return e}},{key:"_appendPlaceholder",value:function(t){var e=this,n=new Un;if(this.lazy&&null==t)return n;var u=this._mapPosToBlock(this.value.length);if(!u)return n;var r=u.index,i=null!=t?t:this._blocks.length;return this._blocks.slice(r,i).forEach((function(u){if(!u.lazy||null!=t){var r=null!=u._blocks?[u._blocks.length]:[],i=u._appendPlaceholder.apply(u,r);e._value+=i.inserted,n.aggregate(i)}})),n}},{key:"_mapPosToBlock",value:function(t){for(var e="",n=0;n<this._blocks.length;++n){var u=this._blocks[n],r=e.length;if(t<=(e+=u.value).length)return{index:n,offset:t-r}}}},{key:"_blockStartPos",value:function(t){return this._blocks.slice(0,t).reduce((function(t,e){return t+e.value.length}),0)}},{key:"_forEachBlocksInRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=arguments.length>2?arguments[2]:void 0,u=this._mapPosToBlock(t);if(u){var r=this._mapPosToBlock(e),i=r&&u.index===r.index,a=u.offset,s=r&&i?r.offset:this._blocks[u.index].value.length;if(n(this._blocks[u.index],u.index,a,s),r&&!i){for(var o=u.index+1;o<r.index;++o)n(this._blocks[o],o,0,this._blocks[o].value.length);n(this._blocks[r.index],r.index,0,r.offset)}}}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,u=Dn(An(n.prototype),"remove",this).call(this,t,e);return this._forEachBlocksInRange(t,e,(function(t,e,n,r){u.aggregate(t.remove(n,r))})),u}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:On,n=this._mapPosToBlock(t)||{index:0,offset:0},u=n.offset,r=n.index,i=this._blocks[r];if(!i)return t;var a=u;0!==a&&a<i.value.length&&(a=i.nearestInputPos(u,Rn(e)));var s=a===i.value.length,o=0===a;if(!o&&!s)return this._blockStartPos(r)+a;var l=s?r+1:r;if(e===On){if(l>0){var h=l-1,c=this._blocks[h],f=c.nearestInputPos(0,On);if(!c.value.length||f!==c.value.length)return this._blockStartPos(l)}for(var p=l,d=p;d<this._blocks.length;++d){var v=this._blocks[d],g=v.nearestInputPos(0,On);if(!v.value.length||g!==v.value.length)return this._blockStartPos(d)+g}for(var k=l-1;k>=0;--k){var y=this._blocks[k],m=y.nearestInputPos(0,On);if(!y.value.length||m!==y.value.length)return this._blockStartPos(k)+y.value.length}return t}if(e===Tn||e===In){for(var _,A=l;A<this._blocks.length;++A)if(this._blocks[A].value){_=A;break}if(null!=_){var b=this._blocks[_],C=b.nearestInputPos(0,jn);if(0===C&&b.unmaskedValue.length)return this._blockStartPos(_)+C}for(var E,F=-1,S=l-1;S>=0;--S){var D=this._blocks[S],B=D.nearestInputPos(D.value.length,In);if(D.value&&0===B||(E=S),0!==B){if(B!==D.value.length)return this._blockStartPos(S)+B;F=S;break}}if(e===Tn)for(var w=F+1;w<=Math.min(l,this._blocks.length-1);++w){var M=this._blocks[w],x=M.nearestInputPos(0,On),P=this._blockStartPos(w)+x;if(P>t)break;if(x!==M.value.length)return P}if(F>=0)return this._blockStartPos(F)+this._blocks[F].value.length;if(e===In||this.lazy&&!this.extractInput()&&!uu(this._blocks[l]))return 0;if(null!=E)return this._blockStartPos(E);for(var O=l;O<this._blocks.length;++O){var T=this._blocks[O],I=T.nearestInputPos(0,On);if(!T.value.length||I!==T.value.length)return this._blockStartPos(O)+I}return 0}if(e===jn||e===Vn){for(var j,V,R=l;R<this._blocks.length;++R){var L=this._blocks[R],N=L.nearestInputPos(0,On);if(N!==L.value.length){V=this._blockStartPos(R)+N,j=R;break}}if(null!=j&&null!=V){for(var z=j;z<this._blocks.length;++z){var U=this._blocks[z],H=U.nearestInputPos(0,Vn);if(H!==U.value.length)return this._blockStartPos(z)+H}return e===Vn?this.value.length:V}for(var Y=Math.min(l,this._blocks.length-1);Y>=0;--Y){var Z=this._blocks[Y],K=Z.nearestInputPos(Z.value.length,Tn);if(0!==K){var G=this._blockStartPos(Y)+K;if(G>=t)return G;break}}}return t}},{key:"maskedBlock",value:function(t){return this.maskedBlocks(t)[0]}},{key:"maskedBlocks",value:function(t){var e=this,n=this._maskedBlocks[t];return n?n.map((function(t){return e._blocks[t]})):[]}}]),n}(Zn);function uu(t){if(!t)return!1;var e=t.value;return!e||t.nearestInputPos(0,On)!==e.length}nu.DEFAULTS={lazy:!0,placeholderChar:"_"},nu.STOP_CHAR="`",nu.ESCAPE_CHAR="\\",nu.InputDefinition=qn,nu.FixedDefinition=Xn,Yn.MaskedPattern=nu;var ru=function(t){_n(n,t);var e=Fn(n);function n(){return kn(this,n),e.apply(this,arguments)}return mn(n,[{key:"_matchFrom",get:function(){return this.maxLength-String(this.from).length}},{key:"_update",value:function(t){t=Object.assign({to:this.to||0,from:this.from||0},t);var e=String(t.to).length;null!=t.maxLength&&(e=Math.max(e,t.maxLength)),t.maxLength=e;for(var u=String(t.from).padStart(e,"0"),r=String(t.to).padStart(e,"0"),i=0;i<r.length&&r[i]===u[i];)++i;t.mask=r.slice(0,i).replace(/0/g,"\\0")+"0".repeat(e-i),Dn(An(n.prototype),"_update",this).call(this,t)}},{key:"isComplete",get:function(){return Dn(An(n.prototype),"isComplete",this)&&Boolean(this.value)}},{key:"boundaries",value:function(t){var e="",n="",u=Mn(t.match(/^(\D*)(\d*)(\D*)/)||[],3),r=u[1],i=u[2];return i&&(e="0".repeat(r.length)+i,n="9".repeat(r.length)+i),[e=e.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9")]}},{key:"doPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=Dn(An(n.prototype),"doPrepare",this).call(this,t,e).replace(/\D/g,""),!this.autofix)return t;for(var u=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0"),i=this.value,a="",s=0;s<t.length;++s){var o=i+a+t[s],l=this.boundaries(o),h=Mn(l,2),c=h[0],f=h[1];Number(f)<this.from?a+=u[o.length-1]:Number(c)>this.to?a+=r[o.length-1]:a+=t[s]}return a}},{key:"doValidate",value:function(){var t,e=this.value,u=e.search(/[^0]/);if(-1===u&&e.length<=this._matchFrom)return!0;for(var r=this.boundaries(e),i=Mn(r,2),a=i[0],s=i[1],o=arguments.length,l=new Array(o),h=0;h<o;h++)l[h]=arguments[h];return this.from<=Number(s)&&Number(a)<=this.to&&(t=Dn(An(n.prototype),"doValidate",this)).call.apply(t,[this].concat(l))}}]),n}(nu);Yn.MaskedRange=ru;var iu=function(t){_n(n,t);var e=Fn(n);function n(t){return kn(this,n),e.call(this,Object.assign({},n.DEFAULTS,t))}return mn(n,[{key:"_update",value:function(t){t.mask===Date&&delete t.mask,t.pattern&&(t.mask=t.pattern);var e=t.blocks;t.blocks=Object.assign({},n.GET_DEFAULT_BLOCKS()),t.min&&(t.blocks.Y.from=t.min.getFullYear()),t.max&&(t.blocks.Y.to=t.max.getFullYear()),t.min&&t.max&&t.blocks.Y.from===t.blocks.Y.to&&(t.blocks.m.from=t.min.getMonth()+1,t.blocks.m.to=t.max.getMonth()+1,t.blocks.m.from===t.blocks.m.to&&(t.blocks.d.from=t.min.getDate(),t.blocks.d.to=t.max.getDate())),Object.assign(t.blocks,e),Object.keys(t.blocks).forEach((function(e){var n=t.blocks[e];"autofix"in n||(n.autofix=t.autofix)})),Dn(An(n.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,e=this.date,u=arguments.length,r=new Array(u),i=0;i<u;i++)r[i]=arguments[i];return(t=Dn(An(n.prototype),"doValidate",this)).call.apply(t,[this].concat(r))&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}},{key:"isDateExist",value:function(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}},{key:"date",get:function(){return this.typedValue},set:function(t){this.typedValue=t}},{key:"typedValue",get:function(){return this.isComplete?Dn(An(n.prototype),"typedValue",this):null},set:function(t){wn(An(n.prototype),"typedValue",t,this,!0)}}]),n}(nu);iu.DEFAULTS={pattern:"d{.}`m{.}`Y",format:function(t){return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:function(t){var e=Mn(t.split("."),3),n=e[0],u=e[1],r=e[2];return new Date(r,u-1,n)}},iu.GET_DEFAULT_BLOCKS=function(){return{d:{mask:ru,from:1,to:31,maxLength:2},m:{mask:ru,from:1,to:12,maxLength:2},Y:{mask:ru,from:1900,to:9999}}},Yn.MaskedDate=iu;var au=function(){function t(){kn(this,t)}return mn(t,[{key:"selectionStart",get:function(){var t;try{t=this._unsafeSelectionStart}catch(t){}return null!=t?t:this.value.length}},{key:"selectionEnd",get:function(){var t;try{t=this._unsafeSelectionEnd}catch(t){}return null!=t?t:this.value.length}},{key:"select",value:function(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch(t){}}},{key:"_unsafeSelect",value:function(t,e){}},{key:"isActive",get:function(){return!1}},{key:"bindEvents",value:function(t){}},{key:"unbindEvents",value:function(){}}]),t}();Yn.MaskElement=au;var su=function(t){_n(n,t);var e=Fn(n);function n(t){var u;return kn(this,n),(u=e.call(this)).input=t,u._handlers={},u}return mn(n,[{key:"rootElement",get:function(){return this.input.getRootNode?this.input.getRootNode():document}},{key:"isActive",get:function(){return this.input===this.rootElement.activeElement}},{key:"_unsafeSelectionStart",get:function(){return this.input.selectionStart}},{key:"_unsafeSelectionEnd",get:function(){return this.input.selectionEnd}},{key:"_unsafeSelect",value:function(t,e){this.input.setSelectionRange(t,e)}},{key:"value",get:function(){return this.input.value},set:function(t){this.input.value=t}},{key:"bindEvents",value:function(t){var e=this;Object.keys(t).forEach((function(u){return e._toggleEventHandler(n.EVENTS_MAP[u],t[u])}))}},{key:"unbindEvents",value:function(){var t=this;Object.keys(this._handlers).forEach((function(e){return t._toggleEventHandler(e)}))}},{key:"_toggleEventHandler",value:function(t,e){this._handlers[t]&&(this.input.removeEventListener(t,this._handlers[t]),delete this._handlers[t]),e&&(this.input.addEventListener(t,e),this._handlers[t]=e)}}]),n}(au);su.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},Yn.HTMLMaskElement=su;var ou=function(t){_n(n,t);var e=Fn(n);function n(){return kn(this,n),e.apply(this,arguments)}return mn(n,[{key:"_unsafeSelectionStart",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection();return e&&e.anchorOffset}},{key:"_unsafeSelectionEnd",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection();return e&&this._unsafeSelectionStart+String(e).length}},{key:"_unsafeSelect",value:function(t,e){if(this.rootElement.createRange){var n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,t),n.setEnd(this.input.lastChild||this.input,e);var u=this.rootElement,r=u.getSelection&&u.getSelection();r&&(r.removeAllRanges(),r.addRange(n))}}},{key:"value",get:function(){return this.input.textContent},set:function(t){this.input.textContent=t}}]),n}(su);Yn.HTMLContenteditableMaskElement=ou;var lu=["mask"],hu=function(){function t(e,n){kn(this,t),this.el=e instanceof au?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new ou(e):new su(e),this.masked=Gn(n),this._listeners={},this._value="",this._unmaskedValue="",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.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}return mn(t,[{key:"mask",get:function(){return this.masked.mask},set:function(t){if(!this.maskEquals(t))if(t instanceof Yn.Masked||this.masked.constructor!==Kn(t)){var e=Gn({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}else this.masked.updateOptions({mask:t})}},{key:"maskEquals",value:function(t){return null==t||t===this.masked.mask||t===Date&&this.masked instanceof iu}},{key:"value",get:function(){return this._value},set:function(t){this.masked.value=t,this.updateControl(),this.alignCursor()}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.masked.unmaskedValue=t,this.updateControl(),this.alignCursor()}},{key:"typedValue",get:function(){return this.masked.typedValue},set:function(t){this.masked.typedValue=t,this.updateControl(),this.alignCursor()}},{key:"_bindEvents",value:function(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange})}},{key:"_unbindEvents",value:function(){this.el&&this.el.unbindEvents()}},{key:"_fireEvent",value:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),u=1;u<e;u++)n[u-1]=arguments[u];var r=this._listeners[t];r&&r.forEach((function(t){return t.apply(void 0,n)}))}},{key:"selectionStart",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}},{key:"cursorPos",get:function(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd},set:function(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}},{key:"_saveSelection",value:function(){this.value!==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}}},{key:"updateValue",value:function(){this.masked.value=this.el.value,this._value=this.masked.value}},{key:"updateControl",value:function(){var t=this.masked.unmaskedValue,e=this.masked.value,n=this.unmaskedValue!==t||this.value!==e;this._unmaskedValue=t,this._value=e,this.el.value!==e&&(this.el.value=e),n&&this._fireChangeEvents()}},{key:"updateOptions",value:function(t){var e=t.mask,n=Cn(t,lu),u=!this.maskEquals(e),r=!Nn(this.masked,n);u&&(this.mask=e),r&&this.masked.updateOptions(n),(u||r)&&this.updateControl()}},{key:"updateCursor",value:function(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}},{key:"_delayUpdateCursor",value:function(t){var e=this;this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout((function(){e.el&&(e.cursorPos=e._changingCursorPos,e._abortUpdateCursor())}),10)}},{key:"_fireChangeEvents",value:function(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}},{key:"_abortUpdateCursor",value:function(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}},{key:"alignCursor",value:function(){this.cursorPos=this.masked.nearestInputPos(this.cursorPos,Tn)}},{key:"alignCursorFriendly",value:function(){this.selectionStart===this.cursorPos&&this.alignCursor()}},{key:"on",value:function(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}},{key:"off",value:function(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;var n=this._listeners[t].indexOf(e);return n>=0&&this._listeners[t].splice(n,1),this}},{key:"_onInput",value:function(t){if(this._inputEvent=t,this._abortUpdateCursor(),!this._selection)return this.updateValue();var e=new zn(this.el.value,this.cursorPos,this.value,this._selection),n=this.masked.rawInputValue,u=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection).offset,r=n===this.masked.rawInputValue?e.removeDirection:On,i=this.masked.nearestInputPos(e.startChangePos+u,r);this.updateControl(),this.updateCursor(i),delete this._inputEvent}},{key:"_onChange",value:function(){this.value!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}},{key:"_onDrop",value:function(t){t.preventDefault(),t.stopPropagation()}},{key:"_onFocus",value:function(t){this.alignCursorFriendly()}},{key:"_onClick",value:function(t){this.alignCursorFriendly()}},{key:"destroy",value:function(){this._unbindEvents(),this._listeners.length=0,delete this.el}}]),t}();Yn.InputMask=hu;var cu=function(t){_n(n,t);var e=Fn(n);function n(){return kn(this,n),e.apply(this,arguments)}return mn(n,[{key:"_update",value:function(t){t.enum&&(t.mask="*".repeat(t.enum[0].length)),Dn(An(n.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,e=this,u=arguments.length,r=new Array(u),i=0;i<u;i++)r[i]=arguments[i];return this.enum.some((function(t){return t.indexOf(e.unmaskedValue)>=0}))&&(t=Dn(An(n.prototype),"doValidate",this)).call.apply(t,[this].concat(r))}}]),n}(nu);Yn.MaskedEnum=cu;var fu=function(t){_n(n,t);var e=Fn(n);function n(t){return kn(this,n),e.call(this,Object.assign({},n.DEFAULTS,t))}return mn(n,[{key:"_update",value:function(t){Dn(An(n.prototype),"_update",this).call(this,t),this._updateRegExps()}},{key:"_updateRegExps",value:function(){var t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+Ln(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExpInput=new RegExp(t+"(0|([1-9]+\\d*))?"+e),this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Ln).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Ln(this.thousandsSeparator),"g")}},{key:"_removeThousandsSeparators",value:function(t){return t.replace(this._thousandsSeparatorRegExp,"")}},{key:"_insertThousandsSeparators",value:function(t){var e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}},{key:"doPrepare",value:function(t){for(var e,u=arguments.length,r=new Array(u>1?u-1:0),i=1;i<u;i++)r[i-1]=arguments[i];return(e=Dn(An(n.prototype),"doPrepare",this)).call.apply(e,[this,this._removeThousandsSeparators(t.replace(this._mapToRadixRegExp,this.radix))].concat(r))}},{key:"_separatorsCount",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,u=0;u<t;++u)this._value.indexOf(this.thousandsSeparator,u)===u&&(++n,e&&(t+=this.thousandsSeparator.length));return n}},{key:"_separatorsCountFromSlice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._value;return this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}},{key:"extractInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,u=arguments.length>2?arguments[2]:void 0,r=this._adjustRangeWithSeparators(t,e),i=Mn(r,2);return t=i[0],e=i[1],this._removeThousandsSeparators(Dn(An(n.prototype),"extractInput",this).call(this,t,e,u))}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.thousandsSeparator)return Dn(An(n.prototype),"_appendCharRaw",this).call(this,t,e);var u=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(u);this._value=this._removeThousandsSeparators(this.value);var i=Dn(An(n.prototype),"_appendCharRaw",this).call(this,t,e);this._value=this._insertThousandsSeparators(this._value);var a=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(a);return i.tailShift+=(s-r)*this.thousandsSeparator.length,i.skip=!i.rawInserted&&t===this.thousandsSeparator,i}},{key:"_findSeparatorAround",value:function(t){if(this.thousandsSeparator){var e=t-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,e);if(n<=t)return n}return-1}},{key:"_adjustRangeWithSeparators",value:function(t,e){var n=this._findSeparatorAround(t);n>=0&&(t=n);var u=this._findSeparatorAround(e);return u>=0&&(e=u+this.thousandsSeparator.length),[t,e]}},{key:"remove",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.value.length,n=this._adjustRangeWithSeparators(t,e),u=Mn(n,2);t=u[0],e=u[1];var r=this.value.slice(0,t),i=this.value.slice(e),a=this._separatorsCount(r.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(r+i));var s=this._separatorsCountFromSlice(r);return new Un({tailShift:(s-a)*this.thousandsSeparator.length})}},{key:"nearestInputPos",value:function(t,e){if(!this.thousandsSeparator)return t;switch(e){case On:case Tn:case In:var n=this._findSeparatorAround(t-1);if(n>=0){var u=n+this.thousandsSeparator.length;if(t<u||this.value.length<=u||e===In)return n}break;case jn:case Vn:var r=this._findSeparatorAround(t);if(r>=0)return r+this.thousandsSeparator.length}return t}},{key:"doValidate",value:function(t){var e=(t.input?this._numberRegExpInput:this._numberRegExp).test(this._removeThousandsSeparators(this.value));if(e){var u=this.number;e=e&&!isNaN(u)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return e&&Dn(An(n.prototype),"doValidate",this).call(this,t)}},{key:"doCommit",value:function(){if(this.value){var t=this.number,e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=String(e));var u=this.value;this.normalizeZeros&&(u=this._normalizeZeros(u)),this.padFractionalZeros&&(u=this._padFractionalZeros(u)),this._value=u}Dn(An(n.prototype),"doCommit",this).call(this)}},{key:"_normalizeZeros",value:function(t){var e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,(function(t,e,n,u){return e+u})),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}},{key:"_padFractionalZeros",value:function(t){if(!t)return t;var e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}},{key:"unmaskedValue",get:function(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,".")},set:function(t){wn(An(n.prototype),"unmaskedValue",t.replace(".",this.radix),this,!0)}},{key:"typedValue",get:function(){return Number(this.unmaskedValue)},set:function(t){wn(An(n.prototype),"unmaskedValue",String(t),this,!0)}},{key:"number",get:function(){return this.typedValue},set:function(t){this.typedValue=t}},{key:"allowNegative",get:function(){return this.signed||null!=this.min&&this.min<0||null!=this.max&&this.max<0}}]),n}(Zn);fu.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,signed:!1,normalizeZeros:!0,padFractionalZeros:!1},Yn.MaskedNumber=fu;var pu=function(t){_n(n,t);var e=Fn(n);function n(){return kn(this,n),e.apply(this,arguments)}return mn(n,[{key:"_update",value:function(t){t.mask&&(t.validate=t.mask),Dn(An(n.prototype),"_update",this).call(this,t)}}]),n}(Zn);Yn.MaskedFunction=pu;var du=["compiledMasks","currentMaskRef","currentMask"],vu=function(t){_n(n,t);var e=Fn(n);function n(t){var u;return kn(this,n),(u=e.call(this,Object.assign({},n.DEFAULTS,t))).currentMask=null,u}return mn(n,[{key:"_update",value:function(t){Dn(An(n.prototype),"_update",this).call(this,t),"mask"in t&&(this.compiledMasks=Array.isArray(t.mask)?t.mask.map((function(t){return Gn(t)})):[])}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this._applyDispatch(t,e);return this.currentMask&&n.aggregate(this.currentMask._appendChar(t,e)),n}},{key:"_applyDispatch",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,u=this.rawInputValue,r=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:u,i=u.slice(r.length),a=this.currentMask,s=new Un,o=a&&a.state;if(this.currentMask=this.doDispatch(t,Object.assign({},e)),this.currentMask)if(this.currentMask!==a){if(this.currentMask.reset(),r){var l=this.currentMask.append(r,{raw:!0});s.tailShift=l.inserted.length-n.length}i&&(s.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)}else this.currentMask.state=o;return s}},{key:"_appendPlaceholder",value:function(){var t=this._applyDispatch.apply(this,arguments);return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}},{key:"doDispatch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.dispatch(t,this,e)}},{key:"doValidate",value:function(){for(var t,e,u=arguments.length,r=new Array(u),i=0;i<u;i++)r[i]=arguments[i];return(t=Dn(An(n.prototype),"doValidate",this)).call.apply(t,[this].concat(r))&&(!this.currentMask||(e=this.currentMask).doValidate.apply(e,r))}},{key:"reset",value:function(){this.currentMask&&this.currentMask.reset(),this.compiledMasks.forEach((function(t){return t.reset()}))}},{key:"value",get:function(){return this.currentMask?this.currentMask.value:""},set:function(t){wn(An(n.prototype),"value",t,this,!0)}},{key:"unmaskedValue",get:function(){return this.currentMask?this.currentMask.unmaskedValue:""},set:function(t){wn(An(n.prototype),"unmaskedValue",t,this,!0)}},{key:"typedValue",get:function(){return this.currentMask?this.currentMask.typedValue:""},set:function(t){var e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}},{key:"isComplete",get:function(){return!!this.currentMask&&this.currentMask.isComplete}},{key:"remove",value:function(){var t,e=new Un;this.currentMask&&e.aggregate((t=this.currentMask).remove.apply(t,arguments)).aggregate(this._applyDispatch());return e}},{key:"state",get:function(){return Object.assign({},Dn(An(n.prototype),"state",this),{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((function(t){return t.state})),currentMaskRef:this.currentMask,currentMask:this.currentMask&&this.currentMask.state})},set:function(t){var e=t.compiledMasks,u=t.currentMaskRef,r=t.currentMask,i=Cn(t,du);this.compiledMasks.forEach((function(t,n){return t.state=e[n]})),null!=u&&(this.currentMask=u,this.currentMask.state=r),wn(An(n.prototype),"state",i,this,!0)}},{key:"extractInput",value:function(){var t;return this.currentMask?(t=this.currentMask).extractInput.apply(t,arguments):""}},{key:"extractTail",value:function(){for(var t,e,u=arguments.length,r=new Array(u),i=0;i<u;i++)r[i]=arguments[i];return this.currentMask?(t=this.currentMask).extractTail.apply(t,r):(e=Dn(An(n.prototype),"extractTail",this)).call.apply(e,[this].concat(r))}},{key:"doCommit",value:function(){this.currentMask&&this.currentMask.doCommit(),Dn(An(n.prototype),"doCommit",this).call(this)}},{key:"nearestInputPos",value:function(){for(var t,e,u=arguments.length,r=new Array(u),i=0;i<u;i++)r[i]=arguments[i];return this.currentMask?(t=this.currentMask).nearestInputPos.apply(t,r):(e=Dn(An(n.prototype),"nearestInputPos",this)).call.apply(e,[this].concat(r))}},{key:"overwrite",get:function(){return this.currentMask?this.currentMask.overwrite:Dn(An(n.prototype),"overwrite",this)},set:function(t){console.warn('"overwrite" option is not available in dynamic mask, use this option in siblings')}}]),n}(Zn);vu.DEFAULTS={dispatch:function(t,e,n){if(e.compiledMasks.length){var u=e.rawInputValue,r=e.compiledMasks.map((function(e,r){return e.reset(),e.append(u,{raw:!0}),e.append(t,n),{weight:e.rawInputValue.length,index:r}}));return r.sort((function(t,e){return e.weight-t.weight})),e.compiledMasks[r[0].index]}}},Yn.MaskedDynamic=vu;var gu={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function ku(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gu.MASKED,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gu.MASKED,u=Gn(t);return function(t){return u.runIsolated((function(u){return u[e]=t,u[n]}))}}function yu(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),u=1;u<e;u++)n[u-1]=arguments[u];return ku.apply(void 0,n)(t)}Yn.PIPE_TYPE=gu,Yn.createPipe=ku,Yn.pipe=yu;try{globalThis.IMask=Yn}catch(t){}t.HTMLContenteditableMaskElement=ou,t.HTMLMaskElement=su,t.InputMask=hu,t.MaskElement=au,t.Masked=Zn,t.MaskedDate=iu,t.MaskedDynamic=vu,t.MaskedEnum=cu,t.MaskedFunction=pu,t.MaskedNumber=fu,t.MaskedPattern=nu,t.MaskedRange=ru,t.MaskedRegExp=tu,t.PIPE_TYPE=gu,t.createMask=Gn,t.createPipe=ku,t.default=Yn,t.pipe=yu,Object.defineProperty(t,"__esModule",{value:!0})})),ymaps.ready((function(){var t=new ymaps.Map("map",{center:[59.938635,30.323118],zoom:17},{searchControlProvider:"yandex#search"}),e=new ymaps.Placemark(t.getCenter(),{hintContent:"",balloonContent:"CatEnergy"},{iconLayout:"default#image",iconImageHref:"map-pin@2x.webp",iconImageSize:[57,53],iconImageOffset:[-15,-38]});t.geoObjects.add(e),t.behaviors.disable("scrollZoom")}));
  