inputmask.js 188 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747
  1. /*!
  2. * dist/inputmask
  3. * https://github.com/RobinHerbots/Inputmask
  4. * Copyright (c) 2010 - 2020 Robin Herbots
  5. * Licensed under the MIT license
  6. * Version: 5.0.3
  7. */
  8. !function webpackUniversalModuleDefinition(root, factory) {
  9. if ("object" == typeof exports && "object" == typeof module) module.exports = factory(); else if ("function" == typeof define && define.amd) define([], factory); else {
  10. var a = factory();
  11. for (var i in a) ("object" == typeof exports ? exports : root)[i] = a[i];
  12. }
  13. }(window, function() {
  14. return modules = [ function(module) {
  15. module.exports = JSON.parse('{"BACKSPACE":8,"BACKSPACE_SAFARI":127,"DELETE":46,"DOWN":40,"END":35,"ENTER":13,"ESCAPE":27,"HOME":36,"INSERT":45,"LEFT":37,"PAGE_DOWN":34,"PAGE_UP":33,"RIGHT":39,"SPACE":32,"TAB":9,"UP":38,"X":88,"CONTROL":17}');
  16. }, function(module, exports, __webpack_require__) {
  17. "use strict";
  18. function _typeof(obj) {
  19. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) {
  20. return typeof obj;
  21. } : function _typeof(obj) {
  22. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  23. }, _typeof(obj);
  24. }
  25. var $ = __webpack_require__(2), window = __webpack_require__(3), document = window.document, generateMaskSet = __webpack_require__(4).generateMaskSet, analyseMask = __webpack_require__(4).analyseMask, maskScope = __webpack_require__(7);
  26. function Inputmask(alias, options, internal) {
  27. if (!(this instanceof Inputmask)) return new Inputmask(alias, options, internal);
  28. this.el = void 0, this.events = {}, this.maskset = void 0, this.refreshValue = !1,
  29. !0 !== internal && ($.isPlainObject(alias) ? options = alias : (options = options || {},
  30. alias && (options.alias = alias)), this.opts = $.extend(!0, {}, this.defaults, options),
  31. this.noMasksCache = options && void 0 !== options.definitions, this.userOptions = options || {},
  32. resolveAlias(this.opts.alias, options, this.opts), this.isRTL = this.opts.numericInput);
  33. }
  34. function resolveAlias(aliasStr, options, opts) {
  35. var aliasDefinition = Inputmask.prototype.aliases[aliasStr];
  36. return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, void 0, opts),
  37. $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : (null === opts.mask && (opts.mask = aliasStr),
  38. !1);
  39. }
  40. function importAttributeOptions(npt, opts, userOptions, dataAttribute) {
  41. function importOption(option, optionData) {
  42. optionData = void 0 !== optionData ? optionData : npt.getAttribute(dataAttribute + "-" + option),
  43. null !== optionData && ("string" == typeof optionData && (0 === option.indexOf("on") ? optionData = window[optionData] : "false" === optionData ? optionData = !1 : "true" === optionData && (optionData = !0)),
  44. userOptions[option] = optionData);
  45. }
  46. if (!0 === opts.importDataAttributes) {
  47. var attrOptions = npt.getAttribute(dataAttribute), option, dataoptions, optionData, p;
  48. if (attrOptions && "" !== attrOptions && (attrOptions = attrOptions.replace(/'/g, '"'),
  49. dataoptions = JSON.parse("{" + attrOptions + "}")), dataoptions) for (p in optionData = void 0,
  50. dataoptions) if ("alias" === p.toLowerCase()) {
  51. optionData = dataoptions[p];
  52. break;
  53. }
  54. for (option in importOption("alias", optionData), userOptions.alias && resolveAlias(userOptions.alias, userOptions, opts),
  55. opts) {
  56. if (dataoptions) for (p in optionData = void 0, dataoptions) if (p.toLowerCase() === option.toLowerCase()) {
  57. optionData = dataoptions[p];
  58. break;
  59. }
  60. importOption(option, optionData);
  61. }
  62. }
  63. return $.extend(!0, opts, userOptions), "rtl" !== npt.dir && !opts.rightAlign || (npt.style.textAlign = "right"),
  64. "rtl" !== npt.dir && !opts.numericInput || (npt.dir = "ltr", npt.removeAttribute("dir"),
  65. opts.isRTL = !0), Object.keys(userOptions).length;
  66. }
  67. Inputmask.prototype = {
  68. dataAttribute: "data-inputmask",
  69. defaults: {
  70. _maxTestPos: 500,
  71. placeholder: "_",
  72. optionalmarker: [ "[", "]" ],
  73. quantifiermarker: [ "{", "}" ],
  74. groupmarker: [ "(", ")" ],
  75. alternatormarker: "|",
  76. escapeChar: "\\",
  77. mask: null,
  78. regex: null,
  79. oncomplete: $.noop,
  80. onincomplete: $.noop,
  81. oncleared: $.noop,
  82. repeat: 0,
  83. greedy: !1,
  84. autoUnmask: !1,
  85. removeMaskOnSubmit: !1,
  86. clearMaskOnLostFocus: !0,
  87. insertMode: !0,
  88. insertModeVisual: !0,
  89. clearIncomplete: !1,
  90. alias: null,
  91. onKeyDown: $.noop,
  92. onBeforeMask: null,
  93. onBeforePaste: function onBeforePaste(pastedValue, opts) {
  94. return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(this, pastedValue, opts) : pastedValue;
  95. },
  96. onBeforeWrite: null,
  97. onUnMask: null,
  98. showMaskOnFocus: !0,
  99. showMaskOnHover: !0,
  100. onKeyValidation: $.noop,
  101. skipOptionalPartCharacter: " ",
  102. numericInput: !1,
  103. rightAlign: !1,
  104. undoOnEscape: !0,
  105. radixPoint: "",
  106. _radixDance: !1,
  107. groupSeparator: "",
  108. keepStatic: null,
  109. positionCaretOnTab: !0,
  110. tabThrough: !1,
  111. supportsInputType: [ "text", "tel", "url", "password", "search" ],
  112. ignorables: [ 8, 9, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 229 ],
  113. isComplete: null,
  114. preValidation: null,
  115. postValidation: null,
  116. staticDefinitionSymbol: void 0,
  117. jitMasking: !1,
  118. nullable: !0,
  119. inputEventOnly: !1,
  120. noValuePatching: !1,
  121. positionCaretOnClick: "lvp",
  122. casing: null,
  123. inputmode: "text",
  124. importDataAttributes: !0,
  125. shiftPositions: !0
  126. },
  127. definitions: {
  128. 9: {
  129. validator: "[0-9\uff11-\uff19]",
  130. definitionSymbol: "*"
  131. },
  132. a: {
  133. validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  134. definitionSymbol: "*"
  135. },
  136. "*": {
  137. validator: "[0-9\uff11-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]"
  138. }
  139. },
  140. aliases: {},
  141. masksCache: {},
  142. mask: function mask(elems) {
  143. var that = this;
  144. return "string" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)),
  145. elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) {
  146. var scopedOpts = $.extend(!0, {}, that.opts);
  147. if (importAttributeOptions(el, scopedOpts, $.extend(!0, {}, that.userOptions), that.dataAttribute)) {
  148. var maskset = generateMaskSet(scopedOpts, that.noMasksCache);
  149. void 0 !== maskset && (void 0 !== el.inputmask && (el.inputmask.opts.autoUnmask = !0,
  150. el.inputmask.remove()), el.inputmask = new Inputmask(void 0, void 0, !0), el.inputmask.opts = scopedOpts,
  151. el.inputmask.noMasksCache = that.noMasksCache, el.inputmask.userOptions = $.extend(!0, {}, that.userOptions),
  152. el.inputmask.isRTL = scopedOpts.isRTL || scopedOpts.numericInput, el.inputmask.el = el,
  153. el.inputmask.maskset = maskset, $.data(el, "_inputmask_opts", scopedOpts), maskScope.call(el.inputmask, {
  154. action: "mask"
  155. }));
  156. }
  157. }), elems && elems[0] && elems[0].inputmask || this;
  158. },
  159. option: function option(options, noremask) {
  160. return "string" == typeof options ? this.opts[options] : "object" === _typeof(options) ? ($.extend(this.userOptions, options),
  161. this.el && !0 !== noremask && this.mask(this.el), this) : void 0;
  162. },
  163. unmaskedvalue: function unmaskedvalue(value) {
  164. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  165. maskScope.call(this, {
  166. action: "unmaskedvalue",
  167. value: value
  168. });
  169. },
  170. remove: function remove() {
  171. return maskScope.call(this, {
  172. action: "remove"
  173. });
  174. },
  175. getemptymask: function getemptymask() {
  176. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  177. maskScope.call(this, {
  178. action: "getemptymask"
  179. });
  180. },
  181. hasMaskedValue: function hasMaskedValue() {
  182. return !this.opts.autoUnmask;
  183. },
  184. isComplete: function isComplete() {
  185. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  186. maskScope.call(this, {
  187. action: "isComplete"
  188. });
  189. },
  190. getmetadata: function getmetadata() {
  191. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  192. maskScope.call(this, {
  193. action: "getmetadata"
  194. });
  195. },
  196. isValid: function isValid(value) {
  197. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  198. maskScope.call(this, {
  199. action: "isValid",
  200. value: value
  201. });
  202. },
  203. format: function format(value, metadata) {
  204. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  205. maskScope.call(this, {
  206. action: "format",
  207. value: value,
  208. metadata: metadata
  209. });
  210. },
  211. setValue: function setValue(value) {
  212. this.el && $(this.el).trigger("setvalue", [ value ]);
  213. },
  214. analyseMask: analyseMask
  215. }, Inputmask.extendDefaults = function(options) {
  216. $.extend(!0, Inputmask.prototype.defaults, options);
  217. }, Inputmask.extendDefinitions = function(definition) {
  218. $.extend(!0, Inputmask.prototype.definitions, definition);
  219. }, Inputmask.extendAliases = function(alias) {
  220. $.extend(!0, Inputmask.prototype.aliases, alias);
  221. }, Inputmask.format = function(value, options, metadata) {
  222. return Inputmask(options).format(value, metadata);
  223. }, Inputmask.unmask = function(value, options) {
  224. return Inputmask(options).unmaskedvalue(value);
  225. }, Inputmask.isValid = function(value, options) {
  226. return Inputmask(options).isValid(value);
  227. }, Inputmask.remove = function(elems) {
  228. "string" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)),
  229. elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) {
  230. el.inputmask && el.inputmask.remove();
  231. });
  232. }, Inputmask.setValue = function(elems, value) {
  233. "string" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)),
  234. elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) {
  235. el.inputmask ? el.inputmask.setValue(value) : $(el).trigger("setvalue", [ value ]);
  236. });
  237. };
  238. var escapeRegexRegex = new RegExp("(\\" + [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ].join("|\\") + ")", "gim");
  239. Inputmask.escapeRegex = function(str) {
  240. return str.replace(escapeRegexRegex, "\\$1");
  241. }, Inputmask.dependencyLib = $, window.Inputmask = Inputmask, module.exports = Inputmask;
  242. }, function(module, exports, __webpack_require__) {
  243. "use strict";
  244. function _typeof(obj) {
  245. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) {
  246. return typeof obj;
  247. } : function _typeof(obj) {
  248. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  249. }, _typeof(obj);
  250. }
  251. var window = __webpack_require__(3), document = window.document;
  252. function indexOf(list, elem) {
  253. for (var i = 0, len = list.length; i < len; i++) if (list[i] === elem) return i;
  254. return -1;
  255. }
  256. function isWindow(obj) {
  257. return null != obj && obj === obj.window;
  258. }
  259. function isArraylike(obj) {
  260. var length = "length" in obj && obj.length, ltype = _typeof(obj);
  261. return "function" !== ltype && !isWindow(obj) && (!(1 !== obj.nodeType || !length) || ("array" === ltype || 0 === length || "number" == typeof length && 0 < length && length - 1 in obj));
  262. }
  263. function isValidElement(elem) {
  264. return elem instanceof Element;
  265. }
  266. function DependencyLib(elem) {
  267. return elem instanceof DependencyLib ? elem : this instanceof DependencyLib ? void (null != elem && elem !== window && (this[0] = elem.nodeName ? elem : void 0 !== elem[0] && elem[0].nodeName ? elem[0] : document.querySelector(elem),
  268. void 0 !== this[0] && null !== this[0] && (this[0].eventRegistry = this[0].eventRegistry || {}))) : new DependencyLib(elem);
  269. }
  270. DependencyLib.prototype = {
  271. on: function on(events, handler) {
  272. function addEvent(ev, namespace) {
  273. elem.addEventListener ? elem.addEventListener(ev, handler, !1) : elem.attachEvent && elem.attachEvent("on" + ev, handler),
  274. eventRegistry[ev] = eventRegistry[ev] || {}, eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [],
  275. eventRegistry[ev][namespace].push(handler);
  276. }
  277. if (isValidElement(this[0])) for (var eventRegistry = this[0].eventRegistry, elem = this[0], _events = events.split(" "), endx = 0; endx < _events.length; endx++) {
  278. var nsEvent = _events[endx].split("."), ev = nsEvent[0], namespace = nsEvent[1] || "global";
  279. addEvent(ev, namespace);
  280. }
  281. return this;
  282. },
  283. off: function off(events, handler) {
  284. var eventRegistry, elem;
  285. function removeEvent(ev, namespace, handler) {
  286. if (ev in eventRegistry == !0) if (elem.removeEventListener ? elem.removeEventListener(ev, handler, !1) : elem.detachEvent && elem.detachEvent("on" + ev, handler),
  287. "global" === namespace) for (var nmsp in eventRegistry[ev]) eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1); else eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);
  288. }
  289. function resolveNamespace(ev, namespace) {
  290. var evts = [], hndx, hndL;
  291. if (0 < ev.length) if (void 0 === handler) for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) evts.push({
  292. ev: ev,
  293. namespace: namespace && 0 < namespace.length ? namespace : "global",
  294. handler: eventRegistry[ev][namespace][hndx]
  295. }); else evts.push({
  296. ev: ev,
  297. namespace: namespace && 0 < namespace.length ? namespace : "global",
  298. handler: handler
  299. }); else if (0 < namespace.length) for (var evNdx in eventRegistry) for (var nmsp in eventRegistry[evNdx]) if (nmsp === namespace) if (void 0 === handler) for (hndx = 0,
  300. hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) evts.push({
  301. ev: evNdx,
  302. namespace: nmsp,
  303. handler: eventRegistry[evNdx][nmsp][hndx]
  304. }); else evts.push({
  305. ev: evNdx,
  306. namespace: nmsp,
  307. handler: handler
  308. });
  309. return evts;
  310. }
  311. if (isValidElement(this[0])) {
  312. eventRegistry = this[0].eventRegistry, elem = this[0];
  313. for (var _events = events.split(" "), endx = 0; endx < _events.length; endx++) for (var nsEvent = _events[endx].split("."), offEvents = resolveNamespace(nsEvent[0], nsEvent[1]), i = 0, offEventsL = offEvents.length; i < offEventsL; i++) removeEvent(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);
  314. }
  315. return this;
  316. },
  317. trigger: function trigger(events, argument_1) {
  318. if (isValidElement(this[0])) for (var eventRegistry = this[0].eventRegistry, elem = this[0], _events = "string" == typeof events ? events.split(" ") : [ events.type ], endx = 0; endx < _events.length; endx++) {
  319. var nsEvent = _events[endx].split("."), ev = nsEvent[0], namespace = nsEvent[1] || "global";
  320. if (void 0 !== document && "global" === namespace) {
  321. var evnt, i, params = {
  322. bubbles: !0,
  323. cancelable: !0,
  324. detail: argument_1
  325. };
  326. if (document.createEvent) {
  327. try {
  328. evnt = new CustomEvent(ev, params);
  329. } catch (e) {
  330. evnt = document.createEvent("CustomEvent"), evnt.initCustomEvent(ev, params.bubbles, params.cancelable, params.detail);
  331. }
  332. events.type && DependencyLib.extend(evnt, events), elem.dispatchEvent(evnt);
  333. } else evnt = document.createEventObject(), evnt.eventType = ev, evnt.detail = argument_1,
  334. events.type && DependencyLib.extend(evnt, events), elem.fireEvent("on" + evnt.eventType, evnt);
  335. } else if (void 0 !== eventRegistry[ev]) if (events = events.type ? events : DependencyLib.Event(events),
  336. events.detail = arguments.slice(1), "global" === namespace) for (var nmsp in eventRegistry[ev]) for (i = 0; i < eventRegistry[ev][nmsp].length; i++) eventRegistry[ev][nmsp][i].apply(elem, arguments); else for (i = 0; i < eventRegistry[ev][namespace].length; i++) eventRegistry[ev][namespace][i].apply(elem, arguments);
  337. }
  338. return this;
  339. }
  340. }, DependencyLib.isFunction = function(obj) {
  341. return "function" == typeof obj;
  342. }, DependencyLib.noop = function() {}, DependencyLib.isArray = Array.isArray, DependencyLib.inArray = function(elem, arr, i) {
  343. return null == arr ? -1 : indexOf(arr, elem, i);
  344. }, DependencyLib.valHooks = void 0, DependencyLib.isPlainObject = function(obj) {
  345. return "object" === _typeof(obj) && !obj.nodeType && !isWindow(obj) && !(obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf"));
  346. }, DependencyLib.extend = function() {
  347. var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = !1;
  348. for ("boolean" == typeof target && (deep = target, target = arguments[i] || {},
  349. i++), "object" === _typeof(target) || DependencyLib.isFunction(target) || (target = {}),
  350. i === length && (target = this, i--); i < length; i++) if (null != (options = arguments[i])) for (name in options) src = target[name],
  351. copy = options[name], target !== copy && (deep && copy && (DependencyLib.isPlainObject(copy) || (copyIsArray = DependencyLib.isArray(copy))) ? (clone = copyIsArray ? (copyIsArray = !1,
  352. src && DependencyLib.isArray(src) ? src : []) : src && DependencyLib.isPlainObject(src) ? src : {},
  353. target[name] = DependencyLib.extend(deep, clone, copy)) : void 0 !== copy && (target[name] = copy));
  354. return target;
  355. }, DependencyLib.each = function(obj, callback) {
  356. var value, i = 0;
  357. if (isArraylike(obj)) for (var length = obj.length; i < length && (value = callback.call(obj[i], i, obj[i]),
  358. !1 !== value); i++) ; else for (i in obj) if (value = callback.call(obj[i], i, obj[i]),
  359. !1 === value) break;
  360. return obj;
  361. }, DependencyLib.data = function(owner, key, value) {
  362. if (void 0 === value) return owner.__data ? owner.__data[key] : null;
  363. owner.__data = owner.__data || {}, owner.__data[key] = value;
  364. }, "function" == typeof window.CustomEvent ? DependencyLib.Event = window.CustomEvent : (DependencyLib.Event = function(event, params) {
  365. params = params || {
  366. bubbles: !1,
  367. cancelable: !1,
  368. detail: void 0
  369. };
  370. var evt = document.createEvent("CustomEvent");
  371. return evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail),
  372. evt;
  373. }, DependencyLib.Event.prototype = window.Event.prototype), module.exports = DependencyLib;
  374. }, function(module, exports, __webpack_require__) {
  375. "use strict";
  376. var __WEBPACK_AMD_DEFINE_RESULT__;
  377. function _typeof(obj) {
  378. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) {
  379. return typeof obj;
  380. } : function _typeof(obj) {
  381. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  382. }, _typeof(obj);
  383. }
  384. __WEBPACK_AMD_DEFINE_RESULT__ = function() {
  385. return "undefined" != typeof window ? window : new (eval("require('jsdom').JSDOM"))("").window;
  386. }.call(exports, __webpack_require__, exports, module), void 0 === __WEBPACK_AMD_DEFINE_RESULT__ || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  387. }, function(module, exports, __webpack_require__) {
  388. "use strict";
  389. var $ = __webpack_require__(2);
  390. function generateMaskSet(opts, nocache) {
  391. var ms;
  392. function generateMask(mask, metadata, opts) {
  393. var regexMask = !1, masksetDefinition, maskdefKey;
  394. if (null !== mask && "" !== mask || (regexMask = null !== opts.regex, mask = regexMask ? (mask = opts.regex,
  395. mask.replace(/^(\^)(.*)(\$)$/, "$2")) : (regexMask = !0, ".*")), 1 === mask.length && !1 === opts.greedy && 0 !== opts.repeat && (opts.placeholder = ""),
  396. 0 < opts.repeat || "*" === opts.repeat || "+" === opts.repeat) {
  397. var repeatStart = "*" === opts.repeat ? 0 : "+" === opts.repeat ? 1 : opts.repeat;
  398. mask = opts.groupmarker[0] + mask + opts.groupmarker[1] + opts.quantifiermarker[0] + repeatStart + "," + opts.repeat + opts.quantifiermarker[1];
  399. }
  400. return maskdefKey = regexMask ? "regex_" + opts.regex : opts.numericInput ? mask.split("").reverse().join("") : mask,
  401. !1 !== opts.keepStatic && (maskdefKey = "ks_" + maskdefKey), void 0 === Inputmask.prototype.masksCache[maskdefKey] || !0 === nocache ? (masksetDefinition = {
  402. mask: mask,
  403. maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts),
  404. validPositions: {},
  405. _buffer: void 0,
  406. buffer: void 0,
  407. tests: {},
  408. excludes: {},
  409. metadata: metadata,
  410. maskLength: void 0,
  411. jitOffset: {}
  412. }, !0 !== nocache && (Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition,
  413. masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]))) : masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]),
  414. masksetDefinition;
  415. }
  416. if ($.isFunction(opts.mask) && (opts.mask = opts.mask(opts)), $.isArray(opts.mask)) {
  417. if (1 < opts.mask.length) {
  418. null === opts.keepStatic && (opts.keepStatic = !0);
  419. var altMask = opts.groupmarker[0];
  420. return $.each(opts.isRTL ? opts.mask.reverse() : opts.mask, function(ndx, msk) {
  421. 1 < altMask.length && (altMask += opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0]),
  422. void 0 === msk.mask || $.isFunction(msk.mask) ? altMask += msk : altMask += msk.mask;
  423. }), altMask += opts.groupmarker[1], generateMask(altMask, opts.mask, opts);
  424. }
  425. opts.mask = opts.mask.pop();
  426. }
  427. return null === opts.keepStatic && (opts.keepStatic = !1), ms = opts.mask && void 0 !== opts.mask.mask && !$.isFunction(opts.mask.mask) ? generateMask(opts.mask.mask, opts.mask, opts) : generateMask(opts.mask, opts.mask, opts),
  428. ms;
  429. }
  430. function analyseMask(mask, regexMask, opts) {
  431. var tokenizer = /(?:[?*+]|\{[0-9+*]+(?:,[0-9+*]*)?(?:\|[0-9+*]*)?\})|[^.?*+^${[]()|\\]+|./g, regexTokenizer = /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g, escaped = !1, currentToken = new MaskToken(), match, m, openenings = [], maskTokens = [], openingToken, currentOpeningToken, alternator, lastMatch, closeRegexGroup = !1;
  432. function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {
  433. this.matches = [], this.openGroup = isGroup || !1, this.alternatorGroup = !1, this.isGroup = isGroup || !1,
  434. this.isOptional = isOptional || !1, this.isQuantifier = isQuantifier || !1, this.isAlternator = isAlternator || !1,
  435. this.quantifier = {
  436. min: 1,
  437. max: 1
  438. };
  439. }
  440. function insertTestDefinition(mtoken, element, position) {
  441. position = void 0 !== position ? position : mtoken.matches.length;
  442. var prevMatch = mtoken.matches[position - 1];
  443. if (regexMask) 0 === element.indexOf("[") || escaped && /\\d|\\s|\\w]/i.test(element) || "." === element ? mtoken.matches.splice(position++, 0, {
  444. fn: new RegExp(element, opts.casing ? "i" : ""),
  445. static: !1,
  446. optionality: !1,
  447. newBlockMarker: void 0 === prevMatch ? "master" : prevMatch.def !== element,
  448. casing: null,
  449. def: element,
  450. placeholder: void 0,
  451. nativeDef: element
  452. }) : (escaped && (element = element[element.length - 1]), $.each(element.split(""), function(ndx, lmnt) {
  453. prevMatch = mtoken.matches[position - 1], mtoken.matches.splice(position++, 0, {
  454. fn: /[a-z]/i.test(opts.staticDefinitionSymbol || lmnt) ? new RegExp("[" + (opts.staticDefinitionSymbol || lmnt) + "]", opts.casing ? "i" : "") : null,
  455. static: !0,
  456. optionality: !1,
  457. newBlockMarker: void 0 === prevMatch ? "master" : prevMatch.def !== lmnt && !0 !== prevMatch.static,
  458. casing: null,
  459. def: opts.staticDefinitionSymbol || lmnt,
  460. placeholder: void 0 !== opts.staticDefinitionSymbol ? lmnt : void 0,
  461. nativeDef: (escaped ? "'" : "") + lmnt
  462. });
  463. })), escaped = !1; else {
  464. var maskdef = (opts.definitions ? opts.definitions[element] : void 0) || Inputmask.prototype.definitions[element];
  465. maskdef && !escaped ? mtoken.matches.splice(position++, 0, {
  466. fn: maskdef.validator ? "string" == typeof maskdef.validator ? new RegExp(maskdef.validator, opts.casing ? "i" : "") : new function() {
  467. this.test = maskdef.validator;
  468. }() : new RegExp("."),
  469. static: maskdef.static || !1,
  470. optionality: !1,
  471. newBlockMarker: void 0 === prevMatch ? "master" : prevMatch.def !== (maskdef.definitionSymbol || element),
  472. casing: maskdef.casing,
  473. def: maskdef.definitionSymbol || element,
  474. placeholder: maskdef.placeholder,
  475. nativeDef: element,
  476. generated: maskdef.generated
  477. }) : (mtoken.matches.splice(position++, 0, {
  478. fn: /[a-z]/i.test(opts.staticDefinitionSymbol || element) ? new RegExp("[" + (opts.staticDefinitionSymbol || element) + "]", opts.casing ? "i" : "") : null,
  479. static: !0,
  480. optionality: !1,
  481. newBlockMarker: void 0 === prevMatch ? "master" : prevMatch.def !== element && !0 !== prevMatch.static,
  482. casing: null,
  483. def: opts.staticDefinitionSymbol || element,
  484. placeholder: void 0 !== opts.staticDefinitionSymbol ? element : void 0,
  485. nativeDef: (escaped ? "'" : "") + element
  486. }), escaped = !1);
  487. }
  488. }
  489. function verifyGroupMarker(maskToken) {
  490. maskToken && maskToken.matches && $.each(maskToken.matches, function(ndx, token) {
  491. var nextToken = maskToken.matches[ndx + 1];
  492. (void 0 === nextToken || void 0 === nextToken.matches || !1 === nextToken.isQuantifier) && token && token.isGroup && (token.isGroup = !1,
  493. regexMask || (insertTestDefinition(token, opts.groupmarker[0], 0), !0 !== token.openGroup && insertTestDefinition(token, opts.groupmarker[1]))),
  494. verifyGroupMarker(token);
  495. });
  496. }
  497. function defaultCase() {
  498. if (0 < openenings.length) {
  499. if (currentOpeningToken = openenings[openenings.length - 1], insertTestDefinition(currentOpeningToken, m),
  500. currentOpeningToken.isAlternator) {
  501. alternator = openenings.pop();
  502. for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup && (alternator.matches[mndx].isGroup = !1);
  503. 0 < openenings.length ? (currentOpeningToken = openenings[openenings.length - 1],
  504. currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);
  505. }
  506. } else insertTestDefinition(currentToken, m);
  507. }
  508. function reverseTokens(maskToken) {
  509. function reverseStatic(st) {
  510. return st === opts.optionalmarker[0] ? st = opts.optionalmarker[1] : st === opts.optionalmarker[1] ? st = opts.optionalmarker[0] : st === opts.groupmarker[0] ? st = opts.groupmarker[1] : st === opts.groupmarker[1] && (st = opts.groupmarker[0]),
  511. st;
  512. }
  513. for (var match in maskToken.matches = maskToken.matches.reverse(), maskToken.matches) if (Object.prototype.hasOwnProperty.call(maskToken.matches, match)) {
  514. var intMatch = parseInt(match);
  515. if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {
  516. var qt = maskToken.matches[match];
  517. maskToken.matches.splice(match, 1), maskToken.matches.splice(intMatch + 1, 0, qt);
  518. }
  519. void 0 !== maskToken.matches[match].matches ? maskToken.matches[match] = reverseTokens(maskToken.matches[match]) : maskToken.matches[match] = reverseStatic(maskToken.matches[match]);
  520. }
  521. return maskToken;
  522. }
  523. function groupify(matches) {
  524. var groupToken = new MaskToken(!0);
  525. return groupToken.openGroup = !1, groupToken.matches = matches, groupToken;
  526. }
  527. function closeGroup() {
  528. if (openingToken = openenings.pop(), openingToken.openGroup = !1, void 0 !== openingToken) if (0 < openenings.length) {
  529. if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(openingToken),
  530. currentOpeningToken.isAlternator) {
  531. alternator = openenings.pop();
  532. for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1,
  533. alternator.matches[mndx].alternatorGroup = !1;
  534. 0 < openenings.length ? (currentOpeningToken = openenings[openenings.length - 1],
  535. currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);
  536. }
  537. } else currentToken.matches.push(openingToken); else defaultCase();
  538. }
  539. function groupQuantifier(matches) {
  540. var lastMatch = matches.pop();
  541. return lastMatch.isQuantifier && (lastMatch = groupify([ matches.pop(), lastMatch ])),
  542. lastMatch;
  543. }
  544. for (regexMask && (opts.optionalmarker[0] = void 0, opts.optionalmarker[1] = void 0); match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask); ) {
  545. if (m = match[0], regexMask) switch (m.charAt(0)) {
  546. case "?":
  547. m = "{0,1}";
  548. break;
  549. case "+":
  550. case "*":
  551. m = "{" + m + "}";
  552. break;
  553. case "|":
  554. if (0 === openenings.length) {
  555. var altRegexGroup = groupify(currentToken.matches);
  556. altRegexGroup.openGroup = !0, openenings.push(altRegexGroup), currentToken.matches = [],
  557. closeRegexGroup = !0;
  558. }
  559. break;
  560. }
  561. if (escaped) defaultCase(); else switch (m.charAt(0)) {
  562. case "(?=":
  563. break;
  564. case "(?!":
  565. break;
  566. case "(?<=":
  567. break;
  568. case "(?<!":
  569. break;
  570. case opts.escapeChar:
  571. escaped = !0, regexMask && defaultCase();
  572. break;
  573. case opts.optionalmarker[1]:
  574. case opts.groupmarker[1]:
  575. closeGroup();
  576. break;
  577. case opts.optionalmarker[0]:
  578. openenings.push(new MaskToken(!1, !0));
  579. break;
  580. case opts.groupmarker[0]:
  581. openenings.push(new MaskToken(!0));
  582. break;
  583. case opts.quantifiermarker[0]:
  584. var quantifier = new MaskToken(!1, !1, !0);
  585. m = m.replace(/[{}]/g, "");
  586. var mqj = m.split("|"), mq = mqj[0].split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);
  587. "*" !== mq0 && "+" !== mq0 || (mq0 = "*" === mq1 ? 0 : 1), quantifier.quantifier = {
  588. min: mq0,
  589. max: mq1,
  590. jit: mqj[1]
  591. };
  592. var matches = 0 < openenings.length ? openenings[openenings.length - 1].matches : currentToken.matches;
  593. if (match = matches.pop(), match.isAlternator) {
  594. matches.push(match), matches = match.matches;
  595. var groupToken = new MaskToken(!0), tmpMatch = matches.pop();
  596. matches.push(groupToken), matches = groupToken.matches, match = tmpMatch;
  597. }
  598. match.isGroup || (match = groupify([ match ])), matches.push(match), matches.push(quantifier);
  599. break;
  600. case opts.alternatormarker:
  601. if (0 < openenings.length) {
  602. currentOpeningToken = openenings[openenings.length - 1];
  603. var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];
  604. lastMatch = currentOpeningToken.openGroup && (void 0 === subToken.matches || !1 === subToken.isGroup && !1 === subToken.isAlternator) ? openenings.pop() : groupQuantifier(currentOpeningToken.matches);
  605. } else lastMatch = groupQuantifier(currentToken.matches);
  606. if (lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(),
  607. lastMatch.alternatorGroup = !1) : alternator = new MaskToken(!1, !1, !1, !0), alternator.matches.push(lastMatch),
  608. openenings.push(alternator), lastMatch.openGroup) {
  609. lastMatch.openGroup = !1;
  610. var alternatorGroup = new MaskToken(!0);
  611. alternatorGroup.alternatorGroup = !0, openenings.push(alternatorGroup);
  612. }
  613. break;
  614. default:
  615. defaultCase();
  616. }
  617. }
  618. for (closeRegexGroup && closeGroup(); 0 < openenings.length; ) openingToken = openenings.pop(),
  619. currentToken.matches.push(openingToken);
  620. return 0 < currentToken.matches.length && (verifyGroupMarker(currentToken), maskTokens.push(currentToken)),
  621. (opts.numericInput || opts.isRTL) && reverseTokens(maskTokens[0]), maskTokens;
  622. }
  623. module.exports = {
  624. generateMaskSet: generateMaskSet,
  625. analyseMask: analyseMask
  626. };
  627. }, function(module, exports, __webpack_require__) {
  628. "use strict";
  629. __webpack_require__(6), __webpack_require__(8), __webpack_require__(9), __webpack_require__(10),
  630. module.exports = __webpack_require__(1);
  631. }, function(module, exports, __webpack_require__) {
  632. "use strict";
  633. var Inputmask = __webpack_require__(1);
  634. Inputmask.extendDefinitions({
  635. A: {
  636. validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  637. casing: "upper"
  638. },
  639. "&": {
  640. validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  641. casing: "upper"
  642. },
  643. "#": {
  644. validator: "[0-9A-Fa-f]",
  645. casing: "upper"
  646. }
  647. });
  648. var ipValidatorRegex = new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]");
  649. function ipValidator(chrs, maskset, pos, strict, opts) {
  650. return chrs = -1 < pos - 1 && "." !== maskset.buffer[pos - 1] ? (chrs = maskset.buffer[pos - 1] + chrs,
  651. -1 < pos - 2 && "." !== maskset.buffer[pos - 2] ? maskset.buffer[pos - 2] + chrs : "0" + chrs) : "00" + chrs,
  652. ipValidatorRegex.test(chrs);
  653. }
  654. Inputmask.extendAliases({
  655. cssunit: {
  656. regex: "[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)"
  657. },
  658. url: {
  659. regex: "(https?|ftp)//.*",
  660. autoUnmask: !1
  661. },
  662. ip: {
  663. mask: "i[i[i]].j[j[j]].k[k[k]].l[l[l]]",
  664. definitions: {
  665. i: {
  666. validator: ipValidator
  667. },
  668. j: {
  669. validator: ipValidator
  670. },
  671. k: {
  672. validator: ipValidator
  673. },
  674. l: {
  675. validator: ipValidator
  676. }
  677. },
  678. onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) {
  679. return maskedValue;
  680. },
  681. inputmode: "numeric"
  682. },
  683. email: {
  684. mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]",
  685. greedy: !1,
  686. casing: "lower",
  687. onBeforePaste: function onBeforePaste(pastedValue, opts) {
  688. return pastedValue = pastedValue.toLowerCase(), pastedValue.replace("mailto:", "");
  689. },
  690. definitions: {
  691. "*": {
  692. validator: "[0-9\uff11-\uff19A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5!#$%&'*+/=?^_`{|}~-]"
  693. },
  694. "-": {
  695. validator: "[0-9A-Za-z-]"
  696. }
  697. },
  698. onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) {
  699. return maskedValue;
  700. },
  701. inputmode: "email"
  702. },
  703. mac: {
  704. mask: "##:##:##:##:##:##"
  705. },
  706. vin: {
  707. mask: "V{13}9{4}",
  708. definitions: {
  709. V: {
  710. validator: "[A-HJ-NPR-Za-hj-npr-z\\d]",
  711. casing: "upper"
  712. }
  713. },
  714. clearIncomplete: !0,
  715. autoUnmask: !0
  716. },
  717. ssn: {
  718. mask: "999-99-9999",
  719. postValidation: function postValidation(buffer, pos, c, currentResult, opts, maskset, strict) {
  720. return /^(?!219-09-9999|078-05-1120)(?!666|000|9.{2}).{3}-(?!00).{2}-(?!0{4}).{4}$/.test(buffer.join(""));
  721. }
  722. }
  723. }), module.exports = Inputmask;
  724. }, function(module, exports, __webpack_require__) {
  725. "use strict";
  726. function _typeof(obj) {
  727. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) {
  728. return typeof obj;
  729. } : function _typeof(obj) {
  730. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  731. }, _typeof(obj);
  732. }
  733. var $ = __webpack_require__(2), window = __webpack_require__(3), document = window.document, ua = window.navigator && window.navigator.userAgent || "", ie = 0 < ua.indexOf("MSIE ") || 0 < ua.indexOf("Trident/"), mobile = "ontouchstart" in window, iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile, keyCode = __webpack_require__(0);
  734. module.exports = function maskScope(actionObj, maskset, opts) {
  735. maskset = maskset || this.maskset, opts = opts || this.opts;
  736. var inputmask = this, el = this.el, isRTL = this.isRTL || (this.isRTL = opts.numericInput), undoValue, $el, skipKeyPressEvent = !1, skipInputEvent = !1, validationEvent = !1, ignorable = !1, maxLength, mouseEnter = !1, originalPlaceholder = void 0;
  737. function getMaskTemplate(baseOnInput, minimalPos, includeMode, noJit, clearOptionalTail) {
  738. var greedy = opts.greedy;
  739. clearOptionalTail && (opts.greedy = !1), minimalPos = minimalPos || 0;
  740. var maskTemplate = [], ndxIntlzr, pos = 0, test, testPos, jitRenderStatic;
  741. do {
  742. if (!0 === baseOnInput && maskset.validPositions[pos]) testPos = clearOptionalTail && !0 === maskset.validPositions[pos].match.optionality && void 0 === maskset.validPositions[pos + 1] && (!0 === maskset.validPositions[pos].generatedInput || maskset.validPositions[pos].input == opts.skipOptionalPartCharacter && 0 < pos) ? determineTestTemplate(pos, getTests(pos, ndxIntlzr, pos - 1)) : maskset.validPositions[pos],
  743. test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(!0 === includeMode ? testPos.input : !1 === includeMode ? test.nativeDef : getPlaceholder(pos, test)); else {
  744. testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), test = testPos.match, ndxIntlzr = testPos.locator.slice();
  745. var jitMasking = !0 !== noJit && (!1 !== opts.jitMasking ? opts.jitMasking : test.jit);
  746. jitRenderStatic = jitRenderStatic && test.static && test.def !== opts.groupSeparator && null === test.fn || maskset.validPositions[pos - 1] && test.static && test.def !== opts.groupSeparator && null === test.fn,
  747. jitRenderStatic || !1 === jitMasking || void 0 === jitMasking || "number" == typeof jitMasking && isFinite(jitMasking) && pos < jitMasking ? maskTemplate.push(!1 === includeMode ? test.nativeDef : getPlaceholder(pos, test)) : jitRenderStatic = !1;
  748. }
  749. pos++;
  750. } while ((void 0 === maxLength || pos < maxLength) && (!0 !== test.static || "" !== test.def) || pos < minimalPos);
  751. return "" === maskTemplate[maskTemplate.length - 1] && maskTemplate.pop(), !1 === includeMode && void 0 !== maskset.maskLength || (maskset.maskLength = pos - 1),
  752. opts.greedy = greedy, maskTemplate;
  753. }
  754. function resetMaskSet(soft) {
  755. maskset.buffer = void 0, !0 !== soft && (maskset.validPositions = {}, maskset.p = 0);
  756. }
  757. function getLastValidPosition(closestTo, strict, validPositions) {
  758. var before = -1, after = -1, valids = validPositions || maskset.validPositions;
  759. for (var posNdx in void 0 === closestTo && (closestTo = -1), valids) {
  760. var psNdx = parseInt(posNdx);
  761. valids[psNdx] && (strict || !0 !== valids[psNdx].generatedInput) && (psNdx <= closestTo && (before = psNdx),
  762. closestTo <= psNdx && (after = psNdx));
  763. }
  764. return -1 === before || before == closestTo ? after : -1 == after ? before : closestTo - before < after - closestTo ? before : after;
  765. }
  766. function getDecisionTaker(tst) {
  767. var decisionTaker = tst.locator[tst.alternation];
  768. return "string" == typeof decisionTaker && 0 < decisionTaker.length && (decisionTaker = decisionTaker.split(",")[0]),
  769. void 0 !== decisionTaker ? decisionTaker.toString() : "";
  770. }
  771. function getLocator(tst, align) {
  772. var locator = (null != tst.alternation ? tst.mloc[getDecisionTaker(tst)] : tst.locator).join("");
  773. if ("" !== locator) for (;locator.length < align; ) locator += "0";
  774. return locator;
  775. }
  776. function determineTestTemplate(pos, tests) {
  777. pos = 0 < pos ? pos - 1 : 0;
  778. for (var altTest = getTest(pos), targetLocator = getLocator(altTest), tstLocator, closest, bestMatch, ndx = 0; ndx < tests.length; ndx++) {
  779. var tst = tests[ndx];
  780. tstLocator = getLocator(tst, targetLocator.length);
  781. var distance = Math.abs(tstLocator - targetLocator);
  782. (void 0 === closest || "" !== tstLocator && distance < closest || bestMatch && !opts.greedy && bestMatch.match.optionality && "master" === bestMatch.match.newBlockMarker && (!tst.match.optionality || !tst.match.newBlockMarker) || bestMatch && bestMatch.match.optionalQuantifier && !tst.match.optionalQuantifier) && (closest = distance,
  783. bestMatch = tst);
  784. }
  785. return bestMatch;
  786. }
  787. function getTestTemplate(pos, ndxIntlzr, tstPs) {
  788. return maskset.validPositions[pos] || determineTestTemplate(pos, getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs));
  789. }
  790. function getTest(pos, tests) {
  791. return maskset.validPositions[pos] ? maskset.validPositions[pos] : (tests || getTests(pos))[0];
  792. }
  793. function positionCanMatchDefinition(pos, testDefinition, opts) {
  794. for (var valid = !1, tests = getTests(pos), tndx = 0; tndx < tests.length; tndx++) {
  795. if (tests[tndx].match && (!(tests[tndx].match.nativeDef !== testDefinition.match[opts.shiftPositions ? "def" : "nativeDef"] || opts.shiftPositions && testDefinition.match.static) || tests[tndx].match.nativeDef === testDefinition.match.nativeDef)) {
  796. valid = !0;
  797. break;
  798. }
  799. if (tests[tndx].match && tests[tndx].match.def === testDefinition.match.nativeDef) {
  800. valid = void 0;
  801. break;
  802. }
  803. }
  804. return !1 === valid && void 0 !== maskset.jitOffset[pos] && (valid = positionCanMatchDefinition(pos + maskset.jitOffset[pos], testDefinition, opts)),
  805. valid;
  806. }
  807. function getTests(pos, ndxIntlzr, tstPs) {
  808. var maskTokens = maskset.maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = !1, latestMatch, cacheDependency = ndxIntlzr ? ndxIntlzr.join("") : "";
  809. function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {
  810. function handleMatch(match, loopNdx, quantifierRecurse) {
  811. function isFirstMatch(latestMatch, tokenGroup) {
  812. var firstMatch = 0 === $.inArray(latestMatch, tokenGroup.matches);
  813. return firstMatch || $.each(tokenGroup.matches, function(ndx, match) {
  814. if (!0 === match.isQuantifier ? firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]) : Object.prototype.hasOwnProperty.call(match, "matches") && (firstMatch = isFirstMatch(latestMatch, match)),
  815. firstMatch) return !1;
  816. }), firstMatch;
  817. }
  818. function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {
  819. var bestMatch, indexPos;
  820. if ((maskset.tests[pos] || maskset.validPositions[pos]) && $.each(maskset.tests[pos] || [ maskset.validPositions[pos] ], function(ndx, lmnt) {
  821. if (lmnt.mloc[alternateNdx]) return bestMatch = lmnt, !1;
  822. var alternation = void 0 !== targetAlternation ? targetAlternation : lmnt.alternation, ndxPos = void 0 !== lmnt.locator[alternation] ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;
  823. (void 0 === indexPos || ndxPos < indexPos) && -1 !== ndxPos && (bestMatch = lmnt,
  824. indexPos = ndxPos);
  825. }), bestMatch) {
  826. var bestMatchAltIndex = bestMatch.locator[bestMatch.alternation], locator = bestMatch.mloc[alternateNdx] || bestMatch.mloc[bestMatchAltIndex] || bestMatch.locator;
  827. return locator.slice((void 0 !== targetAlternation ? targetAlternation : bestMatch.alternation) + 1);
  828. }
  829. return void 0 !== targetAlternation ? resolveNdxInitializer(pos, alternateNdx) : void 0;
  830. }
  831. function isSubsetOf(source, target) {
  832. function expand(pattern) {
  833. for (var expanded = [], start = -1, end, i = 0, l = pattern.length; i < l; i++) if ("-" === pattern.charAt(i)) for (end = pattern.charCodeAt(i + 1); ++start < end; ) expanded.push(String.fromCharCode(start)); else start = pattern.charCodeAt(i),
  834. expanded.push(pattern.charAt(i));
  835. return expanded.join("");
  836. }
  837. return source.match.def === target.match.nativeDef || !(!(opts.regex || source.match.fn instanceof RegExp && target.match.fn instanceof RegExp) || !0 === source.match.static || !0 === target.match.static) && -1 !== expand(target.match.fn.toString().replace(/[[\]/]/g, "")).indexOf(expand(source.match.fn.toString().replace(/[[\]/]/g, "")));
  838. }
  839. function staticCanMatchDefinition(source, target) {
  840. return !0 === source.match.static && !0 !== target.match.static && target.match.fn.test(source.match.def, maskset, pos, !1, opts, !1);
  841. }
  842. function setMergeLocators(targetMatch, altMatch) {
  843. var alternationNdx = targetMatch.alternation, shouldMerge = void 0 === altMatch || alternationNdx === altMatch.alternation && -1 === targetMatch.locator[alternationNdx].toString().indexOf(altMatch.locator[alternationNdx]);
  844. if (!shouldMerge && alternationNdx > altMatch.alternation) for (var i = altMatch.alternation; i < alternationNdx; i++) if (targetMatch.locator[i] !== altMatch.locator[i]) {
  845. alternationNdx = i, shouldMerge = !0;
  846. break;
  847. }
  848. if (shouldMerge) {
  849. targetMatch.mloc = targetMatch.mloc || {};
  850. var locNdx = targetMatch.locator[alternationNdx];
  851. if (void 0 !== locNdx) {
  852. if ("string" == typeof locNdx && (locNdx = locNdx.split(",")[0]), void 0 === targetMatch.mloc[locNdx] && (targetMatch.mloc[locNdx] = targetMatch.locator.slice()),
  853. void 0 !== altMatch) {
  854. for (var ndx in altMatch.mloc) "string" == typeof ndx && (ndx = ndx.split(",")[0]),
  855. void 0 === targetMatch.mloc[ndx] && (targetMatch.mloc[ndx] = altMatch.mloc[ndx]);
  856. targetMatch.locator[alternationNdx] = Object.keys(targetMatch.mloc).join(",");
  857. }
  858. return !0;
  859. }
  860. targetMatch.alternation = void 0;
  861. }
  862. return !1;
  863. }
  864. function isSameLevel(targetMatch, altMatch) {
  865. if (targetMatch.locator.length !== altMatch.locator.length) return !1;
  866. for (var locNdx = targetMatch.alternation + 1; locNdx < targetMatch.locator.length; locNdx++) if (targetMatch.locator[locNdx] !== altMatch.locator[locNdx]) return !1;
  867. return !0;
  868. }
  869. if (testPos > opts._maxTestPos && void 0 !== quantifierRecurse) throw "Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. " + maskset.mask;
  870. if (testPos === pos && void 0 === match.matches) return matches.push({
  871. match: match,
  872. locator: loopNdx.reverse(),
  873. cd: cacheDependency,
  874. mloc: {}
  875. }), !0;
  876. if (void 0 !== match.matches) {
  877. if (match.isGroup && quantifierRecurse !== match) {
  878. if (match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx, quantifierRecurse),
  879. match) return !0;
  880. } else if (match.isOptional) {
  881. var optionalToken = match, mtchsNdx = matches.length;
  882. if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse),
  883. match) {
  884. if ($.each(matches, function(ndx, mtch) {
  885. mtchsNdx <= ndx && (mtch.match.optionality = !0);
  886. }), latestMatch = matches[matches.length - 1].match, void 0 !== quantifierRecurse || !isFirstMatch(latestMatch, optionalToken)) return !0;
  887. insertStop = !0, testPos = pos;
  888. }
  889. } else if (match.isAlternator) {
  890. var alternateToken = match, malternateMatches = [], maltMatches, currentMatches = matches.slice(), loopNdxCnt = loopNdx.length, altIndex = 0 < ndxInitializer.length ? ndxInitializer.shift() : -1;
  891. if (-1 === altIndex || "string" == typeof altIndex) {
  892. var currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [], amndx;
  893. if ("string" == typeof altIndex) altIndexArr = altIndex.split(","); else for (amndx = 0; amndx < alternateToken.matches.length; amndx++) altIndexArr.push(amndx.toString());
  894. if (void 0 !== maskset.excludes[pos]) {
  895. for (var altIndexArrClone = altIndexArr.slice(), i = 0, exl = maskset.excludes[pos].length; i < exl; i++) {
  896. var excludeSet = maskset.excludes[pos][i].toString().split(":");
  897. loopNdx.length == excludeSet[1] && altIndexArr.splice(altIndexArr.indexOf(excludeSet[0]), 1);
  898. }
  899. 0 === altIndexArr.length && (delete maskset.excludes[pos], altIndexArr = altIndexArrClone);
  900. }
  901. (!0 === opts.keepStatic || isFinite(parseInt(opts.keepStatic)) && currentPos >= opts.keepStatic) && (altIndexArr = altIndexArr.slice(0, 1));
  902. for (var unMatchedAlternation = !1, ndx = 0; ndx < altIndexArr.length; ndx++) {
  903. amndx = parseInt(altIndexArr[ndx]), matches = [], ndxInitializer = "string" == typeof altIndex && resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice(),
  904. alternateToken.matches[amndx] && handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) ? match = !0 : 0 === ndx && (unMatchedAlternation = !0),
  905. maltMatches = matches.slice(), testPos = currentPos, matches = [];
  906. for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {
  907. var altMatch = maltMatches[ndx1], dropMatch = !1;
  908. altMatch.match.jit = altMatch.match.jit || unMatchedAlternation, altMatch.alternation = altMatch.alternation || loopNdxCnt,
  909. setMergeLocators(altMatch);
  910. for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {
  911. var altMatch2 = malternateMatches[ndx2];
  912. if ("string" != typeof altIndex || void 0 !== altMatch.alternation && -1 !== $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr)) {
  913. if (altMatch.match.nativeDef === altMatch2.match.nativeDef) {
  914. dropMatch = !0, setMergeLocators(altMatch2, altMatch);
  915. break;
  916. }
  917. if (isSubsetOf(altMatch, altMatch2)) {
  918. setMergeLocators(altMatch, altMatch2) && (dropMatch = !0, malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch));
  919. break;
  920. }
  921. if (isSubsetOf(altMatch2, altMatch)) {
  922. setMergeLocators(altMatch2, altMatch);
  923. break;
  924. }
  925. if (staticCanMatchDefinition(altMatch, altMatch2)) {
  926. isSameLevel(altMatch, altMatch2) || void 0 !== el.inputmask.userOptions.keepStatic ? setMergeLocators(altMatch, altMatch2) && (dropMatch = !0,
  927. malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch)) : opts.keepStatic = !0;
  928. break;
  929. }
  930. }
  931. }
  932. dropMatch || malternateMatches.push(altMatch);
  933. }
  934. }
  935. matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = 0 < matches.length,
  936. match = 0 < malternateMatches.length, ndxInitializer = ndxInitializerClone.slice();
  937. } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);
  938. if (match) return !0;
  939. } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) for (var qt = match, qndx = 0 < ndxInitializer.length ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) {
  940. var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];
  941. if (match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup), match) {
  942. if (latestMatch = matches[matches.length - 1].match, latestMatch.optionalQuantifier = qndx >= qt.quantifier.min,
  943. latestMatch.jit = (qndx || 1) * tokenGroup.matches.indexOf(latestMatch) >= qt.quantifier.jit,
  944. latestMatch.optionalQuantifier && isFirstMatch(latestMatch, tokenGroup)) {
  945. insertStop = !0, testPos = pos;
  946. break;
  947. }
  948. return latestMatch.jit && (maskset.jitOffset[pos] = tokenGroup.matches.length - tokenGroup.matches.indexOf(latestMatch)),
  949. !0;
  950. }
  951. } else if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse),
  952. match) return !0;
  953. } else testPos++;
  954. }
  955. for (var tndx = 0 < ndxInitializer.length ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) if (!0 !== maskToken.matches[tndx].isQuantifier) {
  956. var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);
  957. if (match && testPos === pos) return match;
  958. if (pos < testPos) break;
  959. }
  960. }
  961. function mergeLocators(pos, tests) {
  962. var locator = [];
  963. return $.isArray(tests) || (tests = [ tests ]), 0 < tests.length && (void 0 === tests[0].alternation || !0 === opts.keepStatic ? (locator = determineTestTemplate(pos, tests.slice()).locator.slice(),
  964. 0 === locator.length && (locator = tests[0].locator.slice())) : $.each(tests, function(ndx, tst) {
  965. if ("" !== tst.def) if (0 === locator.length) locator = tst.locator.slice(); else for (var i = 0; i < locator.length; i++) tst.locator[i] && -1 === locator[i].toString().indexOf(tst.locator[i]) && (locator[i] += "," + tst.locator[i]);
  966. })), locator;
  967. }
  968. if (-1 < pos && (void 0 === maxLength || pos < maxLength)) {
  969. if (void 0 === ndxIntlzr) {
  970. for (var previousPos = pos - 1, test; void 0 === (test = maskset.validPositions[previousPos] || maskset.tests[previousPos]) && -1 < previousPos; ) previousPos--;
  971. void 0 !== test && -1 < previousPos && (ndxInitializer = mergeLocators(previousPos, test),
  972. cacheDependency = ndxInitializer.join(""), testPos = previousPos);
  973. }
  974. if (maskset.tests[pos] && maskset.tests[pos][0].cd === cacheDependency) return maskset.tests[pos];
  975. for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {
  976. var match = resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]);
  977. if (match && testPos === pos || pos < testPos) break;
  978. }
  979. }
  980. return 0 !== matches.length && !insertStop || matches.push({
  981. match: {
  982. fn: null,
  983. static: !0,
  984. optionality: !1,
  985. casing: null,
  986. def: "",
  987. placeholder: ""
  988. },
  989. locator: [],
  990. mloc: {},
  991. cd: cacheDependency
  992. }), void 0 !== ndxIntlzr && maskset.tests[pos] ? $.extend(!0, [], matches) : (maskset.tests[pos] = $.extend(!0, [], matches),
  993. maskset.tests[pos]);
  994. }
  995. function getBufferTemplate() {
  996. return void 0 === maskset._buffer && (maskset._buffer = getMaskTemplate(!1, 1),
  997. void 0 === maskset.buffer && (maskset.buffer = maskset._buffer.slice())), maskset._buffer;
  998. }
  999. function getBuffer(noCache) {
  1000. return void 0 !== maskset.buffer && !0 !== noCache || (maskset.buffer = getMaskTemplate(!0, getLastValidPosition(), !0),
  1001. void 0 === maskset._buffer && (maskset._buffer = maskset.buffer.slice())), maskset.buffer;
  1002. }
  1003. function refreshFromBuffer(start, end, buffer) {
  1004. var i, p, skipOptionalPartCharacter = opts.skipOptionalPartCharacter, bffr = isRTL ? buffer.slice().reverse() : buffer;
  1005. if (opts.skipOptionalPartCharacter = "", !0 === start) resetMaskSet(), maskset.tests = {},
  1006. start = 0, end = buffer.length, p = determineNewCaretPosition({
  1007. begin: 0,
  1008. end: 0
  1009. }, !1).begin; else {
  1010. for (i = start; i < end; i++) delete maskset.validPositions[i];
  1011. p = start;
  1012. }
  1013. var keypress = new $.Event("keypress");
  1014. for (i = start; i < end; i++) {
  1015. keypress.which = bffr[i].toString().charCodeAt(0), ignorable = !1;
  1016. var valResult = EventHandlers.keypressEvent.call(el, keypress, !0, !1, !1, p);
  1017. !1 !== valResult && (p = valResult.forwardPosition);
  1018. }
  1019. opts.skipOptionalPartCharacter = skipOptionalPartCharacter;
  1020. }
  1021. function casing(elem, test, pos) {
  1022. switch (opts.casing || test.casing) {
  1023. case "upper":
  1024. elem = elem.toUpperCase();
  1025. break;
  1026. case "lower":
  1027. elem = elem.toLowerCase();
  1028. break;
  1029. case "title":
  1030. var posBefore = maskset.validPositions[pos - 1];
  1031. elem = 0 === pos || posBefore && posBefore.input === String.fromCharCode(keyCode.SPACE) ? elem.toUpperCase() : elem.toLowerCase();
  1032. break;
  1033. default:
  1034. if ($.isFunction(opts.casing)) {
  1035. var args = Array.prototype.slice.call(arguments);
  1036. args.push(maskset.validPositions), elem = opts.casing.apply(this, args);
  1037. }
  1038. }
  1039. return elem;
  1040. }
  1041. function checkAlternationMatch(altArr1, altArr2, na) {
  1042. for (var altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = !1, naArr = void 0 !== na ? na.split(",") : [], naNdx, i = 0; i < naArr.length; i++) -1 !== (naNdx = altArr1.indexOf(naArr[i])) && altArr1.splice(naNdx, 1);
  1043. for (var alndx = 0; alndx < altArr1.length; alndx++) if (-1 !== $.inArray(altArr1[alndx], altArrC)) {
  1044. isMatch = !0;
  1045. break;
  1046. }
  1047. return isMatch;
  1048. }
  1049. function alternate(maskPos, c, strict, fromIsValid, rAltPos, selection) {
  1050. var validPsClone = $.extend(!0, {}, maskset.validPositions), tstClone = $.extend(!0, {}, maskset.tests), lastAlt, alternation, isValidRslt = !1, returnRslt = !1, altPos, prevAltPos, i, validPos, decisionPos, lAltPos = void 0 !== rAltPos ? rAltPos : getLastValidPosition(), nextPos, input, begin, end;
  1051. if (selection && (begin = selection.begin, end = selection.end, selection.begin > selection.end && (begin = selection.end,
  1052. end = selection.begin)), -1 === lAltPos && void 0 === rAltPos) lastAlt = 0, prevAltPos = getTest(lastAlt),
  1053. alternation = prevAltPos.alternation; else for (;0 <= lAltPos; lAltPos--) if (altPos = maskset.validPositions[lAltPos],
  1054. altPos && void 0 !== altPos.alternation) {
  1055. if (prevAltPos && prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) break;
  1056. lastAlt = lAltPos, alternation = maskset.validPositions[lastAlt].alternation, prevAltPos = altPos;
  1057. }
  1058. if (void 0 !== alternation) {
  1059. decisionPos = parseInt(lastAlt), maskset.excludes[decisionPos] = maskset.excludes[decisionPos] || [],
  1060. !0 !== maskPos && maskset.excludes[decisionPos].push(getDecisionTaker(prevAltPos) + ":" + prevAltPos.alternation);
  1061. var validInputs = [], resultPos = -1;
  1062. for (i = decisionPos; i < getLastValidPosition(void 0, !0) + 1; i++) -1 === resultPos && maskPos <= i && void 0 !== c && (validInputs.push(c),
  1063. resultPos = validInputs.length - 1), validPos = maskset.validPositions[i], validPos && !0 !== validPos.generatedInput && (void 0 === selection || i < begin || end <= i) && validInputs.push(validPos.input),
  1064. delete maskset.validPositions[i];
  1065. for (-1 === resultPos && void 0 !== c && (validInputs.push(c), resultPos = validInputs.length - 1); void 0 !== maskset.excludes[decisionPos] && maskset.excludes[decisionPos].length < 10; ) {
  1066. for (maskset.tests = {}, resetMaskSet(!0), isValidRslt = !0, i = 0; i < validInputs.length && (nextPos = isValidRslt.caret || getLastValidPosition(void 0, !0) + 1,
  1067. input = validInputs[i], isValidRslt = isValid(nextPos, input, !1, fromIsValid, !0)); i++) i === resultPos && (returnRslt = isValidRslt),
  1068. 1 == maskPos && isValidRslt && (returnRslt = {
  1069. caretPos: i
  1070. });
  1071. if (isValidRslt) break;
  1072. if (resetMaskSet(), prevAltPos = getTest(decisionPos), maskset.validPositions = $.extend(!0, {}, validPsClone),
  1073. maskset.tests = $.extend(!0, {}, tstClone), !maskset.excludes[decisionPos]) {
  1074. returnRslt = alternate(maskPos, c, strict, fromIsValid, decisionPos - 1, selection);
  1075. break;
  1076. }
  1077. var decisionTaker = getDecisionTaker(prevAltPos);
  1078. if (-1 !== maskset.excludes[decisionPos].indexOf(decisionTaker + ":" + prevAltPos.alternation)) {
  1079. returnRslt = alternate(maskPos, c, strict, fromIsValid, decisionPos - 1, selection);
  1080. break;
  1081. }
  1082. for (maskset.excludes[decisionPos].push(decisionTaker + ":" + prevAltPos.alternation),
  1083. i = decisionPos; i < getLastValidPosition(void 0, !0) + 1; i++) delete maskset.validPositions[i];
  1084. }
  1085. }
  1086. return returnRslt && !1 === opts.keepStatic || delete maskset.excludes[decisionPos],
  1087. returnRslt;
  1088. }
  1089. function isValid(pos, c, strict, fromIsValid, fromAlternate, validateOnly) {
  1090. function isSelection(posObj) {
  1091. return isRTL ? 1 < posObj.begin - posObj.end || posObj.begin - posObj.end == 1 : 1 < posObj.end - posObj.begin || posObj.end - posObj.begin == 1;
  1092. }
  1093. strict = !0 === strict;
  1094. var maskPos = pos;
  1095. function processCommandObject(commandObj) {
  1096. if (void 0 !== commandObj) {
  1097. if (void 0 !== commandObj.remove && ($.isArray(commandObj.remove) || (commandObj.remove = [ commandObj.remove ]),
  1098. $.each(commandObj.remove.sort(function(a, b) {
  1099. return b.pos - a.pos;
  1100. }), function(ndx, lmnt) {
  1101. revalidateMask({
  1102. begin: lmnt,
  1103. end: lmnt + 1
  1104. });
  1105. }), commandObj.remove = void 0), void 0 !== commandObj.insert && ($.isArray(commandObj.insert) || (commandObj.insert = [ commandObj.insert ]),
  1106. $.each(commandObj.insert.sort(function(a, b) {
  1107. return a.pos - b.pos;
  1108. }), function(ndx, lmnt) {
  1109. "" !== lmnt.c && isValid(lmnt.pos, lmnt.c, void 0 === lmnt.strict || lmnt.strict, void 0 !== lmnt.fromIsValid ? lmnt.fromIsValid : fromIsValid);
  1110. }), commandObj.insert = void 0), commandObj.refreshFromBuffer && commandObj.buffer) {
  1111. var refresh = commandObj.refreshFromBuffer;
  1112. refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, commandObj.buffer),
  1113. commandObj.refreshFromBuffer = void 0;
  1114. }
  1115. void 0 !== commandObj.rewritePosition && (maskPos = commandObj.rewritePosition,
  1116. commandObj = !0);
  1117. }
  1118. return commandObj;
  1119. }
  1120. function _isValid(position, c, strict) {
  1121. var rslt = !1;
  1122. return $.each(getTests(position), function(ndx, tst) {
  1123. var test = tst.match;
  1124. if (getBuffer(!0), rslt = null != test.fn ? test.fn.test(c, maskset, position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && "" !== test.def && {
  1125. c: getPlaceholder(position, test, !0) || test.def,
  1126. pos: position
  1127. }, !1 !== rslt) {
  1128. var elem = void 0 !== rslt.c ? rslt.c : c, validatedPos = position;
  1129. return elem = elem === opts.skipOptionalPartCharacter && !0 === test.static ? getPlaceholder(position, test, !0) || test.def : elem,
  1130. rslt = processCommandObject(rslt), !0 !== rslt && void 0 !== rslt.pos && rslt.pos !== position && (validatedPos = rslt.pos),
  1131. !0 !== rslt && void 0 === rslt.pos && void 0 === rslt.c ? !1 : (!1 === revalidateMask(pos, $.extend({}, tst, {
  1132. input: casing(elem, test, validatedPos)
  1133. }), fromIsValid, validatedPos) && (rslt = !1), !1);
  1134. }
  1135. }), rslt;
  1136. }
  1137. void 0 !== pos.begin && (maskPos = isRTL ? pos.end : pos.begin);
  1138. var result = !0, positionsClone = $.extend(!0, {}, maskset.validPositions);
  1139. if (!1 === opts.keepStatic && void 0 !== maskset.excludes[maskPos] && !0 !== fromAlternate && !0 !== fromIsValid) for (var i = maskPos; i < (isRTL ? pos.begin : pos.end); i++) void 0 !== maskset.excludes[i] && (maskset.excludes[i] = void 0,
  1140. delete maskset.tests[i]);
  1141. if ($.isFunction(opts.preValidation) && !0 !== fromIsValid && !0 !== validateOnly && (result = opts.preValidation.call(el, getBuffer(), maskPos, c, isSelection(pos), opts, maskset, pos, strict || fromAlternate),
  1142. result = processCommandObject(result)), !0 === result) {
  1143. if (void 0 === maxLength || maskPos < maxLength) {
  1144. if (result = _isValid(maskPos, c, strict), (!strict || !0 === fromIsValid) && !1 === result && !0 !== validateOnly) {
  1145. var currentPosValid = maskset.validPositions[maskPos];
  1146. if (!currentPosValid || !0 !== currentPosValid.match.static || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
  1147. if (opts.insertMode || void 0 === maskset.validPositions[seekNext(maskPos)] || pos.end > maskPos) {
  1148. var skip = !1;
  1149. if (maskset.jitOffset[maskPos] && void 0 === maskset.validPositions[seekNext(maskPos)] && (result = isValid(maskPos + maskset.jitOffset[maskPos], c, !0),
  1150. !1 !== result && (!0 !== fromAlternate && (result.caret = maskPos), skip = !0)),
  1151. pos.end > maskPos && (maskset.validPositions[maskPos] = void 0), !skip && !isMask(maskPos, opts.keepStatic)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) if (result = _isValid(nPos, c, strict),
  1152. !1 !== result) {
  1153. result = trackbackPositions(maskPos, void 0 !== result.pos ? result.pos : nPos) || result,
  1154. maskPos = nPos;
  1155. break;
  1156. }
  1157. }
  1158. } else result = {
  1159. caret: seekNext(maskPos)
  1160. };
  1161. }
  1162. } else result = !1;
  1163. !1 !== result || !opts.keepStatic || !isComplete(getBuffer()) && 0 !== maskPos || strict || !0 === fromAlternate ? isSelection(pos) && maskset.tests[maskPos] && 1 < maskset.tests[maskPos].length && opts.keepStatic && !strict && !0 !== fromAlternate && (result = alternate(!0)) : result = alternate(maskPos, c, strict, fromIsValid, void 0, pos),
  1164. !0 === result && (result = {
  1165. pos: maskPos
  1166. });
  1167. }
  1168. if ($.isFunction(opts.postValidation) && !0 !== fromIsValid && !0 !== validateOnly) {
  1169. var postResult = opts.postValidation.call(el, getBuffer(!0), void 0 !== pos.begin ? isRTL ? pos.end : pos.begin : pos, c, result, opts, maskset, strict);
  1170. void 0 !== postResult && (result = !0 === postResult ? result : postResult);
  1171. }
  1172. result && void 0 === result.pos && (result.pos = maskPos), !1 === result || !0 === validateOnly ? (resetMaskSet(!0),
  1173. maskset.validPositions = $.extend(!0, {}, positionsClone)) : trackbackPositions(void 0, maskPos, !0);
  1174. var endResult = processCommandObject(result);
  1175. return endResult;
  1176. }
  1177. function trackbackPositions(originalPos, newPos, fillOnly) {
  1178. if (void 0 === originalPos) for (originalPos = newPos - 1; 0 < originalPos && !maskset.validPositions[originalPos]; originalPos--) ;
  1179. for (var ps = originalPos; ps < newPos; ps++) if (void 0 === maskset.validPositions[ps] && !isMask(ps, !0)) {
  1180. var vp = 0 == ps ? getTest(ps) : maskset.validPositions[ps - 1];
  1181. if (vp) {
  1182. var tests = getTests(ps).slice();
  1183. "" === tests[tests.length - 1].match.def && tests.pop();
  1184. var bestMatch = determineTestTemplate(ps, tests), np;
  1185. if (bestMatch && (!0 !== bestMatch.match.jit || "master" === bestMatch.match.newBlockMarker && (np = maskset.validPositions[ps + 1]) && !0 === np.match.optionalQuantifier) && (bestMatch = $.extend({}, bestMatch, {
  1186. input: getPlaceholder(ps, bestMatch.match, !0) || bestMatch.match.def
  1187. }), bestMatch.generatedInput = !0, revalidateMask(ps, bestMatch, !0), !0 !== fillOnly)) {
  1188. var cvpInput = maskset.validPositions[newPos].input;
  1189. return maskset.validPositions[newPos] = void 0, isValid(newPos, cvpInput, !0, !0);
  1190. }
  1191. }
  1192. }
  1193. }
  1194. function revalidateMask(pos, validTest, fromIsValid, validatedPos) {
  1195. function IsEnclosedStatic(pos, valids, selection) {
  1196. var posMatch = valids[pos];
  1197. if (void 0 === posMatch || !0 !== posMatch.match.static || !0 === posMatch.match.optionality || void 0 !== valids[0] && void 0 !== valids[0].alternation) return !1;
  1198. var prevMatch = selection.begin <= pos - 1 ? valids[pos - 1] && !0 === valids[pos - 1].match.static && valids[pos - 1] : valids[pos - 1], nextMatch = selection.end > pos + 1 ? valids[pos + 1] && !0 === valids[pos + 1].match.static && valids[pos + 1] : valids[pos + 1];
  1199. return prevMatch && nextMatch;
  1200. }
  1201. var offset = 0, begin = void 0 !== pos.begin ? pos.begin : pos, end = void 0 !== pos.end ? pos.end : pos;
  1202. if (pos.begin > pos.end && (begin = pos.end, end = pos.begin), validatedPos = void 0 !== validatedPos ? validatedPos : begin,
  1203. begin !== end || opts.insertMode && void 0 !== maskset.validPositions[validatedPos] && void 0 === fromIsValid || void 0 === validTest) {
  1204. var positionsClone = $.extend(!0, {}, maskset.validPositions), lvp = getLastValidPosition(void 0, !0), i;
  1205. for (maskset.p = begin, i = lvp; begin <= i; i--) delete maskset.validPositions[i],
  1206. void 0 === validTest && delete maskset.tests[i + 1];
  1207. var valid = !0, j = validatedPos, posMatch = j, t, canMatch;
  1208. for (validTest && (maskset.validPositions[validatedPos] = $.extend(!0, {}, validTest),
  1209. posMatch++, j++), i = validTest ? end : end - 1; i <= lvp; i++) {
  1210. if (void 0 !== (t = positionsClone[i]) && !0 !== t.generatedInput && (end <= i || begin <= i && IsEnclosedStatic(i, positionsClone, {
  1211. begin: begin,
  1212. end: end
  1213. }))) {
  1214. for (;"" !== getTest(posMatch).match.def; ) {
  1215. if (!1 !== (canMatch = positionCanMatchDefinition(posMatch, t, opts)) || "+" === t.match.def) {
  1216. "+" === t.match.def && getBuffer(!0);
  1217. var result = isValid(posMatch, t.input, "+" !== t.match.def, "+" !== t.match.def);
  1218. if (valid = !1 !== result, j = (result.pos || posMatch) + 1, !valid && canMatch) break;
  1219. } else valid = !1;
  1220. if (valid) {
  1221. void 0 === validTest && t.match.static && i === pos.begin && offset++;
  1222. break;
  1223. }
  1224. if (!valid && posMatch > maskset.maskLength) break;
  1225. posMatch++;
  1226. }
  1227. "" == getTest(posMatch).match.def && (valid = !1), posMatch = j;
  1228. }
  1229. if (!valid) break;
  1230. }
  1231. if (!valid) return maskset.validPositions = $.extend(!0, {}, positionsClone), resetMaskSet(!0),
  1232. !1;
  1233. } else validTest && getTest(validatedPos).match.cd === validTest.match.cd && (maskset.validPositions[validatedPos] = $.extend(!0, {}, validTest));
  1234. return resetMaskSet(!0), offset;
  1235. }
  1236. function isMask(pos, strict, fuzzy) {
  1237. var test = getTestTemplate(pos).match;
  1238. if ("" === test.def && (test = getTest(pos).match), !0 !== test.static) return test.fn;
  1239. if (!0 === fuzzy && void 0 !== maskset.validPositions[pos] && !0 !== maskset.validPositions[pos].generatedInput) return !0;
  1240. if (!0 !== strict && -1 < pos) {
  1241. if (fuzzy) {
  1242. var tests = getTests(pos);
  1243. return tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0);
  1244. }
  1245. var testTemplate = determineTestTemplate(pos, getTests(pos)), testPlaceHolder = getPlaceholder(pos, testTemplate.match);
  1246. return testTemplate.match.def !== testPlaceHolder;
  1247. }
  1248. return !1;
  1249. }
  1250. function seekNext(pos, newBlock, fuzzy) {
  1251. void 0 === fuzzy && (fuzzy = !0);
  1252. for (var position = pos + 1; "" !== getTest(position).match.def && (!0 === newBlock && (!0 !== getTest(position).match.newBlockMarker || !isMask(position, void 0, !0)) || !0 !== newBlock && !isMask(position, void 0, fuzzy)); ) position++;
  1253. return position;
  1254. }
  1255. function seekPrevious(pos, newBlock) {
  1256. var position = pos, tests;
  1257. if (position <= 0) return 0;
  1258. for (;0 < --position && (!0 === newBlock && !0 !== getTest(position).match.newBlockMarker || !0 !== newBlock && !isMask(position, void 0, !0) && (tests = getTests(position),
  1259. tests.length < 2 || 2 === tests.length && "" === tests[1].match.def)); ) ;
  1260. return position;
  1261. }
  1262. function writeBuffer(input, buffer, caretPos, event, triggerEvents) {
  1263. if (event && $.isFunction(opts.onBeforeWrite)) {
  1264. var result = opts.onBeforeWrite.call(inputmask, event, buffer, caretPos, opts);
  1265. if (result) {
  1266. if (result.refreshFromBuffer) {
  1267. var refresh = result.refreshFromBuffer;
  1268. refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer || buffer),
  1269. buffer = getBuffer(!0);
  1270. }
  1271. void 0 !== caretPos && (caretPos = void 0 !== result.caret ? result.caret : caretPos);
  1272. }
  1273. }
  1274. if (void 0 !== input && (input.inputmask._valueSet(buffer.join("")), void 0 === caretPos || void 0 !== event && "blur" === event.type || caret(input, caretPos, void 0, void 0, void 0 !== event && "keydown" === event.type && (event.keyCode === keyCode.DELETE || event.keyCode === keyCode.BACKSPACE)),
  1275. !0 === triggerEvents)) {
  1276. var $input = $(input), nptVal = input.inputmask._valueGet();
  1277. skipInputEvent = !0, $input.trigger("input"), setTimeout(function() {
  1278. nptVal === getBufferTemplate().join("") ? $input.trigger("cleared") : !0 === isComplete(buffer) && $input.trigger("complete");
  1279. }, 0);
  1280. }
  1281. }
  1282. function getPlaceholder(pos, test, returnPL) {
  1283. if (test = test || getTest(pos).match, void 0 !== test.placeholder || !0 === returnPL) return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder;
  1284. if (!0 !== test.static) return opts.placeholder.charAt(pos % opts.placeholder.length);
  1285. if (-1 < pos && void 0 === maskset.validPositions[pos]) {
  1286. var tests = getTests(pos), staticAlternations = [], prevTest;
  1287. if (tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0)) for (var i = 0; i < tests.length; i++) if ("" !== tests[i].match.def && !0 !== tests[i].match.optionality && !0 !== tests[i].match.optionalQuantifier && (!0 === tests[i].match.static || void 0 === prevTest || !1 !== tests[i].match.fn.test(prevTest.match.def, maskset, pos, !0, opts)) && (staticAlternations.push(tests[i]),
  1288. !0 === tests[i].match.static && (prevTest = tests[i]), 1 < staticAlternations.length && /[0-9a-bA-Z]/.test(staticAlternations[0].match.def))) return opts.placeholder.charAt(pos % opts.placeholder.length);
  1289. }
  1290. return test.def;
  1291. }
  1292. function HandleNativePlaceholder(npt, value) {
  1293. if (ie) {
  1294. if (npt.inputmask._valueGet() !== value && (npt.placeholder !== value || "" === npt.placeholder)) {
  1295. var buffer = getBuffer().slice(), nptValue = npt.inputmask._valueGet();
  1296. if (nptValue !== value) {
  1297. var lvp = getLastValidPosition();
  1298. -1 === lvp && nptValue === getBufferTemplate().join("") ? buffer = [] : -1 !== lvp && clearOptionalTail(buffer),
  1299. writeBuffer(npt, buffer);
  1300. }
  1301. }
  1302. } else npt.placeholder !== value && (npt.placeholder = value, "" === npt.placeholder && npt.removeAttribute("placeholder"));
  1303. }
  1304. function determineNewCaretPosition(selectedCaret, tabbed) {
  1305. function doRadixFocus(clickPos) {
  1306. if ("" !== opts.radixPoint && 0 !== opts.digits) {
  1307. var vps = maskset.validPositions;
  1308. if (void 0 === vps[clickPos] || vps[clickPos].input === getPlaceholder(clickPos)) {
  1309. if (clickPos < seekNext(-1)) return !0;
  1310. var radixPos = $.inArray(opts.radixPoint, getBuffer());
  1311. if (-1 !== radixPos) {
  1312. for (var vp in vps) if (vps[vp] && radixPos < vp && vps[vp].input !== getPlaceholder(vp)) return !1;
  1313. return !0;
  1314. }
  1315. }
  1316. }
  1317. return !1;
  1318. }
  1319. if (tabbed && (isRTL ? selectedCaret.end = selectedCaret.begin : selectedCaret.begin = selectedCaret.end),
  1320. selectedCaret.begin === selectedCaret.end) {
  1321. switch (opts.positionCaretOnClick) {
  1322. case "none":
  1323. break;
  1324. case "select":
  1325. selectedCaret = {
  1326. begin: 0,
  1327. end: getBuffer().length
  1328. };
  1329. break;
  1330. case "ignore":
  1331. selectedCaret.end = selectedCaret.begin = seekNext(getLastValidPosition());
  1332. break;
  1333. case "radixFocus":
  1334. if (doRadixFocus(selectedCaret.begin)) {
  1335. var radixPos = getBuffer().join("").indexOf(opts.radixPoint);
  1336. selectedCaret.end = selectedCaret.begin = opts.numericInput ? seekNext(radixPos) : radixPos;
  1337. break;
  1338. }
  1339. default:
  1340. var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, !0), lastPosition = seekNext(-1 !== lvclickPosition || isMask(0) ? lvclickPosition : 0);
  1341. if (clickPosition < lastPosition) selectedCaret.end = selectedCaret.begin = isMask(clickPosition, !0) || isMask(clickPosition - 1, !0) ? clickPosition : seekNext(clickPosition); else {
  1342. var lvp = maskset.validPositions[lvclickPosition], tt = getTestTemplate(lastPosition, lvp ? lvp.match.locator : void 0, lvp), placeholder = getPlaceholder(lastPosition, tt.match);
  1343. if ("" !== placeholder && getBuffer()[lastPosition] !== placeholder && !0 !== tt.match.optionalQuantifier && !0 !== tt.match.newBlockMarker || !isMask(lastPosition, opts.keepStatic) && tt.match.def === placeholder) {
  1344. var newPos = seekNext(lastPosition);
  1345. (newPos <= clickPosition || clickPosition === lastPosition) && (lastPosition = newPos);
  1346. }
  1347. selectedCaret.end = selectedCaret.begin = lastPosition;
  1348. }
  1349. }
  1350. return selectedCaret;
  1351. }
  1352. }
  1353. var EventRuler = {
  1354. on: function on(input, eventName, eventHandler) {
  1355. var ev = function ev(e) {
  1356. e.originalEvent && (e = e.originalEvent || e, arguments[0] = e);
  1357. var that = this, args;
  1358. if (void 0 === that.inputmask && "FORM" !== this.nodeName) {
  1359. var imOpts = $.data(that, "_inputmask_opts");
  1360. imOpts ? new Inputmask(imOpts).mask(that) : EventRuler.off(that);
  1361. } else {
  1362. if ("setvalue" === e.type || "FORM" === this.nodeName || !(that.disabled || that.readOnly && !("keydown" === e.type && e.ctrlKey && 67 === e.keyCode || !1 === opts.tabThrough && e.keyCode === keyCode.TAB))) {
  1363. switch (e.type) {
  1364. case "input":
  1365. if (!0 === skipInputEvent || e.inputType && "insertCompositionText" === e.inputType) return skipInputEvent = !1,
  1366. e.preventDefault();
  1367. break;
  1368. case "keydown":
  1369. skipKeyPressEvent = !1, skipInputEvent = !1;
  1370. break;
  1371. case "keypress":
  1372. if (!0 === skipKeyPressEvent) return e.preventDefault();
  1373. skipKeyPressEvent = !0;
  1374. break;
  1375. case "click":
  1376. case "focus":
  1377. return validationEvent ? (validationEvent = !1, input.blur(), HandleNativePlaceholder(input, (isRTL ? getBufferTemplate().slice().reverse() : getBufferTemplate()).join("")),
  1378. setTimeout(function() {
  1379. input.focus();
  1380. }, 3e3)) : (args = arguments, setTimeout(function() {
  1381. input.inputmask && eventHandler.apply(that, args);
  1382. }, 0)), !1;
  1383. }
  1384. var returnVal = eventHandler.apply(that, arguments);
  1385. return !1 === returnVal && (e.preventDefault(), e.stopPropagation()), returnVal;
  1386. }
  1387. e.preventDefault();
  1388. }
  1389. };
  1390. input.inputmask.events[eventName] = input.inputmask.events[eventName] || [], input.inputmask.events[eventName].push(ev),
  1391. -1 !== $.inArray(eventName, [ "submit", "reset" ]) ? null !== input.form && $(input.form).on(eventName, ev) : $(input).on(eventName, ev);
  1392. },
  1393. off: function off(input, event) {
  1394. var events;
  1395. input.inputmask && input.inputmask.events && (event ? (events = [], events[event] = input.inputmask.events[event]) : events = input.inputmask.events,
  1396. $.each(events, function(eventName, evArr) {
  1397. for (;0 < evArr.length; ) {
  1398. var ev = evArr.pop();
  1399. -1 !== $.inArray(eventName, [ "submit", "reset" ]) ? null !== input.form && $(input.form).off(eventName, ev) : $(input).off(eventName, ev);
  1400. }
  1401. delete input.inputmask.events[eventName];
  1402. }));
  1403. }
  1404. }, EventHandlers = {
  1405. keydownEvent: function keydownEvent(e) {
  1406. var input = this, $input = $(input), k = e.keyCode, pos = caret(input), kdResult = opts.onKeyDown.call(this, e, getBuffer(), pos, opts);
  1407. if (void 0 !== kdResult) return kdResult;
  1408. if (k === keyCode.BACKSPACE || k === keyCode.DELETE || iphone && k === keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === keyCode.X && !("oncut" in input)) e.preventDefault(),
  1409. handleRemove(input, k, pos), writeBuffer(input, getBuffer(!0), maskset.p, e, input.inputmask._valueGet() !== getBuffer().join("")); else if (k === keyCode.END || k === keyCode.PAGE_DOWN) {
  1410. e.preventDefault();
  1411. var caretPos = seekNext(getLastValidPosition());
  1412. caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, !0);
  1413. } else k === keyCode.HOME && !e.shiftKey || k === keyCode.PAGE_UP ? (e.preventDefault(),
  1414. caret(input, 0, e.shiftKey ? pos.begin : 0, !0)) : (opts.undoOnEscape && k === keyCode.ESCAPE || 90 === k && e.ctrlKey) && !0 !== e.altKey ? (checkVal(input, !0, !1, undoValue.split("")),
  1415. $input.trigger("click")) : !0 === opts.tabThrough && k === keyCode.TAB ? (!0 === e.shiftKey ? (!0 === getTest(pos.begin).match.static && (pos.begin = seekNext(pos.begin)),
  1416. pos.end = seekPrevious(pos.begin, !0), pos.begin = seekPrevious(pos.end, !0)) : (pos.begin = seekNext(pos.begin, !0),
  1417. pos.end = seekNext(pos.begin, !0), pos.end < maskset.maskLength && pos.end--), pos.begin < maskset.maskLength && (e.preventDefault(),
  1418. caret(input, pos.begin, pos.end))) : e.shiftKey || opts.insertModeVisual && !1 === opts.insertMode && (k === keyCode.RIGHT ? setTimeout(function() {
  1419. var caretPos = caret(input);
  1420. caret(input, caretPos.begin);
  1421. }, 0) : k === keyCode.LEFT && setTimeout(function() {
  1422. var caretPos_begin = translatePosition(input.inputmask.caretPos.begin), caretPos_end = translatePosition(input.inputmask.caretPos.end);
  1423. caret(input, isRTL ? caretPos_begin + (caretPos_begin === maskset.maskLength ? 0 : 1) : caretPos_begin - (0 === caretPos_begin ? 0 : 1));
  1424. }, 0));
  1425. ignorable = -1 !== $.inArray(k, opts.ignorables);
  1426. },
  1427. keypressEvent: function keypressEvent(e, checkval, writeOut, strict, ndx) {
  1428. var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;
  1429. if (!(!0 === checkval || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable)) return k === keyCode.ENTER && undoValue !== getBuffer().join("") && (undoValue = getBuffer().join(""),
  1430. setTimeout(function() {
  1431. $input.trigger("change");
  1432. }, 0)), skipInputEvent = !0, !0;
  1433. if (k) {
  1434. 44 !== k && 46 !== k || 3 !== e.location || "" === opts.radixPoint || (k = opts.radixPoint.charCodeAt(0));
  1435. var pos = checkval ? {
  1436. begin: ndx,
  1437. end: ndx
  1438. } : caret(input), forwardPosition, c = String.fromCharCode(k);
  1439. maskset.writeOutBuffer = !0;
  1440. var valResult = isValid(pos, c, strict);
  1441. if (!1 !== valResult && (resetMaskSet(!0), forwardPosition = void 0 !== valResult.caret ? valResult.caret : seekNext(valResult.pos.begin ? valResult.pos.begin : valResult.pos),
  1442. maskset.p = forwardPosition), forwardPosition = opts.numericInput && void 0 === valResult.caret ? seekPrevious(forwardPosition) : forwardPosition,
  1443. !1 !== writeOut && (setTimeout(function() {
  1444. opts.onKeyValidation.call(input, k, valResult);
  1445. }, 0), maskset.writeOutBuffer && !1 !== valResult)) {
  1446. var buffer = getBuffer();
  1447. writeBuffer(input, buffer, forwardPosition, e, !0 !== checkval);
  1448. }
  1449. if (e.preventDefault(), checkval) return !1 !== valResult && (valResult.forwardPosition = forwardPosition),
  1450. valResult;
  1451. }
  1452. },
  1453. pasteEvent: function pasteEvent(e) {
  1454. var input = this, inputValue = this.inputmask._valueGet(!0), caretPos = caret(this), tempValue;
  1455. isRTL && (tempValue = caretPos.end, caretPos.end = caretPos.begin, caretPos.begin = tempValue);
  1456. var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);
  1457. if (valueBeforeCaret == (isRTL ? getBufferTemplate().slice().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join("") && (valueBeforeCaret = ""),
  1458. valueAfterCaret == (isRTL ? getBufferTemplate().slice().reverse() : getBufferTemplate()).slice(caretPos.end).join("") && (valueAfterCaret = ""),
  1459. window.clipboardData && window.clipboardData.getData) inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret; else {
  1460. if (!e.clipboardData || !e.clipboardData.getData) return !0;
  1461. inputValue = valueBeforeCaret + e.clipboardData.getData("text/plain") + valueAfterCaret;
  1462. }
  1463. var pasteValue = inputValue;
  1464. if ($.isFunction(opts.onBeforePaste)) {
  1465. if (pasteValue = opts.onBeforePaste.call(inputmask, inputValue, opts), !1 === pasteValue) return e.preventDefault();
  1466. pasteValue = pasteValue || inputValue;
  1467. }
  1468. return checkVal(this, !1, !1, pasteValue.toString().split("")), writeBuffer(this, getBuffer(), seekNext(getLastValidPosition()), e, undoValue !== getBuffer().join("")),
  1469. e.preventDefault();
  1470. },
  1471. inputFallBackEvent: function inputFallBackEvent(e) {
  1472. function ieMobileHandler(input, inputValue, caretPos) {
  1473. if (iemobile) {
  1474. var inputChar = inputValue.replace(getBuffer().join(""), "");
  1475. if (1 === inputChar.length) {
  1476. var iv = inputValue.split("");
  1477. iv.splice(caretPos.begin, 0, inputChar), inputValue = iv.join("");
  1478. }
  1479. }
  1480. return inputValue;
  1481. }
  1482. function analyseChanges(inputValue, buffer, caretPos) {
  1483. for (var frontPart = inputValue.substr(0, caretPos.begin).split(""), backPart = inputValue.substr(caretPos.begin).split(""), frontBufferPart = buffer.substr(0, caretPos.begin).split(""), backBufferPart = buffer.substr(caretPos.begin).split(""), fpl = frontPart.length >= frontBufferPart.length ? frontPart.length : frontBufferPart.length, bpl = backPart.length >= backBufferPart.length ? backPart.length : backBufferPart.length, bl, i, action = "", data = [], marker = "~", placeholder; frontPart.length < fpl; ) frontPart.push("~");
  1484. for (;frontBufferPart.length < fpl; ) frontBufferPart.push("~");
  1485. for (;backPart.length < bpl; ) backPart.unshift("~");
  1486. for (;backBufferPart.length < bpl; ) backBufferPart.unshift("~");
  1487. var newBuffer = frontPart.concat(backPart), oldBuffer = frontBufferPart.concat(backBufferPart);
  1488. for (i = 0, bl = newBuffer.length; i < bl; i++) switch (placeholder = getPlaceholder(translatePosition(i)),
  1489. action) {
  1490. case "insertText":
  1491. oldBuffer[i - 1] === newBuffer[i] && caretPos.begin == newBuffer.length - 1 && data.push(newBuffer[i]),
  1492. i = bl;
  1493. break;
  1494. case "insertReplacementText":
  1495. "~" === newBuffer[i] ? caretPos.end++ : i = bl;
  1496. break;
  1497. case "deleteContentBackward":
  1498. "~" === newBuffer[i] ? caretPos.end++ : i = bl;
  1499. break;
  1500. default:
  1501. newBuffer[i] !== oldBuffer[i] && ("~" !== newBuffer[i + 1] && newBuffer[i + 1] !== placeholder && void 0 !== newBuffer[i + 1] || (oldBuffer[i] !== placeholder || "~" !== oldBuffer[i + 1]) && "~" !== oldBuffer[i] ? "~" === oldBuffer[i + 1] && oldBuffer[i] === newBuffer[i + 1] ? (action = "insertText",
  1502. data.push(newBuffer[i]), caretPos.begin--, caretPos.end--) : newBuffer[i] !== placeholder && "~" !== newBuffer[i] && ("~" === newBuffer[i + 1] || oldBuffer[i] !== newBuffer[i] && oldBuffer[i + 1] === newBuffer[i + 1]) ? (action = "insertReplacementText",
  1503. data.push(newBuffer[i]), caretPos.begin--) : "~" === newBuffer[i] ? (action = "deleteContentBackward",
  1504. !isMask(translatePosition(i), !0) && oldBuffer[i] !== opts.radixPoint || caretPos.end++) : i = bl : (action = "insertText",
  1505. data.push(newBuffer[i]), caretPos.begin--, caretPos.end--));
  1506. break;
  1507. }
  1508. return {
  1509. action: action,
  1510. data: data,
  1511. caret: caretPos
  1512. };
  1513. }
  1514. var input = this, inputValue = input.inputmask._valueGet(!0), buffer = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(""), caretPos = caret(input, void 0, void 0, !0);
  1515. if (buffer !== inputValue) {
  1516. inputValue = ieMobileHandler(input, inputValue, caretPos);
  1517. var changes = analyseChanges(inputValue, buffer, caretPos);
  1518. switch ((input.inputmask.shadowRoot || document).activeElement !== input && input.focus(),
  1519. writeBuffer(input, getBuffer()), caret(input, caretPos.begin, caretPos.end, !0),
  1520. changes.action) {
  1521. case "insertText":
  1522. case "insertReplacementText":
  1523. $.each(changes.data, function(ndx, entry) {
  1524. var keypress = new $.Event("keypress");
  1525. keypress.which = entry.charCodeAt(0), ignorable = !1, EventHandlers.keypressEvent.call(input, keypress);
  1526. }), setTimeout(function() {
  1527. $el.trigger("keyup");
  1528. }, 0);
  1529. break;
  1530. case "deleteContentBackward":
  1531. var keydown = new $.Event("keydown");
  1532. keydown.keyCode = keyCode.BACKSPACE, EventHandlers.keydownEvent.call(input, keydown);
  1533. break;
  1534. default:
  1535. applyInputValue(input, inputValue);
  1536. break;
  1537. }
  1538. e.preventDefault();
  1539. }
  1540. },
  1541. compositionendEvent: function compositionendEvent(e) {
  1542. $el.trigger("input");
  1543. },
  1544. setValueEvent: function setValueEvent(e, argument_1, argument_2) {
  1545. var input = this, value = e && e.detail ? e.detail[0] : argument_1;
  1546. void 0 === value && (value = this.inputmask._valueGet(!0)), applyInputValue(this, value),
  1547. (e.detail && void 0 !== e.detail[1] || void 0 !== argument_2) && caret(this, e.detail ? e.detail[1] : argument_2);
  1548. },
  1549. focusEvent: function focusEvent(e) {
  1550. var input = this, nptValue = this.inputmask._valueGet();
  1551. opts.showMaskOnFocus && nptValue !== getBuffer().join("") && writeBuffer(this, getBuffer(), seekNext(getLastValidPosition())),
  1552. !0 !== opts.positionCaretOnTab || !1 !== mouseEnter || isComplete(getBuffer()) && -1 !== getLastValidPosition() || EventHandlers.clickEvent.apply(this, [ e, !0 ]),
  1553. undoValue = getBuffer().join("");
  1554. },
  1555. invalidEvent: function invalidEvent(e) {
  1556. validationEvent = !0;
  1557. },
  1558. mouseleaveEvent: function mouseleaveEvent() {
  1559. var input = this;
  1560. mouseEnter = !1, opts.clearMaskOnLostFocus && (this.inputmask.shadowRoot || document).activeElement !== this && HandleNativePlaceholder(this, originalPlaceholder);
  1561. },
  1562. clickEvent: function clickEvent(e, tabbed) {
  1563. var input = this;
  1564. if ((this.inputmask.shadowRoot || document).activeElement === this) {
  1565. var newCaretPosition = determineNewCaretPosition(caret(this), tabbed);
  1566. void 0 !== newCaretPosition && caret(this, newCaretPosition);
  1567. }
  1568. },
  1569. cutEvent: function cutEvent(e) {
  1570. var input = this, pos = caret(this), clipboardData = window.clipboardData || e.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end);
  1571. clipboardData.setData("text", isRTL ? clipData.reverse().join("") : clipData.join("")),
  1572. document.execCommand && document.execCommand("copy"), handleRemove(this, keyCode.DELETE, pos),
  1573. writeBuffer(this, getBuffer(), maskset.p, e, undoValue !== getBuffer().join(""));
  1574. },
  1575. blurEvent: function blurEvent(e) {
  1576. var $input = $(this), input = this;
  1577. if (this.inputmask) {
  1578. HandleNativePlaceholder(this, originalPlaceholder);
  1579. var nptValue = this.inputmask._valueGet(), buffer = getBuffer().slice();
  1580. "" !== nptValue && (opts.clearMaskOnLostFocus && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)),
  1581. !1 === isComplete(buffer) && (setTimeout(function() {
  1582. $input.trigger("incomplete");
  1583. }, 0), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())),
  1584. writeBuffer(this, buffer, void 0, e)), undoValue !== getBuffer().join("") && (undoValue = getBuffer().join(""),
  1585. $input.trigger("change"));
  1586. }
  1587. },
  1588. mouseenterEvent: function mouseenterEvent() {
  1589. var input = this;
  1590. mouseEnter = !0, (this.inputmask.shadowRoot || document).activeElement !== this && (null == originalPlaceholder && this.placeholder !== originalPlaceholder && (originalPlaceholder = this.placeholder),
  1591. opts.showMaskOnHover && HandleNativePlaceholder(this, (isRTL ? getBufferTemplate().slice().reverse() : getBufferTemplate()).join("")));
  1592. },
  1593. submitEvent: function submitEvent() {
  1594. undoValue !== getBuffer().join("") && $el.trigger("change"), opts.clearMaskOnLostFocus && -1 === getLastValidPosition() && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join("") && el.inputmask._valueSet(""),
  1595. opts.clearIncomplete && !1 === isComplete(getBuffer()) && el.inputmask._valueSet(""),
  1596. opts.removeMaskOnSubmit && (el.inputmask._valueSet(el.inputmask.unmaskedvalue(), !0),
  1597. setTimeout(function() {
  1598. writeBuffer(el, getBuffer());
  1599. }, 0));
  1600. },
  1601. resetEvent: function resetEvent() {
  1602. el.inputmask.refreshValue = !0, setTimeout(function() {
  1603. applyInputValue(el, el.inputmask._valueGet(!0));
  1604. }, 0);
  1605. }
  1606. }, valueBuffer;
  1607. function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {
  1608. var inputmask = this || input.inputmask, inputValue = nptvl.slice(), charCodes = "", initialNdx = -1, result = void 0;
  1609. function isTemplateMatch(ndx, charCodes) {
  1610. for (var targetTemplate = getMaskTemplate(!0, 0).slice(ndx, seekNext(ndx)).join("").replace(/'/g, ""), charCodeNdx = targetTemplate.indexOf(charCodes); 0 < charCodeNdx && " " === targetTemplate[charCodeNdx - 1]; ) charCodeNdx--;
  1611. var match = 0 === charCodeNdx && !isMask(ndx) && (getTest(ndx).match.nativeDef === charCodes.charAt(0) || !0 === getTest(ndx).match.static && getTest(ndx).match.nativeDef === "'" + charCodes.charAt(0) || " " === getTest(ndx).match.nativeDef && (getTest(ndx + 1).match.nativeDef === charCodes.charAt(0) || !0 === getTest(ndx + 1).match.static && getTest(ndx + 1).match.nativeDef === "'" + charCodes.charAt(0)));
  1612. if (!match && 0 < charCodeNdx && !isMask(ndx, !1, !0)) {
  1613. var nextPos = seekNext(ndx);
  1614. inputmask.caretPos.begin < nextPos && (inputmask.caretPos = {
  1615. begin: nextPos
  1616. });
  1617. }
  1618. return match;
  1619. }
  1620. resetMaskSet(), maskset.tests = {}, initialNdx = opts.radixPoint ? determineNewCaretPosition({
  1621. begin: 0,
  1622. end: 0
  1623. }).begin : 0, maskset.p = initialNdx, inputmask.caretPos = {
  1624. begin: initialNdx
  1625. };
  1626. var staticMatches = [], prevCaretPos = inputmask.caretPos;
  1627. if ($.each(inputValue, function(ndx, charCode) {
  1628. if (void 0 !== charCode) if (void 0 === maskset.validPositions[ndx] && inputValue[ndx] === getPlaceholder(ndx) && isMask(ndx, !0) && !1 === isValid(ndx, inputValue[ndx], !0, void 0, void 0, !0)) maskset.p++; else {
  1629. var keypress = new $.Event("_checkval");
  1630. keypress.which = charCode.toString().charCodeAt(0), charCodes += charCode;
  1631. var lvp = getLastValidPosition(void 0, !0);
  1632. isTemplateMatch(initialNdx, charCodes) ? result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, lvp + 1) : (result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, inputmask.caretPos.begin),
  1633. result && (initialNdx = inputmask.caretPos.begin + 1, charCodes = "")), result ? (void 0 !== result.pos && maskset.validPositions[result.pos] && !0 === maskset.validPositions[result.pos].match.static && void 0 === maskset.validPositions[result.pos].alternation && (staticMatches.push(result.pos),
  1634. isRTL || (result.forwardPosition = result.pos + 1)), writeBuffer(void 0, getBuffer(), result.forwardPosition, keypress, !1),
  1635. inputmask.caretPos = {
  1636. begin: result.forwardPosition,
  1637. end: result.forwardPosition
  1638. }, prevCaretPos = inputmask.caretPos) : inputmask.caretPos = prevCaretPos;
  1639. }
  1640. }), 0 < staticMatches.length) {
  1641. var sndx, validPos, nextValid = seekNext(-1, void 0, !1);
  1642. if (!isComplete(getBuffer()) && staticMatches.length <= nextValid || isComplete(getBuffer()) && 0 < staticMatches.length && staticMatches.length !== nextValid && 0 === staticMatches[0]) for (var nextSndx = nextValid; void 0 !== (sndx = staticMatches.shift()); ) {
  1643. var keypress = new $.Event("_checkval");
  1644. if (validPos = maskset.validPositions[sndx], validPos.generatedInput = !0, keypress.which = validPos.input.charCodeAt(0),
  1645. result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, nextSndx),
  1646. result && void 0 !== result.pos && result.pos !== sndx && maskset.validPositions[result.pos] && !0 === maskset.validPositions[result.pos].match.static) staticMatches.push(result.pos); else if (!result) break;
  1647. nextSndx++;
  1648. } else for (;sndx = staticMatches.pop(); ) validPos = maskset.validPositions[sndx],
  1649. validPos && (validPos.generatedInput = !0);
  1650. }
  1651. if (writeOut) for (var vndx in writeBuffer(input, getBuffer(), result ? result.forwardPosition : void 0, initiatingEvent || new $.Event("checkval"), initiatingEvent && "input" === initiatingEvent.type),
  1652. maskset.validPositions) !0 !== maskset.validPositions[vndx].match.generated && delete maskset.validPositions[vndx].generatedInput;
  1653. }
  1654. function unmaskedvalue(input) {
  1655. if (input) {
  1656. if (void 0 === input.inputmask) return input.value;
  1657. input.inputmask && input.inputmask.refreshValue && applyInputValue(input, input.inputmask._valueGet(!0));
  1658. }
  1659. var umValue = [], vps = maskset.validPositions;
  1660. for (var pndx in vps) vps[pndx] && vps[pndx].match && (1 != vps[pndx].match.static || !0 !== vps[pndx].generatedInput) && umValue.push(vps[pndx].input);
  1661. var unmaskedValue = 0 === umValue.length ? "" : (isRTL ? umValue.reverse() : umValue).join("");
  1662. if ($.isFunction(opts.onUnMask)) {
  1663. var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join("");
  1664. unmaskedValue = opts.onUnMask.call(inputmask, bufferValue, unmaskedValue, opts);
  1665. }
  1666. return unmaskedValue;
  1667. }
  1668. function translatePosition(pos) {
  1669. return !isRTL || "number" != typeof pos || opts.greedy && "" === opts.placeholder || !el || (pos = el.inputmask._valueGet().length - pos),
  1670. pos;
  1671. }
  1672. function caret(input, begin, end, notranslate, isDelete) {
  1673. var range;
  1674. if (void 0 === begin) return "selectionStart" in input && "selectionEnd" in input ? (begin = input.selectionStart,
  1675. end = input.selectionEnd) : window.getSelection ? (range = window.getSelection().getRangeAt(0),
  1676. range.commonAncestorContainer.parentNode !== input && range.commonAncestorContainer !== input || (begin = range.startOffset,
  1677. end = range.endOffset)) : document.selection && document.selection.createRange && (range = document.selection.createRange(),
  1678. begin = 0 - range.duplicate().moveStart("character", -input.inputmask._valueGet().length),
  1679. end = begin + range.text.length), {
  1680. begin: notranslate ? begin : translatePosition(begin),
  1681. end: notranslate ? end : translatePosition(end)
  1682. };
  1683. if ($.isArray(begin) && (end = isRTL ? begin[0] : begin[1], begin = isRTL ? begin[1] : begin[0]),
  1684. void 0 !== begin.begin && (end = isRTL ? begin.begin : begin.end, begin = isRTL ? begin.end : begin.begin),
  1685. "number" == typeof begin) {
  1686. begin = notranslate ? begin : translatePosition(begin), end = notranslate ? end : translatePosition(end),
  1687. end = "number" == typeof end ? end : begin;
  1688. var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;
  1689. if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, input.inputmask.caretPos = {
  1690. begin: begin,
  1691. end: end
  1692. }, opts.insertModeVisual && !1 === opts.insertMode && begin === end && (isDelete || end++),
  1693. input === (input.inputmask.shadowRoot || document).activeElement) if ("setSelectionRange" in input) input.setSelectionRange(begin, end); else if (window.getSelection) {
  1694. if (range = document.createRange(), void 0 === input.firstChild || null === input.firstChild) {
  1695. var textNode = document.createTextNode("");
  1696. input.appendChild(textNode);
  1697. }
  1698. range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length),
  1699. range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length),
  1700. range.collapse(!0);
  1701. var sel = window.getSelection();
  1702. sel.removeAllRanges(), sel.addRange(range);
  1703. } else input.createTextRange && (range = input.createTextRange(), range.collapse(!0),
  1704. range.moveEnd("character", end), range.moveStart("character", begin), range.select());
  1705. }
  1706. }
  1707. function determineLastRequiredPosition(returnDefinition) {
  1708. var buffer = getMaskTemplate(!0, getLastValidPosition(), !0, !0), bl = buffer.length, pos, lvp = getLastValidPosition(), positions = {}, lvTest = maskset.validPositions[lvp], ndxIntlzr = void 0 !== lvTest ? lvTest.locator.slice() : void 0, testPos;
  1709. for (pos = lvp + 1; pos < buffer.length; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
  1710. ndxIntlzr = testPos.locator.slice(), positions[pos] = $.extend(!0, {}, testPos);
  1711. var lvTestAlt = lvTest && void 0 !== lvTest.alternation ? lvTest.locator[lvTest.alternation] : void 0;
  1712. for (pos = bl - 1; lvp < pos && (testPos = positions[pos], (testPos.match.optionality || testPos.match.optionalQuantifier && testPos.match.newBlockMarker || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && 1 != testPos.match.static || !0 === testPos.match.static && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAlt.toString().split(",")) && "" !== getTests(pos)[0].def)) && buffer[pos] === getPlaceholder(pos, testPos.match)); pos--) bl--;
  1713. return returnDefinition ? {
  1714. l: bl,
  1715. def: positions[bl] ? positions[bl].match : void 0
  1716. } : bl;
  1717. }
  1718. function clearOptionalTail(buffer) {
  1719. buffer.length = 0;
  1720. for (var template = getMaskTemplate(!0, 0, !0, void 0, !0), lmnt; void 0 !== (lmnt = template.shift()); ) buffer.push(lmnt);
  1721. return buffer;
  1722. }
  1723. function isComplete(buffer) {
  1724. if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts);
  1725. if ("*" !== opts.repeat) {
  1726. var complete = !1, lrp = determineLastRequiredPosition(!0), aml = seekPrevious(lrp.l);
  1727. if (void 0 === lrp.def || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {
  1728. complete = !0;
  1729. for (var i = 0; i <= aml; i++) {
  1730. var test = getTestTemplate(i).match;
  1731. if (!0 !== test.static && void 0 === maskset.validPositions[i] && !0 !== test.optionality && !0 !== test.optionalQuantifier || !0 === test.static && buffer[i] !== getPlaceholder(i, test)) {
  1732. complete = !1;
  1733. break;
  1734. }
  1735. }
  1736. }
  1737. return complete;
  1738. }
  1739. }
  1740. function handleRemove(input, k, pos, strict, fromIsValid) {
  1741. if ((opts.numericInput || isRTL) && (k === keyCode.BACKSPACE ? k = keyCode.DELETE : k === keyCode.DELETE && (k = keyCode.BACKSPACE),
  1742. isRTL)) {
  1743. var pend = pos.end;
  1744. pos.end = pos.begin, pos.begin = pend;
  1745. }
  1746. var lvp = getLastValidPosition(void 0, !0), offset;
  1747. if (pos.end >= getBuffer().length && lvp >= pos.end && (pos.end = lvp + 1), k === keyCode.BACKSPACE ? pos.end - pos.begin < 1 && (pos.begin = seekPrevious(pos.begin)) : k === keyCode.DELETE && pos.begin === pos.end && (pos.end = isMask(pos.end, !0, !0) ? pos.end + 1 : seekNext(pos.end) + 1),
  1748. !1 !== (offset = revalidateMask(pos))) {
  1749. if (!0 !== strict && !1 !== opts.keepStatic || null !== opts.regex && -1 !== getTest(pos.begin).match.def.indexOf("|")) {
  1750. var result = alternate(!0);
  1751. if (result) {
  1752. var newPos = void 0 !== result.caret ? result.caret : result.pos ? seekNext(result.pos.begin ? result.pos.begin : result.pos) : getLastValidPosition(-1, !0);
  1753. (k !== keyCode.DELETE || pos.begin > newPos) && pos.begin;
  1754. }
  1755. }
  1756. !0 !== strict && (maskset.p = k === keyCode.DELETE ? pos.begin + offset : pos.begin);
  1757. }
  1758. }
  1759. function applyInputValue(input, value) {
  1760. input.inputmask.refreshValue = !1, $.isFunction(opts.onBeforeMask) && (value = opts.onBeforeMask.call(inputmask, value, opts) || value),
  1761. value = value.toString().split(""), checkVal(input, !0, !1, value), undoValue = getBuffer().join(""),
  1762. (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join("") && -1 === getLastValidPosition() && input.inputmask._valueSet("");
  1763. }
  1764. function mask(elem) {
  1765. function isElementTypeSupported(input, opts) {
  1766. function patchValueProperty(npt) {
  1767. var valueGet, valueSet;
  1768. function patchValhook(type) {
  1769. if ($.valHooks && (void 0 === $.valHooks[type] || !0 !== $.valHooks[type].inputmaskpatch)) {
  1770. var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {
  1771. return elem.value;
  1772. }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {
  1773. return elem.value = value, elem;
  1774. };
  1775. $.valHooks[type] = {
  1776. get: function get(elem) {
  1777. if (elem.inputmask) {
  1778. if (elem.inputmask.opts.autoUnmask) return elem.inputmask.unmaskedvalue();
  1779. var result = valhookGet(elem);
  1780. return -1 !== getLastValidPosition(void 0, void 0, elem.inputmask.maskset.validPositions) || !0 !== opts.nullable ? result : "";
  1781. }
  1782. return valhookGet(elem);
  1783. },
  1784. set: function set(elem, value) {
  1785. var result = valhookSet(elem, value);
  1786. return elem.inputmask && applyInputValue(elem, value), result;
  1787. },
  1788. inputmaskpatch: !0
  1789. };
  1790. }
  1791. }
  1792. function getter() {
  1793. return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== getLastValidPosition() || !0 !== opts.nullable ? (this.inputmask.shadowRoot || document.activeElement) === this && opts.clearMaskOnLostFocus ? (isRTL ? clearOptionalTail(getBuffer().slice()).reverse() : clearOptionalTail(getBuffer().slice())).join("") : valueGet.call(this) : "" : valueGet.call(this);
  1794. }
  1795. function setter(value) {
  1796. valueSet.call(this, value), this.inputmask && applyInputValue(this, value);
  1797. }
  1798. function installNativeValueSetFallback(npt) {
  1799. EventRuler.on(npt, "mouseenter", function() {
  1800. var input = this, value = this.inputmask._valueGet(!0);
  1801. value !== (isRTL ? getBuffer().reverse() : getBuffer()).join("") && applyInputValue(this, value);
  1802. });
  1803. }
  1804. if (!npt.inputmask.__valueGet) {
  1805. if (!0 !== opts.noValuePatching) {
  1806. if (Object.getOwnPropertyDescriptor) {
  1807. "function" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = "object" === _typeof("test".__proto__) ? function(object) {
  1808. return object.__proto__;
  1809. } : function(object) {
  1810. return object.constructor.prototype;
  1811. });
  1812. var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), "value") : void 0;
  1813. valueProperty && valueProperty.get && valueProperty.set ? (valueGet = valueProperty.get,
  1814. valueSet = valueProperty.set, Object.defineProperty(npt, "value", {
  1815. get: getter,
  1816. set: setter,
  1817. configurable: !0
  1818. })) : "input" !== npt.tagName.toLowerCase() && (valueGet = function valueGet() {
  1819. return this.textContent;
  1820. }, valueSet = function valueSet(value) {
  1821. this.textContent = value;
  1822. }, Object.defineProperty(npt, "value", {
  1823. get: getter,
  1824. set: setter,
  1825. configurable: !0
  1826. }));
  1827. } else document.__lookupGetter__ && npt.__lookupGetter__("value") && (valueGet = npt.__lookupGetter__("value"),
  1828. valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter),
  1829. npt.__defineSetter__("value", setter));
  1830. npt.inputmask.__valueGet = valueGet, npt.inputmask.__valueSet = valueSet;
  1831. }
  1832. npt.inputmask._valueGet = function(overruleRTL) {
  1833. return isRTL && !0 !== overruleRTL ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el);
  1834. }, npt.inputmask._valueSet = function(value, overruleRTL) {
  1835. valueSet.call(this.el, null == value ? "" : !0 !== overruleRTL && isRTL ? value.split("").reverse().join("") : value);
  1836. }, void 0 === valueGet && (valueGet = function valueGet() {
  1837. return this.value;
  1838. }, valueSet = function valueSet(value) {
  1839. this.value = value;
  1840. }, patchValhook(npt.type), installNativeValueSetFallback(npt));
  1841. }
  1842. }
  1843. "textarea" !== input.tagName.toLowerCase() && opts.ignorables.push(keyCode.ENTER);
  1844. var elementType = input.getAttribute("type"), isSupported = "input" === input.tagName.toLowerCase() && -1 !== $.inArray(elementType, opts.supportsInputType) || input.isContentEditable || "textarea" === input.tagName.toLowerCase();
  1845. if (!isSupported) if ("input" === input.tagName.toLowerCase()) {
  1846. var el = document.createElement("input");
  1847. el.setAttribute("type", elementType), isSupported = "text" === el.type, el = null;
  1848. } else isSupported = "partial";
  1849. return !1 !== isSupported ? patchValueProperty(input) : input.inputmask = void 0,
  1850. isSupported;
  1851. }
  1852. EventRuler.off(elem);
  1853. var isSupported = isElementTypeSupported(elem, opts);
  1854. if (!1 !== isSupported) {
  1855. el = elem, $el = $(el), originalPlaceholder = el.placeholder, maxLength = void 0 !== el ? el.maxLength : void 0,
  1856. -1 === maxLength && (maxLength = void 0), "inputMode" in el && null === el.getAttribute("inputmode") && (el.inputMode = opts.inputmode,
  1857. el.setAttribute("inputmode", opts.inputmode)), !0 === isSupported && (opts.showMaskOnFocus = opts.showMaskOnFocus && -1 === [ "cc-number", "cc-exp" ].indexOf(el.autocomplete),
  1858. iphone && (opts.insertModeVisual = !1), EventRuler.on(el, "submit", EventHandlers.submitEvent),
  1859. EventRuler.on(el, "reset", EventHandlers.resetEvent), EventRuler.on(el, "blur", EventHandlers.blurEvent),
  1860. EventRuler.on(el, "focus", EventHandlers.focusEvent), EventRuler.on(el, "invalid", EventHandlers.invalidEvent),
  1861. EventRuler.on(el, "click", EventHandlers.clickEvent), EventRuler.on(el, "mouseleave", EventHandlers.mouseleaveEvent),
  1862. EventRuler.on(el, "mouseenter", EventHandlers.mouseenterEvent), EventRuler.on(el, "paste", EventHandlers.pasteEvent),
  1863. EventRuler.on(el, "cut", EventHandlers.cutEvent), EventRuler.on(el, "complete", opts.oncomplete),
  1864. EventRuler.on(el, "incomplete", opts.onincomplete), EventRuler.on(el, "cleared", opts.oncleared),
  1865. mobile || !0 === opts.inputEventOnly ? el.removeAttribute("maxLength") : (EventRuler.on(el, "keydown", EventHandlers.keydownEvent),
  1866. EventRuler.on(el, "keypress", EventHandlers.keypressEvent)), EventRuler.on(el, "input", EventHandlers.inputFallBackEvent),
  1867. EventRuler.on(el, "compositionend", EventHandlers.compositionendEvent)), EventRuler.on(el, "setvalue", EventHandlers.setValueEvent),
  1868. undoValue = getBufferTemplate().join("");
  1869. var activeElement = (el.inputmask.shadowRoot || document).activeElement;
  1870. if ("" !== el.inputmask._valueGet(!0) || !1 === opts.clearMaskOnLostFocus || activeElement === el) {
  1871. applyInputValue(el, el.inputmask._valueGet(!0), opts);
  1872. var buffer = getBuffer().slice();
  1873. !1 === isComplete(buffer) && opts.clearIncomplete && resetMaskSet(), opts.clearMaskOnLostFocus && activeElement !== el && (-1 === getLastValidPosition() ? buffer = [] : clearOptionalTail(buffer)),
  1874. (!1 === opts.clearMaskOnLostFocus || opts.showMaskOnFocus && activeElement === el || "" !== el.inputmask._valueGet(!0)) && writeBuffer(el, buffer),
  1875. activeElement === el && caret(el, seekNext(getLastValidPosition()));
  1876. }
  1877. }
  1878. }
  1879. if (void 0 !== actionObj) switch (actionObj.action) {
  1880. case "isComplete":
  1881. return el = actionObj.el, isComplete(getBuffer());
  1882. case "unmaskedvalue":
  1883. return void 0 !== el && void 0 === actionObj.value || (valueBuffer = actionObj.value,
  1884. valueBuffer = ($.isFunction(opts.onBeforeMask) && opts.onBeforeMask.call(inputmask, valueBuffer, opts) || valueBuffer).split(""),
  1885. checkVal.call(this, void 0, !1, !1, valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite.call(inputmask, void 0, getBuffer(), 0, opts)),
  1886. unmaskedvalue(el);
  1887. case "mask":
  1888. mask(el);
  1889. break;
  1890. case "format":
  1891. return valueBuffer = ($.isFunction(opts.onBeforeMask) && opts.onBeforeMask.call(inputmask, actionObj.value, opts) || actionObj.value).split(""),
  1892. checkVal.call(this, void 0, !0, !1, valueBuffer), actionObj.metadata ? {
  1893. value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""),
  1894. metadata: maskScope.call(this, {
  1895. action: "getmetadata"
  1896. }, maskset, opts)
  1897. } : isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join("");
  1898. case "isValid":
  1899. actionObj.value ? (valueBuffer = ($.isFunction(opts.onBeforeMask) && opts.onBeforeMask.call(inputmask, actionObj.value, opts) || actionObj.value).split(""),
  1900. checkVal.call(this, void 0, !0, !1, valueBuffer)) : actionObj.value = isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join("");
  1901. for (var buffer = getBuffer(), rl = determineLastRequiredPosition(), lmib = buffer.length - 1; rl < lmib && !isMask(lmib); lmib--) ;
  1902. return buffer.splice(rl, lmib + 1 - rl), isComplete(buffer) && actionObj.value === (isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""));
  1903. case "getemptymask":
  1904. return getBufferTemplate().join("");
  1905. case "remove":
  1906. if (el && el.inputmask) {
  1907. $.data(el, "_inputmask_opts", null), $el = $(el);
  1908. var cv = opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(opts.autoUnmask), valueProperty;
  1909. cv !== getBufferTemplate().join("") ? el.inputmask._valueSet(cv, opts.autoUnmask) : el.inputmask._valueSet(""),
  1910. EventRuler.off(el), Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? (valueProperty = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), "value"),
  1911. valueProperty && el.inputmask.__valueGet && Object.defineProperty(el, "value", {
  1912. get: el.inputmask.__valueGet,
  1913. set: el.inputmask.__valueSet,
  1914. configurable: !0
  1915. })) : document.__lookupGetter__ && el.__lookupGetter__("value") && el.inputmask.__valueGet && (el.__defineGetter__("value", el.inputmask.__valueGet),
  1916. el.__defineSetter__("value", el.inputmask.__valueSet)), el.inputmask = void 0;
  1917. }
  1918. return el;
  1919. case "getmetadata":
  1920. if ($.isArray(maskset.metadata)) {
  1921. var maskTarget = getMaskTemplate(!0, 0, !1).join("");
  1922. return $.each(maskset.metadata, function(ndx, mtdt) {
  1923. if (mtdt.mask === maskTarget) return maskTarget = mtdt, !1;
  1924. }), maskTarget;
  1925. }
  1926. return maskset.metadata;
  1927. }
  1928. };
  1929. }, function(module, exports, __webpack_require__) {
  1930. "use strict";
  1931. function _typeof(obj) {
  1932. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) {
  1933. return typeof obj;
  1934. } : function _typeof(obj) {
  1935. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  1936. }, _typeof(obj);
  1937. }
  1938. var Inputmask = __webpack_require__(1), $ = Inputmask.dependencyLib, keyCode = __webpack_require__(0), formatCode = {
  1939. d: [ "[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", Date.prototype.getDate ],
  1940. dd: [ "0[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", function() {
  1941. return pad(Date.prototype.getDate.call(this), 2);
  1942. } ],
  1943. ddd: [ "" ],
  1944. dddd: [ "" ],
  1945. m: [ "[1-9]|1[012]", Date.prototype.setMonth, "month", function() {
  1946. return Date.prototype.getMonth.call(this) + 1;
  1947. } ],
  1948. mm: [ "0[1-9]|1[012]", Date.prototype.setMonth, "month", function() {
  1949. return pad(Date.prototype.getMonth.call(this) + 1, 2);
  1950. } ],
  1951. mmm: [ "" ],
  1952. mmmm: [ "" ],
  1953. yy: [ "[0-9]{2}", Date.prototype.setFullYear, "year", function() {
  1954. return pad(Date.prototype.getFullYear.call(this), 2);
  1955. } ],
  1956. yyyy: [ "[0-9]{4}", Date.prototype.setFullYear, "year", function() {
  1957. return pad(Date.prototype.getFullYear.call(this), 4);
  1958. } ],
  1959. h: [ "[1-9]|1[0-2]", Date.prototype.setHours, "hours", Date.prototype.getHours ],
  1960. hh: [ "0[1-9]|1[0-2]", Date.prototype.setHours, "hours", function() {
  1961. return pad(Date.prototype.getHours.call(this), 2);
  1962. } ],
  1963. hx: [ function(x) {
  1964. return "[0-9]{".concat(x, "}");
  1965. }, Date.prototype.setHours, "hours", function(x) {
  1966. return Date.prototype.getHours;
  1967. } ],
  1968. H: [ "1?[0-9]|2[0-3]", Date.prototype.setHours, "hours", Date.prototype.getHours ],
  1969. HH: [ "0[0-9]|1[0-9]|2[0-3]", Date.prototype.setHours, "hours", function() {
  1970. return pad(Date.prototype.getHours.call(this), 2);
  1971. } ],
  1972. Hx: [ function(x) {
  1973. return "[0-9]{".concat(x, "}");
  1974. }, Date.prototype.setHours, "hours", function(x) {
  1975. return function() {
  1976. return pad(Date.prototype.getHours.call(this), x);
  1977. };
  1978. } ],
  1979. M: [ "[1-5]?[0-9]", Date.prototype.setMinutes, "minutes", Date.prototype.getMinutes ],
  1980. MM: [ "0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]", Date.prototype.setMinutes, "minutes", function() {
  1981. return pad(Date.prototype.getMinutes.call(this), 2);
  1982. } ],
  1983. s: [ "[1-5]?[0-9]", Date.prototype.setSeconds, "seconds", Date.prototype.getSeconds ],
  1984. ss: [ "0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]", Date.prototype.setSeconds, "seconds", function() {
  1985. return pad(Date.prototype.getSeconds.call(this), 2);
  1986. } ],
  1987. l: [ "[0-9]{3}", Date.prototype.setMilliseconds, "milliseconds", function() {
  1988. return pad(Date.prototype.getMilliseconds.call(this), 3);
  1989. } ],
  1990. L: [ "[0-9]{2}", Date.prototype.setMilliseconds, "milliseconds", function() {
  1991. return pad(Date.prototype.getMilliseconds.call(this), 2);
  1992. } ],
  1993. t: [ "[ap]" ],
  1994. tt: [ "[ap]m" ],
  1995. T: [ "[AP]" ],
  1996. TT: [ "[AP]M" ],
  1997. Z: [ "" ],
  1998. o: [ "" ],
  1999. S: [ "" ]
  2000. }, formatAlias = {
  2001. isoDate: "yyyy-mm-dd",
  2002. isoTime: "HH:MM:ss",
  2003. isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
  2004. isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
  2005. };
  2006. function formatcode(match) {
  2007. var dynMatches = new RegExp("\\d+$").exec(match[0]);
  2008. if (dynMatches && void 0 !== dynMatches[0]) {
  2009. var fcode = formatCode[match[0][0] + "x"].slice("");
  2010. return fcode[0] = fcode[0](dynMatches[0]), fcode[3] = fcode[3](dynMatches[0]), fcode;
  2011. }
  2012. if (formatCode[match[0]]) return formatCode[match[0]];
  2013. }
  2014. function getTokenizer(opts) {
  2015. if (!opts.tokenizer) {
  2016. var tokens = [], dyntokens = [];
  2017. for (var ndx in formatCode) if (/\.*x$/.test(ndx)) {
  2018. var dynToken = ndx[0] + "\\d+";
  2019. -1 === dyntokens.indexOf(dynToken) && dyntokens.push(dynToken);
  2020. } else -1 === tokens.indexOf(ndx[0]) && tokens.push(ndx[0]);
  2021. opts.tokenizer = "(" + (0 < dyntokens.length ? dyntokens.join("|") + "|" : "") + tokens.join("+|") + ")+?|.",
  2022. opts.tokenizer = new RegExp(opts.tokenizer, "g");
  2023. }
  2024. return opts.tokenizer;
  2025. }
  2026. function isValidDate(dateParts, currentResult) {
  2027. return (!isFinite(dateParts.rawday) || "29" == dateParts.day && !isFinite(dateParts.rawyear) || new Date(dateParts.date.getFullYear(), isFinite(dateParts.rawmonth) ? dateParts.month : dateParts.date.getMonth() + 1, 0).getDate() >= dateParts.day) && currentResult;
  2028. }
  2029. function isDateInRange(dateParts, opts) {
  2030. var result = !0;
  2031. if (opts.min) {
  2032. if (dateParts.rawyear) {
  2033. var rawYear = dateParts.rawyear.replace(/[^0-9]/g, ""), minYear = opts.min.year.substr(0, rawYear.length);
  2034. result = minYear <= rawYear;
  2035. }
  2036. dateParts.year === dateParts.rawyear && opts.min.date.getTime() == opts.min.date.getTime() && (result = opts.min.date.getTime() <= dateParts.date.getTime());
  2037. }
  2038. return result && opts.max && opts.max.date.getTime() == opts.max.date.getTime() && (result = opts.max.date.getTime() >= dateParts.date.getTime()),
  2039. result;
  2040. }
  2041. function parse(format, dateObjValue, opts, raw) {
  2042. var mask = "", match, fcode;
  2043. for (getTokenizer(opts).lastIndex = 0; match = getTokenizer(opts).exec(format); ) if (void 0 === dateObjValue) if (fcode = formatcode(match)) mask += "(" + fcode[0] + ")"; else switch (match[0]) {
  2044. case "[":
  2045. mask += "(";
  2046. break;
  2047. case "]":
  2048. mask += ")?";
  2049. break;
  2050. default:
  2051. mask += Inputmask.escapeRegex(match[0]);
  2052. } else if (fcode = formatcode(match)) if (!0 !== raw && fcode[3]) {
  2053. var getFn = fcode[3];
  2054. mask += getFn.call(dateObjValue.date);
  2055. } else fcode[2] ? mask += dateObjValue["raw" + fcode[2]] : mask += match[0]; else mask += match[0];
  2056. return mask;
  2057. }
  2058. function pad(val, len) {
  2059. for (val = String(val), len = len || 2; val.length < len; ) val = "0" + val;
  2060. return val;
  2061. }
  2062. function analyseMask(maskString, format, opts) {
  2063. var dateObj = {
  2064. date: new Date(1, 0, 1)
  2065. }, targetProp, mask = maskString, match, dateOperation;
  2066. function extendProperty(value) {
  2067. var correctedValue = value.replace(/[^0-9]/g, "0");
  2068. return correctedValue;
  2069. }
  2070. function setValue(dateObj, value, opts) {
  2071. dateObj[targetProp] = extendProperty(value), dateObj["raw" + targetProp] = value,
  2072. void 0 !== dateOperation && dateOperation.call(dateObj.date, "month" == targetProp ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]);
  2073. }
  2074. if ("string" == typeof mask) {
  2075. for (getTokenizer(opts).lastIndex = 0; match = getTokenizer(opts).exec(format); ) {
  2076. var value = mask.slice(0, match[0].length);
  2077. formatCode.hasOwnProperty(match[0]) && (targetProp = formatCode[match[0]][2], dateOperation = formatCode[match[0]][1],
  2078. setValue(dateObj, value, opts)), mask = mask.slice(value.length);
  2079. }
  2080. return dateObj;
  2081. }
  2082. if (mask && "object" === _typeof(mask) && mask.hasOwnProperty("date")) return mask;
  2083. }
  2084. function importDate(dateObj, opts) {
  2085. var match, date = "";
  2086. for (getTokenizer(opts).lastIndex = 0; match = getTokenizer(opts).exec(opts.inputFormat); ) "d" === match[0].charAt(0) ? date += pad(dateObj.getDate(), match[0].length) : "m" === match[0].charAt(0) ? date += pad(dateObj.getMonth() + 1, match[0].length) : "yyyy" === match[0] ? date += dateObj.getFullYear().toString() : "y" === match[0].charAt(0) && (date += pad(dateObj.getYear(), match[0].length));
  2087. return date;
  2088. }
  2089. function getTokenMatch(pos, opts) {
  2090. var calcPos = 0, targetMatch, match, matchLength = 0;
  2091. for (getTokenizer(opts).lastIndex = 0; match = getTokenizer(opts).exec(opts.inputFormat); ) {
  2092. var dynMatches = new RegExp("\\d+$").exec(match[0]);
  2093. if (matchLength = dynMatches ? parseInt(dynMatches[0]) : match[0].length, calcPos += matchLength,
  2094. pos <= calcPos) {
  2095. targetMatch = match, match = getTokenizer(opts).exec(opts.inputFormat);
  2096. break;
  2097. }
  2098. }
  2099. return {
  2100. targetMatchIndex: calcPos - matchLength,
  2101. nextMatch: match,
  2102. targetMatch: targetMatch
  2103. };
  2104. }
  2105. Inputmask.extendAliases({
  2106. datetime: {
  2107. mask: function mask(opts) {
  2108. return opts.numericInput = !1, formatCode.S = opts.i18n.ordinalSuffix.join("|"),
  2109. opts.inputFormat = formatAlias[opts.inputFormat] || opts.inputFormat, opts.displayFormat = formatAlias[opts.displayFormat] || opts.displayFormat || opts.inputFormat,
  2110. opts.outputFormat = formatAlias[opts.outputFormat] || opts.outputFormat || opts.inputFormat,
  2111. opts.placeholder = "" !== opts.placeholder ? opts.placeholder : opts.inputFormat.replace(/[[\]]/, ""),
  2112. opts.regex = parse(opts.inputFormat, void 0, opts), opts.min = analyseMask(opts.min, opts.inputFormat, opts),
  2113. opts.max = analyseMask(opts.max, opts.inputFormat, opts), null;
  2114. },
  2115. placeholder: "",
  2116. inputFormat: "isoDateTime",
  2117. displayFormat: void 0,
  2118. outputFormat: void 0,
  2119. min: null,
  2120. max: null,
  2121. skipOptionalPartCharacter: "",
  2122. i18n: {
  2123. dayNames: [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ],
  2124. monthNames: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ],
  2125. ordinalSuffix: [ "st", "nd", "rd", "th" ]
  2126. },
  2127. preValidation: function preValidation(buffer, pos, c, isSelection, opts, maskset, caretPos, strict) {
  2128. if (strict) return !0;
  2129. if (isNaN(c) && buffer[pos] !== c) {
  2130. var tokenMatch = getTokenMatch(pos, opts);
  2131. if (tokenMatch.nextMatch && tokenMatch.nextMatch[0] === c && 1 < tokenMatch.targetMatch[0].length) {
  2132. var validator = formatCode[tokenMatch.targetMatch[0]][0];
  2133. if (new RegExp(validator).test("0" + buffer[pos - 1])) return buffer[pos] = buffer[pos - 1],
  2134. buffer[pos - 1] = "0", {
  2135. fuzzy: !0,
  2136. buffer: buffer,
  2137. refreshFromBuffer: {
  2138. start: pos - 1,
  2139. end: pos + 1
  2140. },
  2141. pos: pos + 1
  2142. };
  2143. }
  2144. }
  2145. return !0;
  2146. },
  2147. postValidation: function postValidation(buffer, pos, c, currentResult, opts, maskset, strict) {
  2148. if (strict) return !0;
  2149. var tokenMatch, validator;
  2150. if (!1 === currentResult) return tokenMatch = getTokenMatch(pos + 1, opts), tokenMatch.targetMatch && tokenMatch.targetMatchIndex === pos && 1 < tokenMatch.targetMatch[0].length && void 0 !== formatCode[tokenMatch.targetMatch[0]] && (validator = formatCode[tokenMatch.targetMatch[0]][0],
  2151. new RegExp(validator).test("0" + c)) ? {
  2152. insert: [ {
  2153. pos: pos,
  2154. c: "0"
  2155. }, {
  2156. pos: pos + 1,
  2157. c: c
  2158. } ],
  2159. pos: pos + 1
  2160. } : currentResult;
  2161. if (currentResult.fuzzy && (buffer = currentResult.buffer, pos = currentResult.pos),
  2162. tokenMatch = getTokenMatch(pos, opts), tokenMatch.targetMatch && tokenMatch.targetMatch[0] && void 0 !== formatCode[tokenMatch.targetMatch[0]]) {
  2163. validator = formatCode[tokenMatch.targetMatch[0]][0];
  2164. var part = buffer.slice(tokenMatch.targetMatchIndex, tokenMatch.targetMatchIndex + tokenMatch.targetMatch[0].length);
  2165. !1 === new RegExp(validator).test(part.join("")) && 2 === tokenMatch.targetMatch[0].length && maskset.validPositions[tokenMatch.targetMatchIndex] && maskset.validPositions[tokenMatch.targetMatchIndex + 1] && (maskset.validPositions[tokenMatch.targetMatchIndex + 1].input = "0");
  2166. }
  2167. var result = currentResult, dateParts = analyseMask(buffer.join(""), opts.inputFormat, opts);
  2168. return result && dateParts.date.getTime() == dateParts.date.getTime() && (result = isValidDate(dateParts, result),
  2169. result = result && isDateInRange(dateParts, opts)), pos && result && currentResult.pos !== pos ? {
  2170. buffer: parse(opts.inputFormat, dateParts, opts).split(""),
  2171. refreshFromBuffer: {
  2172. start: pos,
  2173. end: currentResult.pos
  2174. }
  2175. } : result;
  2176. },
  2177. onKeyDown: function onKeyDown(e, buffer, caretPos, opts) {
  2178. var input = this;
  2179. e.ctrlKey && e.keyCode === keyCode.RIGHT && (this.inputmask._valueSet(importDate(new Date(), opts)),
  2180. $(this).trigger("setvalue"));
  2181. },
  2182. onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) {
  2183. return unmaskedValue ? parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, !0) : unmaskedValue;
  2184. },
  2185. casing: function casing(elem, test, pos, validPositions) {
  2186. return 0 == test.nativeDef.indexOf("[ap]") ? elem.toLowerCase() : 0 == test.nativeDef.indexOf("[AP]") ? elem.toUpperCase() : elem;
  2187. },
  2188. onBeforeMask: function onBeforeMask(initialValue, opts) {
  2189. return "[object Date]" === Object.prototype.toString.call(initialValue) && (initialValue = importDate(initialValue, opts)),
  2190. initialValue;
  2191. },
  2192. insertMode: !1,
  2193. shiftPositions: !1,
  2194. keepStatic: !1,
  2195. inputmode: "numeric"
  2196. }
  2197. }), module.exports = Inputmask;
  2198. }, function(module, exports, __webpack_require__) {
  2199. "use strict";
  2200. var Inputmask = __webpack_require__(1), $ = Inputmask.dependencyLib, keyCode = __webpack_require__(0);
  2201. function autoEscape(txt, opts) {
  2202. for (var escapedTxt = "", i = 0; i < txt.length; i++) Inputmask.prototype.definitions[txt.charAt(i)] || opts.definitions[txt.charAt(i)] || opts.optionalmarker[0] === txt.charAt(i) || opts.optionalmarker[1] === txt.charAt(i) || opts.quantifiermarker[0] === txt.charAt(i) || opts.quantifiermarker[1] === txt.charAt(i) || opts.groupmarker[0] === txt.charAt(i) || opts.groupmarker[1] === txt.charAt(i) || opts.alternatormarker === txt.charAt(i) ? escapedTxt += "\\" + txt.charAt(i) : escapedTxt += txt.charAt(i);
  2203. return escapedTxt;
  2204. }
  2205. function alignDigits(buffer, digits, opts, force) {
  2206. if (0 < buffer.length && 0 < digits && (!opts.digitsOptional || force)) {
  2207. var radixPosition = $.inArray(opts.radixPoint, buffer);
  2208. -1 === radixPosition && (buffer.push(opts.radixPoint), radixPosition = buffer.length - 1);
  2209. for (var i = 1; i <= digits; i++) isFinite(buffer[radixPosition + i]) || (buffer[radixPosition + i] = "0");
  2210. }
  2211. return buffer;
  2212. }
  2213. function findValidator(symbol, maskset) {
  2214. var posNdx = 0;
  2215. if ("+" === symbol) {
  2216. for (posNdx in maskset.validPositions) ;
  2217. posNdx = parseInt(posNdx);
  2218. }
  2219. for (var tstNdx in maskset.tests) if (tstNdx = parseInt(tstNdx), posNdx <= tstNdx) for (var ndx = 0, ndxl = maskset.tests[tstNdx].length; ndx < ndxl; ndx++) if ((void 0 === maskset.validPositions[tstNdx] || "-" === symbol) && maskset.tests[tstNdx][ndx].match.def === symbol) return tstNdx + (void 0 !== maskset.validPositions[tstNdx] && "-" !== symbol ? 1 : 0);
  2220. return posNdx;
  2221. }
  2222. function findValid(symbol, maskset) {
  2223. var ret = -1;
  2224. return $.each(maskset.validPositions, function(ndx, tst) {
  2225. if (tst && tst.match.def === symbol) return ret = parseInt(ndx), !1;
  2226. }), ret;
  2227. }
  2228. function parseMinMaxOptions(opts) {
  2229. void 0 === opts.parseMinMaxOptions && (null !== opts.min && (opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2230. "," === opts.radixPoint && (opts.min = opts.min.replace(opts.radixPoint, ".")),
  2231. opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN, isNaN(opts.min) && (opts.min = Number.MIN_VALUE)),
  2232. null !== opts.max && (opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2233. "," === opts.radixPoint && (opts.max = opts.max.replace(opts.radixPoint, ".")),
  2234. opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN, isNaN(opts.max) && (opts.max = Number.MAX_VALUE)),
  2235. opts.parseMinMaxOptions = "done");
  2236. }
  2237. function genMask(opts) {
  2238. opts.repeat = 0, opts.groupSeparator === opts.radixPoint && opts.digits && "0" !== opts.digits && ("." === opts.radixPoint ? opts.groupSeparator = "," : "," === opts.radixPoint ? opts.groupSeparator = "." : opts.groupSeparator = ""),
  2239. " " === opts.groupSeparator && (opts.skipOptionalPartCharacter = void 0), 1 < opts.placeholder.length && (opts.placeholder = opts.placeholder.charAt(0)),
  2240. "radixFocus" === opts.positionCaretOnClick && "" === opts.placeholder && (opts.positionCaretOnClick = "lvp");
  2241. var decimalDef = "0", radixPointDef = opts.radixPoint;
  2242. !0 === opts.numericInput && void 0 === opts.__financeInput ? (decimalDef = "1",
  2243. opts.positionCaretOnClick = "radixFocus" === opts.positionCaretOnClick ? "lvp" : opts.positionCaretOnClick,
  2244. opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), opts._radixDance = !1,
  2245. radixPointDef = "," === opts.radixPoint ? "?" : "!", "" !== opts.radixPoint && void 0 === opts.definitions[radixPointDef] && (opts.definitions[radixPointDef] = {},
  2246. opts.definitions[radixPointDef].validator = "[" + opts.radixPoint + "]", opts.definitions[radixPointDef].placeholder = opts.radixPoint,
  2247. opts.definitions[radixPointDef].static = !0, opts.definitions[radixPointDef].generated = !0)) : (opts.__financeInput = !1,
  2248. opts.numericInput = !0);
  2249. var mask = "[+]", altMask;
  2250. if (mask += autoEscape(opts.prefix, opts), "" !== opts.groupSeparator ? (void 0 === opts.definitions[opts.groupSeparator] && (opts.definitions[opts.groupSeparator] = {},
  2251. opts.definitions[opts.groupSeparator].validator = "[" + opts.groupSeparator + "]",
  2252. opts.definitions[opts.groupSeparator].placeholder = opts.groupSeparator, opts.definitions[opts.groupSeparator].static = !0,
  2253. opts.definitions[opts.groupSeparator].generated = !0), mask += opts._mask(opts)) : mask += "9{+}",
  2254. void 0 !== opts.digits && 0 !== opts.digits) {
  2255. var dq = opts.digits.toString().split(",");
  2256. isFinite(dq[0]) && dq[1] && isFinite(dq[1]) ? mask += radixPointDef + decimalDef + "{" + opts.digits + "}" : (isNaN(opts.digits) || 0 < parseInt(opts.digits)) && (opts.digitsOptional ? (altMask = mask + radixPointDef + decimalDef + "{0," + opts.digits + "}",
  2257. opts.keepStatic = !0) : mask += radixPointDef + decimalDef + "{" + opts.digits + "}");
  2258. }
  2259. return mask += autoEscape(opts.suffix, opts), mask += "[-]", altMask && (mask = [ altMask + autoEscape(opts.suffix, opts) + "[-]", mask ]),
  2260. opts.greedy = !1, parseMinMaxOptions(opts), mask;
  2261. }
  2262. function hanndleRadixDance(pos, c, radixPos, maskset, opts) {
  2263. return opts._radixDance && opts.numericInput && c !== opts.negationSymbol.back && pos <= radixPos && (0 < radixPos || c == opts.radixPoint) && (void 0 === maskset.validPositions[pos - 1] || maskset.validPositions[pos - 1].input !== opts.negationSymbol.back) && (pos -= 1),
  2264. pos;
  2265. }
  2266. function decimalValidator(chrs, maskset, pos, strict, opts) {
  2267. var radixPos = maskset.buffer ? maskset.buffer.indexOf(opts.radixPoint) : -1, result = -1 !== radixPos && new RegExp("[0-9\uff11-\uff19]").test(chrs);
  2268. return opts._radixDance && result && null == maskset.validPositions[radixPos] ? {
  2269. insert: {
  2270. pos: radixPos === pos ? radixPos + 1 : radixPos,
  2271. c: opts.radixPoint
  2272. },
  2273. pos: pos
  2274. } : result;
  2275. }
  2276. function checkForLeadingZeroes(buffer, opts) {
  2277. var numberMatches = new RegExp("(^" + ("" !== opts.negationSymbol.front ? Inputmask.escapeRegex(opts.negationSymbol.front) + "?" : "") + Inputmask.escapeRegex(opts.prefix) + ")(.*)(" + Inputmask.escapeRegex(opts.suffix) + ("" != opts.negationSymbol.back ? Inputmask.escapeRegex(opts.negationSymbol.back) + "?" : "") + "$)").exec(buffer.slice().reverse().join("")), number = numberMatches ? numberMatches[2] : "", leadingzeroes = !1;
  2278. return number && (number = number.split(opts.radixPoint.charAt(0))[0], leadingzeroes = new RegExp("^[0" + opts.groupSeparator + "]*").exec(number)),
  2279. !(!leadingzeroes || !(1 < leadingzeroes[0].length || 0 < leadingzeroes[0].length && leadingzeroes[0].length < number.length)) && leadingzeroes;
  2280. }
  2281. Inputmask.extendAliases({
  2282. numeric: {
  2283. mask: genMask,
  2284. _mask: function _mask(opts) {
  2285. return "(" + opts.groupSeparator + "999){+|1}";
  2286. },
  2287. digits: "*",
  2288. digitsOptional: !0,
  2289. enforceDigitsOnBlur: !1,
  2290. radixPoint: ".",
  2291. positionCaretOnClick: "radixFocus",
  2292. _radixDance: !0,
  2293. groupSeparator: "",
  2294. allowMinus: !0,
  2295. negationSymbol: {
  2296. front: "-",
  2297. back: ""
  2298. },
  2299. prefix: "",
  2300. suffix: "",
  2301. min: null,
  2302. max: null,
  2303. step: 1,
  2304. unmaskAsNumber: !1,
  2305. roundingFN: Math.round,
  2306. inputmode: "numeric",
  2307. shortcuts: {
  2308. k: "000",
  2309. m: "000000"
  2310. },
  2311. placeholder: "0",
  2312. greedy: !1,
  2313. rightAlign: !0,
  2314. insertMode: !0,
  2315. autoUnmask: !1,
  2316. skipOptionalPartCharacter: "",
  2317. definitions: {
  2318. 0: {
  2319. validator: decimalValidator
  2320. },
  2321. 1: {
  2322. validator: decimalValidator,
  2323. definitionSymbol: "9"
  2324. },
  2325. "+": {
  2326. validator: function validator(chrs, maskset, pos, strict, opts) {
  2327. return opts.allowMinus && ("-" === chrs || chrs === opts.negationSymbol.front);
  2328. }
  2329. },
  2330. "-": {
  2331. validator: function validator(chrs, maskset, pos, strict, opts) {
  2332. return opts.allowMinus && chrs === opts.negationSymbol.back;
  2333. }
  2334. }
  2335. },
  2336. preValidation: function preValidation(buffer, pos, c, isSelection, opts, maskset, caretPos, strict) {
  2337. if (!1 !== opts.__financeInput && c === opts.radixPoint) return !1;
  2338. var pattern;
  2339. if (pattern = opts.shortcuts && opts.shortcuts[c]) {
  2340. if (1 < pattern.length) for (var inserts = [], i = 0; i < pattern.length; i++) inserts.push({
  2341. pos: pos + i,
  2342. c: pattern[i],
  2343. strict: !1
  2344. });
  2345. return {
  2346. insert: inserts
  2347. };
  2348. }
  2349. var radixPos = $.inArray(opts.radixPoint, buffer), initPos = pos;
  2350. if (pos = hanndleRadixDance(pos, c, radixPos, maskset, opts), "-" === c || c === opts.negationSymbol.front) {
  2351. if (!0 !== opts.allowMinus) return !1;
  2352. var isNegative = !1, front = findValid("+", maskset), back = findValid("-", maskset);
  2353. return -1 !== front && (isNegative = [ front, back ]), !1 !== isNegative ? {
  2354. remove: isNegative,
  2355. caret: initPos
  2356. } : {
  2357. insert: [ {
  2358. pos: findValidator("+", maskset),
  2359. c: opts.negationSymbol.front,
  2360. fromIsValid: !0
  2361. }, {
  2362. pos: findValidator("-", maskset),
  2363. c: opts.negationSymbol.back,
  2364. fromIsValid: void 0
  2365. } ],
  2366. caret: initPos + opts.negationSymbol.back.length
  2367. };
  2368. }
  2369. if (strict) return !0;
  2370. if (-1 !== radixPos && !0 === opts._radixDance && !1 === isSelection && c === opts.radixPoint && void 0 !== opts.digits && (isNaN(opts.digits) || 0 < parseInt(opts.digits)) && radixPos !== pos) return {
  2371. caret: opts._radixDance && pos === radixPos - 1 ? radixPos + 1 : radixPos
  2372. };
  2373. if (!1 === opts.__financeInput) if (isSelection) {
  2374. if (opts.digitsOptional) return {
  2375. rewritePosition: caretPos.end
  2376. };
  2377. if (!opts.digitsOptional) {
  2378. if (caretPos.begin > radixPos && caretPos.end <= radixPos) return c === opts.radixPoint ? {
  2379. insert: {
  2380. pos: radixPos + 1,
  2381. c: "0",
  2382. fromIsValid: !0
  2383. },
  2384. rewritePosition: radixPos
  2385. } : {
  2386. rewritePosition: radixPos + 1
  2387. };
  2388. if (caretPos.begin < radixPos) return {
  2389. rewritePosition: caretPos.begin - 1
  2390. };
  2391. }
  2392. } else if (!opts.showMaskOnHover && !opts.showMaskOnFocus && !opts.digitsOptional && 0 < opts.digits && "" === this.inputmask.__valueGet.call(this)) return {
  2393. rewritePosition: radixPos
  2394. };
  2395. return {
  2396. rewritePosition: pos
  2397. };
  2398. },
  2399. postValidation: function postValidation(buffer, pos, c, currentResult, opts, maskset, strict) {
  2400. if (!1 === currentResult) return currentResult;
  2401. if (strict) return !0;
  2402. if (null !== opts.min || null !== opts.max) {
  2403. var unmasked = opts.onUnMask(buffer.slice().reverse().join(""), void 0, $.extend({}, opts, {
  2404. unmaskAsNumber: !0
  2405. }));
  2406. if (null !== opts.min && unmasked < opts.min && (unmasked.toString().length >= opts.min.toString().length || unmasked < 0)) return !1;
  2407. if (null !== opts.max && unmasked > opts.max) return !1;
  2408. }
  2409. return currentResult;
  2410. },
  2411. onUnMask: function onUnMask(maskedValue, unmaskedValue, opts) {
  2412. if ("" === unmaskedValue && !0 === opts.nullable) return unmaskedValue;
  2413. var processValue = maskedValue.replace(opts.prefix, "");
  2414. return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2415. "" !== opts.placeholder.charAt(0) && (processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), "g"), "0")),
  2416. opts.unmaskAsNumber ? ("" !== opts.radixPoint && -1 !== processValue.indexOf(opts.radixPoint) && (processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".")),
  2417. processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-"),
  2418. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
  2419. Number(processValue)) : processValue;
  2420. },
  2421. isComplete: function isComplete(buffer, opts) {
  2422. var maskedValue = (opts.numericInput ? buffer.slice().reverse() : buffer).join("");
  2423. return maskedValue = maskedValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-"),
  2424. maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
  2425. maskedValue = maskedValue.replace(opts.prefix, ""), maskedValue = maskedValue.replace(opts.suffix, ""),
  2426. maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + "([0-9]{3})", "g"), "$1"),
  2427. "," === opts.radixPoint && (maskedValue = maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")),
  2428. isFinite(maskedValue);
  2429. },
  2430. onBeforeMask: function onBeforeMask(initialValue, opts) {
  2431. var radixPoint = opts.radixPoint || ",";
  2432. isFinite(opts.digits) && (opts.digits = parseInt(opts.digits)), "number" != typeof initialValue && "number" !== opts.inputType || "" === radixPoint || (initialValue = initialValue.toString().replace(".", radixPoint));
  2433. var valueParts = initialValue.split(radixPoint), integerPart = valueParts[0].replace(/[^\-0-9]/g, ""), decimalPart = 1 < valueParts.length ? valueParts[1].replace(/[^0-9]/g, "") : "", forceDigits = 1 < valueParts.length;
  2434. initialValue = integerPart + ("" !== decimalPart ? radixPoint + decimalPart : decimalPart);
  2435. var digits = 0;
  2436. if ("" !== radixPoint && (digits = opts.digitsOptional ? opts.digits < decimalPart.length ? opts.digits : decimalPart.length : opts.digits,
  2437. "" !== decimalPart || !opts.digitsOptional)) {
  2438. var digitsFactor = Math.pow(10, digits || 1);
  2439. initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), "."), isNaN(parseFloat(initialValue)) || (initialValue = (opts.roundingFN(parseFloat(initialValue) * digitsFactor) / digitsFactor).toFixed(digits)),
  2440. initialValue = initialValue.toString().replace(".", radixPoint);
  2441. }
  2442. if (0 === opts.digits && -1 !== initialValue.indexOf(radixPoint) && (initialValue = initialValue.substring(0, initialValue.indexOf(radixPoint))),
  2443. null !== opts.min || null !== opts.max) {
  2444. var numberValue = initialValue.toString().replace(radixPoint, ".");
  2445. null !== opts.min && numberValue < opts.min ? initialValue = opts.min.toString().replace(".", radixPoint) : null !== opts.max && numberValue > opts.max && (initialValue = opts.max.toString().replace(".", radixPoint));
  2446. }
  2447. return alignDigits(initialValue.toString().split(""), digits, opts, forceDigits).join("");
  2448. },
  2449. onBeforeWrite: function onBeforeWrite(e, buffer, caretPos, opts) {
  2450. function stripBuffer(buffer, stripRadix) {
  2451. if (!1 !== opts.__financeInput || stripRadix) {
  2452. var position = $.inArray(opts.radixPoint, buffer);
  2453. -1 !== position && buffer.splice(position, 1);
  2454. }
  2455. if ("" !== opts.groupSeparator) for (;-1 !== (position = buffer.indexOf(opts.groupSeparator)); ) buffer.splice(position, 1);
  2456. return buffer;
  2457. }
  2458. var result, leadingzeroes = checkForLeadingZeroes(buffer, opts);
  2459. if (leadingzeroes) {
  2460. var buf = buffer.slice().reverse(), caretNdx = buf.join("").indexOf(leadingzeroes[0]);
  2461. buf.splice(caretNdx, leadingzeroes[0].length);
  2462. var newCaretPos = buf.length - caretNdx;
  2463. stripBuffer(buf), result = {
  2464. refreshFromBuffer: !0,
  2465. buffer: buf.reverse(),
  2466. caret: caretPos < newCaretPos ? caretPos : newCaretPos
  2467. };
  2468. }
  2469. if (e) switch (e.type) {
  2470. case "blur":
  2471. case "checkval":
  2472. if (null !== opts.min) {
  2473. var unmasked = opts.onUnMask(buffer.slice().reverse().join(""), void 0, $.extend({}, opts, {
  2474. unmaskAsNumber: !0
  2475. }));
  2476. if (null !== opts.min && unmasked < opts.min) return {
  2477. refreshFromBuffer: !0,
  2478. buffer: alignDigits(opts.min.toString().replace(".", opts.radixPoint).split(""), opts.digits, opts).reverse()
  2479. };
  2480. }
  2481. if (buffer[buffer.length - 1] === opts.negationSymbol.front) {
  2482. var nmbrMtchs = new RegExp("(^" + ("" != opts.negationSymbol.front ? Inputmask.escapeRegex(opts.negationSymbol.front) + "?" : "") + Inputmask.escapeRegex(opts.prefix) + ")(.*)(" + Inputmask.escapeRegex(opts.suffix) + ("" != opts.negationSymbol.back ? Inputmask.escapeRegex(opts.negationSymbol.back) + "?" : "") + "$)").exec(stripBuffer(buffer.slice(), !0).reverse().join("")), number = nmbrMtchs ? nmbrMtchs[2] : "";
  2483. 0 == number && (result = {
  2484. refreshFromBuffer: !0,
  2485. buffer: [ 0 ]
  2486. });
  2487. } else "" !== opts.radixPoint && buffer[0] === opts.radixPoint && (result && result.buffer ? result.buffer.shift() : (buffer.shift(),
  2488. result = {
  2489. refreshFromBuffer: !0,
  2490. buffer: stripBuffer(buffer)
  2491. }));
  2492. if (opts.enforceDigitsOnBlur) {
  2493. result = result || {};
  2494. var bffr = result && result.buffer || buffer.slice().reverse();
  2495. result.refreshFromBuffer = !0, result.buffer = alignDigits(bffr, opts.digits, opts, !0).reverse();
  2496. }
  2497. }
  2498. return result;
  2499. },
  2500. onKeyDown: function onKeyDown(e, buffer, caretPos, opts) {
  2501. var $input = $(this), bffr;
  2502. if (e.ctrlKey) switch (e.keyCode) {
  2503. case keyCode.UP:
  2504. return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)),
  2505. $input.trigger("setvalue"), !1;
  2506. case keyCode.DOWN:
  2507. return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)),
  2508. $input.trigger("setvalue"), !1;
  2509. }
  2510. if (!e.shiftKey && (e.keyCode === keyCode.DELETE || e.keyCode === keyCode.BACKSPACE || e.keyCode === keyCode.BACKSPACE_SAFARI) && caretPos.begin !== buffer.length) {
  2511. if (buffer[e.keyCode === keyCode.DELETE ? caretPos.begin - 1 : caretPos.end] === opts.negationSymbol.front) return bffr = buffer.slice().reverse(),
  2512. "" !== opts.negationSymbol.front && bffr.shift(), "" !== opts.negationSymbol.back && bffr.pop(),
  2513. $input.trigger("setvalue", [ bffr.join(""), caretPos.begin ]), !1;
  2514. if (!0 === opts._radixDance) {
  2515. var radixPos = $.inArray(opts.radixPoint, buffer);
  2516. if (opts.digitsOptional) {
  2517. if (0 === radixPos) return bffr = buffer.slice().reverse(), bffr.pop(), $input.trigger("setvalue", [ bffr.join(""), caretPos.begin >= bffr.length ? bffr.length : caretPos.begin ]),
  2518. !1;
  2519. } else if (-1 !== radixPos && (caretPos.begin < radixPos || caretPos.end < radixPos || e.keyCode === keyCode.DELETE && caretPos.begin === radixPos)) return caretPos.begin !== caretPos.end || e.keyCode !== keyCode.BACKSPACE && e.keyCode !== keyCode.BACKSPACE_SAFARI || caretPos.begin++,
  2520. bffr = buffer.slice().reverse(), bffr.splice(bffr.length - caretPos.begin, caretPos.begin - caretPos.end + 1),
  2521. bffr = alignDigits(bffr, opts.digits, opts).join(""), $input.trigger("setvalue", [ bffr, caretPos.begin >= bffr.length ? radixPos + 1 : caretPos.begin ]),
  2522. !1;
  2523. }
  2524. }
  2525. }
  2526. },
  2527. currency: {
  2528. prefix: "",
  2529. groupSeparator: ",",
  2530. alias: "numeric",
  2531. digits: 2,
  2532. digitsOptional: !1
  2533. },
  2534. decimal: {
  2535. alias: "numeric"
  2536. },
  2537. integer: {
  2538. alias: "numeric",
  2539. digits: 0
  2540. },
  2541. percentage: {
  2542. alias: "numeric",
  2543. min: 0,
  2544. max: 100,
  2545. suffix: " %",
  2546. digits: 0,
  2547. allowMinus: !1
  2548. },
  2549. indianns: {
  2550. alias: "numeric",
  2551. _mask: function _mask(opts) {
  2552. return "(" + opts.groupSeparator + "99){*|1}(" + opts.groupSeparator + "999){1|1}";
  2553. },
  2554. groupSeparator: ",",
  2555. radixPoint: ".",
  2556. placeholder: "0",
  2557. digits: 2,
  2558. digitsOptional: !1
  2559. }
  2560. }), module.exports = Inputmask;
  2561. }, function(module, exports, __webpack_require__) {
  2562. "use strict";
  2563. var _inputmask = _interopRequireDefault(__webpack_require__(1));
  2564. function _typeof(obj) {
  2565. return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function _typeof(obj) {
  2566. return typeof obj;
  2567. } : function _typeof(obj) {
  2568. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2569. }, _typeof(obj);
  2570. }
  2571. function _classCallCheck(instance, Constructor) {
  2572. if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
  2573. }
  2574. function _possibleConstructorReturn(self, call) {
  2575. return !call || "object" !== _typeof(call) && "function" != typeof call ? _assertThisInitialized(self) : call;
  2576. }
  2577. function _assertThisInitialized(self) {
  2578. if (void 0 === self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  2579. return self;
  2580. }
  2581. function _inherits(subClass, superClass) {
  2582. if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function");
  2583. subClass.prototype = Object.create(superClass && superClass.prototype, {
  2584. constructor: {
  2585. value: subClass,
  2586. writable: !0,
  2587. configurable: !0
  2588. }
  2589. }), superClass && _setPrototypeOf(subClass, superClass);
  2590. }
  2591. function _wrapNativeSuper(Class) {
  2592. var _cache = "function" == typeof Map ? new Map() : void 0;
  2593. return _wrapNativeSuper = function _wrapNativeSuper(Class) {
  2594. if (null === Class || !_isNativeFunction(Class)) return Class;
  2595. if ("function" != typeof Class) throw new TypeError("Super expression must either be null or a function");
  2596. if ("undefined" != typeof _cache) {
  2597. if (_cache.has(Class)) return _cache.get(Class);
  2598. _cache.set(Class, Wrapper);
  2599. }
  2600. function Wrapper() {
  2601. return _construct(Class, arguments, _getPrototypeOf(this).constructor);
  2602. }
  2603. return Wrapper.prototype = Object.create(Class.prototype, {
  2604. constructor: {
  2605. value: Wrapper,
  2606. enumerable: !1,
  2607. writable: !0,
  2608. configurable: !0
  2609. }
  2610. }), _setPrototypeOf(Wrapper, Class);
  2611. }, _wrapNativeSuper(Class);
  2612. }
  2613. function isNativeReflectConstruct() {
  2614. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  2615. if (Reflect.construct.sham) return !1;
  2616. if ("function" == typeof Proxy) return !0;
  2617. try {
  2618. return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})),
  2619. !0;
  2620. } catch (e) {
  2621. return !1;
  2622. }
  2623. }
  2624. function _construct(Parent, args, Class) {
  2625. return _construct = isNativeReflectConstruct() ? Reflect.construct : function _construct(Parent, args, Class) {
  2626. var a = [ null ];
  2627. a.push.apply(a, args);
  2628. var Constructor = Function.bind.apply(Parent, a), instance = new Constructor();
  2629. return Class && _setPrototypeOf(instance, Class.prototype), instance;
  2630. }, _construct.apply(null, arguments);
  2631. }
  2632. function _isNativeFunction(fn) {
  2633. return -1 !== Function.toString.call(fn).indexOf("[native code]");
  2634. }
  2635. function _setPrototypeOf(o, p) {
  2636. return _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  2637. return o.__proto__ = p, o;
  2638. }, _setPrototypeOf(o, p);
  2639. }
  2640. function _getPrototypeOf(o) {
  2641. return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  2642. return o.__proto__ || Object.getPrototypeOf(o);
  2643. }, _getPrototypeOf(o);
  2644. }
  2645. function _interopRequireDefault(obj) {
  2646. return obj && obj.__esModule ? obj : {
  2647. default: obj
  2648. };
  2649. }
  2650. if (document.head.createShadowRoot || document.head.attachShadow) {
  2651. var InputmaskElement = function(_HTMLElement) {
  2652. function InputmaskElement() {
  2653. var _this;
  2654. _classCallCheck(this, InputmaskElement), _this = _possibleConstructorReturn(this, _getPrototypeOf(InputmaskElement).call(this));
  2655. var attributeNames = _this.getAttributeNames(), shadow = _this.attachShadow({
  2656. mode: "closed"
  2657. }), input = document.createElement("input");
  2658. for (var attr in input.type = "text", shadow.appendChild(input), attributeNames) Object.prototype.hasOwnProperty.call(attributeNames, attr) && input.setAttribute("data-inputmask-" + attributeNames[attr], _this.getAttribute(attributeNames[attr]));
  2659. return new _inputmask.default().mask(input), input.inputmask.shadowRoot = shadow,
  2660. _this;
  2661. }
  2662. return _inherits(InputmaskElement, _HTMLElement), InputmaskElement;
  2663. }(_wrapNativeSuper(HTMLElement));
  2664. customElements.define("input-mask", InputmaskElement);
  2665. }
  2666. } ], installedModules = {}, __webpack_require__.m = modules, __webpack_require__.c = installedModules,
  2667. __webpack_require__.d = function(exports, name, getter) {
  2668. __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {
  2669. enumerable: !0,
  2670. get: getter
  2671. });
  2672. }, __webpack_require__.r = function(exports) {
  2673. "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, {
  2674. value: "Module"
  2675. }), Object.defineProperty(exports, "__esModule", {
  2676. value: !0
  2677. });
  2678. }, __webpack_require__.t = function(value, mode) {
  2679. if (1 & mode && (value = __webpack_require__(value)), 8 & mode) return value;
  2680. if (4 & mode && "object" == typeof value && value && value.__esModule) return value;
  2681. var ns = Object.create(null);
  2682. if (__webpack_require__.r(ns), Object.defineProperty(ns, "default", {
  2683. enumerable: !0,
  2684. value: value
  2685. }), 2 & mode && "string" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) {
  2686. return value[key];
  2687. }.bind(null, key));
  2688. return ns;
  2689. }, __webpack_require__.n = function(module) {
  2690. var getter = module && module.__esModule ? function getDefault() {
  2691. return module.default;
  2692. } : function getModuleExports() {
  2693. return module;
  2694. };
  2695. return __webpack_require__.d(getter, "a", getter), getter;
  2696. }, __webpack_require__.o = function(object, property) {
  2697. return Object.prototype.hasOwnProperty.call(object, property);
  2698. }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 5);
  2699. function __webpack_require__(moduleId) {
  2700. if (installedModules[moduleId]) return installedModules[moduleId].exports;
  2701. var module = installedModules[moduleId] = {
  2702. i: moduleId,
  2703. l: !1,
  2704. exports: {}
  2705. };
  2706. return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__),
  2707. module.l = !0, module.exports;
  2708. }
  2709. var modules, installedModules;
  2710. });