Socket
Socket
Sign inDemoInstall

imask

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imask - npm Package Compare versions

Comparing version 6.4.3 to 6.5.0-alpha.0

esm/_rollupPluginBabelHelpers-30a49e9e.js

2

dist/imask.min.js

@@ -1,2 +0,2 @@

!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";function e(t){return e="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},e(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function u(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function o(t,e){if(null==t)return{};var n,i,u=function(t,e){if(null==t)return{};var n,i,u={},s=Object.keys(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)>=0||(u[n]=t[n]);return u}(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(i=0;i<s.length;i++)n=s[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(u[n]=t[n])}return u}function l(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(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,i=r(t);if(e){var u=r(this).constructor;n=Reflect.construct(i,arguments,u)}else n=i.apply(this,arguments);return l(this,n)}}function c(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=r(t)););return t}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=c(t,e);if(i){var u=Object.getOwnPropertyDescriptor(i,e);return u.get?u.get.call(arguments.length<3?t:n):u.value}},f.apply(this,arguments)}function p(t,e,n,i){return p="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,n,i){var u,s=c(t,e);if(s){if((u=Object.getOwnPropertyDescriptor(s,e)).set)return u.set.call(i,n),!0;if(!u.writable)return!1}if(u=Object.getOwnPropertyDescriptor(i,e)){if(!u.writable)return!1;u.value=n,Object.defineProperty(i,e,u)}else!function(t,e,n){e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(i,e,n);return!0},p(t,e,n,i)}function d(t,e,n,i,u){if(!p(t,e,n,i||t)&&u)throw new Error("failed to set property");return n}function v(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 i,u,s=[],r=!0,a=!1;try{for(n=n.call(t);!(r=(i=n.next()).done)&&(s.push(i.value),!e||s.length!==e);r=!0);}catch(t){a=!0,u=t}finally{try{r||null==n.return||n.return()}finally{if(a)throw u}}return s}(t,e)||k(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 k(t,e){if(t){if("string"==typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,e):void 0}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var y=function(){function t(e){n(this,t),Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}return u(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}();function m(t){return"string"==typeof t||t instanceof String}var _="NONE",A="LEFT",b="FORCE_LEFT",C="RIGHT",E="FORCE_RIGHT";function F(t){switch(t){case A:return b;case C:return E;default:return t}}function S(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function B(t){return Array.isArray(t)?t:[t,new y]}function D(t,n){if(n===t)return!0;var i,u=Array.isArray(n),s=Array.isArray(t);if(u&&s){if(n.length!=t.length)return!1;for(i=0;i<n.length;i++)if(!D(n[i],t[i]))return!1;return!0}if(u!=s)return!1;if(n&&t&&"object"===e(n)&&"object"===e(t)){var r=n instanceof Date,a=t instanceof Date;if(r&&a)return n.getTime()==t.getTime();if(r!=a)return!1;var o=n instanceof RegExp,l=t instanceof RegExp;if(o&&l)return n.toString()==t.toString();if(o!=l)return!1;var h=Object.keys(n);for(i=0;i<h.length;i++)if(!Object.prototype.hasOwnProperty.call(t,h[i]))return!1;for(i=0;i<h.length;i++)if(!D(t[h[i]],n[h[i]]))return!1;return!0}return!(!n||!t||"function"!=typeof n||"function"!=typeof t)&&n.toString()===t.toString()}var x=function(){function t(e,i,u,s){for(n(this,t),this.value=e,this.cursorPos=i,this.oldValue=u,this.oldSelection=s;this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}return u(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?_:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?A:C}}]),t}(),w=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=arguments.length>2?arguments[2]:void 0;n(this,t),this.value=e,this.from=i,this.stop=u}return u(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:"unshift",value:function(t){if(!this.value.length||null!=t&&this.from>=t)return"";var e=this.value[0];return this.value=this.value.slice(1),e}},{key:"shift",value:function(){if(!this.value.length)return"";var t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}]),t}();function M(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new M.InputMask(t,e)}var P=function(){function t(e){n(this,t),this._value="",this._update(Object.assign({},t.DEFAULTS,e)),this.isInitialized=!0}return u(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:"isFilled",get:function(){return this.isComplete}},{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 w(this.extractInput(t,e),t)}},{key:"appendTail",value:function(t){return m(t)&&(t=new w(String(t))),t.appendTo(this)}},{key:"_appendCharRaw",value:function(t){return t?(this._value+=t,new y({inserted:t,rawInserted:t})):new y}},{key:"_appendChar",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,u=this.state,s=B(this.doPrepare(t,n)),r=v(s,2);if(t=r[0],(e=(e=r[1]).aggregate(this._appendCharRaw(t,n))).inserted){var a,o=!1!==this.doValidate(n);if(o&&null!=i){var l=this.state;!0===this.overwrite&&(a=i.state,i.unshift(this.value.length));var h=this.appendTail(i);(o=h.rawInserted===i.toString())&&h.inserted||"shift"!==this.overwrite||(this.state=l,a=i.state,i.shift(),o=(h=this.appendTail(i)).rawInserted===i.toString()),o&&h.inserted&&(this.state=l)}o||(e=new y,this.state=u,i&&a&&(i.state=a))}return e}},{key:"_appendPlaceholder",value:function(){return new y}},{key:"_appendEager",value:function(){return new y}},{key:"append",value:function(t,e,n){if(!m(t))throw new Error("value should be string");var i=new y,u=m(n)?new w(String(n)):n;null!=e&&e.tail&&(e._beforeTailState=this.state);for(var s=0;s<t.length;++s)i.aggregate(this._appendChar(t[s],e,u));return null!=u&&(i.tailShift+=this.appendTail(u).tailShift),this.eager&&null!=e&&e.input&&t&&i.aggregate(this._appendEager()),i}},{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 y}},{key:"withValueRefresh",value:function(t){if(this._refreshing||!this.isInitialized)return t();this._refreshing=!0;var e=this.rawInputValue,n=this.value,i=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,i}},{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,i){var u,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{input:!0},r=t+e,a=this.extractTail(r);this.eager&&(i=F(i),u=this.extractInput(0,r,{raw:!0}));var o=this.nearestInputPos(t,e>1&&0!==t&&!this.eager?_:i),l=new y({tailShift:o-t}).aggregate(this.remove(o));if(this.eager&&i!==_&&u===this.rawInputValue)if(i===b)for(var h;u===this.rawInputValue&&(h=this.value.length);)l.aggregate(new y({tailShift:-1})).aggregate(this.remove(h-1));else i===E&&a.unshift();return l.aggregate(this.append(n,s,a))}},{key:"maskEquals",value:function(t){return this.mask===t}},{key:"typedValueEquals",value:function(e){var n=this.typedValue;return e===n||t.EMPTY_VALUES.includes(e)&&t.EMPTY_VALUES.includes(n)||this.doFormat(e)===this.doFormat(this.typedValue)}}]),t}();function T(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?M.MaskedRegExp:m(t)?M.MaskedPattern:t instanceof Date||t===Date?M.MaskedDate:t instanceof Number||"number"==typeof t||t===Number?M.MaskedNumber:Array.isArray(t)||t===Array?M.MaskedDynamic:M.Masked&&t.prototype instanceof M.Masked?t:t instanceof M.Masked?t.constructor:t instanceof Function?M.MaskedFunction:(console.warn("Mask not found for mask",t),M.Masked)}function I(t){if(M.Masked&&t instanceof M.Masked)return t;var e=(t=Object.assign({},t)).mask;if(M.Masked&&e instanceof M.Masked)return e;var n=T(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)}P.DEFAULTS={format:function(t){return t},parse:function(t){return t}},P.EMPTY_VALUES=[void 0,null,""],M.Masked=P,M.createMask=I;var V=["mask"],O={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]/,"*":/./},R=function(){function t(e){n(this,t);var i=e.mask,u=o(e,V);this.masked=I({mask:i}),Object.assign(this,u)}return u(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 y}},{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 y;var n=this.masked.state,i=this.masked._appendChar(t,e);return i.inserted&&!1===this.doValidate(e)&&(i.inserted=i.rawInserted="",this.masked.state=n),i.inserted||this.isOptional||this.lazy||e.input||(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=Boolean(i.inserted),i}},{key:"append",value:function(){var t;return(t=this.masked).append.apply(t,arguments)}},{key:"_appendPlaceholder",value:function(){var t=new y;return this.isFilled||this.isOptional||(this.isFilled=!0,t.inserted=this.placeholderChar),t}},{key:"_appendEager",value:function(){return new y}},{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]:_,n=0,i=this.value.length,u=Math.min(Math.max(t,n),i);switch(e){case A:case b:return this.isComplete?u:n;case C:case E:return this.isComplete?u:i;default:return u}}},{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}(),j=function(){function t(e){n(this,t),Object.assign(this,e),this._value="",this.isFixed=!0}return u(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 y}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_,n=0,i=this._value.length;switch(e){case A:case b:return n;default:return i}}},{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:"isFilled",get:function(){return Boolean(this._value)}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new y;if(this._value)return n;var i=this.char===t,u=i&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!this.eager)&&!e.tail;return u&&(n.rawInserted=this.char),this._value=n.inserted=this.char,this._isRawInput=u&&(e.raw||e.input),n}},{key:"_appendEager",value:function(){return this._appendChar(this.char,{tail:!0})}},{key:"_appendPlaceholder",value:function(){var t=new y;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 w("")}},{key:"appendTail",value:function(t){return m(t)&&(t=new w(String(t))),t.appendTo(this)}},{key:"append",value:function(t,e,n){var i=this._appendChar(t[0],e);return null!=n&&(i.tailShift+=this.appendTail(n).tailShift),i}},{key:"doCommit",value:function(){}},{key:"state",get:function(){return{_value:this._value,_isRawInput:this._isRawInput}},set:function(t){Object.assign(this,t)}}]),t}(),L=["chunks"],U=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;n(this,t),this.chunks=e,this.from=i}return u(t,[{key:"toString",value:function(){return this.chunks.map(String).join("")}},{key:"extend",value:function(e){if(String(e)){m(e)&&(e=new w(String(e)));var n=this.chunks[this.chunks.length-1],i=n&&(n.stop===e.stop||null==e.stop)&&e.from===n.from+n.toString().length;if(e instanceof w)i?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof t){if(null==e.stop)for(var u;e.chunks.length&&null==e.chunks[0].stop;)(u=e.chunks.shift()).from+=e.from,this.extend(u);e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}}},{key:"appendTo",value:function(e){if(!(e instanceof M.MaskedPattern))return new w(this.toString()).appendTo(e);for(var n=new y,i=0;i<this.chunks.length&&!n.skip;++i){var u=this.chunks[i],s=e._mapPosToBlock(e.value.length),r=u.stop,a=void 0;if(null!=r&&(!s||s.index<=r)&&((u instanceof t||e._stops.indexOf(r)>=0)&&n.aggregate(e._appendPlaceholder(r)),a=u instanceof t&&e._blocks[r]),a){var o=a.appendTail(u);o.skip=!1,n.aggregate(o),e._value+=o.inserted;var l=u.toString().slice(o.rawInserted.length);l&&n.aggregate(e.append(l,{tail:!0}))}else n.aggregate(e.append(u.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,i=o(e,L);Object.assign(this,i),this.chunks=n.map((function(e){var n="chunks"in e?new t:new w;return n.state=e,n}))}},{key:"unshift",value:function(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";for(var e=null!=t?t-this.from:t,n=0;n<this.chunks.length;){var i=this.chunks[n],u=i.unshift(e);if(i.toString()){if(!u)break;++n}else this.chunks.splice(n,1);if(u)return u}return""}},{key:"shift",value:function(){if(!this.chunks.length)return"";for(var t=this.chunks.length-1;0<=t;){var e=this.chunks[t],n=e.shift();if(e.toString()){if(!n)break;--t}else this.chunks.splice(t,1);if(n)return n}return""}}]),t}(),N=function(){function t(e,i){n(this,t),this.masked=e,this._log=[];var u=e._mapPosToBlock(i)||(i<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0}),s=u.offset,r=u.index;this.offset=s,this.index=r,this.ok=!1}return u(t,[{key:"block",get:function(){return this.masked._blocks[this.index]}},{key:"pos",get:function(){return this.masked._blockStartPos(this.index)+this.offset}},{key:"state",get:function(){return{index:this.index,offset:this.offset,ok:this.ok}},set:function(t){Object.assign(this,t)}},{key:"pushState",value:function(){this._log.push(this.state)}},{key:"popState",value:function(){var t=this._log.pop();return this.state=t,t}},{key:"bindBlock",value:function(){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.value.length))}},{key:"_pushLeft",value:function(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null===(e=this.block)||void 0===e?void 0:e.value.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}},{key:"_pushRight",value:function(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}},{key:"pushLeftBeforeFilled",value:function(){var t=this;return this._pushLeft((function(){if(!t.block.isFixed&&t.block.value)return t.offset=t.block.nearestInputPos(t.offset,b),0!==t.offset||void 0}))}},{key:"pushLeftBeforeInput",value:function(){var t=this;return this._pushLeft((function(){if(!t.block.isFixed)return t.offset=t.block.nearestInputPos(t.offset,A),!0}))}},{key:"pushLeftBeforeRequired",value:function(){var t=this;return this._pushLeft((function(){if(!(t.block.isFixed||t.block.isOptional&&!t.block.value))return t.offset=t.block.nearestInputPos(t.offset,A),!0}))}},{key:"pushRightBeforeFilled",value:function(){var t=this;return this._pushRight((function(){if(!t.block.isFixed&&t.block.value)return t.offset=t.block.nearestInputPos(t.offset,E),t.offset!==t.block.value.length||void 0}))}},{key:"pushRightBeforeInput",value:function(){var t=this;return this._pushRight((function(){if(!t.block.isFixed)return t.offset=t.block.nearestInputPos(t.offset,_),!0}))}},{key:"pushRightBeforeRequired",value:function(){var t=this;return this._pushRight((function(){if(!(t.block.isFixed||t.block.isOptional&&!t.block.value))return t.offset=t.block.nearestInputPos(t.offset,_),!0}))}}]),t}(),q=function(t){s(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{key:"_update",value:function(t){t.mask&&(t.validate=function(e){return e.search(t.mask)>=0}),f(r(i.prototype),"_update",this).call(this,t)}}]),i}(P);M.MaskedRegExp=q;var Y=["_blocks"],z=function(t){s(i,t);var e=h(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,i),t.definitions=Object.assign({},O,t.definitions),e.call(this,Object.assign({},i.DEFAULTS,t))}return u(i,[{key:"_update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.definitions=Object.assign({},this.definitions,t.definitions),f(r(i.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 n=this.mask;if(n&&e)for(var u=!1,s=!1,r=0;r<n.length;++r){if(this.blocks)if("continue"===function(){var e=n.slice(r),i=Object.keys(t.blocks).filter((function(t){return 0===e.indexOf(t)}));i.sort((function(t,e){return e.length-t.length}));var u=i[0];if(u){var s=I(Object.assign({parent:t,lazy:t.lazy,eager:t.eager,placeholderChar:t.placeholderChar,overwrite:t.overwrite},t.blocks[u]));return s&&(t._blocks.push(s),t._maskedBlocks[u]||(t._maskedBlocks[u]=[]),t._maskedBlocks[u].push(t._blocks.length-1)),r+=u.length-1,"continue"}}())continue;var a=n[r],o=a in e;if(a!==i.STOP_CHAR)if("{"!==a&&"}"!==a)if("["!==a&&"]"!==a){if(a===i.ESCAPE_CHAR){if(++r,!(a=n[r]))break;o=!1}var l=o?new R({parent:this,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,mask:e[a],isOptional:s}):new j({char:a,eager:this.eager,isUnmasking:u});this._blocks.push(l)}else s=!s;else u=!u;else this._stops.push(this._blocks.length)}}},{key:"state",get:function(){return Object.assign({},f(r(i.prototype),"state",this),{_blocks:this._blocks.map((function(t){return t.state}))})},set:function(t){var e=t._blocks,n=o(t,Y);this._blocks.forEach((function(t,n){return t.state=e[n]})),d(r(i.prototype),"state",n,this,!0)}},{key:"reset",value:function(){f(r(i.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:"isFilled",get:function(){return this._blocks.every((function(t){return t.isFilled}))}},{key:"isFixed",get:function(){return this._blocks.every((function(t){return t.isFixed}))}},{key:"isOptional",get:function(){return this._blocks.every((function(t){return t.isOptional}))}},{key:"doCommit",value:function(){this._blocks.forEach((function(t){return t.doCommit()})),f(r(i.prototype),"doCommit",this).call(this)}},{key:"unmaskedValue",get:function(){return this._blocks.reduce((function(t,e){return t+e.unmaskedValue}),"")},set:function(t){d(r(i.prototype),"unmaskedValue",t,this,!0)}},{key:"value",get:function(){return this._blocks.reduce((function(t,e){return t+e.value}),"")},set:function(t){d(r(i.prototype),"value",t,this,!0)}},{key:"appendTail",value:function(t){return f(r(i.prototype),"appendTail",this).call(this,t).aggregate(this._appendPlaceholder())}},{key:"_appendEager",value:function(){var t,e=new y,n=null===(t=this._mapPosToBlock(this.value.length))||void 0===t?void 0:t.index;if(null==n)return e;this._blocks[n].isFilled&&++n;for(var i=n;i<this._blocks.length;++i){var u=this._blocks[i]._appendEager();if(!u.inserted)break;e.aggregate(u)}return e}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this._mapPosToBlock(this.value.length),i=new y;if(!n)return i;for(var u=n.index;;++u){var s,r,a=this._blocks[u];if(!a)break;var o=a._appendChar(t,Object.assign({},e,{_beforeTailState:null===(s=e._beforeTailState)||void 0===s||null===(r=s._blocks)||void 0===r?void 0:r[u]})),l=o.skip;if(i.aggregate(o),l||o.rawInserted)break}return i}},{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,i=new U;return e===n||this._forEachBlocksInRange(e,n,(function(e,n,u,s){var r=e.extractTail(u,s);r.stop=t._findStopBefore(n),r.from=t._blockStartPos(n),r instanceof U&&(r.blockIndex=n),i.extend(r)})),i}},{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 i="";return this._forEachBlocksInRange(t,e,(function(t,e,u,s){i+=t.extractInput(u,s,n)})),i}},{key:"_findStopBefore",value:function(t){for(var e,n=0;n<this._stops.length;++n){var i=this._stops[n];if(!(i<=t))break;e=i}return e}},{key:"_appendPlaceholder",value:function(t){var e=this,n=new y;if(this.lazy&&null==t)return n;var i=this._mapPosToBlock(this.value.length);if(!i)return n;var u=i.index,s=null!=t?t:this._blocks.length;return this._blocks.slice(u,s).forEach((function(i){if(!i.lazy||null!=t){var u=null!=i._blocks?[i._blocks.length]:[],s=i._appendPlaceholder.apply(i,u);e._value+=s.inserted,n.aggregate(s)}})),n}},{key:"_mapPosToBlock",value:function(t){for(var e="",n=0;n<this._blocks.length;++n){var i=this._blocks[n],u=e.length;if(t<=(e+=i.value).length)return{index:n,offset:t-u}}}},{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,i=this._mapPosToBlock(t);if(i){var u=this._mapPosToBlock(e),s=u&&i.index===u.index,r=i.offset,a=u&&s?u.offset:this._blocks[i.index].value.length;if(n(this._blocks[i.index],i.index,r,a),u&&!s){for(var o=i.index+1;o<u.index;++o)n(this._blocks[o],o,0,this._blocks[o].value.length);n(this._blocks[u.index],u.index,0,u.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,n=f(r(i.prototype),"remove",this).call(this,t,e);return this._forEachBlocksInRange(t,e,(function(t,e,i,u){n.aggregate(t.remove(i,u))})),n}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_;if(!this._blocks.length)return 0;var n=new N(this,t);if(e===_)return n.pushRightBeforeInput()?n.pos:(n.popState(),n.pushLeftBeforeInput()?n.pos:this.value.length);if(e===A||e===b){if(e===A){if(n.pushRightBeforeFilled(),n.ok&&n.pos===t)return t;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),e===A){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=t)return n.pos;if(n.popState(),n.ok&&n.pos<=t)return n.pos;n.popState()}return n.ok?n.pos:e===b?0:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:0))}return e===C||e===E?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:e===E?this.value.length:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:this.nearestInputPos(t,A)))):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]})):[]}}]),i}(P);z.DEFAULTS={lazy:!0,placeholderChar:"_"},z.STOP_CHAR="`",z.ESCAPE_CHAR="\\",z.InputDefinition=R,z.FixedDefinition=j,M.MaskedPattern=z;var H=function(t){s(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{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,maxLength:this.maxLength||0},t);var e=String(t.to).length;null!=t.maxLength&&(e=Math.max(e,t.maxLength)),t.maxLength=e;for(var n=String(t.from).padStart(e,"0"),u=String(t.to).padStart(e,"0"),s=0;s<u.length&&u[s]===n[s];)++s;t.mask=u.slice(0,s).replace(/0/g,"\\0")+"0".repeat(e-s),f(r(i.prototype),"_update",this).call(this,t)}},{key:"isComplete",get:function(){return f(r(i.prototype),"isComplete",this)&&Boolean(this.value)}},{key:"boundaries",value:function(t){var e="",n="",i=v(t.match(/^(\D*)(\d*)(\D*)/)||[],3),u=i[1],s=i[2];return s&&(e="0".repeat(u.length)+s,n="9".repeat(u.length)+s),[e=e.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9")]}},{key:"doPrepare",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=B(f(r(i.prototype),"doPrepare",this).call(this,t.replace(/\D/g,""),n)),s=v(u,2);if(t=s[0],e=s[1],!this.autofix||!t)return t;var a=String(this.from).padStart(this.maxLength,"0"),o=String(this.to).padStart(this.maxLength,"0"),l=this.value+t;if(l.length>this.maxLength)return"";var h=this.boundaries(l),c=v(h,2),p=c[0],d=c[1];return Number(d)<this.from?a[l.length-1]:Number(p)>this.to?"pad"===this.autofix&&l.length<this.maxLength?["",e.aggregate(this.append(a[l.length-1]+t,n))]:o[l.length-1]:t}},{key:"doValidate",value:function(){var t,e=this.value,n=e.search(/[^0]/);if(-1===n&&e.length<=this._matchFrom)return!0;for(var u=this.boundaries(e),s=v(u,2),a=s[0],o=s[1],l=arguments.length,h=new Array(l),c=0;c<l;c++)h[c]=arguments[c];return this.from<=Number(o)&&Number(a)<=this.to&&(t=f(r(i.prototype),"doValidate",this)).call.apply(t,[this].concat(h))}}]),i}(z);M.MaskedRange=H;var Z=function(t){s(i,t);var e=h(i);function i(t){return n(this,i),e.call(this,Object.assign({},i.DEFAULTS,t))}return u(i,[{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({},i.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,this.blocks,e),Object.keys(t.blocks).forEach((function(e){var n=t.blocks[e];!("autofix"in n)&&"autofix"in t&&(n.autofix=t.autofix)})),f(r(i.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,e=this.date,n=arguments.length,u=new Array(n),s=0;s<n;s++)u[s]=arguments[s];return(t=f(r(i.prototype),"doValidate",this)).call.apply(t,[this].concat(u))&&(!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?f(r(i.prototype),"typedValue",this):null},set:function(t){d(r(i.prototype),"typedValue",t,this,!0)}},{key:"maskEquals",value:function(t){return t===Date||f(r(i.prototype),"maskEquals",this).call(this,t)}}]),i}(z);Z.DEFAULTS={pattern:"d{.}`m{.}`Y",format:function(t){return t?[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join("."):""},parse:function(t){var e=v(t.split("."),3),n=e[0],i=e[1],u=e[2];return new Date(u,i-1,n)}},Z.GET_DEFAULT_BLOCKS=function(){return{d:{mask:H,from:1,to:31,maxLength:2},m:{mask:H,from:1,to:12,maxLength:2},Y:{mask:H,from:1900,to:9999}}},M.MaskedDate=Z;var K=function(){function t(){n(this,t)}return u(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}();M.MaskElement=K;var $=function(t){s(i,t);var e=h(i);function i(t){var u;return n(this,i),(u=e.call(this)).input=t,u._handlers={},u}return u(i,[{key:"rootElement",get:function(){var t,e,n;return null!==(t=null===(e=(n=this.input).getRootNode)||void 0===e?void 0:e.call(n))&&void 0!==t?t: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(n){return e._toggleEventHandler(i.EVENTS_MAP[n],t[n])}))}},{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)}}]),i}(K);$.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},M.HTMLMaskElement=$;var G=function(t){s(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{key:"_unsafeSelectionStart",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,i=e&&e.focusOffset;return null==i||null==n||n<i?n:i}},{key:"_unsafeSelectionEnd",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,i=e&&e.focusOffset;return null==i||null==n||n>i?n:i}},{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 i=this.rootElement,u=i.getSelection&&i.getSelection();u&&(u.removeAllRanges(),u.addRange(n))}}},{key:"value",get:function(){return this.input.textContent},set:function(t){this.input.textContent=t}}]),i}($);M.HTMLContenteditableMaskElement=G;var W=["mask"],X=function(){function t(e,i){n(this,t),this.el=e instanceof K?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new G(e):new $(e),this.masked=I(i),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 u(t,[{key:"mask",get:function(){return this.masked.mask},set:function(t){if(!this.maskEquals(t))if(t instanceof M.Masked||this.masked.constructor!==T(t)){var e=I({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}else this.masked.updateOptions({mask:t})}},{key:"maskEquals",value:function(t){var e;return null==t||(null===(e=this.masked)||void 0===e?void 0:e.maskEquals(t))}},{key:"value",get:function(){return this._value},set:function(t){this.value!==t&&(this.masked.value=t,this.updateControl(),this.alignCursor())}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl(),this.alignCursor())}},{key:"typedValue",get:function(){return this.masked.typedValue},set:function(t){this.masked.typedValueEquals(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),i=1;i<e;i++)n[i-1]=arguments[i];var u=this._listeners[t];u&&u.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=o(t,W),i=!this.maskEquals(e),u=!D(this.masked,n);i&&(this.mask=e),u&&this.masked.updateOptions(n),(i||u)&&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.masked.nearestInputPos(this.cursorPos,A))}},{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 x(this.el.value,this.cursorPos,this.value,this._selection),n=this.masked.rawInputValue,i=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,u=n===this.masked.rawInputValue?e.removeDirection:_,s=this.masked.nearestInputPos(e.startChangePos+i,u);u!==_&&(s=this.masked.nearestInputPos(s,_)),this.updateControl(),this.updateCursor(s),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}();M.InputMask=X;var J=function(t){s(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{key:"_update",value:function(t){t.enum&&(t.mask="*".repeat(t.enum[0].length)),f(r(i.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,e=this,n=arguments.length,u=new Array(n),s=0;s<n;s++)u[s]=arguments[s];return this.enum.some((function(t){return t.indexOf(e.unmaskedValue)>=0}))&&(t=f(r(i.prototype),"doValidate",this)).call.apply(t,[this].concat(u))}}]),i}(z);M.MaskedEnum=J;var Q,tt=function(t){s(i,t);var e=h(i);function i(t){return n(this,i),e.call(this,Object.assign({},i.DEFAULTS,t))}return u(i,[{key:"_update",value:function(t){f(r(i.prototype),"_update",this).call(this,t),this._updateRegExps()}},{key:"_updateRegExps",value:function(){var t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+S(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(S).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(S(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){var e;t=t.replace(this._mapToRadixRegExp,this.radix);for(var n=this._removeThousandsSeparators(t),u=arguments.length,s=new Array(u>1?u-1:0),a=1;a<u;a++)s[a-1]=arguments[a];var o=B((e=f(r(i.prototype),"doPrepare",this)).call.apply(e,[this,n].concat(s))),l=v(o,2),h=l[0],c=l[1];return t&&!n&&(c.skip=!0),[h,c]}},{key:"_separatorsCount",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++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,n=arguments.length>2?arguments[2]:void 0,u=this._adjustRangeWithSeparators(t,e),s=v(u,2);return t=s[0],e=s[1],this._removeThousandsSeparators(f(r(i.prototype),"extractInput",this).call(this,t,e,n))}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.thousandsSeparator)return f(r(i.prototype),"_appendCharRaw",this).call(this,t,e);var n=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,u=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);var s=f(r(i.prototype),"_appendCharRaw",this).call(this,t,e);this._value=this._insertThousandsSeparators(this._value);var a=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,o=this._separatorsCountFromSlice(a);return s.tailShift+=(o-u)*this.thousandsSeparator.length,s.skip=!s.rawInserted&&t===this.thousandsSeparator,s}},{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 i=this._findSeparatorAround(e);return i>=0&&(e=i+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),i=v(n,2);t=i[0],e=i[1];var u=this.value.slice(0,t),s=this.value.slice(e),r=this._separatorsCount(u.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(u+s));var a=this._separatorsCountFromSlice(u);return new y({tailShift:(a-r)*this.thousandsSeparator.length})}},{key:"nearestInputPos",value:function(t,e){if(!this.thousandsSeparator)return t;switch(e){case _:case A:case b:var n=this._findSeparatorAround(t-1);if(n>=0){var i=n+this.thousandsSeparator.length;if(t<i||this.value.length<=i||e===b)return n}break;case C:case E:var u=this._findSeparatorAround(t);if(u>=0)return u+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 n=this.number;e=e&&!isNaN(n)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return e&&f(r(i.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 n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}f(r(i.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,i){return e+i})),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){d(r(i.prototype),"unmaskedValue",t.replace(".",this.radix),this,!0)}},{key:"typedValue",get:function(){return Number(this.unmaskedValue)},set:function(t){d(r(i.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}},{key:"typedValueEquals",value:function(t){return(f(r(i.prototype),"typedValueEquals",this).call(this,t)||i.EMPTY_VALUES.includes(t)&&i.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}]),i}(P);tt.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,signed:!1,normalizeZeros:!0,padFractionalZeros:!1},tt.EMPTY_VALUES=[].concat(function(t){if(Array.isArray(t))return g(t)}(Q=P.EMPTY_VALUES)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(Q)||k(Q)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),M.MaskedNumber=tt;var et=function(t){s(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{key:"_update",value:function(t){t.mask&&(t.validate=t.mask),f(r(i.prototype),"_update",this).call(this,t)}}]),i}(P);M.MaskedFunction=et;var nt=["compiledMasks","currentMaskRef","currentMask"],it=function(t){s(i,t);var e=h(i);function i(t){var u;return n(this,i),(u=e.call(this,Object.assign({},i.DEFAULTS,t))).currentMask=null,u}return u(i,[{key:"_update",value:function(t){f(r(i.prototype),"_update",this).call(this,t),"mask"in t&&(this.compiledMasks=Array.isArray(t.mask)?t.mask.map((function(t){return I(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,this.currentMaskFlags(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,i=this.rawInputValue,u=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:i,s=i.slice(u.length),r=this.currentMask,a=new y,o=null==r?void 0:r.state;if(this.currentMask=this.doDispatch(t,Object.assign({},e)),this.currentMask)if(this.currentMask!==r){if(this.currentMask.reset(),u){var l=this.currentMask.append(u,{raw:!0});a.tailShift=l.inserted.length-n.length}s&&(a.tailShift+=this.currentMask.append(s,{raw:!0,tail:!0}).tailShift)}else this.currentMask.state=o;return a}},{key:"_appendPlaceholder",value:function(){var t=this._applyDispatch.apply(this,arguments);return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}},{key:"_appendEager",value:function(){var t=this._applyDispatch.apply(this,arguments);return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}},{key:"currentMaskFlags",value:function(t){var e,n;return Object.assign({},t,{_beforeTailState:(null===(e=t._beforeTailState)||void 0===e?void 0:e.currentMaskRef)===this.currentMask&&(null===(n=t._beforeTailState)||void 0===n?void 0:n.currentMask)||t._beforeTailState})}},{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(t){return f(r(i.prototype),"doValidate",this).call(this,t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}},{key:"doPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=B(f(r(i.prototype),"doPrepare",this).call(this,t,e)),u=v(n,2),s=u[0],a=u[1];if(this.currentMask){var o,l=B(f(r(i.prototype),"doPrepare",this).call(this,s,this.currentMaskFlags(e))),h=v(l,2);s=h[0],o=h[1],a=a.aggregate(o)}return[s,a]}},{key:"reset",value:function(){var t;null===(t=this.currentMask)||void 0===t||t.reset(),this.compiledMasks.forEach((function(t){return t.reset()}))}},{key:"value",get:function(){return this.currentMask?this.currentMask.value:""},set:function(t){d(r(i.prototype),"value",t,this,!0)}},{key:"unmaskedValue",get:function(){return this.currentMask?this.currentMask.unmaskedValue:""},set:function(t){d(r(i.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(){var t;return Boolean(null===(t=this.currentMask)||void 0===t?void 0:t.isComplete)}},{key:"isFilled",get:function(){var t;return Boolean(null===(t=this.currentMask)||void 0===t?void 0:t.isFilled)}},{key:"remove",value:function(){var t,e=new y;this.currentMask&&e.aggregate((t=this.currentMask).remove.apply(t,arguments)).aggregate(this._applyDispatch());return e}},{key:"state",get:function(){var t;return Object.assign({},f(r(i.prototype),"state",this),{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((function(t){return t.state})),currentMaskRef:this.currentMask,currentMask:null===(t=this.currentMask)||void 0===t?void 0:t.state})},set:function(t){var e=t.compiledMasks,n=t.currentMaskRef,u=t.currentMask,s=o(t,nt);this.compiledMasks.forEach((function(t,n){return t.state=e[n]})),null!=n&&(this.currentMask=n,this.currentMask.state=u),d(r(i.prototype),"state",s,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,n=arguments.length,u=new Array(n),s=0;s<n;s++)u[s]=arguments[s];return this.currentMask?(t=this.currentMask).extractTail.apply(t,u):(e=f(r(i.prototype),"extractTail",this)).call.apply(e,[this].concat(u))}},{key:"doCommit",value:function(){this.currentMask&&this.currentMask.doCommit(),f(r(i.prototype),"doCommit",this).call(this)}},{key:"nearestInputPos",value:function(){for(var t,e,n=arguments.length,u=new Array(n),s=0;s<n;s++)u[s]=arguments[s];return this.currentMask?(t=this.currentMask).nearestInputPos.apply(t,u):(e=f(r(i.prototype),"nearestInputPos",this)).call.apply(e,[this].concat(u))}},{key:"overwrite",get:function(){return this.currentMask?this.currentMask.overwrite:f(r(i.prototype),"overwrite",this)},set:function(t){console.warn('"overwrite" option is not available in dynamic mask, use this option in siblings')}},{key:"eager",get:function(){return this.currentMask?this.currentMask.eager:f(r(i.prototype),"eager",this)},set:function(t){console.warn('"eager" option is not available in dynamic mask, use this option in siblings')}},{key:"maskEquals",value:function(t){return Array.isArray(t)&&this.compiledMasks.every((function(e,n){var i;return e.maskEquals(null===(i=t[n])||void 0===i?void 0:i.mask)}))}},{key:"typedValueEquals",value:function(t){var e;return Boolean(null===(e=this.currentMask)||void 0===e?void 0:e.typedValueEquals(t))}}]),i}(P);it.DEFAULTS={dispatch:function(t,e,n){if(e.compiledMasks.length){var i=e.rawInputValue,u=e.compiledMasks.map((function(u,s){return u.reset(),u.append(i,{raw:!0}),u.append(t,e.currentMaskFlags(n)),{weight:u.rawInputValue.length,index:s}}));return u.sort((function(t,e){return e.weight-t.weight})),e.compiledMasks[u[0].index]}}},M.MaskedDynamic=it;var ut={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function st(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ut.MASKED,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ut.MASKED,i=I(t);return function(t){return i.runIsolated((function(i){return i[e]=t,i[n]}))}}function rt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return st.apply(void 0,n)(t)}M.PIPE_TYPE=ut,M.createPipe=st,M.pipe=rt;try{globalThis.IMask=M}catch(t){}t.HTMLContenteditableMaskElement=G,t.HTMLMaskElement=$,t.InputMask=X,t.MaskElement=K,t.Masked=P,t.MaskedDate=Z,t.MaskedDynamic=it,t.MaskedEnum=J,t.MaskedFunction=et,t.MaskedNumber=tt,t.MaskedPattern=z,t.MaskedRange=H,t.MaskedRegExp=q,t.PIPE_TYPE=ut,t.createMask=I,t.createPipe=st,t.default=M,t.pipe=rt,Object.defineProperty(t,"__esModule",{value:!0})}));
!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";function e(t){return e="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},e(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,y(i.key),i)}}function u(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a(t,e)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}function a(t,e){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},a(t,e)}function o(t,e){if(null==t)return{};var n,i,u=function(t,e){if(null==t)return{};var n,i,u={},r=Object.keys(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||(u[n]=t[n]);return u}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(u[n]=t[n])}return u}function l(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(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,i=s(t);if(e){var u=s(this).constructor;n=Reflect.construct(i,arguments,u)}else n=i.apply(this,arguments);return l(this,n)}}function c(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t}function f(){return f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=c(t,e);if(i){var u=Object.getOwnPropertyDescriptor(i,e);return u.get?u.get.call(arguments.length<3?t:n):u.value}},f.apply(this,arguments)}function p(t,e,n,i){return p="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,n,i){var u,r=c(t,e);if(r){if((u=Object.getOwnPropertyDescriptor(r,e)).set)return u.set.call(i,n),!0;if(!u.writable)return!1}if(u=Object.getOwnPropertyDescriptor(i,e)){if(!u.writable)return!1;u.value=n,Object.defineProperty(i,e,u)}else!function(t,e,n){(e=y(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}(i,e,n);return!0},p(t,e,n,i)}function d(t,e,n,i,u){if(!p(t,e,n,i||t)&&u)throw new TypeError("failed to set property");return n}function v(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){var i,u,r,s,a=[],o=!0,l=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;o=!1}else for(;!(o=(i=r.call(n)).done)&&(a.push(i.value),a.length!==e);o=!0);}catch(t){l=!0,u=t}finally{try{if(!o&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw u}}return a}}(t,e)||k(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 k(t,e){if(t){if("string"==typeof t)return g(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?g(t,e):void 0}}function g(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function y(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var m=function(){function t(e){n(this,t),Object.assign(this,{inserted:"",rawInserted:"",skip:!1,tailShift:0},e)}return u(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}();function _(t){return"string"==typeof t||t instanceof String}var E={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function A(t){return t.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function F(t){return Array.isArray(t)?t:[t,new m]}function C(t,n){if(n===t)return!0;var i,u=Array.isArray(n),r=Array.isArray(t);if(u&&r){if(n.length!=t.length)return!1;for(i=0;i<n.length;i++)if(!C(n[i],t[i]))return!1;return!0}if(u!=r)return!1;if(n&&t&&"object"===e(n)&&"object"===e(t)){var s=n instanceof Date,a=t instanceof Date;if(s&&a)return n.getTime()==t.getTime();if(s!=a)return!1;var o=n instanceof RegExp,l=t instanceof RegExp;if(o&&l)return n.toString()==t.toString();if(o!=l)return!1;var h=Object.keys(n);for(i=0;i<h.length;i++)if(!Object.prototype.hasOwnProperty.call(t,h[i]))return!1;for(i=0;i<h.length;i++)if(!C(t[h[i]],n[h[i]]))return!1;return!0}return!(!n||!t||"function"!=typeof n||"function"!=typeof t)&&n.toString()===t.toString()}var b=function(){function t(e,i,u,r){for(n(this,t),this.value=e,this.cursorPos=i,this.oldValue=u,this.oldSelection=r;this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start}return u(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?E.NONE:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?E.LEFT:E.RIGHT}}]),t}(),S=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,u=arguments.length>2?arguments[2]:void 0;n(this,t),this.value=e,this.from=i,this.stop=u}return u(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:"unshift",value:function(t){if(!this.value.length||null!=t&&this.from>=t)return"";var e=this.value[0];return this.value=this.value.slice(1),e}},{key:"shift",value:function(){if(!this.value.length)return"";var t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}]),t}();function B(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new B.InputMask(t,e)}var D=function(){function t(e){n(this,t),this._value="",this._update(Object.assign({},t.DEFAULTS,e)),this.isInitialized=!0}return u(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:"isFilled",get:function(){return this.isComplete}},{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 S(this.extractInput(t,e),t)}},{key:"appendTail",value:function(t){return _(t)&&(t=new S(String(t))),t.appendTo(this)}},{key:"_appendCharRaw",value:function(t){return t?(this._value+=t,new m({inserted:t,rawInserted:t})):new m}},{key:"_appendChar",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,u=this.state,r=v(F(this.doPrepare(t,n)),2);if(t=r[0],(e=(e=r[1]).aggregate(this._appendCharRaw(t,n))).inserted){var s,a=!1!==this.doValidate(n);if(a&&null!=i){var o=this.state;!0===this.overwrite&&(s=i.state,i.unshift(this.value.length-e.tailShift));var l=this.appendTail(i);(a=l.rawInserted===i.toString())&&l.inserted||"shift"!==this.overwrite||(this.state=o,s=i.state,i.shift(),a=(l=this.appendTail(i)).rawInserted===i.toString()),a&&l.inserted&&(this.state=o)}a||(e=new m,this.state=u,i&&s&&(i.state=s))}return e}},{key:"_appendPlaceholder",value:function(){return new m}},{key:"_appendEager",value:function(){return new m}},{key:"append",value:function(t,e,n){if(!_(t))throw new Error("value should be string");var i=new m,u=_(n)?new S(String(n)):n;null!=e&&e.tail&&(e._beforeTailState=this.state);for(var r=0;r<t.length;++r)i.aggregate(this._appendChar(t[r],e,u));return null!=u&&(i.tailShift+=this.appendTail(u).tailShift),this.eager&&null!=e&&e.input&&t&&i.aggregate(this._appendEager()),i}},{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 m}},{key:"withValueRefresh",value:function(t){if(this._refreshing||!this.isInitialized)return t();this._refreshing=!0;var e=this.rawInputValue,n=this.value,i=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,i}},{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,i){var u,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{input:!0},s=t+e,a=this.extractTail(s);this.eager&&(i=function(t){switch(t){case E.LEFT:return E.FORCE_LEFT;case E.RIGHT:return E.FORCE_RIGHT;default:return t}}(i),u=this.extractInput(0,s,{raw:!0}));var o=t,l=new m;if(i!==E.NONE&&(o=this.nearestInputPos(t,e>1&&0!==t&&!this.eager?E.NONE:i),l.tailShift=o-t),l.aggregate(this.remove(o)),this.eager&&i!==E.NONE&&u===this.rawInputValue)if(i===E.FORCE_LEFT)for(var h;u===this.rawInputValue&&(h=this.value.length);)l.aggregate(new m({tailShift:-1})).aggregate(this.remove(h-1));else i===E.FORCE_RIGHT&&a.unshift();return l.aggregate(this.append(n,r,a))}},{key:"maskEquals",value:function(t){return this.mask===t}},{key:"typedValueEquals",value:function(e){var n=this.typedValue;return e===n||t.EMPTY_VALUES.includes(e)&&t.EMPTY_VALUES.includes(n)||this.doFormat(e)===this.doFormat(this.typedValue)}}]),t}();function w(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?B.MaskedRegExp:_(t)?B.MaskedPattern:t instanceof Date||t===Date?B.MaskedDate:t instanceof Number||"number"==typeof t||t===Number?B.MaskedNumber:Array.isArray(t)||t===Array?B.MaskedDynamic:B.Masked&&t.prototype instanceof B.Masked?t:t instanceof B.Masked?t.constructor:t instanceof Function?B.MaskedFunction:(console.warn("Mask not found for mask",t),B.Masked)}function x(t){if(B.Masked&&t instanceof B.Masked)return t;var e=(t=Object.assign({},t)).mask;if(B.Masked&&e instanceof B.Masked)return e;var n=w(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)}D.DEFAULTS={format:function(t){return t},parse:function(t){return t}},D.EMPTY_VALUES=[void 0,null,""],B.Masked=D,B.createMask=x;var T=["mask"],M={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]/,"*":/./},O=function(){function t(e){n(this,t);var i=e.mask,u=o(e,T);this.masked=x({mask:i}),Object.assign(this,u)}return u(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 m}},{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 m;var n=this.masked.state,i=this.masked._appendChar(t,e);return i.inserted&&!1===this.doValidate(e)&&(i.inserted=i.rawInserted="",this.masked.state=n),i.inserted||this.isOptional||this.lazy||e.input||(i.inserted=this.placeholderChar),i.skip=!i.inserted&&!this.isOptional,this.isFilled=Boolean(i.inserted),i}},{key:"append",value:function(){var t;return(t=this.masked).append.apply(t,arguments)}},{key:"_appendPlaceholder",value:function(){var t=new m;return this.isFilled||this.isOptional||(this.isFilled=!0,t.inserted=this.placeholderChar),t}},{key:"_appendEager",value:function(){return new m}},{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]:E.NONE,n=this.value.length,i=Math.min(Math.max(t,0),n);switch(e){case E.LEFT:case E.FORCE_LEFT:return this.isComplete?i:0;case E.RIGHT:case E.FORCE_RIGHT:return this.isComplete?i:n;case E.NONE:default:return i}}},{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}(),R=function(){function t(e){n(this,t),Object.assign(this,e),this._value="",this.isFixed=!0}return u(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 m}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.NONE,n=this._value.length;switch(e){case E.LEFT:case E.FORCE_LEFT:return 0;case E.NONE:case E.RIGHT:case E.FORCE_RIGHT:default:return n}}},{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(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).raw&&this._isRawInput&&this._value.slice(t,e)||""}},{key:"isComplete",get:function(){return!0}},{key:"isFilled",get:function(){return Boolean(this._value)}},{key:"_appendChar",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new m;if(this._value)return n;var i=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!this.eager)&&!e.tail;return i&&(n.rawInserted=this.char),this._value=n.inserted=this.char,this._isRawInput=i&&(e.raw||e.input),n}},{key:"_appendEager",value:function(){return this._appendChar(this.char,{tail:!0})}},{key:"_appendPlaceholder",value:function(){var t=new m;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 S("")}},{key:"appendTail",value:function(t){return _(t)&&(t=new S(String(t))),t.appendTo(this)}},{key:"append",value:function(t,e,n){var i=this._appendChar(t[0],e);return null!=n&&(i.tailShift+=this.appendTail(n).tailShift),i}},{key:"doCommit",value:function(){}},{key:"state",get:function(){return{_value:this._value,_isRawInput:this._isRawInput}},set:function(t){Object.assign(this,t)}}]),t}(),P=["chunks"],I=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;n(this,t),this.chunks=e,this.from=i}return u(t,[{key:"toString",value:function(){return this.chunks.map(String).join("")}},{key:"extend",value:function(e){if(String(e)){_(e)&&(e=new S(String(e)));var n=this.chunks[this.chunks.length-1],i=n&&(n.stop===e.stop||null==e.stop)&&e.from===n.from+n.toString().length;if(e instanceof S)i?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof t){if(null==e.stop)for(var u;e.chunks.length&&null==e.chunks[0].stop;)(u=e.chunks.shift()).from+=e.from,this.extend(u);e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}}},{key:"appendTo",value:function(e){if(!(e instanceof B.MaskedPattern))return new S(this.toString()).appendTo(e);for(var n=new m,i=0;i<this.chunks.length&&!n.skip;++i){var u=this.chunks[i],r=e._mapPosToBlock(e.value.length),s=u.stop,a=void 0;if(null!=s&&(!r||r.index<=s)&&((u instanceof t||e._stops.indexOf(s)>=0)&&n.aggregate(e._appendPlaceholder(s)),a=u instanceof t&&e._blocks[s]),a){var o=a.appendTail(u);o.skip=!1,n.aggregate(o),e._value+=o.inserted;var l=u.toString().slice(o.rawInserted.length);l&&n.aggregate(e.append(l,{tail:!0}))}else n.aggregate(e.append(u.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,i=o(e,P);Object.assign(this,i),this.chunks=n.map((function(e){var n="chunks"in e?new t:new S;return n.state=e,n}))}},{key:"unshift",value:function(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";for(var e=null!=t?t-this.from:t,n=0;n<this.chunks.length;){var i=this.chunks[n],u=i.unshift(e);if(i.toString()){if(!u)break;++n}else this.chunks.splice(n,1);if(u)return u}return""}},{key:"shift",value:function(){if(!this.chunks.length)return"";for(var t=this.chunks.length-1;0<=t;){var e=this.chunks[t],n=e.shift();if(e.toString()){if(!n)break;--t}else this.chunks.splice(t,1);if(n)return n}return""}}]),t}(),V=function(){function t(e,i){n(this,t),this.masked=e,this._log=[];var u=e._mapPosToBlock(i)||(i<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0}),r=u.offset,s=u.index;this.offset=r,this.index=s,this.ok=!1}return u(t,[{key:"block",get:function(){return this.masked._blocks[this.index]}},{key:"pos",get:function(){return this.masked._blockStartPos(this.index)+this.offset}},{key:"state",get:function(){return{index:this.index,offset:this.offset,ok:this.ok}},set:function(t){Object.assign(this,t)}},{key:"pushState",value:function(){this._log.push(this.state)}},{key:"popState",value:function(){var t=this._log.pop();return this.state=t,t}},{key:"bindBlock",value:function(){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.value.length))}},{key:"_pushLeft",value:function(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null===(e=this.block)||void 0===e?void 0:e.value.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}},{key:"_pushRight",value:function(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}},{key:"pushLeftBeforeFilled",value:function(){var t=this;return this._pushLeft((function(){if(!t.block.isFixed&&t.block.value)return t.offset=t.block.nearestInputPos(t.offset,E.FORCE_LEFT),0!==t.offset||void 0}))}},{key:"pushLeftBeforeInput",value:function(){var t=this;return this._pushLeft((function(){if(!t.block.isFixed)return t.offset=t.block.nearestInputPos(t.offset,E.LEFT),!0}))}},{key:"pushLeftBeforeRequired",value:function(){var t=this;return this._pushLeft((function(){if(!(t.block.isFixed||t.block.isOptional&&!t.block.value))return t.offset=t.block.nearestInputPos(t.offset,E.LEFT),!0}))}},{key:"pushRightBeforeFilled",value:function(){var t=this;return this._pushRight((function(){if(!t.block.isFixed&&t.block.value)return t.offset=t.block.nearestInputPos(t.offset,E.FORCE_RIGHT),t.offset!==t.block.value.length||void 0}))}},{key:"pushRightBeforeInput",value:function(){var t=this;return this._pushRight((function(){if(!t.block.isFixed)return t.offset=t.block.nearestInputPos(t.offset,E.NONE),!0}))}},{key:"pushRightBeforeRequired",value:function(){var t=this;return this._pushRight((function(){if(!(t.block.isFixed||t.block.isOptional&&!t.block.value))return t.offset=t.block.nearestInputPos(t.offset,E.NONE),!0}))}}]),t}(),L=function(t){r(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{key:"_update",value:function(t){t.mask&&(t.validate=function(e){return e.search(t.mask)>=0}),f(s(i.prototype),"_update",this).call(this,t)}}]),i}(D);B.MaskedRegExp=L;var j=["_blocks"],N=function(t){r(i,t);var e=h(i);function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n(this,i),t.definitions=Object.assign({},M,t.definitions),e.call(this,Object.assign({},i.DEFAULTS,t))}return u(i,[{key:"_update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.definitions=Object.assign({},this.definitions,t.definitions),f(s(i.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 n=this.mask;if(n&&e)for(var u=!1,r=!1,s=function(s){if(t.blocks){var o=n.slice(s),l=Object.keys(t.blocks).filter((function(t){return 0===o.indexOf(t)}));l.sort((function(t,e){return e.length-t.length}));var h=l[0];if(h){var c=x(Object.assign({parent:t,lazy:t.lazy,eager:t.eager,placeholderChar:t.placeholderChar,overwrite:t.overwrite},t.blocks[h]));return c&&(t._blocks.push(c),t._maskedBlocks[h]||(t._maskedBlocks[h]=[]),t._maskedBlocks[h].push(t._blocks.length-1)),s+=h.length-1,a=s,"continue"}}var f=n[s],p=f in e;if(f===i.STOP_CHAR)return t._stops.push(t._blocks.length),a=s,"continue";if("{"===f||"}"===f)return u=!u,a=s,"continue";if("["===f||"]"===f)return r=!r,a=s,"continue";if(f===i.ESCAPE_CHAR){if(++s,!(f=n[s]))return a=s,"break";p=!1}var d=p?new O({parent:t,lazy:t.lazy,eager:t.eager,placeholderChar:t.placeholderChar,mask:e[f],isOptional:r}):new R({char:f,eager:t.eager,isUnmasking:u});t._blocks.push(d),a=s},a=0;a<n.length;++a){var o=s(a);if("continue"!==o&&"break"===o)break}}},{key:"state",get:function(){return Object.assign({},f(s(i.prototype),"state",this),{_blocks:this._blocks.map((function(t){return t.state}))})},set:function(t){var e=t._blocks,n=o(t,j);this._blocks.forEach((function(t,n){return t.state=e[n]})),d(s(i.prototype),"state",n,this,!0)}},{key:"reset",value:function(){f(s(i.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:"isFilled",get:function(){return this._blocks.every((function(t){return t.isFilled}))}},{key:"isFixed",get:function(){return this._blocks.every((function(t){return t.isFixed}))}},{key:"isOptional",get:function(){return this._blocks.every((function(t){return t.isOptional}))}},{key:"doCommit",value:function(){this._blocks.forEach((function(t){return t.doCommit()})),f(s(i.prototype),"doCommit",this).call(this)}},{key:"unmaskedValue",get:function(){return this._blocks.reduce((function(t,e){return t+e.unmaskedValue}),"")},set:function(t){d(s(i.prototype),"unmaskedValue",t,this,!0)}},{key:"value",get:function(){return this._blocks.reduce((function(t,e){return t+e.value}),"")},set:function(t){d(s(i.prototype),"value",t,this,!0)}},{key:"appendTail",value:function(t){return f(s(i.prototype),"appendTail",this).call(this,t).aggregate(this._appendPlaceholder())}},{key:"_appendEager",value:function(){var t,e=new m,n=null===(t=this._mapPosToBlock(this.value.length))||void 0===t?void 0:t.index;if(null==n)return e;this._blocks[n].isFilled&&++n;for(var i=n;i<this._blocks.length;++i){var u=this._blocks[i]._appendEager();if(!u.inserted)break;e.aggregate(u)}return e}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this._mapPosToBlock(this.value.length),i=new m;if(!n)return i;for(var u=n.index;;++u){var r,s,a=this._blocks[u];if(!a)break;var o=a._appendChar(t,Object.assign({},e,{_beforeTailState:null===(r=e._beforeTailState)||void 0===r||null===(s=r._blocks)||void 0===s?void 0:s[u]})),l=o.skip;if(i.aggregate(o),l||o.rawInserted)break}return i}},{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,i=new I;return e===n||this._forEachBlocksInRange(e,n,(function(e,n,u,r){var s=e.extractTail(u,r);s.stop=t._findStopBefore(n),s.from=t._blockStartPos(n),s instanceof I&&(s.blockIndex=n),i.extend(s)})),i}},{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 i="";return this._forEachBlocksInRange(t,e,(function(t,e,u,r){i+=t.extractInput(u,r,n)})),i}},{key:"_findStopBefore",value:function(t){for(var e,n=0;n<this._stops.length;++n){var i=this._stops[n];if(!(i<=t))break;e=i}return e}},{key:"_appendPlaceholder",value:function(t){var e=this,n=new m;if(this.lazy&&null==t)return n;var i=this._mapPosToBlock(this.value.length);if(!i)return n;var u=i.index,r=null!=t?t:this._blocks.length;return this._blocks.slice(u,r).forEach((function(i){if(!i.lazy||null!=t){var u=null!=i._blocks?[i._blocks.length]:[],r=i._appendPlaceholder.apply(i,u);e._value+=r.inserted,n.aggregate(r)}})),n}},{key:"_mapPosToBlock",value:function(t){for(var e="",n=0;n<this._blocks.length;++n){var i=this._blocks[n],u=e.length;if(t<=(e+=i.value).length)return{index:n,offset:t-u}}}},{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,i=this._mapPosToBlock(t);if(i){var u=this._mapPosToBlock(e),r=u&&i.index===u.index,s=i.offset,a=u&&r?u.offset:this._blocks[i.index].value.length;if(n(this._blocks[i.index],i.index,s,a),u&&!r){for(var o=i.index+1;o<u.index;++o)n(this._blocks[o],o,0,this._blocks[o].value.length);n(this._blocks[u.index],u.index,0,u.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,n=f(s(i.prototype),"remove",this).call(this,t,e);return this._forEachBlocksInRange(t,e,(function(t,e,i,u){n.aggregate(t.remove(i,u))})),n}},{key:"nearestInputPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:E.NONE;if(!this._blocks.length)return 0;var n=new V(this,t);if(e===E.NONE)return n.pushRightBeforeInput()?n.pos:(n.popState(),n.pushLeftBeforeInput()?n.pos:this.value.length);if(e===E.LEFT||e===E.FORCE_LEFT){if(e===E.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===t)return t;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),e===E.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=t)return n.pos;if(n.popState(),n.ok&&n.pos<=t)return n.pos;n.popState()}return n.ok?n.pos:e===E.FORCE_LEFT?0:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:0))}return e===E.RIGHT||e===E.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:e===E.FORCE_RIGHT?this.value.length:(n.popState(),n.ok?n.pos:(n.popState(),n.ok?n.pos:this.nearestInputPos(t,E.LEFT)))):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]})):[]}}]),i}(D);N.DEFAULTS={lazy:!0,placeholderChar:"_"},N.STOP_CHAR="`",N.ESCAPE_CHAR="\\",N.InputDefinition=O,N.FixedDefinition=R,B.MaskedPattern=N;var U=function(t){r(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{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,maxLength:this.maxLength||0},t);var e=String(t.to).length;null!=t.maxLength&&(e=Math.max(e,t.maxLength)),t.maxLength=e;for(var n=String(t.from).padStart(e,"0"),u=String(t.to).padStart(e,"0"),r=0;r<u.length&&u[r]===n[r];)++r;t.mask=u.slice(0,r).replace(/0/g,"\\0")+"0".repeat(e-r),f(s(i.prototype),"_update",this).call(this,t)}},{key:"isComplete",get:function(){return f(s(i.prototype),"isComplete",this)&&Boolean(this.value)}},{key:"boundaries",value:function(t){var e="",n="",i=v(t.match(/^(\D*)(\d*)(\D*)/)||[],3),u=i[1],r=i[2];return r&&(e="0".repeat(u.length)+r,n="9".repeat(u.length)+r),[e=e.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9")]}},{key:"doPrepare",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=v(F(f(s(i.prototype),"doPrepare",this).call(this,t.replace(/\D/g,""),n)),2);if(t=u[0],e=u[1],!this.autofix||!t)return t;var r=String(this.from).padStart(this.maxLength,"0"),a=String(this.to).padStart(this.maxLength,"0"),o=this.value+t;if(o.length>this.maxLength)return"";var l=v(this.boundaries(o),2),h=l[0],c=l[1];return Number(c)<this.from?r[o.length-1]:Number(h)>this.to?"pad"===this.autofix&&o.length<this.maxLength?["",e.aggregate(this.append(r[o.length-1]+t,n))]:a[o.length-1]:t}},{key:"doValidate",value:function(){var t,e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;for(var n=v(this.boundaries(e),2),u=n[0],r=n[1],a=arguments.length,o=new Array(a),l=0;l<a;l++)o[l]=arguments[l];return this.from<=Number(r)&&Number(u)<=this.to&&(t=f(s(i.prototype),"doValidate",this)).call.apply(t,[this].concat(o))}}]),i}(N);B.MaskedRange=U;var H=function(t){r(i,t);var e=h(i);function i(t){return n(this,i),e.call(this,Object.assign({},i.DEFAULTS,t))}return u(i,[{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({},i.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,this.blocks,e),Object.keys(t.blocks).forEach((function(e){var n=t.blocks[e];!("autofix"in n)&&"autofix"in t&&(n.autofix=t.autofix)})),f(s(i.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,e=this.date,n=arguments.length,u=new Array(n),r=0;r<n;r++)u[r]=arguments[r];return(t=f(s(i.prototype),"doValidate",this)).call.apply(t,[this].concat(u))&&(!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?f(s(i.prototype),"typedValue",this):null},set:function(t){d(s(i.prototype),"typedValue",t,this,!0)}},{key:"maskEquals",value:function(t){return t===Date||f(s(i.prototype),"maskEquals",this).call(this,t)}}]),i}(N);H.DEFAULTS={pattern:"d{.}`m{.}`Y",format:function(t){return t?[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join("."):""},parse:function(t){var e=v(t.split("."),3),n=e[0],i=e[1],u=e[2];return new Date(u,i-1,n)}},H.GET_DEFAULT_BLOCKS=function(){return{d:{mask:U,from:1,to:31,maxLength:2},m:{mask:U,from:1,to:12,maxLength:2},Y:{mask:U,from:1900,to:9999}}},B.MaskedDate=H;var q=function(){function t(){n(this,t)}return u(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}();B.MaskElement=q;var G=function(t){r(i,t);var e=h(i);function i(t){var u;return n(this,i),(u=e.call(this)).input=t,u._handlers={},u}return u(i,[{key:"rootElement",get:function(){var t,e,n;return null!==(t=null===(e=(n=this.input).getRootNode)||void 0===e?void 0:e.call(n))&&void 0!==t?t: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(n){return e._toggleEventHandler(i.EVENTS_MAP[n],t[n])}))}},{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)}}]),i}(q);G.EVENTS_MAP={selectionChange:"keydown",input:"input",drop:"drop",click:"click",focus:"focus",commit:"blur"},B.HTMLMaskElement=G;var Y=function(t){r(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{key:"_unsafeSelectionStart",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,i=e&&e.focusOffset;return null==i||null==n||n<i?n:i}},{key:"_unsafeSelectionEnd",get:function(){var t=this.rootElement,e=t.getSelection&&t.getSelection(),n=e&&e.anchorOffset,i=e&&e.focusOffset;return null==i||null==n||n>i?n:i}},{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 i=this.rootElement,u=i.getSelection&&i.getSelection();u&&(u.removeAllRanges(),u.addRange(n))}}},{key:"value",get:function(){return this.input.textContent},set:function(t){this.input.textContent=t}}]),i}(G);B.HTMLContenteditableMaskElement=Y;var z=["mask"],Z=function(){function t(e,i){n(this,t),this.el=e instanceof q?e:e.isContentEditable&&"INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName?new Y(e):new G(e),this.masked=x(i),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 u(t,[{key:"mask",get:function(){return this.masked.mask},set:function(t){if(!this.maskEquals(t))if(t instanceof B.Masked||this.masked.constructor!==w(t)){var e=x({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}else this.masked.updateOptions({mask:t})}},{key:"maskEquals",value:function(t){var e;return null==t||(null===(e=this.masked)||void 0===e?void 0:e.maskEquals(t))}},{key:"value",get:function(){return this._value},set:function(t){this.value!==t&&(this.masked.value=t,this.updateControl(),this.alignCursor())}},{key:"unmaskedValue",get:function(){return this._unmaskedValue},set:function(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl(),this.alignCursor())}},{key:"typedValue",get:function(){return this.masked.typedValue},set:function(t){this.masked.typedValueEquals(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),i=1;i<e;i++)n[i-1]=arguments[i];var u=this._listeners[t];u&&u.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=o(t,z),i=!this.maskEquals(e),u=!C(this.masked,n);i&&(this.mask=e),u&&this.masked.updateOptions(n),(i||u)&&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.masked.nearestInputPos(this.cursorPos,E.LEFT))}},{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 b(this.el.value,this.cursorPos,this.value,this._selection),n=this.masked.rawInputValue,i=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,u=n===this.masked.rawInputValue?e.removeDirection:E.NONE,r=this.masked.nearestInputPos(e.startChangePos+i,u);u!==E.NONE&&(r=this.masked.nearestInputPos(r,E.NONE)),this.updateControl(),this.updateCursor(r),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}();B.InputMask=Z;var K=function(t){r(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{key:"_update",value:function(t){t.enum&&(t.mask="*".repeat(t.enum[0].length)),f(s(i.prototype),"_update",this).call(this,t)}},{key:"doValidate",value:function(){for(var t,e=this,n=arguments.length,u=new Array(n),r=0;r<n;r++)u[r]=arguments[r];return this.enum.some((function(t){return t.indexOf(e.unmaskedValue)>=0}))&&(t=f(s(i.prototype),"doValidate",this)).call.apply(t,[this].concat(u))}}]),i}(N);B.MaskedEnum=K;var $,W=function(t){r(i,t);var e=h(i);function i(t){return n(this,i),e.call(this,Object.assign({},i.DEFAULTS,t))}return u(i,[{key:"_update",value:function(t){f(s(i.prototype),"_update",this).call(this,t),this._updateRegExps()}},{key:"_updateRegExps",value:function(){var t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"(".concat(A(this.radix),"\\d{0,").concat(this.scale,"})?"):"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("[".concat(this.mapToRadix.map(A).join(""),"]"),"g"),this._thousandsSeparatorRegExp=new RegExp(A(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){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&e.raw?t.replace(this._mapToRadixRegExp,this.radix):t);var n=v(F(f(s(i.prototype),"doPrepare",this).call(this,t,e)),2),u=n[0],r=n[1];return t&&!u&&(r.skip=!0),[u,r]}},{key:"_separatorsCount",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=0,i=0;i<t;++i)this._value.indexOf(this.thousandsSeparator,i)===i&&(++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,n=arguments.length>2?arguments[2]:void 0,u=v(this._adjustRangeWithSeparators(t,e),2);return t=u[0],e=u[1],this._removeThousandsSeparators(f(s(i.prototype),"extractInput",this).call(this,t,e,n))}},{key:"_appendCharRaw",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.thousandsSeparator)return f(s(i.prototype),"_appendCharRaw",this).call(this,t,e);var n=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,u=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);var r=f(s(i.prototype),"_appendCharRaw",this).call(this,t,e);this._value=this._insertThousandsSeparators(this._value);var a=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,o=this._separatorsCountFromSlice(a);return r.tailShift+=(o-u)*this.thousandsSeparator.length,r.skip=!r.rawInserted&&t===this.thousandsSeparator,r}},{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 i=this._findSeparatorAround(e);return i>=0&&(e=i+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=v(this._adjustRangeWithSeparators(t,e),2);t=n[0],e=n[1];var i=this.value.slice(0,t),u=this.value.slice(e),r=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+u));var s=this._separatorsCountFromSlice(i);return new m({tailShift:(s-r)*this.thousandsSeparator.length})}},{key:"nearestInputPos",value:function(t,e){if(!this.thousandsSeparator)return t;switch(e){case E.NONE:case E.LEFT:case E.FORCE_LEFT:var n=this._findSeparatorAround(t-1);if(n>=0){var i=n+this.thousandsSeparator.length;if(t<i||this.value.length<=i||e===E.FORCE_LEFT)return n}break;case E.RIGHT:case E.FORCE_RIGHT:var u=this._findSeparatorAround(t);if(u>=0)return u+this.thousandsSeparator.length}return t}},{key:"doValidate",value:function(t){var e=Boolean(this._removeThousandsSeparators(this.value).match(this._numberRegExp));if(e){var n=this.number;e=e&&!isNaN(n)&&(null==this.min||this.min>=0||this.min<=this.number)&&(null==this.max||this.max<=0||this.number<=this.max)}return e&&f(s(i.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 n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}f(s(i.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,i){return e+i})),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){d(s(i.prototype),"unmaskedValue",t.replace(".",this.radix),this,!0)}},{key:"typedValue",get:function(){return Number(this.unmaskedValue)},set:function(t){this.rawInputValue=String(t).replace(".",this.radix)}},{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}},{key:"typedValueEquals",value:function(t){return(f(s(i.prototype),"typedValueEquals",this).call(this,t)||i.EMPTY_VALUES.includes(t)&&i.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}]),i}(D);W.DEFAULTS={radix:",",thousandsSeparator:"",mapToRadix:["."],scale:2,signed:!1,normalizeZeros:!0,padFractionalZeros:!1},W.EMPTY_VALUES=[].concat(function(t){if(Array.isArray(t))return g(t)}($=D.EMPTY_VALUES)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}($)||k($)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[0]),B.MaskedNumber=W;var X=function(t){r(i,t);var e=h(i);function i(){return n(this,i),e.apply(this,arguments)}return u(i,[{key:"_update",value:function(t){t.mask&&(t.validate=t.mask),f(s(i.prototype),"_update",this).call(this,t)}}]),i}(D);B.MaskedFunction=X;var J=["compiledMasks","currentMaskRef","currentMask"],Q=function(t){r(i,t);var e=h(i);function i(t){var u;return n(this,i),(u=e.call(this,Object.assign({},i.DEFAULTS,t))).currentMask=null,u}return u(i,[{key:"_update",value:function(t){f(s(i.prototype),"_update",this).call(this,t),"mask"in t&&(this.compiledMasks=Array.isArray(t.mask)?t.mask.map((function(t){return x(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,this.currentMaskFlags(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,i=this.rawInputValue,u=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:i,r=i.slice(u.length),s=this.currentMask,a=new m,o=null==s?void 0:s.state;if(this.currentMask=this.doDispatch(t,Object.assign({},e)),this.currentMask)if(this.currentMask!==s){if(this.currentMask.reset(),u){var l=this.currentMask.append(u,{raw:!0});a.tailShift=l.inserted.length-n.length}r&&(a.tailShift+=this.currentMask.append(r,{raw:!0,tail:!0}).tailShift)}else this.currentMask.state=o;return a}},{key:"_appendPlaceholder",value:function(){var t=this._applyDispatch.apply(this,arguments);return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}},{key:"_appendEager",value:function(){var t=this._applyDispatch.apply(this,arguments);return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}},{key:"currentMaskFlags",value:function(t){var e,n;return Object.assign({},t,{_beforeTailState:(null===(e=t._beforeTailState)||void 0===e?void 0:e.currentMaskRef)===this.currentMask&&(null===(n=t._beforeTailState)||void 0===n?void 0:n.currentMask)||t._beforeTailState})}},{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(t){return f(s(i.prototype),"doValidate",this).call(this,t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}},{key:"doPrepare",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=v(F(f(s(i.prototype),"doPrepare",this).call(this,t,e)),2),u=n[0],r=n[1];if(this.currentMask){var a,o=v(F(f(s(i.prototype),"doPrepare",this).call(this,u,this.currentMaskFlags(e))),2);u=o[0],a=o[1],r=r.aggregate(a)}return[u,r]}},{key:"reset",value:function(){var t;null===(t=this.currentMask)||void 0===t||t.reset(),this.compiledMasks.forEach((function(t){return t.reset()}))}},{key:"value",get:function(){return this.currentMask?this.currentMask.value:""},set:function(t){d(s(i.prototype),"value",t,this,!0)}},{key:"unmaskedValue",get:function(){return this.currentMask?this.currentMask.unmaskedValue:""},set:function(t){d(s(i.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(){var t;return Boolean(null===(t=this.currentMask)||void 0===t?void 0:t.isComplete)}},{key:"isFilled",get:function(){var t;return Boolean(null===(t=this.currentMask)||void 0===t?void 0:t.isFilled)}},{key:"remove",value:function(){var t,e=new m;this.currentMask&&e.aggregate((t=this.currentMask).remove.apply(t,arguments)).aggregate(this._applyDispatch());return e}},{key:"state",get:function(){var t;return Object.assign({},f(s(i.prototype),"state",this),{_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((function(t){return t.state})),currentMaskRef:this.currentMask,currentMask:null===(t=this.currentMask)||void 0===t?void 0:t.state})},set:function(t){var e=t.compiledMasks,n=t.currentMaskRef,u=t.currentMask,r=o(t,J);this.compiledMasks.forEach((function(t,n){return t.state=e[n]})),null!=n&&(this.currentMask=n,this.currentMask.state=u),d(s(i.prototype),"state",r,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,n=arguments.length,u=new Array(n),r=0;r<n;r++)u[r]=arguments[r];return this.currentMask?(t=this.currentMask).extractTail.apply(t,u):(e=f(s(i.prototype),"extractTail",this)).call.apply(e,[this].concat(u))}},{key:"doCommit",value:function(){this.currentMask&&this.currentMask.doCommit(),f(s(i.prototype),"doCommit",this).call(this)}},{key:"nearestInputPos",value:function(){for(var t,e,n=arguments.length,u=new Array(n),r=0;r<n;r++)u[r]=arguments[r];return this.currentMask?(t=this.currentMask).nearestInputPos.apply(t,u):(e=f(s(i.prototype),"nearestInputPos",this)).call.apply(e,[this].concat(u))}},{key:"overwrite",get:function(){return this.currentMask?this.currentMask.overwrite:f(s(i.prototype),"overwrite",this)},set:function(t){console.warn('"overwrite" option is not available in dynamic mask, use this option in siblings')}},{key:"eager",get:function(){return this.currentMask?this.currentMask.eager:f(s(i.prototype),"eager",this)},set:function(t){console.warn('"eager" option is not available in dynamic mask, use this option in siblings')}},{key:"maskEquals",value:function(t){return Array.isArray(t)&&this.compiledMasks.every((function(e,n){var i;return e.maskEquals(null===(i=t[n])||void 0===i?void 0:i.mask)}))}},{key:"typedValueEquals",value:function(t){var e;return Boolean(null===(e=this.currentMask)||void 0===e?void 0:e.typedValueEquals(t))}}]),i}(D);Q.DEFAULTS={dispatch:function(t,e,n){if(e.compiledMasks.length){var i=e.rawInputValue,u=e.compiledMasks.map((function(u,r){return u.reset(),u.append(i,{raw:!0}),u.append(t,e.currentMaskFlags(n)),{weight:u.rawInputValue.length,index:r}}));return u.sort((function(t,e){return e.weight-t.weight})),e.compiledMasks[u[0].index]}}},B.MaskedDynamic=Q;var tt={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function et(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tt.MASKED,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:tt.MASKED,i=x(t);return function(t){return i.runIsolated((function(i){return i[e]=t,i[n]}))}}function nt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return et.apply(void 0,n)(t)}B.PIPE_TYPE=tt,B.createPipe=et,B.pipe=nt;try{globalThis.IMask=B}catch(t){}t.ChangeDetails=m,t.HTMLContenteditableMaskElement=Y,t.HTMLMaskElement=G,t.InputMask=Z,t.MaskElement=q,t.Masked=D,t.MaskedDate=H,t.MaskedDynamic=Q,t.MaskedEnum=K,t.MaskedFunction=X,t.MaskedNumber=W,t.MaskedPattern=N,t.MaskedRange=U,t.MaskedRegExp=L,t.PIPE_TYPE=tt,t.createMask=x,t.createPipe=et,t.default=B,t.pipe=nt,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=imask.min.js.map

@@ -1,2 +0,2 @@

import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import HTMLMaskElement from './html-mask-element.js';

@@ -8,11 +8,7 @@ import IMask from '../core/holder.js';

_inherits(HTMLContenteditableMaskElement, _HTMLMaskElement);
var _super = _createSuper(HTMLContenteditableMaskElement);
function HTMLContenteditableMaskElement() {
_classCallCheck(this, HTMLContenteditableMaskElement);
return _super.apply(this, arguments);
}
_createClass(HTMLContenteditableMaskElement, [{

@@ -30,9 +26,8 @@ key: "_unsafeSelectionStart",

var focusOffset = selection && selection.focusOffset;
if (focusOffset == null || anchorOffset == null || anchorOffset < focusOffset) {
return anchorOffset;
}
return focusOffset;
}
/**

@@ -42,3 +37,2 @@ Returns HTMLElement selection end

*/
}, {

@@ -51,9 +45,8 @@ key: "_unsafeSelectionEnd",

var focusOffset = selection && selection.focusOffset;
if (focusOffset == null || anchorOffset == null || anchorOffset > focusOffset) {
return anchorOffset;
}
return focusOffset;
}
/**

@@ -63,3 +56,2 @@ Sets HTMLElement selection

*/
}, {

@@ -74,3 +66,2 @@ key: "_unsafeSelect",

var selection = root.getSelection && root.getSelection();
if (selection) {

@@ -81,2 +72,3 @@ selection.removeAllRanges();

}
/**

@@ -86,3 +78,2 @@ HTMLElement value

*/
}, {

@@ -98,3 +89,2 @@ key: "value",

}]);
return HTMLContenteditableMaskElement;

@@ -101,0 +91,0 @@ }(HTMLMaskElement);

@@ -1,2 +0,2 @@

import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import MaskElement from './mask-element.js';

@@ -6,8 +6,5 @@ import IMask from '../core/holder.js';

/** Bridge between HTMLElement and {@link Masked} */
var HTMLMaskElement = /*#__PURE__*/function (_MaskElement) {
_inherits(HTMLMaskElement, _MaskElement);
var _super = _createSuper(HTMLMaskElement);
/** Mapping between HTMLElement events and mask internal events */

@@ -22,5 +19,3 @@

var _this;
_classCallCheck(this, HTMLMaskElement);
_this = _super.call(this);

@@ -31,6 +26,5 @@ _this.input = input;

}
/** */
// $FlowFixMe https://github.com/facebook/flow/issues/2839
_createClass(HTMLMaskElement, [{

@@ -40,5 +34,5 @@ key: "rootElement",

var _this$input$getRootNo, _this$input$getRootNo2, _this$input;
return (_this$input$getRootNo = (_this$input$getRootNo2 = (_this$input = this.input).getRootNode) === null || _this$input$getRootNo2 === void 0 ? void 0 : _this$input$getRootNo2.call(_this$input)) !== null && _this$input$getRootNo !== void 0 ? _this$input$getRootNo : document;
}
/**

@@ -48,3 +42,2 @@ Is element in focus

*/
}, {

@@ -56,2 +49,3 @@ key: "isActive",

}
/**

@@ -61,3 +55,2 @@ Returns HTMLElement selection start

*/
}, {

@@ -68,2 +61,3 @@ key: "_unsafeSelectionStart",

}
/**

@@ -73,3 +67,2 @@ Returns HTMLElement selection end

*/
}, {

@@ -80,2 +73,3 @@ key: "_unsafeSelectionEnd",

}
/**

@@ -85,3 +79,2 @@ Sets HTMLElement selection

*/
}, {

@@ -92,2 +85,3 @@ key: "_unsafeSelect",

}
/**

@@ -97,3 +91,2 @@ HTMLElement value

*/
}, {

@@ -107,2 +100,3 @@ key: "value",

}
/**

@@ -112,3 +106,2 @@ Binds HTMLElement events to mask internal events

*/
}, {

@@ -118,3 +111,2 @@ key: "bindEvents",

var _this2 = this;
Object.keys(handlers).forEach(function (event) {

@@ -124,2 +116,3 @@ return _this2._toggleEventHandler(HTMLMaskElement.EVENTS_MAP[event], handlers[event]);

}
/**

@@ -129,3 +122,2 @@ Unbinds HTMLElement events to mask internal events

*/
}, {

@@ -135,3 +127,2 @@ key: "unbindEvents",

var _this3 = this;
Object.keys(this._handlers).forEach(function (event) {

@@ -141,4 +132,4 @@ return _this3._toggleEventHandler(event);

}
/** */
}, {

@@ -151,3 +142,2 @@ key: "_toggleEventHandler",

}
if (handler) {

@@ -159,3 +149,2 @@ this.input.addEventListener(event, handler);

}]);
return HTMLMaskElement;

@@ -162,0 +151,0 @@ }(MaskElement);

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck, b as _objectWithoutProperties } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck, b as _objectWithoutProperties } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import { objectIncludes, DIRECTION } from '../core/utils.js';

@@ -22,4 +22,4 @@ import ActionDetails from '../core/action-details.js';

var _excluded = ["mask"];
/** Listens to element events and controls changes between element and {@link Masked} */
var InputMask = /*#__PURE__*/function () {

@@ -42,3 +42,2 @@ /**

_classCallCheck(this, InputMask);
this.el = el instanceof MaskElement ? el : el.isContentEditable && el.tagName !== 'INPUT' && el.tagName !== 'TEXTAREA' ? new HTMLContenteditableMaskElement(el) : new HTMLMaskElement(el);

@@ -57,13 +56,10 @@ this.masked = createMask(opts);

this.alignCursorFriendly = this.alignCursorFriendly.bind(this);
this._bindEvents();
this._bindEvents(); // refresh
// refresh
this.updateValue();
this._onChange();
}
/** Read or update mask */
_createClass(InputMask, [{

@@ -75,4 +71,5 @@ key: "mask",

set: function set(mask) {
if (this.maskEquals(mask)) return; // $FlowFixMe No ideas ... after update
if (this.maskEquals(mask)) return;
// $FlowFixMe No ideas ... after update
if (!(mask instanceof IMask.Masked) && this.masked.constructor === maskedClass(mask)) {

@@ -84,3 +81,2 @@ this.masked.updateOptions({

}
var masked = createMask({

@@ -92,4 +88,4 @@ mask: mask

}
/** Raw value */
}, {

@@ -99,3 +95,2 @@ key: "maskEquals",

var _this$masked;
return mask == null || ((_this$masked = this.masked) === null || _this$masked === void 0 ? void 0 : _this$masked.maskEquals(mask));

@@ -114,4 +109,4 @@ }

}
/** Unmasked value */
}, {

@@ -128,4 +123,4 @@ key: "unmaskedValue",

}
/** Typed unmasked value */
}, {

@@ -142,2 +137,3 @@ key: "typedValue",

}
/**

@@ -147,3 +143,2 @@ Starts listening to element events

*/
}, {

@@ -161,2 +156,3 @@ key: "_bindEvents",

}
/**

@@ -166,3 +162,2 @@ Stops listening to element events

*/
}, {

@@ -173,2 +168,3 @@ key: "_unbindEvents",

}
/**

@@ -178,3 +174,2 @@ Fires custom event

*/
}, {

@@ -186,3 +181,2 @@ key: "_fireEvent",

}
var listeners = this._listeners[ev];

@@ -194,2 +188,3 @@ if (!listeners) return;

}
/**

@@ -199,3 +194,2 @@ Current selection start

*/
}, {

@@ -206,4 +200,4 @@ key: "selectionStart",

}
/** Current cursor position */
}, {

@@ -217,5 +211,5 @@ key: "cursorPos",

this.el.select(pos, pos);
this._saveSelection();
}
/**

@@ -225,8 +219,6 @@ Stores current selection

*/
}, {
key: "_saveSelection",
value: function
/* ev */
_saveSelection() {
value: function _saveSelection( /* ev */
) {
if (this.value !== this.el.value) {

@@ -241,4 +233,4 @@ console.warn('Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly.'); // eslint-disable-line no-console

}
/** Syncronizes model value from view */
}, {

@@ -250,4 +242,4 @@ key: "updateValue",

}
/** Syncronizes view from model value, fires change events */
}, {

@@ -264,4 +256,4 @@ key: "updateControl",

}
/** Updates options with deep equal check, recreates @{link Masked} model if mask type changes */
}, {

@@ -271,4 +263,3 @@ key: "updateOptions",

var mask = opts.mask,
restOpts = _objectWithoutProperties(opts, _excluded);
restOpts = _objectWithoutProperties(opts, _excluded);
var updateMask = !this.maskEquals(mask);

@@ -280,4 +271,4 @@ var updateOpts = !objectIncludes(this.masked, restOpts);

}
/** Updates cursor */
}, {

@@ -287,6 +278,8 @@ key: "updateCursor",

if (cursorPos == null) return;
this.cursorPos = cursorPos; // also queue change cursor for mobile browsers
this.cursorPos = cursorPos;
// also queue change cursor for mobile browsers
this._delayUpdateCursor(cursorPos);
}
/**

@@ -296,3 +289,2 @@ Delays cursor update to support mobile browsers

*/
}, {

@@ -302,14 +294,11 @@ key: "_delayUpdateCursor",

var _this = this;
this._abortUpdateCursor();
this._changingCursorPos = cursorPos;
this._cursorChanging = setTimeout(function () {
if (!_this.el) return; // if was destroyed
_this.cursorPos = _this._changingCursorPos;
_this._abortUpdateCursor();
}, 10);
}
/**

@@ -319,3 +308,2 @@ Fires custom events

*/
}, {

@@ -325,5 +313,5 @@ key: "_fireChangeEvents",

this._fireEvent('accept', this._inputEvent);
if (this.masked.isComplete) this._fireEvent('complete', this._inputEvent);
}
/**

@@ -333,3 +321,2 @@ Aborts delayed cursor update

*/
}, {

@@ -343,4 +330,4 @@ key: "_abortUpdateCursor",

}
/** Aligns cursor to nearest available position */
}, {

@@ -351,4 +338,4 @@ key: "alignCursor",

}
/** Aligns cursor only if selection is empty */
}, {

@@ -358,7 +345,6 @@ key: "alignCursorFriendly",

if (this.selectionStart !== this.cursorPos) return; // skip if range is selected
this.alignCursor();
}
/** Adds listener on custom event */
}, {

@@ -368,9 +354,7 @@ key: "on",

if (!this._listeners[ev]) this._listeners[ev] = [];
this._listeners[ev].push(handler);
return this;
}
/** Removes custom event listener */
}, {

@@ -380,3 +364,2 @@ key: "off",

if (!this._listeners[ev]) return this;
if (!handler) {

@@ -386,10 +369,8 @@ delete this._listeners[ev];

}
var hIndex = this._listeners[ev].indexOf(handler);
if (hIndex >= 0) this._listeners[ev].splice(hIndex, 1);
return this;
}
/** Handles view input event */
}, {

@@ -399,9 +380,10 @@ key: "_onInput",

this._inputEvent = e;
this._abortUpdateCursor();
this._abortUpdateCursor(); // fix strange IE behavior
// fix strange IE behavior
if (!this._selection) return this.updateValue();
var details = new ActionDetails( // new state
this.el.value, this.cursorPos, // old state
var details = new ActionDetails(
// new state
this.el.value, this.cursorPos,
// old state
this.value, this._selection);

@@ -412,5 +394,6 @@ var oldRawValue = this.masked.rawInputValue;

raw: true
}).offset; // force align in remove direction only if no input chars were removed
}).offset;
// force align in remove direction only if no input chars were removed
// otherwise we still need to align with NONE (to get out from fixed symbols for instance)
var removeDirection = oldRawValue === this.masked.rawInputValue ? details.removeDirection : DIRECTION.NONE;

@@ -423,4 +406,4 @@ var cursorPos = this.masked.nearestInputPos(details.startChangePos + offset, removeDirection);

}
/** Handles view change event and commits model value */
}, {

@@ -432,10 +415,8 @@ key: "_onChange",

}
this.masked.doCommit();
this.updateControl();
this._saveSelection();
}
/** Handles view drop event, prevents by default */
}, {

@@ -447,4 +428,4 @@ key: "_onDrop",

}
/** Restore last selection on focus */
}, {

@@ -455,4 +436,4 @@ key: "_onFocus",

}
/** Restore last selection on focus */
}, {

@@ -463,16 +444,14 @@ key: "_onClick",

}
/** Unbind view events and removes element reference */
}, {
key: "destroy",
value: function destroy() {
this._unbindEvents(); // $FlowFixMe why not do so?
this._listeners.length = 0; // $FlowFixMe
this._unbindEvents();
// $FlowFixMe why not do so?
this._listeners.length = 0;
// $FlowFixMe
delete this.el;
}
}]);
return InputMask;

@@ -479,0 +458,0 @@ }();

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import IMask from '../core/holder.js';

@@ -12,7 +12,5 @@

}
_createClass(MaskElement, [{
key: "selectionStart",
get:
/** */
get: /** */

@@ -26,11 +24,9 @@ /** */

var start;
try {
start = this._unsafeSelectionStart;
} catch (e) {}
return start != null ? start : this.value.length;
}
/** Safely returns selection end */
}, {

@@ -40,11 +36,9 @@ key: "selectionEnd",

var end;
try {
end = this._unsafeSelectionEnd;
} catch (e) {}
return end != null ? end : this.value.length;
}
/** Safely sets element selection */
}, {

@@ -54,3 +48,2 @@ key: "select",

if (start == null || end == null || start === this.selectionStart && end === this.selectionEnd) return;
try {

@@ -60,4 +53,4 @@ this._unsafeSelect(start, end);

}
/** Should be overriden in subclasses */
}, {

@@ -67,3 +60,2 @@ key: "_unsafeSelect",

/** Should be overriden in subclasses */
}, {

@@ -75,3 +67,2 @@ key: "isActive",

/** Should be overriden in subclasses */
}, {

@@ -81,3 +72,2 @@ key: "bindEvents",

/** Should be overriden in subclasses */
}, {

@@ -87,3 +77,2 @@ key: "unbindEvents",

}]);
return MaskElement;

@@ -90,0 +79,0 @@ }();

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import { DIRECTION } from './utils.js';

@@ -6,3 +6,2 @@ import './change-details.js';

/** Provides details of changing input */
var ActionDetails = /*#__PURE__*/function () {

@@ -16,10 +15,11 @@ /** Current input value */

/** Old selection */
function ActionDetails(value, cursorPos, oldValue, oldSelection) {
_classCallCheck(this, ActionDetails);
this.value = value;
this.cursorPos = cursorPos;
this.oldValue = oldValue;
this.oldSelection = oldSelection; // double check if left part was changed (autofilling, other non-standard input triggers)
this.oldSelection = oldSelection;
// double check if left part was changed (autofilling, other non-standard input triggers)
while (this.value.slice(0, this.startChangePos) !== this.oldValue.slice(0, this.startChangePos)) {

@@ -29,2 +29,3 @@ --this.oldSelection.start;

}
/**

@@ -34,4 +35,2 @@ Start changing position

*/
_createClass(ActionDetails, [{

@@ -42,2 +41,3 @@ key: "startChangePos",

}
/**

@@ -47,3 +47,2 @@ Inserted symbols count

*/
}, {

@@ -54,2 +53,3 @@ key: "insertedCount",

}
/**

@@ -59,3 +59,2 @@ Inserted symbols

*/
}, {

@@ -66,2 +65,3 @@ key: "inserted",

}
/**

@@ -71,3 +71,2 @@ Removed symbols count

*/
}, {

@@ -77,5 +76,7 @@ key: "removedCount",

// Math.max for opposite operation
return Math.max(this.oldSelection.end - this.startChangePos || // for Delete
return Math.max(this.oldSelection.end - this.startChangePos ||
// for Delete
this.oldValue.length - this.value.length, 0);
}
/**

@@ -85,3 +86,2 @@ Removed symbols

*/
}, {

@@ -92,2 +92,3 @@ key: "removed",

}
/**

@@ -97,3 +98,2 @@ Unchanged head symbols

*/
}, {

@@ -104,2 +104,3 @@ key: "head",

}
/**

@@ -109,3 +110,2 @@ Unchanged tail symbols

*/
}, {

@@ -116,2 +116,3 @@ key: "tail",

}
/**

@@ -121,13 +122,13 @@ Remove direction

*/
}, {
key: "removeDirection",
get: function get() {
if (!this.removedCount || this.insertedCount) return DIRECTION.NONE; // align right if delete at right
if (!this.removedCount || this.insertedCount) return DIRECTION.NONE;
return (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) && // if not range removed (event with backspace)
// align right if delete at right
return (this.oldSelection.end === this.cursorPos || this.oldSelection.start === this.cursorPos) &&
// if not range removed (event with backspace)
this.oldSelection.end === this.oldSelection.start ? DIRECTION.RIGHT : DIRECTION.LEFT;
}
}]);
return ActionDetails;

@@ -134,0 +135,0 @@ }();

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-30a49e9e.js';

@@ -19,5 +19,5 @@ /**

/** Raw inserted is used by dynamic mask */
function ChangeDetails(details) {
_classCallCheck(this, ChangeDetails);
Object.assign(this, {

@@ -30,2 +30,3 @@ inserted: '',

}
/**

@@ -35,4 +36,2 @@ Aggregate changes

*/
_createClass(ChangeDetails, [{

@@ -47,4 +46,4 @@ key: "aggregate",

}
/** Total offset considering all changes */
}, {

@@ -56,3 +55,2 @@ key: "offset",

}]);
return ChangeDetails;

@@ -59,0 +57,0 @@ }();

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck } from '../_rollupPluginBabelHelpers-30a49e9e.js';

@@ -10,2 +10,3 @@ /** Provides details of continuous extracted tail */

/** Start position */
function ContinuousTailDetails() {

@@ -15,5 +16,3 @@ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';

var stop = arguments.length > 2 ? arguments[2] : undefined;
_classCallCheck(this, ContinuousTailDetails);
this.value = value;

@@ -23,3 +22,2 @@ this.from = from;

}
_createClass(ContinuousTailDetails, [{

@@ -71,3 +69,2 @@ key: "toString",

}]);
return ContinuousTailDetails;

@@ -74,0 +71,0 @@ }();

@@ -1,9 +0,9 @@

import { c as _typeof } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { c as _typeof } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import ChangeDetails from './change-details.js';
/** Checks if value is string */
function isString(str) {
return typeof str === 'string' || str instanceof String;
}
/**

@@ -17,3 +17,2 @@ Direction

*/
var DIRECTION = {

@@ -36,4 +35,4 @@ NONE: 'NONE',

}
/** Returns next char position in direction */
function posInDirection(pos, direction) {

@@ -44,7 +43,5 @@ switch (direction) {

return --pos;
case DIRECTION.RIGHT:
case DIRECTION.FORCE_RIGHT:
return ++pos;
default:

@@ -54,4 +51,4 @@ return pos;

}
/** */
function forceDirection(direction) {

@@ -61,6 +58,4 @@ switch (direction) {

return DIRECTION.FORCE_LEFT;
case DIRECTION.RIGHT:
return DIRECTION.FORCE_RIGHT;
default:

@@ -70,4 +65,4 @@ return direction;

}
/** Escapes regular expression control chars */
function escapeRegExp(str) {

@@ -78,42 +73,32 @@ return str.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');

return Array.isArray(prep) ? prep : [prep, new ChangeDetails()];
} // cloned from https://github.com/epoberezkin/fast-deep-equal with small changes
}
// cloned from https://github.com/epoberezkin/fast-deep-equal with small changes
function objectIncludes(b, a) {
if (a === b) return true;
var arrA = Array.isArray(a),
arrB = Array.isArray(b),
i;
arrB = Array.isArray(b),
i;
if (arrA && arrB) {
if (a.length != b.length) return false;
for (i = 0; i < a.length; i++) {
if (!objectIncludes(a[i], b[i])) return false;
}
for (i = 0; i < a.length; i++) if (!objectIncludes(a[i], b[i])) return false;
return true;
}
if (arrA != arrB) return false;
if (a && b && _typeof(a) === 'object' && _typeof(b) === 'object') {
var dateA = a instanceof Date,
dateB = b instanceof Date;
dateB = b instanceof Date;
if (dateA && dateB) return a.getTime() == b.getTime();
if (dateA != dateB) return false;
var regexpA = a instanceof RegExp,
regexpB = b instanceof RegExp;
regexpB = b instanceof RegExp;
if (regexpA && regexpB) return a.toString() == b.toString();
if (regexpA != regexpB) return false;
var keys = Object.keys(a); // if (keys.length !== Object.keys(b).length) return false;
var keys = Object.keys(a);
// if (keys.length !== Object.keys(b).length) return false;
for (i = 0; i < keys.length; i++) {
// $FlowFixMe ... ???
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
}
for (i = 0; i < keys.length; i++) {
if (!objectIncludes(b[keys[i]], a[keys[i]])) return false;
}
for (i = 0; i < keys.length; i++)
// $FlowFixMe ... ???
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
for (i = 0; i < keys.length; i++) if (!objectIncludes(b[keys[i]], a[keys[i]])) return false;
return true;

@@ -123,7 +108,7 @@ } else if (a && b && typeof a === 'function' && typeof b === 'function') {

}
return false;
}
/** Selection range */
export { DIRECTION, escapeRegExp, forceDirection, indexInDirection, isString, normalizePrepare, objectIncludes, posInDirection };
import './controls/input.js';
import IMask from './core/holder.js';
export { default } from './core/holder.js';
import './_rollupPluginBabelHelpers-67bba7fb.js';
import './_rollupPluginBabelHelpers-30a49e9e.js';
import './core/utils.js';

@@ -6,0 +6,0 @@ import './core/change-details.js';

@@ -18,5 +18,5 @@ export { default as InputMask } from './controls/input.js';

export { PIPE_TYPE, createPipe, pipe } from './masked/pipe.js';
import './_rollupPluginBabelHelpers-67bba7fb.js';
export { default as ChangeDetails } from './core/change-details.js';
import './_rollupPluginBabelHelpers-30a49e9e.js';
import './core/utils.js';
import './core/change-details.js';
import './core/action-details.js';

@@ -23,0 +23,0 @@ import './core/continuous-tail-details.js';

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck, f as _slicedToArray } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck, f as _slicedToArray } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import ChangeDetails from '../core/change-details.js';

@@ -8,3 +8,2 @@ import ContinuousTailDetails from '../core/continuous-tail-details.js';

/** Supported mask type */
/** Provides common masking stuff */

@@ -16,4 +15,3 @@ var Masked = /*#__PURE__*/function () {

/** */
// $FlowFixMe no ideas
/** */ // $FlowFixMe no ideas

@@ -35,21 +33,19 @@ /** Transforms value before mask processing */

/** */
function Masked(opts) {
_classCallCheck(this, Masked);
this._value = '';
this._update(Object.assign({}, Masked.DEFAULTS, opts));
this.isInitialized = true;
}
/** Sets and applies new options */
_createClass(Masked, [{
key: "updateOptions",
value: function updateOptions(opts) {
if (!Object.keys(opts).length) return; // $FlowFixMe
if (!Object.keys(opts).length) return;
// $FlowFixMe
this.withValueRefresh(this._update.bind(this, opts));
}
/**

@@ -59,3 +55,2 @@ Sets new options

*/
}, {

@@ -66,4 +61,4 @@ key: "_update",

}
/** Mask state */
}, {

@@ -79,4 +74,4 @@ key: "state",

}
/** Resets value */
}, {

@@ -87,4 +82,4 @@ key: "reset",

}
/** */
}, {

@@ -98,4 +93,4 @@ key: "value",

}
/** Resolve new value */
}, {

@@ -111,4 +106,4 @@ key: "resolve",

}
/** */
}, {

@@ -124,4 +119,4 @@ key: "unmaskedValue",

}
/** */
}, {

@@ -135,4 +130,4 @@ key: "typedValue",

}
/** Value that includes raw user input */
}, {

@@ -152,4 +147,4 @@ key: "rawInputValue",

}
/** */
}, {

@@ -160,4 +155,4 @@ key: "isComplete",

}
/** */
}, {

@@ -168,4 +163,4 @@ key: "isFilled",

}
/** Finds nearest input position in direction */
}, {

@@ -176,4 +171,4 @@ key: "nearestInputPos",

}
/** Extracts value in range considering flags */
}, {

@@ -186,4 +181,4 @@ key: "extractInput",

}
/** Extracts tail in range */
}, {

@@ -196,5 +191,5 @@ key: "extractTail",

}
/** Appends tail */
// $FlowFixMe no ideas
}, {

@@ -206,4 +201,4 @@ key: "appendTail",

}
/** Appends char */
}, {

@@ -219,4 +214,4 @@ key: "_appendCharRaw",

}
/** Appends char */
}, {

@@ -229,27 +224,21 @@ key: "_appendChar",

var details;
var _normalizePrepare = normalizePrepare(this.doPrepare(ch, flags));
var _normalizePrepare2 = _slicedToArray(_normalizePrepare, 2);
ch = _normalizePrepare2[0];
details = _normalizePrepare2[1];
details = details.aggregate(this._appendCharRaw(ch, flags));
if (details.inserted) {
var consistentTail;
var appended = this.doValidate(flags) !== false;
if (appended && checkTail != null) {
// validation ok, check tail
var beforeTailState = this.state;
if (this.overwrite === true) {
consistentTail = checkTail.state;
checkTail.unshift(this.value.length);
checkTail.unshift(this.value.length - details.tailShift);
}
var tailDetails = this.appendTail(checkTail);
appended = tailDetails.rawInserted === checkTail.toString(); // not ok, try shift
appended = tailDetails.rawInserted === checkTail.toString();
// not ok, try shift
if (!(appended && tailDetails.inserted) && this.overwrite === 'shift') {

@@ -261,9 +250,9 @@ this.state = beforeTailState;

appended = tailDetails.rawInserted === checkTail.toString();
} // if ok, rollback state after tail
}
// if ok, rollback state after tail
if (appended && tailDetails.inserted) this.state = beforeTailState;
} // revert all if something went wrong
}
// revert all if something went wrong
if (!appended) {

@@ -275,7 +264,6 @@ details = new ChangeDetails();

}
return details;
}
/** Appends optional placeholder at end */
}, {

@@ -286,4 +274,4 @@ key: "_appendPlaceholder",

}
/** Appends optional eager placeholder at end */
}, {

@@ -294,5 +282,5 @@ key: "_appendEager",

}
/** Appends symbols considering flags */
// $FlowFixMe no ideas
}, {

@@ -305,10 +293,10 @@ key: "append",

if (flags !== null && flags !== void 0 && flags.tail) flags._beforeTailState = this.state;
for (var ci = 0; ci < str.length; ++ci) {
details.aggregate(this._appendChar(str[ci], flags, checkTail));
} // append tail but aggregate only tailShift
}
// append tail but aggregate only tailShift
if (checkTail != null) {
details.tailShift += this.appendTail(checkTail).tailShift; // TODO it's a good idea to clear state after appending ends
details.tailShift += this.appendTail(checkTail).tailShift;
// TODO it's a good idea to clear state after appending ends
// but it causes bugs when one append calls another (when dynamic dispatch set rawInputValue)

@@ -321,7 +309,6 @@ // this._resetBeforeTailState();

}
return details;
}
/** */
}, {

@@ -335,4 +322,4 @@ key: "remove",

}
/** Calls function and reapplies current value */
}, {

@@ -346,13 +333,12 @@ key: "withValueRefresh",

var ret = fn();
this.rawInputValue = rawInput; // append lost trailing chars at end
this.rawInputValue = rawInput;
// append lost trailing chars at end
if (this.value && this.value !== value && value.indexOf(this.value) === 0) {
this.append(value.slice(this.value.length), {}, '');
}
delete this._refreshing;
return ret;
}
/** */
}, {

@@ -369,2 +355,3 @@ key: "runIsolated",

}
/**

@@ -374,3 +361,2 @@ Prepares string before mask processing

*/
}, {

@@ -382,2 +368,3 @@ key: "doPrepare",

}
/**

@@ -387,3 +374,2 @@ Validates if value is acceptable

*/
}, {

@@ -394,2 +380,3 @@ key: "doValidate",

}
/**

@@ -399,3 +386,2 @@ Does additional processing in the end of editing

*/
}, {

@@ -406,4 +392,4 @@ key: "doCommit",

}
/** */
}, {

@@ -414,4 +400,4 @@ key: "doFormat",

}
/** */
}, {

@@ -422,4 +408,4 @@ key: "doParse",

}
/** */
}, {

@@ -434,3 +420,2 @@ key: "splice",

var oldRawValue;
if (this.eager) {

@@ -442,13 +427,16 @@ removeDirection = forceDirection(removeDirection);

}
var startChangePos = start;
var details = new ChangeDetails();
var startChangePos = this.nearestInputPos(start, deleteCount > 1 && start !== 0 && !this.eager ? DIRECTION.NONE : removeDirection);
var details = new ChangeDetails({
tailShift: startChangePos - start // adjust tailShift if start was aligned
// if it is just deletion without insertion
if (removeDirection !== DIRECTION.NONE) {
startChangePos = this.nearestInputPos(start, deleteCount > 1 && start !== 0 && !this.eager ? DIRECTION.NONE : removeDirection);
}).aggregate(this.remove(startChangePos));
// adjust tailShift if start was aligned
details.tailShift = startChangePos - start;
}
details.aggregate(this.remove(startChangePos));
if (this.eager && removeDirection !== DIRECTION.NONE && oldRawValue === this.rawInputValue) {
if (removeDirection === DIRECTION.FORCE_LEFT) {
var valLength;
while (oldRawValue === this.rawInputValue && (valLength = this.value.length)) {

@@ -463,3 +451,2 @@ details.aggregate(new ChangeDetails({

}
return details.aggregate(this.append(inserted, flags, tail));

@@ -479,3 +466,2 @@ }

}]);
return Masked;

@@ -482,0 +468,0 @@ }();

@@ -1,2 +0,2 @@

import { d as _inherits, e as _createSuper, _ as _createClass, f as _slicedToArray, a as _classCallCheck, g as _get, h as _getPrototypeOf, i as _set } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { d as _inherits, e as _createSuper, _ as _createClass, f as _slicedToArray, a as _classCallCheck, g as _get, h as _getPrototypeOf, i as _set } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import MaskedPattern from './pattern.js';

@@ -17,8 +17,5 @@ import MaskedRange from './range.js';

/** Date mask */
var MaskedDate = /*#__PURE__*/function (_MaskedPattern) {
_inherits(MaskedDate, _MaskedPattern);
var _super = _createSuper(MaskedDate);
/** Pattern mask for date according to {@link MaskedDate#format} */

@@ -37,10 +34,8 @@

_classCallCheck(this, MaskedDate);
return _super.call(this, Object.assign({}, MaskedDate.DEFAULTS, opts));
}
/**
@override
*/
_createClass(MaskedDate, [{

@@ -52,11 +47,9 @@ key: "_update",

var blocks = opts.blocks;
opts.blocks = Object.assign({}, MaskedDate.GET_DEFAULT_BLOCKS()); // adjust year block
opts.blocks = Object.assign({}, MaskedDate.GET_DEFAULT_BLOCKS());
// adjust year block
if (opts.min) opts.blocks.Y.from = opts.min.getFullYear();
if (opts.max) opts.blocks.Y.to = opts.max.getFullYear();
if (opts.min && opts.max && opts.blocks.Y.from === opts.blocks.Y.to) {
opts.blocks.m.from = opts.min.getMonth() + 1;
opts.blocks.m.to = opts.max.getMonth() + 1;
if (opts.blocks.m.from === opts.blocks.m.to) {

@@ -67,5 +60,5 @@ opts.blocks.d.from = opts.min.getDate();

}
Object.assign(opts.blocks, this.blocks, blocks);
Object.assign(opts.blocks, this.blocks, blocks); // add autofix
// add autofix
Object.keys(opts.blocks).forEach(function (bk) {

@@ -75,9 +68,8 @@ var b = opts.blocks[bk];

});
_get(_getPrototypeOf(MaskedDate.prototype), "_update", this).call(this, opts);
}
/**
@override
*/
}, {

@@ -87,13 +79,10 @@ key: "doValidate",

var _get2;
var date = this.date;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return (_get2 = _get(_getPrototypeOf(MaskedDate.prototype), "doValidate", this)).call.apply(_get2, [this].concat(args)) && (!this.isComplete || this.isDateExist(this.value) && date != null && (this.min == null || this.min <= date) && (this.max == null || date <= this.max));
}
/** Checks if date is exists */
}, {

@@ -104,4 +93,4 @@ key: "isDateExist",

}
/** Parsed Date */
}, {

@@ -115,6 +104,6 @@ key: "date",

}
/**
@override
*/
}, {

@@ -128,6 +117,6 @@ key: "typedValue",

}
/**
@override
*/
}, {

@@ -139,3 +128,2 @@ key: "maskEquals",

}]);
return MaskedDate;

@@ -154,11 +142,9 @@ }(MaskedPattern);

var _str$split = str.split('.'),
_str$split2 = _slicedToArray(_str$split, 3),
day = _str$split2[0],
month = _str$split2[1],
year = _str$split2[2];
_str$split2 = _slicedToArray(_str$split, 3),
day = _str$split2[0],
month = _str$split2[1],
year = _str$split2[2];
return new Date(year, month - 1, day);
}
};
MaskedDate.GET_DEFAULT_BLOCKS = function () {

@@ -185,5 +171,4 @@ return {

};
IMask.MaskedDate = MaskedDate;
export { MaskedDate as default };

@@ -1,2 +0,2 @@

import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf, f as _slicedToArray, i as _set, b as _objectWithoutProperties } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf, f as _slicedToArray, i as _set, b as _objectWithoutProperties } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import ChangeDetails from '../core/change-details.js';

@@ -10,9 +10,6 @@ import createMask from './factory.js';

var _excluded = ["compiledMasks", "currentMaskRef", "currentMask"];
/** Dynamic mask for choosing apropriate mask in run-time */
var MaskedDynamic = /*#__PURE__*/function (_Masked) {
_inherits(MaskedDynamic, _Masked);
var _super = _createSuper(MaskedDynamic);
/** Currently chosen mask */

@@ -29,5 +26,3 @@

var _this;
_classCallCheck(this, MaskedDynamic);
_this = _super.call(this, Object.assign({}, MaskedDynamic.DEFAULTS, opts));

@@ -37,7 +32,6 @@ _this.currentMask = null;

}
/**
@override
*/
_createClass(MaskedDynamic, [{

@@ -47,3 +41,2 @@ key: "_update",

_get(_getPrototypeOf(MaskedDynamic.prototype), "_update", this).call(this, opts);
if ('mask' in opts) {

@@ -56,6 +49,6 @@ // mask could be totally dynamic with only `dispatch` option

}
/**
@override
*/
}, {

@@ -65,9 +58,6 @@ key: "_appendCharRaw",

var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var details = this._applyDispatch(ch, flags);
if (this.currentMask) {
details.aggregate(this.currentMask._appendChar(ch, this.currentMaskFlags(flags)));
}
return details;

@@ -82,3 +72,4 @@ }

var inputValue = this.rawInputValue;
var insertValue = flags.tail && flags._beforeTailState != null ? // $FlowFixMe - tired to fight with type system
var insertValue = flags.tail && flags._beforeTailState != null ?
// $FlowFixMe - tired to fight with type system
flags._beforeTailState._rawInputValue : inputValue;

@@ -88,6 +79,8 @@ var tailValue = inputValue.slice(insertValue.length);

var details = new ChangeDetails();
var prevMaskState = prevMask === null || prevMask === void 0 ? void 0 : prevMask.state; // clone flags to prevent overwriting `_beforeTailState`
var prevMaskState = prevMask === null || prevMask === void 0 ? void 0 : prevMask.state;
this.currentMask = this.doDispatch(appended, Object.assign({}, flags)); // restore state after dispatch
// clone flags to prevent overwriting `_beforeTailState`
this.currentMask = this.doDispatch(appended, Object.assign({}, flags));
// restore state after dispatch
if (this.currentMask) {

@@ -97,3 +90,2 @@ if (this.currentMask !== prevMask) {

this.currentMask.reset();
if (insertValue) {

@@ -106,3 +98,2 @@ // $FlowFixMe - it's ok, we don't change current mask above

}
if (tailValue) {

@@ -121,3 +112,2 @@ // $FlowFixMe - it's ok, we don't change current mask above

}
return details;

@@ -129,13 +119,11 @@ }

var details = this._applyDispatch.apply(this, arguments);
if (this.currentMask) {
details.aggregate(this.currentMask._appendPlaceholder());
}
return details;
}
/**
@override
*/
}, {

@@ -145,7 +133,5 @@ key: "_appendEager",

var details = this._applyDispatch.apply(this, arguments);
if (this.currentMask) {
details.aggregate(this.currentMask._appendEager());
}
return details;

@@ -157,3 +143,2 @@ }

var _flags$_beforeTailSta, _flags$_beforeTailSta2;
return Object.assign({}, flags, {

@@ -163,6 +148,6 @@ _beforeTailState: ((_flags$_beforeTailSta = flags._beforeTailState) === null || _flags$_beforeTailSta === void 0 ? void 0 : _flags$_beforeTailSta.currentMaskRef) === this.currentMask && ((_flags$_beforeTailSta2 = flags._beforeTailState) === null || _flags$_beforeTailSta2 === void 0 ? void 0 : _flags$_beforeTailSta2.currentMask) || flags._beforeTailState

}
/**
@override
*/
}, {

@@ -174,6 +159,6 @@ key: "doDispatch",

}
/**
@override
*/
}, {

@@ -184,6 +169,6 @@ key: "doValidate",

}
/**
@override
*/
}, {

@@ -193,15 +178,10 @@ key: "doPrepare",

var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var _normalizePrepare = normalizePrepare(_get(_getPrototypeOf(MaskedDynamic.prototype), "doPrepare", this).call(this, str, flags)),
_normalizePrepare2 = _slicedToArray(_normalizePrepare, 2),
s = _normalizePrepare2[0],
details = _normalizePrepare2[1];
_normalizePrepare2 = _slicedToArray(_normalizePrepare, 2),
s = _normalizePrepare2[0],
details = _normalizePrepare2[1];
if (this.currentMask) {
var currentDetails;
var _normalizePrepare3 = normalizePrepare(_get(_getPrototypeOf(MaskedDynamic.prototype), "doPrepare", this).call(this, s, this.currentMaskFlags(flags)));
var _normalizePrepare4 = _slicedToArray(_normalizePrepare3, 2);
s = _normalizePrepare4[0];

@@ -211,9 +191,8 @@ currentDetails = _normalizePrepare4[1];

}
return [s, details];
}
/**
@override
*/
}, {

@@ -223,3 +202,2 @@ key: "reset",

var _this$currentMask;
(_this$currentMask = this.currentMask) === null || _this$currentMask === void 0 ? void 0 : _this$currentMask.reset();

@@ -230,6 +208,6 @@ this.compiledMasks.forEach(function (m) {

}
/**
@override
*/
}, {

@@ -243,6 +221,6 @@ key: "value",

}
/**
@override
*/
}, {

@@ -256,6 +234,6 @@ key: "unmaskedValue",

}
/**
@override
*/
}, {

@@ -265,7 +243,10 @@ key: "typedValue",

return this.currentMask ? this.currentMask.typedValue : '';
} // probably typedValue should not be used with dynamic
}
// probably typedValue should not be used with dynamic
,
set: function set(value) {
var unmaskedValue = String(value); // double check it
var unmaskedValue = String(value);
// double check it
if (this.currentMask) {

@@ -275,9 +256,8 @@ this.currentMask.typedValue = value;

}
this.unmaskedValue = unmaskedValue;
}
/**
@override
*/
}, {

@@ -287,9 +267,8 @@ key: "isComplete",

var _this$currentMask2;
return Boolean((_this$currentMask2 = this.currentMask) === null || _this$currentMask2 === void 0 ? void 0 : _this$currentMask2.isComplete);
}
/**
@override
*/
}, {

@@ -299,9 +278,8 @@ key: "isFilled",

var _this$currentMask3;
return Boolean((_this$currentMask3 = this.currentMask) === null || _this$currentMask3 === void 0 ? void 0 : _this$currentMask3.isFilled);
}
/**
@override
*/
}, {

@@ -311,16 +289,14 @@ key: "remove",

var details = new ChangeDetails();
if (this.currentMask) {
var _this$currentMask4;
details.aggregate((_this$currentMask4 = this.currentMask).remove.apply(_this$currentMask4, arguments)) // update with dispatch
details.aggregate((_this$currentMask4 = this.currentMask).remove.apply(_this$currentMask4, arguments))
// update with dispatch
.aggregate(this._applyDispatch());
}
return details;
}
/**
@override
*/
}, {

@@ -330,3 +306,2 @@ key: "state",

var _this$currentMask5;
return Object.assign({}, _get(_getPrototypeOf(MaskedDynamic.prototype), "state", this), {

@@ -343,10 +318,8 @@ _rawInputValue: this.rawInputValue,

var compiledMasks = state.compiledMasks,
currentMaskRef = state.currentMaskRef,
currentMask = state.currentMask,
maskedState = _objectWithoutProperties(state, _excluded);
currentMaskRef = state.currentMaskRef,
currentMask = state.currentMask,
maskedState = _objectWithoutProperties(state, _excluded);
this.compiledMasks.forEach(function (m, mi) {
return m.state = compiledMasks[mi];
});
if (currentMaskRef != null) {

@@ -356,9 +329,8 @@ this.currentMask = currentMaskRef;

}
_set(_getPrototypeOf(MaskedDynamic.prototype), "state", maskedState, this, true);
}
/**
@override
*/
}, {

@@ -368,9 +340,8 @@ key: "extractInput",

var _this$currentMask6;
return this.currentMask ? (_this$currentMask6 = this.currentMask).extractInput.apply(_this$currentMask6, arguments) : '';
}
/**
@override
*/
}, {

@@ -380,13 +351,11 @@ key: "extractTail",

var _this$currentMask7, _get2;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return this.currentMask ? (_this$currentMask7 = this.currentMask).extractTail.apply(_this$currentMask7, args) : (_get2 = _get(_getPrototypeOf(MaskedDynamic.prototype), "extractTail", this)).call.apply(_get2, [this].concat(args));
}
/**
@override
*/
}, {

@@ -396,9 +365,8 @@ key: "doCommit",

if (this.currentMask) this.currentMask.doCommit();
_get(_getPrototypeOf(MaskedDynamic.prototype), "doCommit", this).call(this);
}
/**
@override
*/
}, {

@@ -408,7 +376,5 @@ key: "nearestInputPos",

var _this$currentMask8, _get3;
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return this.currentMask ? (_this$currentMask8 = this.currentMask).nearestInputPos.apply(_this$currentMask8, args) : (_get3 = _get(_getPrototypeOf(MaskedDynamic.prototype), "nearestInputPos", this)).call.apply(_get3, [this].concat(args));

@@ -432,6 +398,6 @@ }

}
/**
@override
*/
}, {

@@ -442,10 +408,9 @@ key: "maskEquals",

var _mask$mi;
return m.maskEquals((_mask$mi = mask[mi]) === null || _mask$mi === void 0 ? void 0 : _mask$mi.mask);
});
}
/**
@override
*/
}, {

@@ -455,7 +420,5 @@ key: "typedValueEquals",

var _this$currentMask9;
return Boolean((_this$currentMask9 = this.currentMask) === null || _this$currentMask9 === void 0 ? void 0 : _this$currentMask9.typedValueEquals(value));
}
}]);
return MaskedDynamic;

@@ -466,4 +429,5 @@ }(Masked);

if (!masked.compiledMasks.length) return;
var inputValue = masked.rawInputValue; // simulate input
var inputValue = masked.rawInputValue;
// simulate input
var inputs = masked.compiledMasks.map(function (m, index) {

@@ -480,4 +444,5 @@ m.reset();

};
}); // pop masks with longer values first
});
// pop masks with longer values first
inputs.sort(function (i1, i2) {

@@ -484,0 +449,0 @@ return i2.weight - i1.weight;

@@ -1,2 +0,2 @@

import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import MaskedPattern from './pattern.js';

@@ -16,14 +16,9 @@ import IMask from '../core/holder.js';

/** Pattern which validates enum values */
var MaskedEnum = /*#__PURE__*/function (_MaskedPattern) {
_inherits(MaskedEnum, _MaskedPattern);
var _super = _createSuper(MaskedEnum);
function MaskedEnum() {
_classCallCheck(this, MaskedEnum);
return _super.apply(this, arguments);
}
_createClass(MaskedEnum, [{

@@ -39,9 +34,8 @@ key: "_update",

if (opts.enum) opts.mask = '*'.repeat(opts.enum[0].length);
_get(_getPrototypeOf(MaskedEnum.prototype), "_update", this).call(this, opts);
}
/**
@override
*/
}, {

@@ -51,8 +45,6 @@ key: "doValidate",

var _this = this,
_get2;
_get2;
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return this.enum.some(function (e) {

@@ -63,3 +55,2 @@ return e.indexOf(_this.unmaskedValue) >= 0;

}]);
return MaskedEnum;

@@ -66,0 +57,0 @@ }(MaskedPattern);

import { isString } from '../core/utils.js';
import IMask from '../core/holder.js';
import '../_rollupPluginBabelHelpers-67bba7fb.js';
import '../_rollupPluginBabelHelpers-30a49e9e.js';
import '../core/change-details.js';
/** Get Masked class by mask type */
function maskedClass(mask) {
if (mask == null) {
throw new Error('mask property should be defined');
} // $FlowFixMe
}
if (mask instanceof RegExp) return IMask.MaskedRegExp; // $FlowFixMe
if (isString(mask)) return IMask.MaskedPattern; // $FlowFixMe
if (mask instanceof Date || mask === Date) return IMask.MaskedDate; // $FlowFixMe
if (mask instanceof Number || typeof mask === 'number' || mask === Number) return IMask.MaskedNumber; // $FlowFixMe
if (Array.isArray(mask) || mask === Array) return IMask.MaskedDynamic; // $FlowFixMe
if (IMask.Masked && mask.prototype instanceof IMask.Masked) return mask; // $FlowFixMe
if (mask instanceof IMask.Masked) return mask.constructor; // $FlowFixMe
// $FlowFixMe
if (mask instanceof RegExp) return IMask.MaskedRegExp;
// $FlowFixMe
if (isString(mask)) return IMask.MaskedPattern;
// $FlowFixMe
if (mask instanceof Date || mask === Date) return IMask.MaskedDate;
// $FlowFixMe
if (mask instanceof Number || typeof mask === 'number' || mask === Number) return IMask.MaskedNumber;
// $FlowFixMe
if (Array.isArray(mask) || mask === Array) return IMask.MaskedDynamic;
// $FlowFixMe
if (IMask.Masked && mask.prototype instanceof IMask.Masked) return mask;
// $FlowFixMe
if (mask instanceof IMask.Masked) return mask.constructor;
// $FlowFixMe
if (mask instanceof Function) return IMask.MaskedFunction;
console.warn('Mask not found for mask', mask); // eslint-disable-line no-console
// $FlowFixMe
return IMask.Masked;
}
/** Creates new {@link Masked} depending on mask type */
function createMask(opts) {

@@ -40,4 +38,5 @@ // $FlowFixMe

opts = Object.assign({}, opts);
var mask = opts.mask; // $FlowFixMe
var mask = opts.mask;
// $FlowFixMe
if (IMask.Masked && mask instanceof IMask.Masked) return mask;

@@ -44,0 +43,0 @@ var MaskedClass = maskedClass(mask);

@@ -1,2 +0,2 @@

import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import Masked from './base.js';

@@ -9,14 +9,9 @@ import IMask from '../core/holder.js';

/** Masking by custom Function */
var MaskedFunction = /*#__PURE__*/function (_Masked) {
_inherits(MaskedFunction, _Masked);
var _super = _createSuper(MaskedFunction);
function MaskedFunction() {
_classCallCheck(this, MaskedFunction);
return _super.apply(this, arguments);
}
_createClass(MaskedFunction, [{

@@ -31,7 +26,5 @@ key: "_update",

if (opts.mask) opts.validate = opts.mask;
_get(_getPrototypeOf(MaskedFunction.prototype), "_update", this).call(this, opts);
}
}]);
return MaskedFunction;

@@ -38,0 +31,0 @@ }(Masked);

@@ -1,2 +0,2 @@

import { j as _toConsumableArray, d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf, f as _slicedToArray, i as _set } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { j as _toConsumableArray, d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf, f as _slicedToArray, i as _set } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import { escapeRegExp, normalizePrepare, DIRECTION } from '../core/utils.js';

@@ -23,5 +23,3 @@ import ChangeDetails from '../core/change-details.js';

_inherits(MaskedNumber, _Masked);
var _super = _createSuper(MaskedNumber);
/** Single char */

@@ -44,12 +42,11 @@

/** Flag to pad trailing zeros after point in the end of editing */
function MaskedNumber(opts) {
_classCallCheck(this, MaskedNumber);
return _super.call(this, Object.assign({}, MaskedNumber.DEFAULTS, opts));
}
/**
@override
*/
_createClass(MaskedNumber, [{

@@ -59,22 +56,18 @@ key: "_update",

_get(_getPrototypeOf(MaskedNumber.prototype), "_update", this).call(this, opts);
this._updateRegExps();
}
/** */
}, {
key: "_updateRegExps",
value: function _updateRegExps() {
// use different regexp to process user input (more strict, input suffix) and tail shifting
var start = '^' + (this.allowNegative ? '[+|\\-]?' : '');
var midInput = '(0|([1-9]+\\d*))?';
var mid = '\\d*';
var end = (this.scale ? '(' + escapeRegExp(this.radix) + '\\d{0,' + this.scale + '})?' : '') + '$';
this._numberRegExpInput = new RegExp(start + midInput + end);
var end = (this.scale ? "(".concat(escapeRegExp(this.radix), "\\d{0,").concat(this.scale, "})?") : '') + '$';
this._numberRegExp = new RegExp(start + mid + end);
this._mapToRadixRegExp = new RegExp('[' + this.mapToRadix.map(escapeRegExp).join('') + ']', 'g');
this._mapToRadixRegExp = new RegExp("[".concat(this.mapToRadix.map(escapeRegExp).join(''), "]"), 'g');
this._thousandsSeparatorRegExp = new RegExp(escapeRegExp(this.thousandsSeparator), 'g');
}
/** */
}, {

@@ -85,4 +78,4 @@ key: "_removeThousandsSeparators",

}
/** */
}, {

@@ -96,29 +89,20 @@ key: "_insertThousandsSeparators",

}
/**
@override
*/
}, {
key: "doPrepare",
value: function doPrepare(ch) {
var _get2;
ch = ch.replace(this._mapToRadixRegExp, this.radix);
var noSepCh = this._removeThousandsSeparators(ch);
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var _normalizePrepare = normalizePrepare((_get2 = _get(_getPrototypeOf(MaskedNumber.prototype), "doPrepare", this)).call.apply(_get2, [this, noSepCh].concat(args))),
_normalizePrepare2 = _slicedToArray(_normalizePrepare, 2),
prepCh = _normalizePrepare2[0],
details = _normalizePrepare2[1];
if (ch && !noSepCh) details.skip = true;
var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
ch = this._removeThousandsSeparators(this.scale && this.mapToRadix.length && flags.raw ? ch.replace(this._mapToRadixRegExp, this.radix) : ch);
var _normalizePrepare = normalizePrepare(_get(_getPrototypeOf(MaskedNumber.prototype), "doPrepare", this).call(this, ch, flags)),
_normalizePrepare2 = _slicedToArray(_normalizePrepare, 2),
prepCh = _normalizePrepare2[0],
details = _normalizePrepare2[1];
if (ch && !prepCh) details.skip = true;
return [prepCh, details];
}
/** */
}, {

@@ -129,3 +113,2 @@ key: "_separatorsCount",

var count = 0;
for (var pos = 0; pos < to; ++pos) {

@@ -137,7 +120,6 @@ if (this._value.indexOf(this.thousandsSeparator, pos) === pos) {

}
return count;
}
/** */
}, {

@@ -149,6 +131,6 @@ key: "_separatorsCountFromSlice",

}
/**
@override
*/
}, {

@@ -160,7 +142,4 @@ key: "extractInput",

var flags = arguments.length > 2 ? arguments[2] : undefined;
var _this$_adjustRangeWit = this._adjustRangeWithSeparators(fromPos, toPos);
var _this$_adjustRangeWit2 = _slicedToArray(_this$_adjustRangeWit, 2);
fromPos = _this$_adjustRangeWit2[0];

@@ -170,6 +149,6 @@ toPos = _this$_adjustRangeWit2[1];

}
/**
@override
*/
}, {

@@ -181,14 +160,8 @@ key: "_appendCharRaw",

var prevBeforeTailValue = flags.tail && flags._beforeTailState ? flags._beforeTailState._value : this._value;
var prevBeforeTailSeparatorsCount = this._separatorsCountFromSlice(prevBeforeTailValue);
this._value = this._removeThousandsSeparators(this.value);
var appendDetails = _get(_getPrototypeOf(MaskedNumber.prototype), "_appendCharRaw", this).call(this, ch, flags);
this._value = this._insertThousandsSeparators(this._value);
var beforeTailValue = flags.tail && flags._beforeTailState ? flags._beforeTailState._value : this._value;
var beforeTailSeparatorsCount = this._separatorsCountFromSlice(beforeTailValue);
appendDetails.tailShift += (beforeTailSeparatorsCount - prevBeforeTailSeparatorsCount) * this.thousandsSeparator.length;

@@ -198,4 +171,4 @@ appendDetails.skip = !appendDetails.rawInserted && ch === this.thousandsSeparator;

}
/** */
}, {

@@ -209,3 +182,2 @@ key: "_findSeparatorAround",

}
return -1;

@@ -217,14 +189,11 @@ }

var separatorAroundFromPos = this._findSeparatorAround(from);
if (separatorAroundFromPos >= 0) from = separatorAroundFromPos;
var separatorAroundToPos = this._findSeparatorAround(to);
if (separatorAroundToPos >= 0) to = separatorAroundToPos + this.thousandsSeparator.length;
return [from, to];
}
/**
@override
*/
}, {

@@ -235,7 +204,4 @@ key: "remove",

var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;
var _this$_adjustRangeWit3 = this._adjustRangeWithSeparators(fromPos, toPos);
var _this$_adjustRangeWit4 = _slicedToArray(_this$_adjustRangeWit3, 2);
fromPos = _this$_adjustRangeWit4[0];

@@ -245,9 +211,5 @@ toPos = _this$_adjustRangeWit4[1];

var valueAfterPos = this.value.slice(toPos);
var prevBeforeTailSeparatorsCount = this._separatorsCount(valueBeforePos.length);
this._value = this._insertThousandsSeparators(this._removeThousandsSeparators(valueBeforePos + valueAfterPos));
var beforeTailSeparatorsCount = this._separatorsCountFromSlice(valueBeforePos);
return new ChangeDetails({

@@ -257,6 +219,6 @@ tailShift: (beforeTailSeparatorsCount - prevBeforeTailSeparatorsCount) * this.thousandsSeparator.length

}
/**
@override
*/
}, {

@@ -266,3 +228,2 @@ key: "nearestInputPos",

if (!this.thousandsSeparator) return cursorPos;
switch (direction) {

@@ -274,6 +235,4 @@ case DIRECTION.NONE:

var separatorAtLeftPos = this._findSeparatorAround(cursorPos - 1);
if (separatorAtLeftPos >= 0) {
var separatorAtLeftEndPos = separatorAtLeftPos + this.thousandsSeparator.length;
if (cursorPos < separatorAtLeftEndPos || this.value.length <= separatorAtLeftEndPos || direction === DIRECTION.FORCE_LEFT) {

@@ -283,6 +242,4 @@ return separatorAtLeftPos;

}
break;
}
case DIRECTION.RIGHT:

@@ -292,3 +249,2 @@ case DIRECTION.FORCE_RIGHT:

var separatorAtRightPos = this._findSeparatorAround(cursorPos);
if (separatorAtRightPos >= 0) {

@@ -299,30 +255,28 @@ return separatorAtRightPos + this.thousandsSeparator.length;

}
return cursorPos;
}
/**
@override
*/
}, {
key: "doValidate",
value: function doValidate(flags) {
var regexp = flags.input ? this._numberRegExpInput : this._numberRegExp; // validate as string
var valid = regexp.test(this._removeThousandsSeparators(this.value));
// validate as string
var valid = Boolean(this._removeThousandsSeparators(this.value).match(this._numberRegExp));
if (valid) {
// validate as number
var number = this.number;
valid = valid && !isNaN(number) && ( // check min bound for negative values
this.min == null || this.min >= 0 || this.min <= this.number) && ( // check max bound for positive values
valid = valid && !isNaN(number) && (
// check min bound for negative values
this.min == null || this.min >= 0 || this.min <= this.number) && (
// check max bound for positive values
this.max == null || this.max <= 0 || this.number <= this.max);
}
return valid && _get(_getPrototypeOf(MaskedNumber.prototype), "doValidate", this).call(this, flags);
}
/**
@override
*/
}, {

@@ -333,4 +287,5 @@ key: "doCommit",

var number = this.number;
var validnum = number; // check bounds
var validnum = number;
// check bounds
if (this.min != null) validnum = Math.max(validnum, this.min);

@@ -344,22 +299,19 @@ if (this.max != null) validnum = Math.min(validnum, this.max);

}
_get(_getPrototypeOf(MaskedNumber.prototype), "doCommit", this).call(this);
}
/** */
}, {
key: "_normalizeZeros",
value: function _normalizeZeros(value) {
var parts = this._removeThousandsSeparators(value).split(this.radix); // remove leading zeros
var parts = this._removeThousandsSeparators(value).split(this.radix);
// remove leading zeros
parts[0] = parts[0].replace(/^(\D*)(0*)(\d*)/, function (match, sign, zeros, num) {
return sign + num;
}); // add leading zero
});
// add leading zero
if (value.length && !/\d$/.test(parts[0])) parts[0] = parts[0] + '0';
if (parts.length > 1) {
parts[1] = parts[1].replace(/0*$/, ''); // remove trailing zeros
if (!parts[1].length) parts.length = 1; // remove fractional

@@ -370,4 +322,4 @@ }

}
/** */
}, {

@@ -382,6 +334,6 @@ key: "_padFractionalZeros",

}
/**
@override
*/
}, {

@@ -395,6 +347,6 @@ key: "unmaskedValue",

}
/**
@override
*/
}, {

@@ -406,6 +358,6 @@ key: "typedValue",

set: function set(n) {
_set(_getPrototypeOf(MaskedNumber.prototype), "unmaskedValue", String(n), this, true);
this.rawInputValue = String(n).replace('.', this.radix);
}
/** Parsed Number */
}, {

@@ -419,2 +371,3 @@ key: "number",

}
/**

@@ -424,3 +377,2 @@ Is negative allowed

*/
}, {

@@ -431,6 +383,6 @@ key: "allowNegative",

}
/**
@override
*/
}, {

@@ -444,3 +396,2 @@ key: "typedValueEquals",

}]);
return MaskedNumber;

@@ -447,0 +398,0 @@ }(Masked);

@@ -1,2 +0,2 @@

import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf, b as _objectWithoutProperties, i as _set } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf, b as _objectWithoutProperties, i as _set } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import { DIRECTION } from '../core/utils.js';

@@ -15,3 +15,2 @@ import ChangeDetails from '../core/change-details.js';

var _excluded = ["_blocks"];
/**

@@ -27,5 +26,3 @@ Pattern mask

_inherits(MaskedPattern, _Masked);
var _super = _createSuper(MaskedPattern);
/** */

@@ -38,7 +35,6 @@

/** Show placeholder only when needed */
function MaskedPattern() {
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, MaskedPattern);
// TODO type $Shape<MaskedPatternOptions>={} does not work

@@ -48,2 +44,3 @@ opts.definitions = Object.assign({}, DEFAULT_INPUT_DEFINITIONS, opts.definitions);

}
/**

@@ -53,4 +50,2 @@ @override

*/
_createClass(MaskedPattern, [{

@@ -61,9 +56,7 @@ key: "_update",

opts.definitions = Object.assign({}, this.definitions, opts.definitions);
_get(_getPrototypeOf(MaskedPattern.prototype), "_update", this).call(this, opts);
this._rebuildMask();
}
/** */
}, {

@@ -73,3 +66,2 @@ key: "_rebuildMask",

var _this = this;
var defs = this.definitions;

@@ -83,75 +75,66 @@ this._blocks = [];

var optionalBlock = false;
var _loop = function _loop(_i) {
if (_this.blocks) {
var p = pattern.slice(_i);
var bNames = Object.keys(_this.blocks).filter(function (bName) {
return p.indexOf(bName) === 0;
});
// order by key length
bNames.sort(function (a, b) {
return b.length - a.length;
});
// use block name with max length
var bName = bNames[0];
if (bName) {
// $FlowFixMe no ideas
var maskedBlock = createMask(Object.assign({
parent: _this,
lazy: _this.lazy,
eager: _this.eager,
placeholderChar: _this.placeholderChar,
overwrite: _this.overwrite
}, _this.blocks[bName]));
if (maskedBlock) {
_this._blocks.push(maskedBlock);
for (var i = 0; i < pattern.length; ++i) {
if (this.blocks) {
var _ret = function () {
var p = pattern.slice(i);
var bNames = Object.keys(_this.blocks).filter(function (bName) {
return p.indexOf(bName) === 0;
}); // order by key length
bNames.sort(function (a, b) {
return b.length - a.length;
}); // use block name with max length
var bName = bNames[0];
if (bName) {
// $FlowFixMe no ideas
var maskedBlock = createMask(Object.assign({
parent: _this,
lazy: _this.lazy,
eager: _this.eager,
placeholderChar: _this.placeholderChar,
overwrite: _this.overwrite
}, _this.blocks[bName]));
if (maskedBlock) {
_this._blocks.push(maskedBlock); // store block index
if (!_this._maskedBlocks[bName]) _this._maskedBlocks[bName] = [];
_this._maskedBlocks[bName].push(_this._blocks.length - 1);
}
i += bName.length - 1;
return "continue";
// store block index
if (!_this._maskedBlocks[bName]) _this._maskedBlocks[bName] = [];
_this._maskedBlocks[bName].push(_this._blocks.length - 1);
}
}();
if (_ret === "continue") continue;
_i += bName.length - 1;
i = _i;
return "continue";
}
}
var char = pattern[i];
var char = pattern[_i];
var isInput = (char in defs);
if (char === MaskedPattern.STOP_CHAR) {
this._stops.push(this._blocks.length);
continue;
_this._stops.push(_this._blocks.length);
i = _i;
return "continue";
}
if (char === '{' || char === '}') {
unmaskingBlock = !unmaskingBlock;
continue;
i = _i;
return "continue";
}
if (char === '[' || char === ']') {
optionalBlock = !optionalBlock;
continue;
i = _i;
return "continue";
}
if (char === MaskedPattern.ESCAPE_CHAR) {
++i;
char = pattern[i];
if (!char) break;
++_i;
char = pattern[_i];
if (!char) {
i = _i;
return "break";
}
isInput = false;
}
var def = isInput ? new PatternInputDefinition({
parent: this,
lazy: this.lazy,
eager: this.eager,
placeholderChar: this.placeholderChar,
parent: _this,
lazy: _this.lazy,
eager: _this.eager,
placeholderChar: _this.placeholderChar,
mask: defs[char],

@@ -161,13 +144,18 @@ isOptional: optionalBlock

char: char,
eager: this.eager,
eager: _this.eager,
isUnmasking: unmaskingBlock
});
this._blocks.push(def);
_this._blocks.push(def);
i = _i;
};
for (var i = 0; i < pattern.length; ++i) {
var _ret = _loop(i);
if (_ret === "continue") continue;
if (_ret === "break") break;
}
}
/**
@override
*/
}, {

@@ -184,14 +172,12 @@ key: "state",

var _blocks = state._blocks,
maskedState = _objectWithoutProperties(state, _excluded);
maskedState = _objectWithoutProperties(state, _excluded);
this._blocks.forEach(function (b, bi) {
return b.state = _blocks[bi];
});
_set(_getPrototypeOf(MaskedPattern.prototype), "state", maskedState, this, true);
}
/**
@override
*/
}, {

@@ -201,3 +187,2 @@ key: "reset",

_get(_getPrototypeOf(MaskedPattern.prototype), "reset", this).call(this);
this._blocks.forEach(function (b) {

@@ -207,6 +192,6 @@ return b.reset();

}
/**
@override
*/
}, {

@@ -219,6 +204,6 @@ key: "isComplete",

}
/**
@override
*/
}, {

@@ -245,6 +230,6 @@ key: "isFilled",

}
/**
@override
*/
}, {

@@ -256,9 +241,8 @@ key: "doCommit",

});
_get(_getPrototypeOf(MaskedPattern.prototype), "doCommit", this).call(this);
}
/**
@override
*/
}, {

@@ -274,6 +258,6 @@ key: "unmaskedValue",

}
/**
@override
*/
}, {

@@ -290,6 +274,6 @@ key: "value",

}
/**
@override
*/
}, {

@@ -300,6 +284,6 @@ key: "appendTail",

}
/**
@override
*/
}, {

@@ -309,22 +293,19 @@ key: "_appendEager",

var _this$_mapPosToBlock;
var details = new ChangeDetails();
var startBlockIndex = (_this$_mapPosToBlock = this._mapPosToBlock(this.value.length)) === null || _this$_mapPosToBlock === void 0 ? void 0 : _this$_mapPosToBlock.index;
if (startBlockIndex == null) return details; // TODO test if it works for nested pattern masks
if (startBlockIndex == null) return details;
// TODO test if it works for nested pattern masks
if (this._blocks[startBlockIndex].isFilled) ++startBlockIndex;
for (var bi = startBlockIndex; bi < this._blocks.length; ++bi) {
var d = this._blocks[bi]._appendEager();
if (!d.inserted) break;
details.aggregate(d);
}
return details;
}
/**
@override
*/
}, {

@@ -334,18 +315,12 @@ key: "_appendCharRaw",

var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var blockIter = this._mapPosToBlock(this.value.length);
var details = new ChangeDetails();
if (!blockIter) return details;
for (var bi = blockIter.index;; ++bi) {
var _flags$_beforeTailSta, _flags$_beforeTailSta2;
var _block = this._blocks[bi];
if (!_block) break;
var blockDetails = _block._appendChar(ch, Object.assign({}, flags, {
_beforeTailState: (_flags$_beforeTailSta = flags._beforeTailState) === null || _flags$_beforeTailSta === void 0 ? void 0 : (_flags$_beforeTailSta2 = _flags$_beforeTailSta._blocks) === null || _flags$_beforeTailSta2 === void 0 ? void 0 : _flags$_beforeTailSta2[bi]
}));
var skip = blockDetails.skip;

@@ -358,6 +333,6 @@ details.aggregate(blockDetails);

}
/**
@override
*/
}, {

@@ -367,3 +342,2 @@ key: "extractTail",

var _this2 = this;
var fromPos = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

@@ -373,3 +347,2 @@ var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;

if (fromPos === toPos) return chunkTail;
this._forEachBlocksInRange(fromPos, toPos, function (b, bi, bFromPos, bToPos) {

@@ -382,9 +355,8 @@ var blockChunk = b.extractTail(bFromPos, bToPos);

});
return chunkTail;
}
/**
@override
*/
}, {

@@ -398,7 +370,5 @@ key: "extractInput",

var input = '';
this._forEachBlocksInRange(fromPos, toPos, function (b, _, fromPos, toPos) {
input += b.extractInput(fromPos, toPos, flags);
});
return input;

@@ -410,3 +380,2 @@ }

var stopBefore;
for (var si = 0; si < this._stops.length; ++si) {

@@ -416,7 +385,6 @@ var stop = this._stops[si];

}
return stopBefore;
}
/** Appends placeholder depending on laziness */
}, {

@@ -426,12 +394,8 @@ key: "_appendPlaceholder",

var _this3 = this;
var details = new ChangeDetails();
if (this.lazy && toBlockIndex == null) return details;
var startBlockIter = this._mapPosToBlock(this.value.length);
if (!startBlockIter) return details;
var startBlockIndex = startBlockIter.index;
var endBlockIndex = toBlockIndex != null ? toBlockIndex : this._blocks.length;
this._blocks.slice(startBlockIndex, endBlockIndex).forEach(function (b) {

@@ -441,5 +405,3 @@ if (!b.lazy || toBlockIndex != null) {

var args = b._blocks != null ? [b._blocks.length] : [];
var bDetails = b._appendPlaceholder.apply(b, args);
_this3._value += bDetails.inserted;

@@ -449,7 +411,6 @@ details.aggregate(bDetails);

});
return details;
}
/** Finds block in pos */
}, {

@@ -459,3 +420,2 @@ key: "_mapPosToBlock",

var accVal = '';
for (var bi = 0; bi < this._blocks.length; ++bi) {

@@ -465,3 +425,2 @@ var _block2 = this._blocks[bi];

accVal += _block2.value;
if (pos <= accVal.length) {

@@ -475,4 +434,4 @@ return {

}
/** */
}, {

@@ -485,4 +444,4 @@ key: "_blockStartPos",

}
/** */
}, {

@@ -493,9 +452,6 @@ key: "_forEachBlocksInRange",

var fn = arguments.length > 2 ? arguments[2] : undefined;
var fromBlockIter = this._mapPosToBlock(fromPos);
if (fromBlockIter) {
var toBlockIter = this._mapPosToBlock(toPos); // process first block
var toBlockIter = this._mapPosToBlock(toPos);
// process first block
var isSameBlock = toBlockIter && fromBlockIter.index === toBlockIter.index;

@@ -505,3 +461,2 @@ var fromBlockStartPos = fromBlockIter.offset;

fn(this._blocks[fromBlockIter.index], fromBlockIter.index, fromBlockStartPos, fromBlockEndPos);
if (toBlockIter && !isSameBlock) {

@@ -511,5 +466,5 @@ // process intermediate blocks

fn(this._blocks[bi], bi, 0, this._blocks[bi].value.length);
} // process last block
}
// process last block
fn(this._blocks[toBlockIter.index], toBlockIter.index, 0, toBlockIter.offset);

@@ -519,6 +474,6 @@ }

}
/**
@override
*/
}, {

@@ -529,15 +484,12 @@ key: "remove",

var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;
var removeDetails = _get(_getPrototypeOf(MaskedPattern.prototype), "remove", this).call(this, fromPos, toPos);
this._forEachBlocksInRange(fromPos, toPos, function (b, _, bFromPos, bToPos) {
removeDetails.aggregate(b.remove(bFromPos, bToPos));
});
return removeDetails;
}
/**
@override
*/
}, {

@@ -549,3 +501,2 @@ key: "nearestInputPos",

var cursor = new PatternCursor(this, cursorPos);
if (direction === DIRECTION.NONE) {

@@ -559,5 +510,5 @@ // -------------------------------------------------

return this.value.length;
} // FORCE is only about a|* otherwise is 0
}
// FORCE is only about a|* otherwise is 0
if (direction === DIRECTION.LEFT || direction === DIRECTION.FORCE_LEFT) {

@@ -569,9 +520,10 @@ // try to break fast when *|a

cursor.popState();
} // forward flow
}
// forward flow
cursor.pushLeftBeforeInput();
cursor.pushLeftBeforeRequired();
cursor.pushLeftBeforeFilled(); // backward flow
cursor.pushLeftBeforeFilled();
// backward flow
if (direction === DIRECTION.LEFT) {

@@ -585,3 +537,2 @@ cursor.pushRightBeforeInput();

}
if (cursor.ok) return cursor.pos;

@@ -592,3 +543,5 @@ if (direction === DIRECTION.FORCE_LEFT) return 0;

cursor.popState();
if (cursor.ok) return cursor.pos; // cursor.popState();
if (cursor.ok) return cursor.pos;
// cursor.popState();
// if (

@@ -602,3 +555,2 @@ // cursor.pushRightBeforeInput() &&

}
if (direction === DIRECTION.RIGHT || direction === DIRECTION.FORCE_RIGHT) {

@@ -609,4 +561,5 @@ // forward flow

if (cursor.pushRightBeforeFilled()) return cursor.pos;
if (direction === DIRECTION.FORCE_RIGHT) return this.value.length; // backward flow
if (direction === DIRECTION.FORCE_RIGHT) return this.value.length;
// backward flow
cursor.popState();

@@ -618,7 +571,6 @@ if (cursor.ok) return cursor.pos;

}
return cursorPos;
}
/** Get block by name */
}, {

@@ -629,4 +581,4 @@ key: "maskedBlock",

}
/** Get all blocks by name */
}, {

@@ -636,3 +588,2 @@ key: "maskedBlocks",

var _this4 = this;
var indices = this._maskedBlocks[name];

@@ -645,3 +596,2 @@ if (!indices) return [];

}]);
return MaskedPattern;

@@ -648,0 +598,0 @@ }(Masked);

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck, b as _objectWithoutProperties } from '../../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck, b as _objectWithoutProperties } from '../../_rollupPluginBabelHelpers-30a49e9e.js';
import ChangeDetails from '../../core/change-details.js';

@@ -8,15 +8,12 @@ import { isString } from '../../core/utils.js';

var _excluded = ["chunks"];
var ChunksTailDetails = /*#__PURE__*/function () {
/** */
function ChunksTailDetails() {
var chunks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
_classCallCheck(this, ChunksTailDetails);
this.chunks = chunks;
this.from = from;
}
_createClass(ChunksTailDetails, [{

@@ -26,4 +23,5 @@ key: "toString",

return this.chunks.map(String).join('');
} // $FlowFixMe no ideas
}
// $FlowFixMe no ideas
}, {

@@ -35,6 +33,7 @@ key: "extend",

var lastChunk = this.chunks[this.chunks.length - 1];
var extendLast = lastChunk && ( // if stops are same or tail has no stop
lastChunk.stop === tailChunk.stop || tailChunk.stop == null) && // if tail chunk goes just after last chunk
var extendLast = lastChunk && (
// if stops are same or tail has no stop
lastChunk.stop === tailChunk.stop || tailChunk.stop == null) &&
// if tail chunk goes just after last chunk
tailChunk.from === lastChunk.from + lastChunk.toString().length;
if (tailChunk instanceof ContinuousTailDetails) {

@@ -53,3 +52,2 @@ // check the ability to extend previous chunk

var firstTailChunk;
while (tailChunk.chunks.length && tailChunk.chunks[0].stop == null) {

@@ -60,5 +58,5 @@ firstTailChunk = tailChunk.chunks.shift();

}
} // if tail chunk still has value
}
// if tail chunk still has value
if (tailChunk.toString()) {

@@ -79,30 +77,25 @@ // if chunks contains stops, then popup stop to container

}
var details = new ChangeDetails();
for (var ci = 0; ci < this.chunks.length && !details.skip; ++ci) {
var chunk = this.chunks[ci];
var lastBlockIter = masked._mapPosToBlock(masked.value.length);
var stop = chunk.stop;
var chunkBlock = void 0;
if (stop != null && ( // if block not found or stop is behind lastBlock
if (stop != null && (
// if block not found or stop is behind lastBlock
!lastBlockIter || lastBlockIter.index <= stop)) {
if (chunk instanceof ChunksTailDetails || // for continuous block also check if stop is exist
if (chunk instanceof ChunksTailDetails ||
// for continuous block also check if stop is exist
masked._stops.indexOf(stop) >= 0) {
details.aggregate(masked._appendPlaceholder(stop));
}
chunkBlock = chunk instanceof ChunksTailDetails && masked._blocks[stop];
}
if (chunkBlock) {
var tailDetails = chunkBlock.appendTail(chunk);
tailDetails.skip = false; // always ignore skip, it will be set on last
details.aggregate(tailDetails);
masked._value += tailDetails.inserted; // get not inserted chars
masked._value += tailDetails.inserted;
// get not inserted chars
var remainChars = chunk.toString().slice(tailDetails.rawInserted.length);

@@ -134,8 +127,7 @@ if (remainChars) details.aggregate(masked.append(remainChars, {

var chunks = state.chunks,
props = _objectWithoutProperties(state, _excluded);
props = _objectWithoutProperties(state, _excluded);
Object.assign(this, props);
this.chunks = chunks.map(function (cstate) {
var chunk = "chunks" in cstate ? new ChunksTailDetails() : new ContinuousTailDetails(); // $FlowFixMe already checked above
var chunk = "chunks" in cstate ? new ChunksTailDetails() : new ContinuousTailDetails();
// $FlowFixMe already checked above
chunk.state = cstate;

@@ -151,7 +143,5 @@ return chunk;

var ci = 0;
while (ci < this.chunks.length) {
var chunk = this.chunks[ci];
var shiftChar = chunk.unshift(chunkShiftPos);
if (chunk.toString()) {

@@ -166,6 +156,4 @@ // chunk still contains value

}
if (shiftChar) return shiftChar;
}
return '';

@@ -178,7 +166,5 @@ }

var ci = this.chunks.length - 1;
while (0 <= ci) {
var chunk = this.chunks[ci];
var shiftChar = chunk.shift();
if (chunk.toString()) {

@@ -193,10 +179,7 @@ // chunk still contains value

}
if (shiftChar) return shiftChar;
}
return '';
}
}]);
return ChunksTailDetails;

@@ -203,0 +186,0 @@ }();

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck } from '../../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck } from '../../_rollupPluginBabelHelpers-30a49e9e.js';
import { DIRECTION } from '../../core/utils.js';

@@ -8,18 +8,17 @@ import '../../core/change-details.js';

_classCallCheck(this, PatternCursor);
this.masked = masked;
this._log = [];
var _ref = masked._mapPosToBlock(pos) || (pos < 0 ? // first
{
index: 0,
offset: 0
} : // last
{
index: this.masked._blocks.length,
offset: 0
}),
offset = _ref.offset,
index = _ref.index;
var _ref = masked._mapPosToBlock(pos) || (pos < 0 ?
// first
{
index: 0,
offset: 0
} :
// last
{
index: this.masked._blocks.length,
offset: 0
}),
offset = _ref.offset,
index = _ref.index;
this.offset = offset;

@@ -29,3 +28,2 @@ this.index = index;

}
_createClass(PatternCursor, [{

@@ -62,3 +60,2 @@ key: "block",

var s = this._log.pop();
this.state = s;

@@ -71,3 +68,2 @@ return s;

if (this.block) return;
if (this.index < 0) {

@@ -77,3 +73,2 @@ this.index = 0;

}
if (this.index >= this.masked._blocks.length) {

@@ -88,9 +83,6 @@ this.index = this.masked._blocks.length - 1;

this.pushState();
for (this.bindBlock(); 0 <= this.index; --this.index, this.offset = ((_this$block = this.block) === null || _this$block === void 0 ? void 0 : _this$block.value.length) || 0) {
var _this$block;
if (fn()) return this.ok = true;
}
return this.ok = false;

@@ -102,7 +94,5 @@ }

this.pushState();
for (this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0) {
if (fn()) return this.ok = true;
}
return this.ok = false;

@@ -114,3 +104,2 @@ }

var _this = this;
return this._pushLeft(function () {

@@ -126,3 +115,2 @@ if (_this.block.isFixed || !_this.block.value) return;

var _this2 = this;
// cases:

@@ -142,3 +130,2 @@ // filled input: 00|

var _this3 = this;
return this._pushLeft(function () {

@@ -154,3 +141,2 @@ if (_this3.block.isFixed || _this3.block.isOptional && !_this3.block.value) return;

var _this4 = this;
return this._pushRight(function () {

@@ -166,11 +152,11 @@ if (_this4.block.isFixed || !_this4.block.value) return;

var _this5 = this;
return this._pushRight(function () {
if (_this5.block.isFixed) return; // const o = this.offset;
if (_this5.block.isFixed) return;
_this5.offset = _this5.block.nearestInputPos(_this5.offset, DIRECTION.NONE); // HACK cases like (STILL DOES NOT WORK FOR NESTED)
// const o = this.offset;
_this5.offset = _this5.block.nearestInputPos(_this5.offset, DIRECTION.NONE);
// HACK cases like (STILL DOES NOT WORK FOR NESTED)
// aa|X
// aa<X|[]>X_ - this will not work
// if (o && o === this.offset && this.block instanceof PatternInputDefinition) continue;
return true;

@@ -183,6 +169,6 @@ });

var _this6 = this;
return this._pushRight(function () {
if (_this6.block.isFixed || _this6.block.isOptional && !_this6.block.value) return; // TODO check |[*]XX_
if (_this6.block.isFixed || _this6.block.isOptional && !_this6.block.value) return;
// TODO check |[*]XX_
_this6.offset = _this6.block.nearestInputPos(_this6.offset, DIRECTION.NONE);

@@ -193,3 +179,2 @@ return true;

}]);
return PatternCursor;

@@ -196,0 +181,0 @@ }();

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck } from '../../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck } from '../../_rollupPluginBabelHelpers-30a49e9e.js';
import ChangeDetails from '../../core/change-details.js';

@@ -18,5 +18,5 @@ import { DIRECTION, isString } from '../../core/utils.js';

/** */
function PatternFixedDefinition(opts) {
_classCallCheck(this, PatternFixedDefinition);
Object.assign(this, opts);

@@ -26,3 +26,2 @@ this._value = '';

}
_createClass(PatternFixedDefinition, [{

@@ -59,3 +58,2 @@ key: "value",

var maxPos = this._value.length;
switch (direction) {

@@ -65,3 +63,2 @@ case DIRECTION.LEFT:

return minPos;
case DIRECTION.NONE:

@@ -125,4 +122,5 @@ case DIRECTION.RIGHT:

return new ContinuousTailDetails('');
} // $FlowFixMe no ideas
}
// $FlowFixMe no ideas
}, {

@@ -138,7 +136,5 @@ key: "appendTail",

var details = this._appendChar(str[0], flags);
if (tail != null) {
details.tailShift += this.appendTail(tail).tailShift;
}
return details;

@@ -161,3 +157,2 @@ }

}]);
return PatternFixedDefinition;

@@ -164,0 +159,0 @@ }();

@@ -1,2 +0,2 @@

import { _ as _createClass, a as _classCallCheck, b as _objectWithoutProperties } from '../../_rollupPluginBabelHelpers-67bba7fb.js';
import { _ as _createClass, a as _classCallCheck, b as _objectWithoutProperties } from '../../_rollupPluginBabelHelpers-30a49e9e.js';
import createMask from '../factory.js';

@@ -14,4 +14,4 @@ import ChangeDetails from '../../core/change-details.js';

};
/** */
var PatternInputDefinition = /*#__PURE__*/function () {

@@ -31,8 +31,7 @@ /** */

/** */
function PatternInputDefinition(opts) {
_classCallCheck(this, PatternInputDefinition);
var mask = opts.mask,
blockOpts = _objectWithoutProperties(opts, _excluded);
blockOpts = _objectWithoutProperties(opts, _excluded);
this.masked = createMask({

@@ -43,3 +42,2 @@ mask: mask

}
_createClass(PatternInputDefinition, [{

@@ -56,3 +54,2 @@ key: "reset",

var toPos = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.value.length;
if (fromPos === 0 && toPos >= 1) {

@@ -62,3 +59,2 @@ this.isFilled = false;

}
return new ChangeDetails();

@@ -86,6 +82,5 @@ }

if (this.isFilled) return new ChangeDetails();
var state = this.masked.state; // simulate input
var state = this.masked.state;
// simulate input
var details = this.masked._appendChar(ch, flags);
if (details.inserted && this.doValidate(flags) === false) {

@@ -95,7 +90,5 @@ details.inserted = details.rawInserted = '';

}
if (!details.inserted && !this.isOptional && !this.lazy && !flags.input) {
details.inserted = this.placeholderChar;
}
details.skip = !details.inserted && !this.isOptional;

@@ -109,3 +102,2 @@ this.isFilled = Boolean(details.inserted);

var _this$masked;
// TODO probably should be done via _appendChar

@@ -132,3 +124,2 @@ return (_this$masked = this.masked).append.apply(_this$masked, arguments);

var _this$masked2;
return (_this$masked2 = this.masked).extractTail.apply(_this$masked2, arguments);

@@ -140,3 +131,2 @@ }

var _this$masked3;
return (_this$masked3 = this.masked).appendTail.apply(_this$masked3, arguments);

@@ -159,3 +149,2 @@ }

var boundPos = Math.min(Math.max(cursorPos, minPos), maxPos);
switch (direction) {

@@ -165,7 +154,5 @@ case DIRECTION.LEFT:

return this.isComplete ? boundPos : minPos;
case DIRECTION.RIGHT:
case DIRECTION.FORCE_RIGHT:
return this.isComplete ? boundPos : maxPos;
case DIRECTION.NONE:

@@ -180,3 +167,2 @@ default:

var _this$masked4, _this$parent;
return (_this$masked4 = this.masked).doValidate.apply(_this$masked4, arguments) && (!this.parent || (_this$parent = this.parent).doValidate.apply(_this$parent, arguments));

@@ -202,3 +188,2 @@ }

}]);
return PatternInputDefinition;

@@ -205,0 +190,0 @@ }();

import createMask from './factory.js';
import IMask from '../core/holder.js';
import '../core/utils.js';
import '../_rollupPluginBabelHelpers-67bba7fb.js';
import '../_rollupPluginBabelHelpers-30a49e9e.js';
import '../core/change-details.js';
/** Mask pipe source and destination types */
var PIPE_TYPE = {

@@ -14,4 +13,4 @@ MASKED: 'value',

};
/** Creates new pipe function depending on mask type, source and destination options */
function createPipe(mask) {

@@ -28,4 +27,4 @@ var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : PIPE_TYPE.MASKED;

}
/** Pipes value through mask depending on mask type, source and destination options */
function pipe(value) {

@@ -35,3 +34,2 @@ for (var _len = arguments.length, pipeArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {

}
return createPipe.apply(void 0, pipeArgs)(value);

@@ -38,0 +36,0 @@ }

@@ -1,2 +0,2 @@

import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf, f as _slicedToArray } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf, f as _slicedToArray } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import MaskedPattern from './pattern.js';

@@ -16,14 +16,9 @@ import { normalizePrepare } from '../core/utils.js';

/** Pattern which accepts ranges */
var MaskedRange = /*#__PURE__*/function (_MaskedPattern) {
_inherits(MaskedRange, _MaskedPattern);
var _super = _createSuper(MaskedRange);
function MaskedRange() {
_classCallCheck(this, MaskedRange);
return _super.apply(this, arguments);
}
_createClass(MaskedRange, [{

@@ -42,9 +37,10 @@ key: "_matchFrom",

/** */
function get() {
return this.maxLength - String(this.from).length;
}
/**
@override
*/
}, {

@@ -65,15 +61,10 @@ key: "_update",

var sameCharsCount = 0;
while (sameCharsCount < toStr.length && toStr[sameCharsCount] === fromStr[sameCharsCount]) {
++sameCharsCount;
}
while (sameCharsCount < toStr.length && toStr[sameCharsCount] === fromStr[sameCharsCount]) ++sameCharsCount;
opts.mask = toStr.slice(0, sameCharsCount).replace(/0/g, '\\0') + '0'.repeat(maxLength - sameCharsCount);
_get(_getPrototypeOf(MaskedRange.prototype), "_update", this).call(this, opts);
}
/**
@override
*/
}, {

@@ -89,8 +80,6 @@ key: "isComplete",

var maxstr = '';
var _ref = str.match(/^(\D*)(\d*)(\D*)/) || [],
_ref2 = _slicedToArray(_ref, 3),
placeholder = _ref2[1],
num = _ref2[2];
_ref2 = _slicedToArray(_ref, 3),
placeholder = _ref2[1],
num = _ref2[2];
if (num) {

@@ -100,12 +89,11 @@ minstr = '0'.repeat(placeholder.length) + num;

}
minstr = minstr.padEnd(this.maxLength, '0');
maxstr = maxstr.padEnd(this.maxLength, '9');
return [minstr, maxstr];
} // TODO str is a single char everytime
}
// TODO str is a single char everytime
/**
@override
*/
}, {

@@ -116,7 +104,4 @@ key: "doPrepare",

var details;
var _normalizePrepare = normalizePrepare(_get(_getPrototypeOf(MaskedRange.prototype), "doPrepare", this).call(this, ch.replace(/\D/g, ''), flags));
var _normalizePrepare2 = _slicedToArray(_normalizePrepare, 2);
ch = _normalizePrepare2[0];

@@ -129,10 +114,7 @@ details = _normalizePrepare2[1];

if (nextVal.length > this.maxLength) return '';
var _this$boundaries = this.boundaries(nextVal),
_this$boundaries2 = _slicedToArray(_this$boundaries, 2),
minstr = _this$boundaries2[0],
maxstr = _this$boundaries2[1];
_this$boundaries2 = _slicedToArray(_this$boundaries, 2),
minstr = _this$boundaries2[0],
maxstr = _this$boundaries2[1];
if (Number(maxstr) < this.from) return fromStr[nextVal.length - 1];
if (Number(minstr) > this.to) {

@@ -142,12 +124,10 @@ if (this.autofix === 'pad' && nextVal.length < this.maxLength) {

}
return toStr[nextVal.length - 1];
}
return ch;
}
/**
@override
*/
}, {

@@ -157,20 +137,15 @@ key: "doValidate",

var _get2;
var str = this.value;
var firstNonZero = str.search(/[^0]/);
if (firstNonZero === -1 && str.length <= this._matchFrom) return true;
var _this$boundaries3 = this.boundaries(str),
_this$boundaries4 = _slicedToArray(_this$boundaries3, 2),
minstr = _this$boundaries4[0],
maxstr = _this$boundaries4[1];
_this$boundaries4 = _slicedToArray(_this$boundaries3, 2),
minstr = _this$boundaries4[0],
maxstr = _this$boundaries4[1];
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return this.from <= Number(maxstr) && Number(minstr) <= this.to && (_get2 = _get(_getPrototypeOf(MaskedRange.prototype), "doValidate", this)).call.apply(_get2, [this].concat(args));
}
}]);
return MaskedRange;

@@ -177,0 +152,0 @@ }(MaskedPattern);

@@ -1,2 +0,2 @@

import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf } from '../_rollupPluginBabelHelpers-67bba7fb.js';
import { d as _inherits, e as _createSuper, _ as _createClass, a as _classCallCheck, g as _get, h as _getPrototypeOf } from '../_rollupPluginBabelHelpers-30a49e9e.js';
import Masked from './base.js';

@@ -9,14 +9,9 @@ import IMask from '../core/holder.js';

/** Masking by RegExp */
var MaskedRegExp = /*#__PURE__*/function (_Masked) {
_inherits(MaskedRegExp, _Masked);
var _super = _createSuper(MaskedRegExp);
function MaskedRegExp() {
_classCallCheck(this, MaskedRegExp);
return _super.apply(this, arguments);
}
_createClass(MaskedRegExp, [{

@@ -33,7 +28,5 @@ key: "_update",

};
_get(_getPrototypeOf(MaskedRegExp.prototype), "_update", this).call(this, opts);
}
}]);
return MaskedRegExp;

@@ -40,0 +33,0 @@ }(Masked);

var $$3 = require('../internals/export');
var assign = require('../internals/object-assign');
var assign = require('../internals/object-assign'); // `Object.assign` method
// `Object.assign` method
// https://tc39.es/ecma262/#sec-object.assign
// eslint-disable-next-line es-x/no-object-assign -- required for testing
// eslint-disable-next-line es/no-object-assign -- required for testing
$$3({

@@ -18,7 +17,6 @@ target: 'Object',

var $$2 = require('../internals/export');
var repeat = require('../internals/string-repeat');
var repeat = require('../internals/string-repeat'); // `String.prototype.repeat` method
// `String.prototype.repeat` method
// https://tc39.es/ecma262/#sec-string.prototype.repeat
$$2({

@@ -32,9 +30,7 @@ target: 'String',

var $$1 = require('../internals/export');
var $padStart = require('../internals/string-pad').start;
var WEBKIT_BUG$1 = require('../internals/string-pad-webkit-bug');
var WEBKIT_BUG$1 = require('../internals/string-pad-webkit-bug'); // `String.prototype.padStart` method
// `String.prototype.padStart` method
// https://tc39.es/ecma262/#sec-string.prototype.padstart
$$1({

@@ -45,5 +41,3 @@ target: 'String',

}, {
padStart: function padStart(maxLength
/* , fillString = ' ' */
) {
padStart: function padStart(maxLength /* , fillString = ' ' */) {
return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);

@@ -54,9 +48,7 @@ }

var $ = require('../internals/export');
var $padEnd = require('../internals/string-pad').end;
var WEBKIT_BUG = require('../internals/string-pad-webkit-bug');
var WEBKIT_BUG = require('../internals/string-pad-webkit-bug'); // `String.prototype.padEnd` method
// `String.prototype.padEnd` method
// https://tc39.es/ecma262/#sec-string.prototype.padend
$({

@@ -67,5 +59,3 @@ target: 'String',

}, {
padEnd: function padEnd(maxLength
/* , fillString = ' ' */
) {
padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : undefined);

@@ -72,0 +62,0 @@ }

{
"name": "imask",
"version": "6.4.3",
"version": "6.5.0-alpha.0",
"author": "Alexey Kryazhev",

@@ -31,3 +31,3 @@ "license": "MIT",

],
"gitHead": "f10ad01a01d4f051e8e25a45164662881050a431"
"gitHead": "686035f5cd81507e6104de966f169dcd6706dd07"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc