jquery.inputmask.bundle.js 131 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299
  1. /*!
  2. * jquery.inputmask.bundle.js
  3. * https://github.com/RobinHerbots/Inputmask
  4. * Copyright (c) 2010 - 2018 Robin Herbots
  5. * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. * Version: 4.0.1-beta.0
  7. */
  8. !function(e) {
  9. var t = {};
  10. function n(i) {
  11. if (t[i]) return t[i].exports;
  12. var a = t[i] = {
  13. i: i,
  14. l: !1,
  15. exports: {}
  16. };
  17. return e[i].call(a.exports, a, a.exports, n), a.l = !0, a.exports;
  18. }
  19. n.m = e, n.c = t, n.d = function(e, t, i) {
  20. n.o(e, t) || Object.defineProperty(e, t, {
  21. configurable: !1,
  22. enumerable: !0,
  23. get: i
  24. });
  25. }, n.r = function(e) {
  26. Object.defineProperty(e, "__esModule", {
  27. value: !0
  28. });
  29. }, n.n = function(e) {
  30. var t = e && e.__esModule ? function() {
  31. return e.default;
  32. } : function() {
  33. return e;
  34. };
  35. return n.d(t, "a", t), t;
  36. }, n.o = function(e, t) {
  37. return Object.prototype.hasOwnProperty.call(e, t);
  38. }, n.p = "", n(n.s = 10);
  39. }([ function(e, t, n) {
  40. "use strict";
  41. var i, a, r, o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
  42. return typeof e;
  43. } : function(e) {
  44. return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  45. };
  46. a = [ n(1), n(8), n(7) ], void 0 === (r = "function" == typeof (i = function(e, t, n, i) {
  47. var a = navigator.userAgent, r = f("touchstart"), s = /iemobile/i.test(a), l = !0;
  48. function u(t, n, a) {
  49. if (!(this instanceof u)) return new u(t, n, a);
  50. this.el = i, this.events = {}, this.maskset = i, this.refreshValue = !1, !0 !== a && (e.isPlainObject(t) ? n = t : (n = n || {},
  51. t && (n.alias = t)), this.opts = e.extend(!0, {}, this.defaults, n), this.noMasksCache = n && n.definitions !== i,
  52. this.userOptions = n || {}, this.isRTL = this.opts.numericInput, c(this.opts.alias, n, this.opts));
  53. }
  54. function c(t, n, a) {
  55. var r = u.prototype.aliases[t];
  56. return r ? (r.alias && c(r.alias, i, a), e.extend(!0, a, r), e.extend(!0, a, n),
  57. !0) : (null === a.mask && (a.mask = t), !1);
  58. }
  59. function p(t, n) {
  60. function a(t, a, r) {
  61. var o = !1;
  62. if (null !== t && "" !== t || ((o = null !== r.regex) ? t = (t = r.regex).replace(/^(\^)(.*)(\$)$/, "$2") : (o = !0,
  63. t = ".*")), 1 === t.length && !1 === r.greedy && 0 !== r.repeat && (r.placeholder = ""),
  64. r.repeat > 0 || "*" === r.repeat || "+" === r.repeat) {
  65. var s = "*" === r.repeat ? 0 : "+" === r.repeat ? 1 : r.repeat;
  66. t = r.groupmarker[0] + t + r.groupmarker[1] + r.quantifiermarker[0] + s + "," + r.repeat + r.quantifiermarker[1];
  67. }
  68. var l, c = o ? "regex_" + r.regex : r.numericInput ? t.split("").reverse().join("") : t;
  69. return u.prototype.masksCache[c] === i || !0 === n ? (l = {
  70. mask: t,
  71. maskToken: u.prototype.analyseMask(t, o, r),
  72. validPositions: {},
  73. _buffer: i,
  74. buffer: i,
  75. tests: {},
  76. excludes: {},
  77. metadata: a,
  78. maskLength: i
  79. }, !0 !== n && (u.prototype.masksCache[c] = l, l = e.extend(!0, {}, u.prototype.masksCache[c]))) : l = e.extend(!0, {}, u.prototype.masksCache[c]),
  80. l;
  81. }
  82. if (e.isFunction(t.mask) && (t.mask = t.mask(t)), e.isArray(t.mask)) {
  83. if (t.mask.length > 1) {
  84. if (null === t.keepStatic) {
  85. t.keepStatic = "auto";
  86. for (var r = 0; r < t.mask.length; r++) if (t.mask[r].charAt(0) !== t.mask[0].charAt(0)) {
  87. t.keepStatic = !0;
  88. break;
  89. }
  90. }
  91. var o = t.groupmarker[0];
  92. return e.each(t.isRTL ? t.mask.reverse() : t.mask, function(n, a) {
  93. o.length > 1 && (o += t.groupmarker[1] + t.alternatormarker + t.groupmarker[0]),
  94. a.mask === i || e.isFunction(a.mask) ? o += a : o += a.mask;
  95. }), a(o += t.groupmarker[1], t.mask, t);
  96. }
  97. t.mask = t.mask.pop();
  98. }
  99. return t.mask && t.mask.mask !== i && !e.isFunction(t.mask.mask) ? a(t.mask.mask, t.mask, t) : a(t.mask, t.mask, t);
  100. }
  101. function f(e) {
  102. var t = n.createElement("input"), i = "on" + e, a = i in t;
  103. return a || (t.setAttribute(i, "return;"), a = "function" == typeof t[i]), t = null,
  104. a;
  105. }
  106. function m(a, c, p) {
  107. c = c || this.maskset, (p = p || this.opts).insertMode = l || p.insertMode;
  108. var d, h, g, v, k = this, y = this.el, b = this.isRTL, x = !1, P = !1, S = !1, A = !1;
  109. function C(e, t, n, a, r) {
  110. var o = p.greedy;
  111. r && (p.greedy = !1), t = t || 0;
  112. var s, l, u, c = [], f = 0, m = M();
  113. do {
  114. if (!0 === e && E().validPositions[f]) l = (u = r && !0 === E().validPositions[f].match.optionality && E().validPositions[f + 1] === i && (!0 === E().validPositions[f].generatedInput || E().validPositions[f].input == p.skipOptionalPartCharacter && f > 0) ? _(f, R(f, s, f - 1)) : E().validPositions[f]).match,
  115. s = u.locator.slice(), c.push(!0 === n ? u.input : !1 === n ? l.nativeDef : W(f, l)); else {
  116. l = (u = j(f, s, f - 1)).match, s = u.locator.slice();
  117. var d = !0 !== a && (!1 !== p.jitMasking ? p.jitMasking : l.jit);
  118. !1 === d || d === i || f < m || "number" == typeof d && isFinite(d) && d > f ? c.push(!1 === n ? l.nativeDef : W(f, l)) : l.jit && l.optionalQuantifier;
  119. }
  120. "auto" === p.keepStatic && l.newBlockMarker && null !== l.fn && (p.keepStatic = f - 1),
  121. f++;
  122. } while ((g === i || f < g) && (null !== l.fn || "" !== l.def) || t > f);
  123. return "" === c[c.length - 1] && c.pop(), !1 === n && E().maskLength !== i || (E().maskLength = f - 1),
  124. p.greedy = o, c;
  125. }
  126. function E() {
  127. return c;
  128. }
  129. function w(e) {
  130. var t = E();
  131. t.buffer = i, !0 !== e && (t.validPositions = {}, t.p = 0);
  132. }
  133. function M(e, t, n) {
  134. var a = -1, r = -1, o = n || E().validPositions;
  135. for (var s in e === i && (e = -1), o) {
  136. var l = parseInt(s);
  137. o[l] && (t || !0 !== o[l].generatedInput) && (l <= e && (a = l), l >= e && (r = l));
  138. }
  139. return -1 === a || a == e ? r : -1 == r ? a : e - a < r - e ? a : r;
  140. }
  141. function D(e) {
  142. var t = e.locator[e.alternation];
  143. return "string" == typeof t && t.length > 0 && (t = t.split(",")[0]), t !== i ? t.toString() : "";
  144. }
  145. function O(e, t) {
  146. var n = (e.alternation != i ? e.mloc[D(e)] : e.locator).join("");
  147. if ("" !== n) for (;n.length < t; ) n += "0";
  148. return n;
  149. }
  150. function _(e, t) {
  151. for (var n, a, r, s = O(F(e = e > 0 ? e - 1 : 0)), l = 0; l < t.length; l++) {
  152. var u = t[l];
  153. n = O(u, s.length);
  154. var c = Math.abs(n - s);
  155. (a === i || "" !== n && c < a || r && r.match.optionality && "master" === r.match.newBlockMarker && (!u.match.optionality || !u.match.newBlockMarker) || r && r.match.optionalQuantifier && !u.match.optionalQuantifier) && (a = c,
  156. r = u);
  157. }
  158. return r;
  159. }
  160. function j(e, t, n) {
  161. return E().validPositions[e] || _(e, R(e, t ? t.slice() : t, n));
  162. }
  163. function F(e, t) {
  164. return E().validPositions[e] ? E().validPositions[e] : (t || R(e))[0];
  165. }
  166. function T(e, t) {
  167. for (var n = !1, i = R(e), a = 0; a < i.length; a++) if (i[a].match && i[a].match.def === t) {
  168. n = !0;
  169. break;
  170. }
  171. return n;
  172. }
  173. function R(t, n, a) {
  174. var r, o = E().maskToken, s = n ? a : 0, l = n ? n.slice() : [ 0 ], u = [], c = !1, f = n ? n.join("") : "";
  175. function m(n, a, o, l) {
  176. function d(o, l, h) {
  177. function g(t, n) {
  178. var i = 0 === e.inArray(t, n.matches);
  179. return i || e.each(n.matches, function(e, a) {
  180. if (!0 === a.isQuantifier ? i = g(t, n.matches[e - 1]) : !0 === a.isOptional ? i = g(t, a) : !0 === a.isAlternate && (i = g(t, a)),
  181. i) return !1;
  182. }), i;
  183. }
  184. function v(t, n, a) {
  185. var r, o;
  186. if ((E().tests[t] || E().validPositions[t]) && e.each(E().tests[t] || [ E().validPositions[t] ], function(e, t) {
  187. if (t.mloc[n]) return r = t, !1;
  188. var s = a !== i ? a : t.alternation, l = t.locator[s] !== i ? t.locator[s].toString().indexOf(n) : -1;
  189. (o === i || l < o) && -1 !== l && (r = t, o = l);
  190. }), r) {
  191. var s = r.locator[r.alternation];
  192. return (r.mloc[n] || r.mloc[s] || r.locator).slice((a !== i ? a : r.alternation) + 1);
  193. }
  194. return a !== i ? v(t, n) : i;
  195. }
  196. function k(e, t) {
  197. function n(e) {
  198. for (var t, n, i = [], a = 0, r = e.length; a < r; a++) if ("-" === e.charAt(a)) for (n = e.charCodeAt(a + 1); ++t < n; ) i.push(String.fromCharCode(t)); else t = e.charCodeAt(a),
  199. i.push(e.charAt(a));
  200. return i.join("");
  201. }
  202. return p.regex && null !== e.match.fn && null !== t.match.fn ? -1 !== n(t.match.def.replace(/[\[\]]/g, "")).indexOf(n(e.match.def.replace(/[\[\]]/g, ""))) : e.match.def === t.match.nativeDef;
  203. }
  204. function y(e, t) {
  205. if (t === i || e.alternation === t.alternation && -1 === e.locator[e.alternation].toString().indexOf(t.locator[t.alternation])) {
  206. e.mloc = e.mloc || {};
  207. var n = e.locator[e.alternation];
  208. if (n !== i) {
  209. if ("string" == typeof n && (n = n.split(",")[0]), e.mloc[n] === i && (e.mloc[n] = e.locator.slice()),
  210. t !== i) {
  211. for (var a in t.mloc) "string" == typeof a && (a = a.split(",")[0]), e.mloc[a] === i && (e.mloc[a] = t.mloc[a]);
  212. e.locator[e.alternation] = Object.keys(e.mloc).join(",");
  213. }
  214. return !0;
  215. }
  216. e.alternation = i;
  217. }
  218. return !1;
  219. }
  220. if (s > 5e3) 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. " + E().mask;
  221. if (s === t && o.matches === i) return u.push({
  222. match: o,
  223. locator: l.reverse(),
  224. cd: f,
  225. mloc: {}
  226. }), !0;
  227. if (o.matches !== i) {
  228. if (o.isGroup && h !== o) {
  229. if (o = d(n.matches[e.inArray(o, n.matches) + 1], l, h)) return !0;
  230. } else if (o.isOptional) {
  231. var b = o;
  232. if (o = m(o, a, l, h)) {
  233. if (e.each(u, function(e, t) {
  234. t.match.optionality = !0;
  235. }), r = u[u.length - 1].match, h !== i || !g(r, b)) return !0;
  236. c = !0, s = t;
  237. }
  238. } else if (o.isAlternator) {
  239. var x, P = o, S = [], A = u.slice(), C = l.length, w = a.length > 0 ? a.shift() : -1;
  240. if (-1 === w || "string" == typeof w) {
  241. var M, D = s, O = a.slice(), _ = [];
  242. if ("string" == typeof w) _ = w.split(","); else for (M = 0; M < P.matches.length; M++) _.push(M.toString());
  243. if (E().excludes[t]) {
  244. for (var j = _.slice(), F = 0, T = E().excludes[t].length; F < T; F++) _.splice(_.indexOf(E().excludes[t][F].toString()), 1);
  245. 0 === _.length && (E().excludes[t] = i, _ = j);
  246. }
  247. (!0 === p.keepStatic || isFinite(parseInt(p.keepStatic)) && D >= p.keepStatic) && (_ = _.slice(0, 1));
  248. for (var R = !1, N = 0; N < _.length; N++) {
  249. M = parseInt(_[N]), u = [], a = "string" == typeof w && v(s, M, C) || O.slice(),
  250. P.matches[M] && d(P.matches[M], [ M ].concat(l), h) ? o = !0 : 0 === N && (R = !0),
  251. x = u.slice(), s = D, u = [];
  252. for (var G = 0; G < x.length; G++) {
  253. var I = x[G], B = !1;
  254. I.match.jit = I.match.jit || R, I.alternation = I.alternation || C, y(I);
  255. for (var L = 0; L < S.length; L++) {
  256. var H = S[L];
  257. if ("string" != typeof w || I.alternation !== i && -1 !== e.inArray(I.locator[I.alternation].toString(), _)) {
  258. if (I.match.nativeDef === H.match.nativeDef) {
  259. B = !0, y(H, I);
  260. break;
  261. }
  262. if (k(I, H)) {
  263. y(I, H) && (B = !0, S.splice(S.indexOf(H), 0, I));
  264. break;
  265. }
  266. if (k(H, I)) {
  267. y(H, I);
  268. break;
  269. }
  270. if (q = H, null === (z = I).match.fn && null !== q.match.fn && q.match.fn.test(z.match.def, E(), t, !1, p, !1)) {
  271. y(I, H) && (B = !0, S.splice(S.indexOf(H), 0, I));
  272. break;
  273. }
  274. }
  275. }
  276. B || S.push(I);
  277. }
  278. }
  279. u = A.concat(S), s = t, c = u.length > 0, o = S.length > 0, a = O.slice();
  280. } else o = d(P.matches[w] || n.matches[w], [ w ].concat(l), h);
  281. if (o) return !0;
  282. } else if (o.isQuantifier && h !== n.matches[e.inArray(o, n.matches) - 1]) for (var V = o, K = a.length > 0 ? a.shift() : 0; K < (isNaN(V.quantifier.max) ? K + 1 : V.quantifier.max) && s <= t; K++) {
  283. var U = n.matches[e.inArray(V, n.matches) - 1];
  284. if (o = d(U, [ K ].concat(l), U)) {
  285. if ((r = u[u.length - 1].match).optionalQuantifier = K > V.quantifier.min - 1, r.jit = K + U.matches.indexOf(r) >= V.quantifier.jit,
  286. g(r, U) && K > V.quantifier.min - 1) {
  287. c = !0, s = t;
  288. break;
  289. }
  290. if (V.quantifier.jit !== i && isNaN(V.quantifier.max) && r.optionalQuantifier && E().validPositions[t - 1] === i) {
  291. u.pop(), c = !0, s = t, f = i;
  292. break;
  293. }
  294. return !0;
  295. }
  296. } else if (o = m(o, a, l, h)) return !0;
  297. } else s++;
  298. var z, q;
  299. }
  300. for (var h = a.length > 0 ? a.shift() : 0; h < n.matches.length; h++) if (!0 !== n.matches[h].isQuantifier) {
  301. var g = d(n.matches[h], [ h ].concat(o), l);
  302. if (g && s === t) return g;
  303. if (s > t) break;
  304. }
  305. }
  306. if (t > -1) {
  307. if (n === i) {
  308. for (var d, h = t - 1; (d = E().validPositions[h] || E().tests[h]) === i && h > -1; ) h--;
  309. d !== i && h > -1 && (l = function(t, n) {
  310. var a = [];
  311. return e.isArray(n) || (n = [ n ]), n.length > 0 && (n[0].alternation === i ? 0 === (a = _(t, n.slice()).locator.slice()).length && (a = n[0].locator.slice()) : e.each(n, function(e, t) {
  312. if ("" !== t.def) if (0 === a.length) a = t.locator.slice(); else for (var n = 0; n < a.length; n++) t.locator[n] && -1 === a[n].toString().indexOf(t.locator[n]) && (a[n] += "," + t.locator[n]);
  313. })), a;
  314. }(h, d), f = l.join(""), s = h);
  315. }
  316. if (E().tests[t] && E().tests[t][0].cd === f) return E().tests[t];
  317. for (var g = l.shift(); g < o.length; g++) {
  318. if (m(o[g], l, [ g ]) && s === t || s > t) break;
  319. }
  320. }
  321. return (0 === u.length || c) && u.push({
  322. match: {
  323. fn: null,
  324. optionality: !1,
  325. casing: null,
  326. def: "",
  327. placeholder: ""
  328. },
  329. locator: [],
  330. mloc: {},
  331. cd: f
  332. }), n !== i && E().tests[t] ? e.extend(!0, [], u) : (E().tests[t] = e.extend(!0, [], u),
  333. E().tests[t]);
  334. }
  335. function N() {
  336. return E()._buffer === i && (E()._buffer = C(!1, 1), E().buffer === i && (E().buffer = E()._buffer.slice())),
  337. E()._buffer;
  338. }
  339. function G(e) {
  340. return E().buffer !== i && !0 !== e || (E().buffer = C(!0, M(), !0)), E().buffer;
  341. }
  342. function I(e, t, n) {
  343. var a, r;
  344. if (!0 === e) w(), e = 0, t = n.length; else for (a = e; a < t; a++) delete E().validPositions[a];
  345. for (r = e, a = e; a < t; a++) if (w(!0), n[a] !== p.skipOptionalPartCharacter) {
  346. var o = H(r, n[a], !0, !0);
  347. !1 !== o && (w(!0), r = o.caret !== i ? o.caret : o.pos + 1);
  348. }
  349. }
  350. function B(t, n, a) {
  351. for (var r, o = p.greedy ? n : n.slice(0, 1), s = !1, l = a !== i ? a.split(",") : [], u = 0; u < l.length; u++) -1 !== (r = t.indexOf(l[u])) && t.splice(r, 1);
  352. for (var c = 0; c < t.length; c++) if (-1 !== e.inArray(t[c], o)) {
  353. s = !0;
  354. break;
  355. }
  356. return s;
  357. }
  358. function L(t, n, a, r, o) {
  359. var s, l, u, c, p, f, m, d = e.extend(!0, {}, E().validPositions), h = !1, g = o !== i ? o : M();
  360. if (-1 === g && o === i) l = (c = F(s = 0)).alternation; else for (;g >= 0; g--) if ((u = E().validPositions[g]) && u.alternation !== i) {
  361. if (c && c.locator[u.alternation] !== u.locator[u.alternation]) break;
  362. s = g, l = E().validPositions[s].alternation, c = u;
  363. }
  364. if (l !== i) {
  365. m = parseInt(s), E().excludes[m] = E().excludes[m] || [], !0 !== t && E().excludes[m].push(D(c));
  366. var v = [], k = 0;
  367. for (p = m; p < M(i, !0) + 1; p++) (f = E().validPositions[p]) && !0 !== f.generatedInput ? v.push(f.input) : p < t && k++,
  368. delete E().validPositions[p];
  369. for (;E().excludes[m] && E().excludes[m].length < 10; ) {
  370. var y = -1 * k, b = v.slice();
  371. for (E().tests[m] = i, w(!0), h = !0; b.length > 0; ) {
  372. var x = b.shift();
  373. if (!(h = H(M(i, !0) + 1, x, !1, r, !0))) break;
  374. }
  375. if (h && n !== i) {
  376. var P = M(t) + 1;
  377. for (p = m; p < M() + 1; p++) ((f = E().validPositions[p]) === i || null == f.match.fn) && p < t + y && y++;
  378. h = H((t += y) > P ? P : t, n, a, r, !0);
  379. }
  380. if (h) break;
  381. if (w(), c = F(m), E().validPositions = e.extend(!0, {}, d), !E().excludes[m]) {
  382. h = L(t, n, a, r, m - 1);
  383. break;
  384. }
  385. var S = D(c);
  386. if (-1 !== E().excludes[m].indexOf(S)) {
  387. h = L(t, n, a, r, m - 1);
  388. break;
  389. }
  390. for (E().excludes[m].push(S), p = m; p < M(i, !0) + 1; p++) delete E().validPositions[p];
  391. }
  392. }
  393. return E().excludes[m] = i, h;
  394. }
  395. function H(t, n, a, r, o, s) {
  396. function l(e) {
  397. return b ? e.begin - e.end > 1 || e.begin - e.end == 1 : e.end - e.begin > 1 || e.end - e.begin == 1;
  398. }
  399. a = !0 === a;
  400. var c = t;
  401. function f(n, a, o) {
  402. var s = !1;
  403. return e.each(R(n), function(c, f) {
  404. var m = f.match;
  405. if (G(!0), !1 !== (s = null != m.fn ? m.fn.test(a, E(), n, o, p, l(t)) : (a === m.def || a === p.skipOptionalPartCharacter) && "" !== m.def && {
  406. c: W(n, m, !0) || m.def,
  407. pos: n
  408. })) {
  409. var d = s.c !== i ? s.c : a, h = n;
  410. return d = d === p.skipOptionalPartCharacter && null === m.fn ? W(n, m, !0) || m.def : d,
  411. s.remove !== i && (e.isArray(s.remove) || (s.remove = [ s.remove ]), e.each(s.remove.sort(function(e, t) {
  412. return t - e;
  413. }), function(e, t) {
  414. K({
  415. begin: t,
  416. end: t + 1
  417. });
  418. })), s.insert !== i && (e.isArray(s.insert) || (s.insert = [ s.insert ]), e.each(s.insert.sort(function(e, t) {
  419. return e - t;
  420. }), function(e, t) {
  421. H(t.pos, t.c, !0, r);
  422. })), !0 !== s && s.pos !== i && s.pos !== n && (h = s.pos), (!0 === s || s.pos !== i || s.c !== i) && (K(t, e.extend({}, f, {
  423. input: function(t, n, i) {
  424. switch (p.casing || n.casing) {
  425. case "upper":
  426. t = t.toUpperCase();
  427. break;
  428. case "lower":
  429. t = t.toLowerCase();
  430. break;
  431. case "title":
  432. var a = E().validPositions[i - 1];
  433. t = 0 === i || a && a.input === String.fromCharCode(u.keyCode.SPACE) ? t.toUpperCase() : t.toLowerCase();
  434. break;
  435. default:
  436. if (e.isFunction(p.casing)) {
  437. var r = Array.prototype.slice.call(arguments);
  438. r.push(E().validPositions), t = p.casing.apply(this, r);
  439. }
  440. }
  441. return t;
  442. }(d, m, h)
  443. }), r, h) || (s = !1), !1);
  444. }
  445. }), s;
  446. }
  447. t.begin !== i && (c = b ? t.end : t.begin);
  448. var m = !0, d = e.extend(!0, {}, E().validPositions);
  449. if (e.isFunction(p.preValidation) && !a && !0 !== r && !0 !== s && (m = p.preValidation(G(), c, n, l(t), p, E())),
  450. !0 === m) {
  451. if (V(i, c, !0), (g === i || c < g) && (m = f(c, n, a), (!a || !0 === r) && !1 === m && !0 !== s)) {
  452. var h = E().validPositions[c];
  453. if (!h || null !== h.match.fn || h.match.def !== n && n !== p.skipOptionalPartCharacter) {
  454. if ((p.insertMode || E().validPositions[z(c)] === i) && !U(c, !0)) for (var v = c + 1, k = z(c); v <= k; v++) if (!1 !== (m = f(v, n, a))) {
  455. m = V(c, m.pos !== i ? m.pos : v) || m, c = v;
  456. break;
  457. }
  458. } else m = {
  459. caret: z(c)
  460. };
  461. }
  462. !1 !== m || !1 === p.keepStatic || null != p.regex && !ae(G()) || a || !0 === o || (m = L(c, n, a, r)),
  463. !0 === m && (m = {
  464. pos: c
  465. });
  466. }
  467. if (e.isFunction(p.postValidation) && !1 !== m && !a && !0 !== r && !0 !== s) {
  468. var y = p.postValidation(G(!0), m, p);
  469. if (y !== i) {
  470. if (y.refreshFromBuffer && y.buffer) {
  471. var x = y.refreshFromBuffer;
  472. I(!0 === x ? x : x.start, x.end, y.buffer);
  473. }
  474. m = !0 === y ? m : y;
  475. }
  476. }
  477. return m && m.pos === i && (m.pos = c), !1 !== m && !0 !== s || (w(!0), E().validPositions = e.extend(!0, {}, d)),
  478. m;
  479. }
  480. function V(t, n, a) {
  481. var r;
  482. if (t === i) for (t = n - 1; t > 0 && !E().validPositions[t]; t--) ;
  483. for (var o = t; o < n; o++) if (E().validPositions[o] === i && !U(o, !0)) {
  484. if (0 == o ? F(o) : E().validPositions[o - 1]) {
  485. var l = R(o).slice();
  486. "" === l[l.length - 1].match.def && l.pop();
  487. var u = _(o, l);
  488. if ((u = e.extend({}, u, {
  489. input: W(o, u.match, !0) || u.match.def
  490. })).generatedInput = !0, K(o, u, !0), !0 !== a) {
  491. var c = E().validPositions[n].input;
  492. E().validPositions[n] = i, r = H(n, c, !0, !0);
  493. }
  494. }
  495. }
  496. return r;
  497. }
  498. function K(t, n, a, r) {
  499. function o(e, t, n) {
  500. var a = t[e];
  501. if (a !== i && (null === a.match.fn && !0 !== a.match.optionality || a.input === p.radixPoint)) {
  502. var r = n.begin <= e - 1 ? t[e - 1] && null === t[e - 1].match.fn && t[e - 1] : t[e - 1], o = n.end > e + 1 ? t[e + 1] && null === t[e + 1].match.fn && t[e + 1] : t[e + 1];
  503. return r && o;
  504. }
  505. return !1;
  506. }
  507. var s = t.begin !== i ? t.begin : t, l = t.end !== i ? t.end : t;
  508. if (t.begin > t.end && (s = t.end, l = t.begin), r = r !== i ? r : s, s !== l || p.insertMode && E().validPositions[r] !== i && a === i) {
  509. var u = e.extend(!0, {}, E().validPositions), c = M(i, !0);
  510. for (E().p = s, g = c; g >= s; g--) E().validPositions[g] && "+" === E().validPositions[g].match.nativeDef && (p.isNegative = !1),
  511. delete E().validPositions[g];
  512. var f = !0, m = r, d = (E().validPositions, !1), h = m, g = m;
  513. for (n && (E().validPositions[r] = e.extend(!0, {}, n), h++, m++, s < l && g++); g <= c; g++) {
  514. var v = u[g];
  515. if (v !== i && (g >= l || g >= s && !0 !== v.generatedInput && o(g, u, {
  516. begin: s,
  517. end: l
  518. }))) {
  519. for (;"" !== F(h).match.def; ) {
  520. if (!1 === d && u[h] && u[h].match.nativeDef === v.match.nativeDef) E().validPositions[h] = e.extend(!0, {}, u[h]),
  521. E().validPositions[h].input = v.input, V(i, h, !0), m = h + 1, f = !0; else if (T(h, v.match.def)) {
  522. var k = H(h, v.input, !0, !0);
  523. f = !1 !== k, m = k.caret || k.insert ? M() : h + 1, d = !0;
  524. } else if (!(f = !0 === v.generatedInput || v.input === p.radixPoint && !0 === p.numericInput) && "" === F(h).match.def) break;
  525. if (f) break;
  526. h++;
  527. }
  528. "" == F(h).match.def && (f = !1), h = m;
  529. }
  530. if (!f) break;
  531. }
  532. if (!f) return E().validPositions = e.extend(!0, {}, u), w(!0), !1;
  533. } else n && (E().validPositions[r] = e.extend(!0, {}, n));
  534. return w(!0), !0;
  535. }
  536. function U(e, t) {
  537. var n = j(e).match;
  538. if ("" === n.def && (n = F(e).match), null != n.fn) return n.fn;
  539. if (!0 !== t && e > -1) {
  540. var i = R(e);
  541. return i.length > 1 + ("" === i[i.length - 1].match.def ? 1 : 0);
  542. }
  543. return !1;
  544. }
  545. function z(e, t) {
  546. for (var n = e + 1; "" !== F(n).match.def && (!0 === t && (!0 !== F(n).match.newBlockMarker || !U(n)) || !0 !== t && !U(n)); ) n++;
  547. return n;
  548. }
  549. function q(e, t) {
  550. var n, i = e;
  551. if (i <= 0) return 0;
  552. for (;--i > 0 && (!0 === t && !0 !== F(i).match.newBlockMarker || !0 !== t && !U(i) && ((n = R(i)).length < 2 || 2 === n.length && "" === n[1].match.def)); ) ;
  553. return i;
  554. }
  555. function Q(t, n, a, r, o) {
  556. if (r && e.isFunction(p.onBeforeWrite)) {
  557. var s = p.onBeforeWrite.call(k, r, n, a, p);
  558. if (s) {
  559. if (s.refreshFromBuffer) {
  560. var l = s.refreshFromBuffer;
  561. I(!0 === l ? l : l.start, l.end, s.buffer || n), n = G(!0);
  562. }
  563. a !== i && (a = s.caret !== i ? s.caret : a);
  564. }
  565. }
  566. if (t !== i && (t.inputmask._valueSet(n.join("")), a === i || r !== i && "blur" === r.type ? se(t, a, 0 === n.length) : te(t, a),
  567. !0 === o)) {
  568. var u = e(t), c = t.inputmask._valueGet();
  569. P = !0, u.trigger("input"), setTimeout(function() {
  570. c === N().join("") ? u.trigger("cleared") : !0 === ae(n) && u.trigger("complete");
  571. }, 0);
  572. }
  573. }
  574. function W(t, n, a) {
  575. if ((n = n || F(t).match).placeholder !== i || !0 === a) return e.isFunction(n.placeholder) ? n.placeholder(p) : n.placeholder;
  576. if (null === n.fn) {
  577. if (t > -1 && E().validPositions[t] === i) {
  578. var r, o = R(t), s = [];
  579. if (o.length > 1 + ("" === o[o.length - 1].match.def ? 1 : 0)) for (var l = 0; l < o.length; l++) if (!0 !== o[l].match.optionality && !0 !== o[l].match.optionalQuantifier && (null === o[l].match.fn || r === i || !1 !== o[l].match.fn.test(r.match.def, E(), t, !0, p)) && (s.push(o[l]),
  580. null === o[l].match.fn && (r = o[l]), s.length > 1 && /[0-9a-bA-Z]/.test(s[0].match.def))) return p.placeholder.charAt(t % p.placeholder.length);
  581. }
  582. return n.def;
  583. }
  584. return p.placeholder.charAt(t % p.placeholder.length);
  585. }
  586. var $, Z = {
  587. on: function(t, n, a) {
  588. var o = function(t) {
  589. var n = this;
  590. if (n.inputmask === i && "FORM" !== this.nodeName) {
  591. var o = e.data(n, "_inputmask_opts");
  592. o ? new u(o).mask(n) : Z.off(n);
  593. } else {
  594. if ("setvalue" === t.type || "FORM" === this.nodeName || !(n.disabled || n.readOnly && !("keydown" === t.type && t.ctrlKey && 67 === t.keyCode || !1 === p.tabThrough && t.keyCode === u.keyCode.TAB))) {
  595. switch (t.type) {
  596. case "input":
  597. if (!0 === P) return P = !1, t.preventDefault();
  598. if (r) {
  599. var c = arguments;
  600. return setTimeout(function() {
  601. a.apply(n, c), te(n, n.inputmask.caretPos, i, !0);
  602. }, 0), !1;
  603. }
  604. break;
  605. case "keydown":
  606. x = !1, P = !1;
  607. break;
  608. case "keypress":
  609. if (!0 === x) return t.preventDefault();
  610. x = !0;
  611. break;
  612. case "click":
  613. if (s || l) {
  614. c = arguments;
  615. return setTimeout(function() {
  616. a.apply(n, c);
  617. }, 0), !1;
  618. }
  619. }
  620. var f = a.apply(n, arguments);
  621. return !1 === f && (t.preventDefault(), t.stopPropagation()), f;
  622. }
  623. t.preventDefault();
  624. }
  625. };
  626. t.inputmask.events[n] = t.inputmask.events[n] || [], t.inputmask.events[n].push(o),
  627. -1 !== e.inArray(n, [ "submit", "reset" ]) ? null !== t.form && e(t.form).on(n, o) : e(t).on(n, o);
  628. },
  629. off: function(t, n) {
  630. var i;
  631. t.inputmask && t.inputmask.events && (n ? (i = [])[n] = t.inputmask.events[n] : i = t.inputmask.events,
  632. e.each(i, function(n, i) {
  633. for (;i.length > 0; ) {
  634. var a = i.pop();
  635. -1 !== e.inArray(n, [ "submit", "reset" ]) ? null !== t.form && e(t.form).off(n, a) : e(t).off(n, a);
  636. }
  637. delete t.inputmask.events[n];
  638. }));
  639. }
  640. }, J = {
  641. keydownEvent: function(t) {
  642. var n = this, i = e(n), a = t.keyCode, r = te(n);
  643. if (a === u.keyCode.BACKSPACE || a === u.keyCode.DELETE || l && a === u.keyCode.BACKSPACE_SAFARI || t.ctrlKey && a === u.keyCode.X && !f("cut")) t.preventDefault(),
  644. re(0, a, r), Q(n, G(!0), E().p, t, n.inputmask._valueGet() !== G().join("")); else if (a === u.keyCode.END || a === u.keyCode.PAGE_DOWN) {
  645. t.preventDefault();
  646. var o = z(M());
  647. p.insertMode || o !== E().maskLength || t.shiftKey || o--, te(n, t.shiftKey ? r.begin : o, o, !0);
  648. } else a === u.keyCode.HOME && !t.shiftKey || a === u.keyCode.PAGE_UP ? (t.preventDefault(),
  649. te(n, 0, t.shiftKey ? r.begin : 0, !0)) : (p.undoOnEscape && a === u.keyCode.ESCAPE || 90 === a && t.ctrlKey) && !0 !== t.altKey ? (Y(n, !0, !1, d.split("")),
  650. i.trigger("click")) : a !== u.keyCode.INSERT || t.shiftKey || t.ctrlKey ? !0 === p.tabThrough && a === u.keyCode.TAB ? (!0 === t.shiftKey ? (null === F(r.begin).match.fn && (r.begin = z(r.begin)),
  651. r.end = q(r.begin, !0), r.begin = q(r.end, !0)) : (r.begin = z(r.begin, !0), r.end = z(r.begin, !0),
  652. r.end < E().maskLength && r.end--), r.begin < E().maskLength && (t.preventDefault(),
  653. te(n, r.begin, r.end))) : t.shiftKey || !1 === p.insertMode && (a === u.keyCode.RIGHT ? setTimeout(function() {
  654. var e = te(n);
  655. te(n, e.begin);
  656. }, 0) : a === u.keyCode.LEFT && setTimeout(function() {
  657. var e = te(n);
  658. te(n, b ? e.begin + 1 : e.begin - 1);
  659. }, 0)) : (p.insertMode = l || !p.insertMode, te(n, p.insertMode || r.begin !== E().maskLength ? r.begin : r.begin - 1));
  660. p.onKeyDown.call(this, t, G(), te(n).begin, p), S = -1 !== e.inArray(a, p.ignorables);
  661. },
  662. keypressEvent: function(t, n, a, r, o) {
  663. var s = this, l = e(s), c = t.which || t.charCode || t.keyCode;
  664. if (!(!0 === n || t.ctrlKey && t.altKey) && (t.ctrlKey || t.metaKey || S)) return c === u.keyCode.ENTER && d !== G().join("") && (d = G().join(""),
  665. setTimeout(function() {
  666. l.trigger("change");
  667. }, 0)), !0;
  668. if (c) {
  669. 46 === c && !1 === t.shiftKey && "" !== p.radixPoint && (c = p.radixPoint.charCodeAt(0));
  670. var f, m = n ? {
  671. begin: o,
  672. end: o
  673. } : te(s), h = String.fromCharCode(c), g = 0;
  674. if (p._radixDance && p.numericInput) {
  675. var v = G().indexOf(p.radixPoint.charAt(0)) + 1;
  676. m.begin <= v && (c === p.radixPoint.charCodeAt(0) && (g = 1), m.begin -= 1, m.end -= 1);
  677. }
  678. E().writeOutBuffer = !0;
  679. var k = H(m, h, r);
  680. if (!1 !== k && (w(!0), f = k.caret !== i ? k.caret : z(k.pos.begin ? k.pos.begin : k.pos),
  681. E().p = f), f = (p.numericInput && k.caret === i ? q(f) : f) + g, !1 !== a && (setTimeout(function() {
  682. p.onKeyValidation.call(s, c, k, p);
  683. }, 0), E().writeOutBuffer && !1 !== k)) {
  684. var y = G();
  685. Q(s, y, f, t, !0 !== n);
  686. }
  687. if (t.preventDefault(), n) return !1 !== k && (k.forwardPosition = f), k;
  688. }
  689. },
  690. pasteEvent: function(n) {
  691. var i, a = n.originalEvent || n, r = (e(this), this.inputmask._valueGet(!0)), o = te(this);
  692. b && (i = o.end, o.end = o.begin, o.begin = i);
  693. var s = r.substr(0, o.begin), l = r.substr(o.end, r.length);
  694. if (s === (b ? N().reverse() : N()).slice(0, o.begin).join("") && (s = ""), l === (b ? N().reverse() : N()).slice(o.end).join("") && (l = ""),
  695. t.clipboardData && t.clipboardData.getData) r = s + t.clipboardData.getData("Text") + l; else {
  696. if (!a.clipboardData || !a.clipboardData.getData) return !0;
  697. r = s + a.clipboardData.getData("text/plain") + l;
  698. }
  699. var u = r;
  700. if (e.isFunction(p.onBeforePaste)) {
  701. if (!1 === (u = p.onBeforePaste.call(k, r, p))) return n.preventDefault();
  702. u || (u = r);
  703. }
  704. return Y(this, !1, !1, u.toString().split("")), Q(this, G(), z(M()), n, d !== G().join("")),
  705. n.preventDefault();
  706. },
  707. inputFallBackEvent: function(t) {
  708. var n = this, i = n.inputmask._valueGet();
  709. if (G().join("") !== i) {
  710. var a = te(n);
  711. if (i = function(e, t, n) {
  712. if (s) {
  713. var i = t.replace(G().join(""), "");
  714. if (1 === i.length) {
  715. var a = t.split("");
  716. a.splice(n.begin, 0, i), t = a.join("");
  717. }
  718. }
  719. return t;
  720. }(0, i = function(e, t, n) {
  721. return "." === t.charAt(n.begin - 1) && "" !== p.radixPoint && ((t = t.split(""))[n.begin - 1] = p.radixPoint.charAt(0),
  722. t = t.join("")), t;
  723. }(0, i, a), a), G().join("") !== i) {
  724. var r = G().join(""), o = !p.numericInput && i.length > r.length ? -1 : 0, l = i.substr(0, a.begin), c = i.substr(a.begin), f = r.substr(0, a.begin + o), m = r.substr(a.begin + o), d = a, h = "", g = !1;
  725. if (l !== f) {
  726. for (var v = (g = l.length >= f.length) ? l.length : f.length, k = 0; l.charAt(k) === f.charAt(k) && k < v; k++) ;
  727. g && (0 === o && (d.begin = k), h += l.slice(k, d.end));
  728. }
  729. if (c !== m && (c.length > m.length ? h += c.slice(0, 1) : c.length < m.length && (d.end += m.length - c.length,
  730. g || "" === p.radixPoint || "" !== c || l.charAt(d.begin + o - 1) !== p.radixPoint || (d.begin--,
  731. h = p.radixPoint))), Q(n, G(), {
  732. begin: d.begin + o,
  733. end: d.end + o
  734. }), h.length > 0) e.each(h.split(""), function(t, i) {
  735. var a = new e.Event("keypress");
  736. a.which = i.charCodeAt(0), S = !1, J.keypressEvent.call(n, a);
  737. }); else {
  738. d.begin === d.end - 1 && (d.begin = q(d.begin + 1), d.begin === d.end - 1 ? te(n, d.begin) : te(n, d.begin, d.end));
  739. var y = new e.Event("keydown");
  740. y.keyCode = p.numericInput ? u.keyCode.BACKSPACE : u.keyCode.DELETE, J.keydownEvent.call(n, y),
  741. !1 === p.insertMode && te(n, te(n).begin - 1);
  742. }
  743. t.preventDefault();
  744. }
  745. }
  746. },
  747. beforeInputEvent: function(t) {
  748. if (t.cancelable) {
  749. var n = this;
  750. switch (t.inputType) {
  751. case "insertText":
  752. return e.each(t.data.split(""), function(t, i) {
  753. var a = new e.Event("keypress");
  754. a.which = i.charCodeAt(0), S = !1, J.keypressEvent.call(n, a);
  755. }), t.preventDefault();
  756. case "deleteContentBackward":
  757. return (i = new e.Event("keydown")).keyCode = u.keyCode.BACKSPACE, J.keydownEvent.call(n, i),
  758. t.preventDefault();
  759. case "deleteContentForward":
  760. var i;
  761. return (i = new e.Event("keydown")).keyCode = u.keyCode.DELETE, J.keydownEvent.call(n, i),
  762. t.preventDefault();
  763. }
  764. }
  765. },
  766. setValueEvent: function(t) {
  767. this.inputmask.refreshValue = !1;
  768. var n = (n = t && t.detail ? t.detail[0] : arguments[1]) || this.inputmask._valueGet(!0);
  769. e.isFunction(p.onBeforeMask) && (n = p.onBeforeMask.call(k, n, p) || n), Y(this, !0, !1, n = n.split("")),
  770. d = G().join(""), (p.clearMaskOnLostFocus || p.clearIncomplete) && this.inputmask._valueGet() === N().join("") && this.inputmask._valueSet("");
  771. },
  772. focusEvent: function(e) {
  773. var t = this.inputmask._valueGet();
  774. p.showMaskOnFocus && (!p.showMaskOnHover || p.showMaskOnHover && "" === t) && (this.inputmask._valueGet() !== G().join("") ? Q(this, G(), z(M())) : !1 === A && te(this, z(M()))),
  775. !0 === p.positionCaretOnTab && !1 === A && J.clickEvent.apply(this, [ e, !0 ]),
  776. d = G().join("");
  777. },
  778. mouseleaveEvent: function(e) {
  779. if (A = !1, p.clearMaskOnLostFocus && n.activeElement !== this) {
  780. var t = G().slice(), i = this.inputmask._valueGet();
  781. i !== this.getAttribute("placeholder") && "" !== i && (-1 === M() && i === N().join("") ? t = [] : ie(t),
  782. Q(this, t));
  783. }
  784. },
  785. clickEvent: function(t, a) {
  786. var r = this;
  787. setTimeout(function() {
  788. if (n.activeElement === r) {
  789. var t = te(r);
  790. if (a && (b ? t.end = t.begin : t.begin = t.end), t.begin === t.end) switch (p.positionCaretOnClick) {
  791. case "none":
  792. break;
  793. case "select":
  794. te(r, 0, G().length);
  795. break;
  796. case "ignore":
  797. te(r, z(M()));
  798. break;
  799. case "radixFocus":
  800. if (function(t) {
  801. if ("" !== p.radixPoint) {
  802. var n = E().validPositions;
  803. if (n[t] === i || n[t].input === W(t)) {
  804. if (t < z(-1)) return !0;
  805. var a = e.inArray(p.radixPoint, G());
  806. if (-1 !== a) {
  807. for (var r in n) if (a < r && n[r].input !== W(r)) return !1;
  808. return !0;
  809. }
  810. }
  811. }
  812. return !1;
  813. }(t.begin)) {
  814. var o = G().join("").indexOf(p.radixPoint);
  815. te(r, p.numericInput ? z(o) : o);
  816. break;
  817. }
  818. default:
  819. var s = t.begin, l = M(s, !0), u = z(l);
  820. if (s < u) te(r, U(s, !0) || U(s - 1, !0) ? s : z(s)); else {
  821. var c = E().validPositions[l], f = j(u, c ? c.match.locator : i, c), m = W(u, f.match);
  822. if ("" !== m && G()[u] !== m && !0 !== f.match.optionalQuantifier && !0 !== f.match.newBlockMarker || !U(u, p.keepStatic) && f.match.def === m) {
  823. var d = z(u);
  824. (s >= d || s === u) && (u = d);
  825. }
  826. te(r, u);
  827. }
  828. }
  829. }
  830. }, 0);
  831. },
  832. cutEvent: function(i) {
  833. e(this);
  834. var a = te(this), r = i.originalEvent || i, o = t.clipboardData || r.clipboardData, s = b ? G().slice(a.end, a.begin) : G().slice(a.begin, a.end);
  835. o.setData("text", b ? s.reverse().join("") : s.join("")), n.execCommand && n.execCommand("copy"),
  836. re(0, u.keyCode.DELETE, a), Q(this, G(), E().p, i, d !== G().join(""));
  837. },
  838. blurEvent: function(t) {
  839. var n = e(this);
  840. if (this.inputmask) {
  841. var a = this.inputmask._valueGet(), r = G().slice();
  842. "" === a && v === i || (p.clearMaskOnLostFocus && (-1 === M() && a === N().join("") ? r = [] : ie(r)),
  843. !1 === ae(r) && (setTimeout(function() {
  844. n.trigger("incomplete");
  845. }, 0), p.clearIncomplete && (w(), r = p.clearMaskOnLostFocus ? [] : N().slice())),
  846. Q(this, r, i, t)), d !== G().join("") && (d = r.join(""), n.trigger("change"));
  847. }
  848. },
  849. mouseenterEvent: function(e) {
  850. A = !0, n.activeElement !== this && p.showMaskOnHover && this.inputmask._valueGet() !== G().join("") && Q(this, G());
  851. },
  852. submitEvent: function(e) {
  853. d !== G().join("") && h.trigger("change"), p.clearMaskOnLostFocus && -1 === M() && y.inputmask._valueGet && y.inputmask._valueGet() === N().join("") && y.inputmask._valueSet(""),
  854. p.clearIncomplete && !1 === ae(G()) && y.inputmask._valueSet(""), p.removeMaskOnSubmit && (y.inputmask._valueSet(y.inputmask.unmaskedvalue(), !0),
  855. setTimeout(function() {
  856. Q(y, G());
  857. }, 0));
  858. },
  859. resetEvent: function(e) {
  860. y.inputmask.refreshValue = !0, setTimeout(function() {
  861. h.trigger("setvalue");
  862. }, 0);
  863. }
  864. };
  865. function Y(t, n, a, r, o) {
  866. var s = this || t.inputmask, l = r.slice(), c = "", f = -1, m = i;
  867. if (w(), a || !0 === p.autoUnmask) f = z(f); else {
  868. var d = N().slice(0, z(-1)).join(""), h = l.join("").match(new RegExp("^" + u.escapeRegex(d), "g"));
  869. h && h.length > 0 && (l.splice(0, h.length * d.length), f = z(f));
  870. }
  871. -1 === f ? (E().p = z(f), f = 0) : E().p = f, s.caretPos = {
  872. begin: f
  873. }, e.each(l, function(n, r) {
  874. if (r !== i) if (E().validPositions[n] === i && l[n] === W(n) && U(n, !0) && !1 === H(n, l[n], !0, i, i, !0)) E().p++; else {
  875. var o = new e.Event("_checkval");
  876. o.which = r.charCodeAt(0), c += r;
  877. var u = M(i, !0);
  878. !function(e, t) {
  879. return -1 !== C(!0, 0, !1).slice(e, z(e)).join("").replace(/'/g, "").indexOf(t) && !U(e) && (F(e).match.nativeDef === t.charAt(0) || null === F(e).match.fn && F(e).match.nativeDef === "'" + t.charAt(0) || " " === F(e).match.nativeDef && (F(e + 1).match.nativeDef === t.charAt(0) || null === F(e + 1).match.fn && F(e + 1).match.nativeDef === "'" + t.charAt(0)));
  880. }(f, c) ? (m = J.keypressEvent.call(t, o, !0, !1, a, s.caretPos.begin)) && (f = s.caretPos.begin + 1,
  881. c = "") : m = J.keypressEvent.call(t, o, !0, !1, a, u + 1), m && (Q(i, G(), m.forwardPosition, o, !1),
  882. s.caretPos = {
  883. begin: m.forwardPosition,
  884. end: m.forwardPosition
  885. });
  886. }
  887. }), n && Q(t, G(), m ? m.forwardPosition : i, o || new e.Event("checkval"), o && "input" === o.type);
  888. }
  889. function X(t) {
  890. if (t) {
  891. if (t.inputmask === i) return t.value;
  892. t.inputmask && t.inputmask.refreshValue && J.setValueEvent.call(t);
  893. }
  894. var n = [], a = E().validPositions;
  895. for (var r in a) a[r].match && null != a[r].match.fn && n.push(a[r].input);
  896. var o = 0 === n.length ? "" : (b ? n.reverse() : n).join("");
  897. if (e.isFunction(p.onUnMask)) {
  898. var s = (b ? G().slice().reverse() : G()).join("");
  899. o = p.onUnMask.call(k, s, o, p);
  900. }
  901. return o;
  902. }
  903. function ee(e) {
  904. return !b || "number" != typeof e || p.greedy && "" === p.placeholder || !y || (e = y.inputmask._valueGet().length - e),
  905. e;
  906. }
  907. function te(a, r, o, s) {
  908. var l;
  909. if (r === i) return a.setSelectionRange ? (r = a.selectionStart, o = a.selectionEnd) : t.getSelection ? (l = t.getSelection().getRangeAt(0)).commonAncestorContainer.parentNode !== a && l.commonAncestorContainer !== a || (r = l.startOffset,
  910. o = l.endOffset) : n.selection && n.selection.createRange && (o = (r = 0 - (l = n.selection.createRange()).duplicate().moveStart("character", -a.inputmask._valueGet().length)) + l.text.length),
  911. {
  912. begin: s ? r : ee(r),
  913. end: s ? o : ee(o)
  914. };
  915. if (e.isArray(r) && (o = b ? r[0] : r[1], r = b ? r[1] : r[0]), r.begin !== i && (o = b ? r.begin : r.end,
  916. r = b ? r.end : r.begin), "number" == typeof r) {
  917. r = s ? r : ee(r), o = "number" == typeof (o = s ? o : ee(o)) ? o : r;
  918. var u = parseInt(((a.ownerDocument.defaultView || t).getComputedStyle ? (a.ownerDocument.defaultView || t).getComputedStyle(a, null) : a.currentStyle).fontSize) * o;
  919. if (a.scrollLeft = u > a.scrollWidth ? u : 0, !1 === p.insertMode && r === o && o++,
  920. a.inputmask.caretPos = {
  921. begin: r,
  922. end: o
  923. }, a.setSelectionRange) a.selectionStart = r, a.selectionEnd = o; else if (t.getSelection) {
  924. if (l = n.createRange(), a.firstChild === i || null === a.firstChild) {
  925. var c = n.createTextNode("");
  926. a.appendChild(c);
  927. }
  928. l.setStart(a.firstChild, r < a.inputmask._valueGet().length ? r : a.inputmask._valueGet().length),
  929. l.setEnd(a.firstChild, o < a.inputmask._valueGet().length ? o : a.inputmask._valueGet().length),
  930. l.collapse(!0);
  931. var f = t.getSelection();
  932. f.removeAllRanges(), f.addRange(l);
  933. } else a.createTextRange && ((l = a.createTextRange()).collapse(!0), l.moveEnd("character", o),
  934. l.moveStart("character", r), l.select());
  935. se(a, {
  936. begin: r,
  937. end: o
  938. });
  939. }
  940. }
  941. function ne(t) {
  942. var n, a, r = C(!0, M(), !0, !0), o = r.length, s = M(), l = {}, u = E().validPositions[s], c = u !== i ? u.locator.slice() : i;
  943. for (n = s + 1; n < r.length; n++) c = (a = j(n, c, n - 1)).locator.slice(), l[n] = e.extend(!0, {}, a);
  944. var p = u && u.alternation !== i ? u.locator[u.alternation] : i;
  945. for (n = o - 1; n > s && ((a = l[n]).match.optionality || a.match.optionalQuantifier && a.match.newBlockMarker || p && (p !== l[n].locator[u.alternation] && null != a.match.fn || null === a.match.fn && a.locator[u.alternation] && B(a.locator[u.alternation].toString().split(","), p.toString().split(",")) && "" !== R(n)[0].def)) && r[n] === W(n, a.match); n--) o--;
  946. return t ? {
  947. l: o,
  948. def: l[o] ? l[o].match : i
  949. } : o;
  950. }
  951. function ie(e) {
  952. e.length = 0;
  953. for (var t, n = C(!0, 0, !0, i, !0); (t = n.shift()) !== i; ) e.push(t);
  954. return e;
  955. }
  956. function ae(t) {
  957. if (e.isFunction(p.isComplete)) return p.isComplete(t, p);
  958. if ("*" === p.repeat) return i;
  959. var n = !1, a = ne(!0), r = q(a.l);
  960. if (a.def === i || a.def.newBlockMarker || a.def.optionality || a.def.optionalQuantifier) {
  961. n = !0;
  962. for (var o = 0; o <= r; o++) {
  963. var s = j(o).match;
  964. if (null !== s.fn && E().validPositions[o] === i && !0 !== s.optionality && !0 !== s.optionalQuantifier || null === s.fn && t[o] !== W(o, s)) {
  965. n = !1;
  966. break;
  967. }
  968. }
  969. }
  970. return n;
  971. }
  972. function re(e, t, n, a, r) {
  973. if ((p.numericInput || b) && (t === u.keyCode.BACKSPACE ? t = u.keyCode.DELETE : t === u.keyCode.DELETE && (t = u.keyCode.BACKSPACE),
  974. b)) {
  975. var o = n.end;
  976. n.end = n.begin, n.begin = o;
  977. }
  978. if (t === u.keyCode.BACKSPACE && (n.end - n.begin < 1 || !1 === p.insertMode) ? (n.begin = q(n.begin),
  979. E().validPositions[n.begin] !== i && E().validPositions[n.begin].input === p.groupSeparator && n.begin--,
  980. !1 === p.insertMode && n.end !== E().maskLength && n.end--) : t === u.keyCode.DELETE && n.begin === n.end && (n.end = U(n.end, !0) && E().validPositions[n.end] && E().validPositions[n.end].input !== p.radixPoint ? n.end + 1 : z(n.end) + 1,
  981. E().validPositions[n.begin] !== i && E().validPositions[n.begin].input === p.groupSeparator && n.end++),
  982. K(n), !0 !== a && !1 !== p.keepStatic || null !== p.regex) {
  983. var s = L(!0);
  984. if (s) {
  985. var l = s.caret !== i ? s.caret : s.pos ? z(s.pos.begin ? s.pos.begin : s.pos) : M(-1, !0);
  986. (t !== u.keyCode.DELETE || n.begin > l) && n.begin;
  987. }
  988. }
  989. var c = M(n.begin, !0);
  990. if (c < n.begin || -1 === n.begin) E().p = z(c); else if (!0 !== a && (E().p = n.begin,
  991. !0 !== r)) for (;E().p < c && E().validPositions[E().p] === i; ) E().p++;
  992. }
  993. function oe(i) {
  994. var a = (i.ownerDocument.defaultView || t).getComputedStyle(i, null), r = n.createElement("div");
  995. r.style.width = a.width, r.style.textAlign = a.textAlign, v = n.createElement("div"),
  996. i.inputmask.colorMask = v, v.className = "im-colormask", i.parentNode.insertBefore(v, i),
  997. i.parentNode.removeChild(i), v.appendChild(i), v.appendChild(r), i.style.left = r.offsetLeft + "px",
  998. e(v).on("mouseleave", function(e) {
  999. return J.mouseleaveEvent.call(i, [ e ]);
  1000. }), e(v).on("mouseenter", function(e) {
  1001. return J.mouseenterEvent.call(i, [ e ]);
  1002. }), e(v).on("click", function(e) {
  1003. return te(i, function(e) {
  1004. var t, r = n.createElement("span");
  1005. for (var o in a) isNaN(o) && -1 !== o.indexOf("font") && (r.style[o] = a[o]);
  1006. r.style.textTransform = a.textTransform, r.style.letterSpacing = a.letterSpacing,
  1007. r.style.position = "absolute", r.style.height = "auto", r.style.width = "auto",
  1008. r.style.visibility = "hidden", r.style.whiteSpace = "nowrap", n.body.appendChild(r);
  1009. var s, l = i.inputmask._valueGet(), u = 0;
  1010. for (t = 0, s = l.length; t <= s; t++) {
  1011. if (r.innerHTML += l.charAt(t) || "_", r.offsetWidth >= e) {
  1012. var c = e - u, p = r.offsetWidth - e;
  1013. r.innerHTML = l.charAt(t), t = (c -= r.offsetWidth / 3) < p ? t - 1 : t;
  1014. break;
  1015. }
  1016. u = r.offsetWidth;
  1017. }
  1018. return n.body.removeChild(r), t;
  1019. }(e.clientX)), J.clickEvent.call(i, [ e ]);
  1020. }), e(i).on("keydown", function(e) {
  1021. e.shiftKey || !1 === p.insertMode || setTimeout(function() {
  1022. se(i);
  1023. }, 0);
  1024. });
  1025. }
  1026. function se(e, t, a) {
  1027. var r, o, s, l = [], u = !1, c = 0;
  1028. function f(e) {
  1029. if (e === i && (e = ""), u || null !== r.fn && o.input !== i) if (u && (null !== r.fn && o.input !== i || "" === r.def)) {
  1030. u = !1;
  1031. var t = l.length;
  1032. l[t - 1] = l[t - 1] + "</span>", l.push(e);
  1033. } else l.push(e); else u = !0, l.push("<span class='im-static'>" + e);
  1034. }
  1035. if (v !== i) {
  1036. var m = G();
  1037. if (t === i ? t = te(e) : t.begin === i && (t = {
  1038. begin: t,
  1039. end: t
  1040. }), !0 !== a) {
  1041. var d = M();
  1042. do {
  1043. E().validPositions[c] ? (o = E().validPositions[c], r = o.match, s = o.locator.slice(),
  1044. f(m[c])) : (o = j(c, s, c - 1), r = o.match, s = o.locator.slice(), !1 === p.jitMasking || c < d || "number" == typeof p.jitMasking && isFinite(p.jitMasking) && p.jitMasking > c ? f(W(c, r)) : u = !1),
  1045. c++;
  1046. } while ((g === i || c < g) && (null !== r.fn || "" !== r.def) || d > c || u);
  1047. u && f(), n.activeElement === e && (l.splice(t.begin, 0, t.begin === t.end || t.end > E().maskLength ? '<mark class="im-caret" style="border-right-width: 1px;border-right-style: solid;">' : '<mark class="im-caret-select">'),
  1048. l.splice(t.end + 1, 0, "</mark>"));
  1049. }
  1050. var h = v.getElementsByTagName("div")[0];
  1051. h.innerHTML = l.join(""), e.inputmask.positionColorMask(e, h);
  1052. }
  1053. }
  1054. if (u.prototype.positionColorMask = function(e, t) {
  1055. e.style.left = t.offsetLeft + "px";
  1056. }, a !== i) switch (a.action) {
  1057. case "isComplete":
  1058. return y = a.el, ae(G());
  1059. case "unmaskedvalue":
  1060. return y !== i && a.value === i || ($ = a.value, $ = (e.isFunction(p.onBeforeMask) && p.onBeforeMask.call(k, $, p) || $).split(""),
  1061. Y.call(this, i, !1, !1, $), e.isFunction(p.onBeforeWrite) && p.onBeforeWrite.call(k, i, G(), 0, p)),
  1062. X(y);
  1063. case "mask":
  1064. !function(t) {
  1065. Z.off(t);
  1066. var a = function(t, a) {
  1067. var r = t.getAttribute("type"), s = "INPUT" === t.tagName && -1 !== e.inArray(r, a.supportsInputType) || t.isContentEditable || "TEXTAREA" === t.tagName;
  1068. if (!s) if ("INPUT" === t.tagName) {
  1069. var l = n.createElement("input");
  1070. l.setAttribute("type", r), s = "text" === l.type, l = null;
  1071. } else s = "partial";
  1072. return !1 !== s ? function(t) {
  1073. var r, s;
  1074. function l() {
  1075. return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== M() || !0 !== a.nullable ? n.activeElement === this && a.clearMaskOnLostFocus ? (b ? ie(G().slice()).reverse() : ie(G().slice())).join("") : r.call(this) : "" : r.call(this);
  1076. }
  1077. function u(t) {
  1078. s.call(this, t), this.inputmask && e(this).trigger("setvalue", [ t ]);
  1079. }
  1080. if (!t.inputmask.__valueGet) {
  1081. if (!0 !== a.noValuePatching) {
  1082. if (Object.getOwnPropertyDescriptor) {
  1083. "function" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = "object" === o("test".__proto__) ? function(e) {
  1084. return e.__proto__;
  1085. } : function(e) {
  1086. return e.constructor.prototype;
  1087. });
  1088. var c = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t), "value") : i;
  1089. c && c.get && c.set ? (r = c.get, s = c.set, Object.defineProperty(t, "value", {
  1090. get: l,
  1091. set: u,
  1092. configurable: !0
  1093. })) : "INPUT" !== t.tagName && (r = function() {
  1094. return this.textContent;
  1095. }, s = function(e) {
  1096. this.textContent = e;
  1097. }, Object.defineProperty(t, "value", {
  1098. get: l,
  1099. set: u,
  1100. configurable: !0
  1101. }));
  1102. } else n.__lookupGetter__ && t.__lookupGetter__("value") && (r = t.__lookupGetter__("value"),
  1103. s = t.__lookupSetter__("value"), t.__defineGetter__("value", l), t.__defineSetter__("value", u));
  1104. t.inputmask.__valueGet = r, t.inputmask.__valueSet = s;
  1105. }
  1106. t.inputmask._valueGet = function(e) {
  1107. return b && !0 !== e ? r.call(this.el).split("").reverse().join("") : r.call(this.el);
  1108. }, t.inputmask._valueSet = function(e, t) {
  1109. s.call(this.el, null === e || e === i ? "" : !0 !== t && b ? e.split("").reverse().join("") : e);
  1110. }, r === i && (r = function() {
  1111. return this.value;
  1112. }, s = function(e) {
  1113. this.value = e;
  1114. }, function(t) {
  1115. if (e.valHooks && (e.valHooks[t] === i || !0 !== e.valHooks[t].inputmaskpatch)) {
  1116. var n = e.valHooks[t] && e.valHooks[t].get ? e.valHooks[t].get : function(e) {
  1117. return e.value;
  1118. }, r = e.valHooks[t] && e.valHooks[t].set ? e.valHooks[t].set : function(e, t) {
  1119. return e.value = t, e;
  1120. };
  1121. e.valHooks[t] = {
  1122. get: function(e) {
  1123. if (e.inputmask) {
  1124. if (e.inputmask.opts.autoUnmask) return e.inputmask.unmaskedvalue();
  1125. var t = n(e);
  1126. return -1 !== M(i, i, e.inputmask.maskset.validPositions) || !0 !== a.nullable ? t : "";
  1127. }
  1128. return n(e);
  1129. },
  1130. set: function(t, n) {
  1131. var i, a = e(t);
  1132. return i = r(t, n), t.inputmask && a.trigger("setvalue", [ n ]), i;
  1133. },
  1134. inputmaskpatch: !0
  1135. };
  1136. }
  1137. }(t.type), function(t) {
  1138. Z.on(t, "mouseenter", function(t) {
  1139. var n = e(this);
  1140. this.inputmask._valueGet() !== G().join("") && n.trigger("setvalue");
  1141. });
  1142. }(t));
  1143. }
  1144. }(t) : t.inputmask = i, s;
  1145. }(t, p);
  1146. if (!1 !== a && (h = e(y = t), -1 === (g = y !== i ? y.maxLength : i) && (g = i),
  1147. !0 === p.colorMask && oe(y), r && ("inputmode" in y && (y.inputmode = p.inputmode,
  1148. y.setAttribute("inputmode", p.inputmode)), !0 === p.disablePredictiveText && ("autocorrect" in y ? y.autocorrect = !1 : (!0 !== p.colorMask && oe(y),
  1149. y.type = "password"))), !0 === a && (Z.on(y, "submit", J.submitEvent), Z.on(y, "reset", J.resetEvent),
  1150. Z.on(y, "blur", J.blurEvent), Z.on(y, "focus", J.focusEvent), !0 !== p.colorMask && (Z.on(y, "click", J.clickEvent),
  1151. Z.on(y, "mouseleave", J.mouseleaveEvent), Z.on(y, "mouseenter", J.mouseenterEvent)),
  1152. Z.on(y, "paste", J.pasteEvent), Z.on(y, "cut", J.cutEvent), Z.on(y, "complete", p.oncomplete),
  1153. Z.on(y, "incomplete", p.onincomplete), Z.on(y, "cleared", p.oncleared), r || !0 === p.inputEventOnly ? y.removeAttribute("maxLength") : (Z.on(y, "keydown", J.keydownEvent),
  1154. Z.on(y, "keypress", J.keypressEvent)), Z.on(y, "input", J.inputFallBackEvent), Z.on(y, "beforeinput", J.beforeInputEvent)),
  1155. Z.on(y, "setvalue", J.setValueEvent), d = N().join(""), "" !== y.inputmask._valueGet(!0) || !1 === p.clearMaskOnLostFocus || n.activeElement === y)) {
  1156. var s = e.isFunction(p.onBeforeMask) && p.onBeforeMask.call(k, y.inputmask._valueGet(!0), p) || y.inputmask._valueGet(!0);
  1157. "" !== s && Y(y, !0, !1, s.split(""));
  1158. var l = G().slice();
  1159. d = l.join(""), !1 === ae(l) && p.clearIncomplete && w(), p.clearMaskOnLostFocus && n.activeElement !== y && (-1 === M() ? l = [] : ie(l)),
  1160. (!1 === p.clearMaskOnLostFocus || p.showMaskOnFocus && n.activeElement === y || "" !== y.inputmask._valueGet(!0)) && Q(y, l),
  1161. n.activeElement === y && te(y, z(M()));
  1162. }
  1163. }(y);
  1164. break;
  1165. case "format":
  1166. return $ = (e.isFunction(p.onBeforeMask) && p.onBeforeMask.call(k, a.value, p) || a.value).split(""),
  1167. Y.call(this, i, !0, !1, $), a.metadata ? {
  1168. value: b ? G().slice().reverse().join("") : G().join(""),
  1169. metadata: m.call(this, {
  1170. action: "getmetadata"
  1171. }, c, p)
  1172. } : b ? G().slice().reverse().join("") : G().join("");
  1173. case "isValid":
  1174. a.value ? ($ = a.value.split(""), Y.call(this, i, !0, !0, $)) : a.value = G().join("");
  1175. for (var le = G(), ue = ne(), ce = le.length - 1; ce > ue && !U(ce); ce--) ;
  1176. return le.splice(ue, ce + 1 - ue), ae(le) && a.value === G().join("");
  1177. case "getemptymask":
  1178. return N().join("");
  1179. case "remove":
  1180. return y && y.inputmask && (e.data(y, "_inputmask_opts", null), h = e(y), y.inputmask._valueSet(p.autoUnmask ? X(y) : y.inputmask._valueGet(!0)),
  1181. Z.off(y), y.inputmask.colorMask && ((v = y.inputmask.colorMask).removeChild(y),
  1182. v.parentNode.insertBefore(y, v), v.parentNode.removeChild(v)), Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(y), "value") && y.inputmask.__valueGet && Object.defineProperty(y, "value", {
  1183. get: y.inputmask.__valueGet,
  1184. set: y.inputmask.__valueSet,
  1185. configurable: !0
  1186. }) : n.__lookupGetter__ && y.__lookupGetter__("value") && y.inputmask.__valueGet && (y.__defineGetter__("value", y.inputmask.__valueGet),
  1187. y.__defineSetter__("value", y.inputmask.__valueSet)), y.inputmask = i), y;
  1188. case "getmetadata":
  1189. if (e.isArray(c.metadata)) {
  1190. var pe = C(!0, 0, !1).join("");
  1191. return e.each(c.metadata, function(e, t) {
  1192. if (t.mask === pe) return pe = t, !1;
  1193. }), pe;
  1194. }
  1195. return c.metadata;
  1196. }
  1197. }
  1198. return u.prototype = {
  1199. dataAttribute: "data-inputmask",
  1200. defaults: {
  1201. placeholder: "_",
  1202. optionalmarker: [ "[", "]" ],
  1203. quantifiermarker: [ "{", "}" ],
  1204. groupmarker: [ "(", ")" ],
  1205. alternatormarker: "|",
  1206. escapeChar: "\\",
  1207. mask: null,
  1208. regex: null,
  1209. oncomplete: e.noop,
  1210. onincomplete: e.noop,
  1211. oncleared: e.noop,
  1212. repeat: 0,
  1213. greedy: !1,
  1214. autoUnmask: !1,
  1215. removeMaskOnSubmit: !1,
  1216. clearMaskOnLostFocus: !0,
  1217. insertMode: !0,
  1218. clearIncomplete: !1,
  1219. alias: null,
  1220. onKeyDown: e.noop,
  1221. onBeforeMask: null,
  1222. onBeforePaste: function(t, n) {
  1223. return e.isFunction(n.onBeforeMask) ? n.onBeforeMask.call(this, t, n) : t;
  1224. },
  1225. onBeforeWrite: null,
  1226. onUnMask: null,
  1227. showMaskOnFocus: !0,
  1228. showMaskOnHover: !0,
  1229. onKeyValidation: e.noop,
  1230. skipOptionalPartCharacter: " ",
  1231. numericInput: !1,
  1232. rightAlign: !1,
  1233. undoOnEscape: !0,
  1234. radixPoint: "",
  1235. _radixDance: !1,
  1236. groupSeparator: "",
  1237. keepStatic: null,
  1238. positionCaretOnTab: !0,
  1239. tabThrough: !1,
  1240. supportsInputType: [ "text", "tel", "password", "search" ],
  1241. ignorables: [ 8, 9, 13, 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 ],
  1242. isComplete: null,
  1243. preValidation: null,
  1244. postValidation: null,
  1245. staticDefinitionSymbol: i,
  1246. jitMasking: !1,
  1247. nullable: !0,
  1248. inputEventOnly: !1,
  1249. noValuePatching: !1,
  1250. positionCaretOnClick: "lvp",
  1251. casing: null,
  1252. inputmode: "verbatim",
  1253. colorMask: !1,
  1254. disablePredictiveText: !1,
  1255. importDataAttributes: !0
  1256. },
  1257. definitions: {
  1258. 9: {
  1259. validator: "[0-91-9]",
  1260. definitionSymbol: "*"
  1261. },
  1262. a: {
  1263. validator: "[A-Za-zА-яЁёÀ-ÿµ]",
  1264. definitionSymbol: "*"
  1265. },
  1266. "*": {
  1267. validator: "[0-91-9A-Za-zА-яЁёÀ-ÿµ]"
  1268. }
  1269. },
  1270. aliases: {},
  1271. masksCache: {},
  1272. mask: function(a) {
  1273. var r = this;
  1274. return "string" == typeof a && (a = n.getElementById(a) || n.querySelectorAll(a)),
  1275. a = a.nodeName ? [ a ] : a, e.each(a, function(n, a) {
  1276. var o = e.extend(!0, {}, r.opts);
  1277. if (function(n, a, r, o) {
  1278. if (!0 === a.importDataAttributes) {
  1279. var s, l, u, p, f = function(e, a) {
  1280. null !== (a = a !== i ? a : n.getAttribute(o + "-" + e)) && ("string" == typeof a && (0 === e.indexOf("on") ? a = t[a] : "false" === a ? a = !1 : "true" === a && (a = !0)),
  1281. r[e] = a);
  1282. }, m = n.getAttribute(o);
  1283. if (m && "" !== m && (m = m.replace(/'/g, '"'), l = JSON.parse("{" + m + "}")),
  1284. l) for (p in u = i, l) if ("alias" === p.toLowerCase()) {
  1285. u = l[p];
  1286. break;
  1287. }
  1288. for (s in f("alias", u), r.alias && c(r.alias, r, a), a) {
  1289. if (l) for (p in u = i, l) if (p.toLowerCase() === s.toLowerCase()) {
  1290. u = l[p];
  1291. break;
  1292. }
  1293. f(s, u);
  1294. }
  1295. }
  1296. return e.extend(!0, a, r), ("rtl" === n.dir || a.rightAlign) && (n.style.textAlign = "right"),
  1297. ("rtl" === n.dir || a.numericInput) && (n.dir = "ltr", n.removeAttribute("dir"),
  1298. a.isRTL = !0), Object.keys(r).length;
  1299. }(a, o, e.extend(!0, {}, r.userOptions), r.dataAttribute)) {
  1300. var s = p(o, r.noMasksCache);
  1301. s !== i && (a.inputmask !== i && (a.inputmask.opts.autoUnmask = !0, a.inputmask.remove()),
  1302. a.inputmask = new u(i, i, !0), a.inputmask.opts = o, a.inputmask.noMasksCache = r.noMasksCache,
  1303. a.inputmask.userOptions = e.extend(!0, {}, r.userOptions), a.inputmask.isRTL = o.isRTL || o.numericInput,
  1304. a.inputmask.el = a, a.inputmask.maskset = s, e.data(a, "_inputmask_opts", o), m.call(a.inputmask, {
  1305. action: "mask"
  1306. }));
  1307. }
  1308. }), a && a[0] && a[0].inputmask || this;
  1309. },
  1310. option: function(t, n) {
  1311. return "string" == typeof t ? this.opts[t] : "object" === (void 0 === t ? "undefined" : o(t)) ? (e.extend(this.userOptions, t),
  1312. this.el && !0 !== n && this.mask(this.el), this) : void 0;
  1313. },
  1314. unmaskedvalue: function(e) {
  1315. return this.maskset = this.maskset || p(this.opts, this.noMasksCache), m.call(this, {
  1316. action: "unmaskedvalue",
  1317. value: e
  1318. });
  1319. },
  1320. remove: function() {
  1321. return m.call(this, {
  1322. action: "remove"
  1323. });
  1324. },
  1325. getemptymask: function() {
  1326. return this.maskset = this.maskset || p(this.opts, this.noMasksCache), m.call(this, {
  1327. action: "getemptymask"
  1328. });
  1329. },
  1330. hasMaskedValue: function() {
  1331. return !this.opts.autoUnmask;
  1332. },
  1333. isComplete: function() {
  1334. return this.maskset = this.maskset || p(this.opts, this.noMasksCache), m.call(this, {
  1335. action: "isComplete"
  1336. });
  1337. },
  1338. getmetadata: function() {
  1339. return this.maskset = this.maskset || p(this.opts, this.noMasksCache), m.call(this, {
  1340. action: "getmetadata"
  1341. });
  1342. },
  1343. isValid: function(e) {
  1344. return this.maskset = this.maskset || p(this.opts, this.noMasksCache), m.call(this, {
  1345. action: "isValid",
  1346. value: e
  1347. });
  1348. },
  1349. format: function(e, t) {
  1350. return this.maskset = this.maskset || p(this.opts, this.noMasksCache), m.call(this, {
  1351. action: "format",
  1352. value: e,
  1353. metadata: t
  1354. });
  1355. },
  1356. setValue: function(t) {
  1357. this.el && e(this.el).trigger("setvalue", [ t ]);
  1358. },
  1359. analyseMask: function(t, n, a) {
  1360. var r, o, s, l, c, p, f = /(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?(?:\|[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g, m = /\[\^?]?(?:[^\\\]]+|\\[\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, d = !1, h = new k(), g = [], v = [];
  1361. function k(e, t, n, i) {
  1362. this.matches = [], this.openGroup = e || !1, this.alternatorGroup = !1, this.isGroup = e || !1,
  1363. this.isOptional = t || !1, this.isQuantifier = n || !1, this.isAlternator = i || !1,
  1364. this.quantifier = {
  1365. min: 1,
  1366. max: 1
  1367. };
  1368. }
  1369. function y(t, r, o) {
  1370. o = o !== i ? o : t.matches.length;
  1371. var s = t.matches[o - 1];
  1372. if (n) 0 === r.indexOf("[") || d && /\\d|\\s|\\w]/i.test(r) || "." === r ? t.matches.splice(o++, 0, {
  1373. fn: new RegExp(r, a.casing ? "i" : ""),
  1374. optionality: !1,
  1375. newBlockMarker: s === i ? "master" : s.def !== r,
  1376. casing: null,
  1377. def: r,
  1378. placeholder: i,
  1379. nativeDef: r
  1380. }) : (d && (r = r[r.length - 1]), e.each(r.split(""), function(e, n) {
  1381. s = t.matches[o - 1], t.matches.splice(o++, 0, {
  1382. fn: null,
  1383. optionality: !1,
  1384. newBlockMarker: s === i ? "master" : s.def !== n && null !== s.fn,
  1385. casing: null,
  1386. def: a.staticDefinitionSymbol || n,
  1387. placeholder: a.staticDefinitionSymbol !== i ? n : i,
  1388. nativeDef: (d ? "'" : "") + n
  1389. });
  1390. })), d = !1; else {
  1391. var l = (a.definitions ? a.definitions[r] : i) || u.prototype.definitions[r];
  1392. l && !d ? t.matches.splice(o++, 0, {
  1393. fn: l.validator ? "string" == typeof l.validator ? new RegExp(l.validator, a.casing ? "i" : "") : new function() {
  1394. this.test = l.validator;
  1395. }() : new RegExp("."),
  1396. optionality: !1,
  1397. newBlockMarker: s === i ? "master" : s.def !== (l.definitionSymbol || r),
  1398. casing: l.casing,
  1399. def: l.definitionSymbol || r,
  1400. placeholder: l.placeholder,
  1401. nativeDef: r
  1402. }) : (t.matches.splice(o++, 0, {
  1403. fn: null,
  1404. optionality: !1,
  1405. newBlockMarker: s === i ? "master" : s.def !== r && null !== s.fn,
  1406. casing: null,
  1407. def: a.staticDefinitionSymbol || r,
  1408. placeholder: a.staticDefinitionSymbol !== i ? r : i,
  1409. nativeDef: (d ? "'" : "") + r
  1410. }), d = !1);
  1411. }
  1412. }
  1413. function b() {
  1414. if (g.length > 0) {
  1415. if (y(l = g[g.length - 1], o), l.isAlternator) {
  1416. c = g.pop();
  1417. for (var e = 0; e < c.matches.length; e++) c.matches[e].isGroup && (c.matches[e].isGroup = !1);
  1418. g.length > 0 ? (l = g[g.length - 1]).matches.push(c) : h.matches.push(c);
  1419. }
  1420. } else y(h, o);
  1421. }
  1422. function x(e) {
  1423. var t = new k(!0);
  1424. return t.openGroup = !1, t.matches = e, t;
  1425. }
  1426. for (n && (a.optionalmarker[0] = i, a.optionalmarker[1] = i); r = n ? m.exec(t) : f.exec(t); ) {
  1427. if (o = r[0], n) switch (o.charAt(0)) {
  1428. case "?":
  1429. o = "{0,1}";
  1430. break;
  1431. case "+":
  1432. case "*":
  1433. o = "{" + o + "}";
  1434. }
  1435. if (d) b(); else switch (o.charAt(0)) {
  1436. case "(?=":
  1437. case "(?!":
  1438. case "(?<=":
  1439. case "(?<!":
  1440. break;
  1441. case a.escapeChar:
  1442. d = !0, n && b();
  1443. break;
  1444. case a.optionalmarker[1]:
  1445. case a.groupmarker[1]:
  1446. if ((s = g.pop()).openGroup = !1, s !== i) if (g.length > 0) {
  1447. if ((l = g[g.length - 1]).matches.push(s), l.isAlternator) {
  1448. c = g.pop();
  1449. for (var P = 0; P < c.matches.length; P++) c.matches[P].isGroup = !1, c.matches[P].alternatorGroup = !1;
  1450. g.length > 0 ? (l = g[g.length - 1]).matches.push(c) : h.matches.push(c);
  1451. }
  1452. } else h.matches.push(s); else b();
  1453. break;
  1454. case a.optionalmarker[0]:
  1455. g.push(new k(!1, !0));
  1456. break;
  1457. case a.groupmarker[0]:
  1458. g.push(new k(!0));
  1459. break;
  1460. case a.quantifiermarker[0]:
  1461. var S = new k(!1, !1, !0), A = (o = o.replace(/[{}]/g, "")).split("|"), C = A[0].split(","), E = isNaN(C[0]) ? C[0] : parseInt(C[0]), w = 1 === C.length ? E : isNaN(C[1]) ? C[1] : parseInt(C[1]);
  1462. "*" !== E && "+" !== E || (E = "*" === w ? 0 : 1), S.quantifier = {
  1463. min: E,
  1464. max: w,
  1465. jit: A[1]
  1466. };
  1467. var M = g.length > 0 ? g[g.length - 1].matches : h.matches;
  1468. if ((r = M.pop()).isAlternator) {
  1469. M.push(r), M = r.matches;
  1470. var D = new k(!0), O = M.pop();
  1471. M.push(D), M = D.matches, r = O;
  1472. }
  1473. r.isGroup || (r = x([ r ])), M.push(r), M.push(S);
  1474. break;
  1475. case a.alternatormarker:
  1476. var _ = function(e) {
  1477. var t = e.pop();
  1478. return t.isQuantifier && (t = x([ e.pop(), t ])), t;
  1479. };
  1480. if (g.length > 0) {
  1481. var j = (l = g[g.length - 1]).matches[l.matches.length - 1];
  1482. p = l.openGroup && (j.matches === i || !1 === j.isGroup && !1 === j.isAlternator) ? g.pop() : _(l.matches);
  1483. } else p = _(h.matches);
  1484. if (p.isAlternator) g.push(p); else if (p.alternatorGroup ? (c = g.pop(), p.alternatorGroup = !1) : c = new k(!1, !1, !1, !0),
  1485. c.matches.push(p), g.push(c), p.openGroup) {
  1486. p.openGroup = !1;
  1487. var F = new k(!0);
  1488. F.alternatorGroup = !0, g.push(F);
  1489. }
  1490. break;
  1491. default:
  1492. b();
  1493. }
  1494. }
  1495. for (;g.length > 0; ) s = g.pop(), h.matches.push(s);
  1496. return h.matches.length > 0 && (function t(r) {
  1497. r && r.matches && e.each(r.matches, function(e, o) {
  1498. var s = r.matches[e + 1];
  1499. (s === i || s.matches === i || !1 === s.isQuantifier) && o && o.isGroup && (o.isGroup = !1,
  1500. n || (y(o, a.groupmarker[0], 0), !0 !== o.openGroup && y(o, a.groupmarker[1]))),
  1501. t(o);
  1502. });
  1503. }(h), v.push(h)), (a.numericInput || a.isRTL) && function e(t) {
  1504. for (var n in t.matches = t.matches.reverse(), t.matches) if (t.matches.hasOwnProperty(n)) {
  1505. var r = parseInt(n);
  1506. if (t.matches[n].isQuantifier && t.matches[r + 1] && t.matches[r + 1].isGroup) {
  1507. var o = t.matches[n];
  1508. t.matches.splice(n, 1), t.matches.splice(r + 1, 0, o);
  1509. }
  1510. t.matches[n].matches !== i ? t.matches[n] = e(t.matches[n]) : t.matches[n] = ((s = t.matches[n]) === a.optionalmarker[0] ? s = a.optionalmarker[1] : s === a.optionalmarker[1] ? s = a.optionalmarker[0] : s === a.groupmarker[0] ? s = a.groupmarker[1] : s === a.groupmarker[1] && (s = a.groupmarker[0]),
  1511. s);
  1512. }
  1513. var s;
  1514. return t;
  1515. }(v[0]), v;
  1516. }
  1517. }, u.extendDefaults = function(t) {
  1518. e.extend(!0, u.prototype.defaults, t);
  1519. }, u.extendDefinitions = function(t) {
  1520. e.extend(!0, u.prototype.definitions, t);
  1521. }, u.extendAliases = function(t) {
  1522. e.extend(!0, u.prototype.aliases, t);
  1523. }, u.format = function(e, t, n) {
  1524. return u(t).format(e, n);
  1525. }, u.unmask = function(e, t) {
  1526. return u(t).unmaskedvalue(e);
  1527. }, u.isValid = function(e, t) {
  1528. return u(t).isValid(e);
  1529. }, u.remove = function(t) {
  1530. "string" == typeof t && (t = n.getElementById(t) || n.querySelectorAll(t)), t = t.nodeName ? [ t ] : t,
  1531. e.each(t, function(e, t) {
  1532. t.inputmask && t.inputmask.remove();
  1533. });
  1534. }, u.setValue = function(t, i) {
  1535. "string" == typeof t && (t = n.getElementById(t) || n.querySelectorAll(t)), t = t.nodeName ? [ t ] : t,
  1536. e.each(t, function(t, n) {
  1537. n.inputmask ? n.inputmask.setValue(i) : e(n).trigger("setvalue", [ i ]);
  1538. });
  1539. }, u.escapeRegex = function(e) {
  1540. return e.replace(new RegExp("(\\" + [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ].join("|\\") + ")", "gim"), "\\$1");
  1541. }, u.keyCode = {
  1542. BACKSPACE: 8,
  1543. BACKSPACE_SAFARI: 127,
  1544. DELETE: 46,
  1545. DOWN: 40,
  1546. END: 35,
  1547. ENTER: 13,
  1548. ESCAPE: 27,
  1549. HOME: 36,
  1550. INSERT: 45,
  1551. LEFT: 37,
  1552. PAGE_DOWN: 34,
  1553. PAGE_UP: 33,
  1554. RIGHT: 39,
  1555. SPACE: 32,
  1556. TAB: 9,
  1557. UP: 38,
  1558. X: 88,
  1559. CONTROL: 17
  1560. }, u;
  1561. }) ? i.apply(t, a) : i) || (e.exports = r);
  1562. }, function(e, t, n) {
  1563. "use strict";
  1564. var i, a, r;
  1565. "function" == typeof Symbol && Symbol.iterator, a = [ n(2) ], void 0 === (r = "function" == typeof (i = function(e) {
  1566. return e;
  1567. }) ? i.apply(t, a) : i) || (e.exports = r);
  1568. }, function(e, t) {
  1569. e.exports = jQuery;
  1570. }, function(e, t, n) {
  1571. "use strict";
  1572. var i, a, r, o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
  1573. return typeof e;
  1574. } : function(e) {
  1575. return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  1576. };
  1577. a = [ n(2), n(0) ], void 0 === (r = "function" == typeof (i = function(e, t) {
  1578. return void 0 === e.fn.inputmask && (e.fn.inputmask = function(n, i) {
  1579. var a, r = this[0];
  1580. if (void 0 === i && (i = {}), "string" == typeof n) switch (n) {
  1581. case "unmaskedvalue":
  1582. return r && r.inputmask ? r.inputmask.unmaskedvalue() : e(r).val();
  1583. case "remove":
  1584. return this.each(function() {
  1585. this.inputmask && this.inputmask.remove();
  1586. });
  1587. case "getemptymask":
  1588. return r && r.inputmask ? r.inputmask.getemptymask() : "";
  1589. case "hasMaskedValue":
  1590. return !(!r || !r.inputmask) && r.inputmask.hasMaskedValue();
  1591. case "isComplete":
  1592. return !r || !r.inputmask || r.inputmask.isComplete();
  1593. case "getmetadata":
  1594. return r && r.inputmask ? r.inputmask.getmetadata() : void 0;
  1595. case "setvalue":
  1596. t.setValue(r, i);
  1597. break;
  1598. case "option":
  1599. if ("string" != typeof i) return this.each(function() {
  1600. if (void 0 !== this.inputmask) return this.inputmask.option(i);
  1601. });
  1602. if (r && void 0 !== r.inputmask) return r.inputmask.option(i);
  1603. break;
  1604. default:
  1605. return i.alias = n, a = new t(i), this.each(function() {
  1606. a.mask(this);
  1607. });
  1608. } else {
  1609. if ("object" == (void 0 === n ? "undefined" : o(n))) return a = new t(n), void 0 === n.mask && void 0 === n.alias ? this.each(function() {
  1610. if (void 0 !== this.inputmask) return this.inputmask.option(n);
  1611. a.mask(this);
  1612. }) : this.each(function() {
  1613. a.mask(this);
  1614. });
  1615. if (void 0 === n) return this.each(function() {
  1616. (a = new t(i)).mask(this);
  1617. });
  1618. }
  1619. }), e.fn.inputmask;
  1620. }) ? i.apply(t, a) : i) || (e.exports = r);
  1621. }, function(e, t, n) {
  1622. "use strict";
  1623. var i, a, r;
  1624. "function" == typeof Symbol && Symbol.iterator, a = [ n(1), n(0) ], void 0 === (r = "function" == typeof (i = function(e, t) {
  1625. function n(e, t) {
  1626. var n = (e.mask || e).replace(/#/g, "0").replace(/\)/, "0").replace(/[+()#-]/g, ""), i = (t.mask || t).replace(/#/g, "0").replace(/\)/, "0").replace(/[+()#-]/g, "");
  1627. return n.localeCompare(i);
  1628. }
  1629. var i = t.prototype.analyseMask;
  1630. return t.prototype.analyseMask = function(t, n, a) {
  1631. var r = {};
  1632. return a.phoneCodes && (a.phoneCodes && a.phoneCodes.length > 1e3 && (function e(n, i, a) {
  1633. i = i || "", a = a || r, "" !== i && (a[i] = {});
  1634. for (var o = "", s = a[i] || a, l = n.length - 1; l >= 0; l--) s[o = (t = n[l].mask || n[l]).substr(0, 1)] = s[o] || [],
  1635. s[o].unshift(t.substr(1)), n.splice(l, 1);
  1636. for (var u in s) s[u].length > 500 && e(s[u].slice(), u, s);
  1637. }((t = t.substr(1, t.length - 2)).split(a.groupmarker[1] + a.alternatormarker + a.groupmarker[0])),
  1638. t = function t(n) {
  1639. var i = "", r = [];
  1640. for (var o in n) e.isArray(n[o]) ? 1 === n[o].length ? r.push(o + n[o]) : r.push(o + a.groupmarker[0] + n[o].join(a.groupmarker[1] + a.alternatormarker + a.groupmarker[0]) + a.groupmarker[1]) : r.push(o + t(n[o]));
  1641. return 1 === r.length ? i += r[0] : i += a.groupmarker[0] + r.join(a.groupmarker[1] + a.alternatormarker + a.groupmarker[0]) + a.groupmarker[1],
  1642. i;
  1643. }(r)), t = t.replace(/9/g, "\\9")), i.call(this, t, n, a);
  1644. }, t.extendAliases({
  1645. abstractphone: {
  1646. groupmarker: [ "<", ">" ],
  1647. countrycode: "",
  1648. phoneCodes: [],
  1649. keepStatic: "auto",
  1650. mask: function(e) {
  1651. return e.definitions = {
  1652. "#": t.prototype.definitions[9]
  1653. }, e.phoneCodes.sort(n);
  1654. },
  1655. onBeforeMask: function(e, t) {
  1656. var n = e.replace(/^0{1,2}/, "").replace(/[\s]/g, "");
  1657. return (n.indexOf(t.countrycode) > 1 || -1 === n.indexOf(t.countrycode)) && (n = "+" + t.countrycode + n),
  1658. n;
  1659. },
  1660. onUnMask: function(e, t, n) {
  1661. return e.replace(/[()#-]/g, "");
  1662. },
  1663. inputmode: "tel"
  1664. }
  1665. }), t;
  1666. }) ? i.apply(t, a) : i) || (e.exports = r);
  1667. }, function(e, t, n) {
  1668. "use strict";
  1669. var i, a, r;
  1670. "function" == typeof Symbol && Symbol.iterator, a = [ n(1), n(0) ], void 0 === (r = "function" == typeof (i = function(e, t, n) {
  1671. function i(e, n) {
  1672. for (var i = "", a = 0; a < e.length; a++) t.prototype.definitions[e.charAt(a)] || n.definitions[e.charAt(a)] || n.optionalmarker.start === e.charAt(a) || n.optionalmarker.end === e.charAt(a) || n.quantifiermarker.start === e.charAt(a) || n.quantifiermarker.end === e.charAt(a) || n.groupmarker.start === e.charAt(a) || n.groupmarker.end === e.charAt(a) || n.alternatormarker === e.charAt(a) ? i += "\\" + e.charAt(a) : i += e.charAt(a);
  1673. return i;
  1674. }
  1675. return t.extendAliases({
  1676. numeric: {
  1677. mask: function(e) {
  1678. if (0 !== e.repeat && isNaN(e.integerDigits) && (e.integerDigits = e.repeat), e.repeat = 0,
  1679. e.groupSeparator === e.radixPoint && e.digits && "0" !== e.digits && ("." === e.radixPoint ? e.groupSeparator = "," : "," === e.radixPoint ? e.groupSeparator = "." : e.groupSeparator = ""),
  1680. " " === e.groupSeparator && (e.skipOptionalPartCharacter = n), e.autoGroup = e.autoGroup && "" !== e.groupSeparator,
  1681. e.autoGroup && ("string" == typeof e.groupSize && isFinite(e.groupSize) && (e.groupSize = parseInt(e.groupSize)),
  1682. isFinite(e.integerDigits))) {
  1683. var t = Math.floor(e.integerDigits / e.groupSize), a = e.integerDigits % e.groupSize;
  1684. e.integerDigits = parseInt(e.integerDigits) + (0 === a ? t - 1 : t), e.integerDigits < 1 && (e.integerDigits = "*");
  1685. }
  1686. e.placeholder.length > 1 && (e.placeholder = e.placeholder.charAt(0)), "radixFocus" === e.positionCaretOnClick && "" === e.placeholder && !1 === e.integerOptional && (e.positionCaretOnClick = "lvp"),
  1687. e.definitions[";"] = e.definitions["~"], e.definitions[";"].definitionSymbol = "~",
  1688. !0 === e.numericInput && (e.positionCaretOnClick = "radixFocus" === e.positionCaretOnClick ? "lvp" : e.positionCaretOnClick,
  1689. e.digitsOptional = !1, isNaN(e.digits) && (e.digits = 2), e.decimalProtect = !1);
  1690. var r = "[+]";
  1691. if (r += i(e.prefix, e), !0 === e.integerOptional ? r += "~{1," + e.integerDigits + "}" : r += "~{" + e.integerDigits + "}",
  1692. e.digits !== n) {
  1693. var o = e.decimalProtect ? ":" : e.radixPoint, s = e.digits.toString().split(",");
  1694. isFinite(s[0]) && s[1] && isFinite(s[1]) ? r += o + ";{" + e.digits + "}" : (isNaN(e.digits) || parseInt(e.digits) > 0) && (e.digitsOptional ? r += "[" + o + ";{1," + e.digits + "}]" : r += o + ";{" + e.digits + "}");
  1695. }
  1696. return r += i(e.suffix, e), r += "[-]", e.greedy = !1, r;
  1697. },
  1698. placeholder: "",
  1699. greedy: !1,
  1700. digits: "*",
  1701. digitsOptional: !0,
  1702. enforceDigitsOnBlur: !1,
  1703. radixPoint: ".",
  1704. positionCaretOnClick: "radixFocus",
  1705. groupSize: 3,
  1706. groupSeparator: "",
  1707. autoGroup: !1,
  1708. allowMinus: !0,
  1709. negationSymbol: {
  1710. front: "-",
  1711. back: ""
  1712. },
  1713. integerDigits: "+",
  1714. integerOptional: !0,
  1715. prefix: "",
  1716. suffix: "",
  1717. rightAlign: !0,
  1718. decimalProtect: !0,
  1719. min: null,
  1720. max: null,
  1721. step: 1,
  1722. insertMode: !0,
  1723. autoUnmask: !1,
  1724. unmaskAsNumber: !1,
  1725. inputmode: "numeric",
  1726. preValidation: function(t, i, a, r, o, s) {
  1727. if ("-" === a || a === o.negationSymbol.front) return !0 === o.allowMinus && (o.isNegative = o.isNegative === n || !o.isNegative,
  1728. "" === t.join("") || {
  1729. caret: i,
  1730. dopost: !0
  1731. });
  1732. if (!1 === r && a === o.radixPoint && o.digits !== n && (isNaN(o.digits) || parseInt(o.digits) > 0)) {
  1733. var l = e.inArray(o.radixPoint, t);
  1734. if (-1 !== l && s.validPositions[l] !== n) return !0 === o.numericInput ? i === l : {
  1735. caret: l + 1
  1736. };
  1737. }
  1738. return !0;
  1739. },
  1740. postValidation: function(i, a, r) {
  1741. var o = r.suffix.split(""), s = r.prefix.split("");
  1742. if (a.pos === n && a.caret !== n && !0 !== a.dopost) return a;
  1743. var l = a.caret !== n ? a.caret : a.pos, u = i.slice();
  1744. r.numericInput && (l = u.length - l - 1, u = u.reverse());
  1745. var c = u[l];
  1746. if (c === r.groupSeparator && (c = u[l += 1]), l === u.length - r.suffix.length - 1 && c === r.radixPoint) return a;
  1747. c !== n && c !== r.radixPoint && c !== r.negationSymbol.front && c !== r.negationSymbol.back && (u[l] = "?",
  1748. r.prefix.length > 0 && l >= (!1 === r.isNegative ? 1 : 0) && l < r.prefix.length - 1 + (!1 === r.isNegative ? 1 : 0) ? s[l - (!1 === r.isNegative ? 1 : 0)] = "?" : r.suffix.length > 0 && l >= u.length - r.suffix.length - (!1 === r.isNegative ? 1 : 0) && (o[l - (u.length - r.suffix.length - (!1 === r.isNegative ? 1 : 0))] = "?")),
  1749. s = s.join(""), o = o.join("");
  1750. var p = u.join("").replace(s, "");
  1751. if (p = (p = (p = (p = p.replace(o, "")).replace(new RegExp(t.escapeRegex(r.groupSeparator), "g"), "")).replace(new RegExp("[-" + t.escapeRegex(r.negationSymbol.front) + "]", "g"), "")).replace(new RegExp(t.escapeRegex(r.negationSymbol.back) + "$"), ""),
  1752. isNaN(r.placeholder) && (p = p.replace(new RegExp(t.escapeRegex(r.placeholder), "g"), "")),
  1753. p.length > 1 && 1 !== p.indexOf(r.radixPoint) && ("0" === c && (p = p.replace(/^\?/g, "")),
  1754. p = p.replace(/^0/g, "")), p.charAt(0) === r.radixPoint && "" !== r.radixPoint && !0 !== r.numericInput && (p = "0" + p),
  1755. "" !== p) {
  1756. if (p = p.split(""), (!r.digitsOptional || r.enforceDigitsOnBlur && "blur" === a.event) && isFinite(r.digits)) {
  1757. var f = e.inArray(r.radixPoint, p), m = e.inArray(r.radixPoint, u);
  1758. -1 === f && (p.push(r.radixPoint), f = p.length - 1);
  1759. for (var d = 1; d <= r.digits; d++) r.digitsOptional && (!r.enforceDigitsOnBlur || "blur" !== a.event) || p[f + d] !== n && p[f + d] !== r.placeholder.charAt(0) ? -1 !== m && u[m + d] !== n && (p[f + d] = p[f + d] || u[m + d]) : p[f + d] = a.placeholder || r.placeholder.charAt(0);
  1760. }
  1761. if (!0 !== r.autoGroup || "" === r.groupSeparator || c === r.radixPoint && a.pos === n && !a.dopost) p = p.join(""); else {
  1762. var h = p[p.length - 1] === r.radixPoint && a.c === r.radixPoint;
  1763. p = t(function(e, t) {
  1764. var n = "";
  1765. if (n += "(" + t.groupSeparator + "*{" + t.groupSize + "}){*}", "" !== t.radixPoint) {
  1766. var i = e.join("").split(t.radixPoint);
  1767. i[1] && (n += t.radixPoint + "*{" + i[1].match(/^\d*\??\d*/)[0].length + "}");
  1768. }
  1769. return n;
  1770. }(p, r), {
  1771. numericInput: !0,
  1772. jitMasking: !0,
  1773. definitions: {
  1774. "*": {
  1775. validator: "[0-9?]",
  1776. cardinality: 1
  1777. }
  1778. }
  1779. }).format(p.join("")), h && (p += r.radixPoint), p.charAt(0) === r.groupSeparator && p.substr(1);
  1780. }
  1781. }
  1782. if (r.isNegative && "blur" === a.event && (r.isNegative = "0" !== p), p = s + p,
  1783. p += o, r.isNegative && (p = r.negationSymbol.front + p, p += r.negationSymbol.back),
  1784. p = p.split(""), c !== n) if (c !== r.radixPoint && c !== r.negationSymbol.front && c !== r.negationSymbol.back) (l = e.inArray("?", p)) > -1 ? p[l] = c : l = a.caret || 0; else if (c === r.radixPoint || c === r.negationSymbol.front || c === r.negationSymbol.back) {
  1785. var g = e.inArray(c, p);
  1786. -1 !== g && (l = g);
  1787. }
  1788. r.numericInput && (l = p.length - l - 1, p = p.reverse());
  1789. var v = {
  1790. caret: c === n || a.pos !== n ? l + (r.numericInput ? -1 : 1) : l,
  1791. buffer: p,
  1792. refreshFromBuffer: a.dopost || i.join("") !== p.join("")
  1793. };
  1794. return v.refreshFromBuffer ? v : a;
  1795. },
  1796. onBeforeWrite: function(i, a, r, o) {
  1797. if (i) switch (i.type) {
  1798. case "keydown":
  1799. return o.postValidation(a, {
  1800. caret: r,
  1801. dopost: !0
  1802. }, o);
  1803. case "blur":
  1804. case "checkval":
  1805. var s;
  1806. if (function(e) {
  1807. e.parseMinMaxOptions === n && (null !== e.min && (e.min = e.min.toString().replace(new RegExp(t.escapeRegex(e.groupSeparator), "g"), ""),
  1808. "," === e.radixPoint && (e.min = e.min.replace(e.radixPoint, ".")), e.min = isFinite(e.min) ? parseFloat(e.min) : NaN,
  1809. isNaN(e.min) && (e.min = Number.MIN_VALUE)), null !== e.max && (e.max = e.max.toString().replace(new RegExp(t.escapeRegex(e.groupSeparator), "g"), ""),
  1810. "," === e.radixPoint && (e.max = e.max.replace(e.radixPoint, ".")), e.max = isFinite(e.max) ? parseFloat(e.max) : NaN,
  1811. isNaN(e.max) && (e.max = Number.MAX_VALUE)), e.parseMinMaxOptions = "done");
  1812. }(o), null !== o.min || null !== o.max) {
  1813. if (s = o.onUnMask(a.join(""), n, e.extend({}, o, {
  1814. unmaskAsNumber: !0
  1815. })), null !== o.min && s < o.min) return o.isNegative = o.min < 0, o.postValidation(o.min.toString().replace(".", o.radixPoint).split(""), {
  1816. caret: r,
  1817. dopost: !0,
  1818. placeholder: "0"
  1819. }, o);
  1820. if (null !== o.max && s > o.max) return o.isNegative = o.max < 0, o.postValidation(o.max.toString().replace(".", o.radixPoint).split(""), {
  1821. caret: r,
  1822. dopost: !0,
  1823. placeholder: "0"
  1824. }, o);
  1825. }
  1826. return o.postValidation(a, {
  1827. caret: r,
  1828. placeholder: "0",
  1829. event: "blur"
  1830. }, o);
  1831. case "_checkval":
  1832. return {
  1833. caret: r
  1834. };
  1835. }
  1836. },
  1837. regex: {
  1838. integerPart: function(e, n) {
  1839. return n ? new RegExp("[" + t.escapeRegex(e.negationSymbol.front) + "+]?") : new RegExp("[" + t.escapeRegex(e.negationSymbol.front) + "+]?\\d+");
  1840. },
  1841. integerNPart: function(e) {
  1842. return new RegExp("[\\d" + t.escapeRegex(e.groupSeparator) + t.escapeRegex(e.placeholder.charAt(0)) + "]+");
  1843. }
  1844. },
  1845. definitions: {
  1846. "~": {
  1847. validator: function(e, i, a, r, o, s) {
  1848. var l;
  1849. if ("k" === e || "m" === e) {
  1850. l = {
  1851. insert: [],
  1852. c: 0
  1853. };
  1854. for (var u = 0, c = "k" === e ? 2 : 5; u < c; u++) l.insert.push({
  1855. pos: a + u,
  1856. c: 0
  1857. });
  1858. return l.pos = a + c, l;
  1859. }
  1860. if (!0 === (l = r ? new RegExp("[0-9" + t.escapeRegex(o.groupSeparator) + "]").test(e) : new RegExp("[0-9]").test(e))) {
  1861. if (!0 !== o.numericInput && i.validPositions[a] !== n && "~" === i.validPositions[a].match.def && !s) {
  1862. var p = i.buffer.join(""), f = (p = (p = p.replace(new RegExp("[-" + t.escapeRegex(o.negationSymbol.front) + "]", "g"), "")).replace(new RegExp(t.escapeRegex(o.negationSymbol.back) + "$"), "")).split(o.radixPoint);
  1863. f.length > 1 && (f[1] = f[1].replace(/0/g, o.placeholder.charAt(0))), "0" === f[0] && (f[0] = f[0].replace(/0/g, o.placeholder.charAt(0))),
  1864. p = f[0] + o.radixPoint + f[1] || "";
  1865. var m = i._buffer.join("");
  1866. for (p === o.radixPoint && (p = m); null === p.match(t.escapeRegex(m) + "$"); ) m = m.slice(1);
  1867. l = (p = (p = p.replace(m, "")).split(""))[a] === n ? {
  1868. pos: a,
  1869. remove: a
  1870. } : {
  1871. pos: a
  1872. };
  1873. }
  1874. } else r || e !== o.radixPoint || i.validPositions[a - 1] !== n || (l = {
  1875. insert: {
  1876. pos: a,
  1877. c: 0
  1878. },
  1879. pos: a + 1
  1880. });
  1881. return l;
  1882. },
  1883. cardinality: 1
  1884. },
  1885. "+": {
  1886. validator: function(e, t, n, i, a) {
  1887. return a.allowMinus && ("-" === e || e === a.negationSymbol.front);
  1888. },
  1889. cardinality: 1,
  1890. placeholder: ""
  1891. },
  1892. "-": {
  1893. validator: function(e, t, n, i, a) {
  1894. return a.allowMinus && e === a.negationSymbol.back;
  1895. },
  1896. cardinality: 1,
  1897. placeholder: ""
  1898. },
  1899. ":": {
  1900. validator: function(e, n, i, a, r) {
  1901. var o = "[" + t.escapeRegex(r.radixPoint) + "]", s = new RegExp(o).test(e);
  1902. return s && n.validPositions[i] && n.validPositions[i].match.placeholder === r.radixPoint && (s = {
  1903. caret: i + 1
  1904. }), s;
  1905. },
  1906. cardinality: 1,
  1907. placeholder: function(e) {
  1908. return e.radixPoint;
  1909. }
  1910. }
  1911. },
  1912. onUnMask: function(e, n, i) {
  1913. if ("" === n && !0 === i.nullable) return n;
  1914. var a = e.replace(i.prefix, "");
  1915. return a = (a = a.replace(i.suffix, "")).replace(new RegExp(t.escapeRegex(i.groupSeparator), "g"), ""),
  1916. "" !== i.placeholder.charAt(0) && (a = a.replace(new RegExp(i.placeholder.charAt(0), "g"), "0")),
  1917. i.unmaskAsNumber ? ("" !== i.radixPoint && -1 !== a.indexOf(i.radixPoint) && (a = a.replace(t.escapeRegex.call(this, i.radixPoint), ".")),
  1918. a = (a = a.replace(new RegExp("^" + t.escapeRegex(i.negationSymbol.front)), "-")).replace(new RegExp(t.escapeRegex(i.negationSymbol.back) + "$"), ""),
  1919. Number(a)) : a;
  1920. },
  1921. isComplete: function(e, n) {
  1922. var i = (n.numericInput ? e.slice().reverse() : e).join("");
  1923. return i = (i = (i = (i = (i = i.replace(new RegExp("^" + t.escapeRegex(n.negationSymbol.front)), "-")).replace(new RegExp(t.escapeRegex(n.negationSymbol.back) + "$"), "")).replace(n.prefix, "")).replace(n.suffix, "")).replace(new RegExp(t.escapeRegex(n.groupSeparator) + "([0-9]{3})", "g"), "$1"),
  1924. "," === n.radixPoint && (i = i.replace(t.escapeRegex(n.radixPoint), ".")), isFinite(i);
  1925. },
  1926. onBeforeMask: function(i, a) {
  1927. if (a.isNegative = n, "number" == typeof i && "" !== a.radixPoint && (i = i.toString().replace(".", a.radixPoint)),
  1928. i = i.toString().charAt(i.length - 1) === a.radixPoint ? i.toString().substr(0, i.length - 1) : i.toString(),
  1929. "" !== a.radixPoint && isFinite(i)) {
  1930. var r = i.split("."), o = "" !== a.groupSeparator ? parseInt(a.groupSize) : 0;
  1931. 2 === r.length && (r[0].length > o || r[1].length > o || r[0].length <= o && r[1].length < o) && (i = i.replace(".", a.radixPoint));
  1932. }
  1933. var s = i.match(/,/g), l = i.match(/\./g);
  1934. if (i = l && s ? l.length > s.length ? (i = i.replace(/\./g, "")).replace(",", a.radixPoint) : s.length > l.length ? (i = i.replace(/,/g, "")).replace(".", a.radixPoint) : i.indexOf(".") < i.indexOf(",") ? i.replace(/\./g, "") : i.replace(/,/g, "") : i.replace(new RegExp(t.escapeRegex(a.groupSeparator), "g"), ""),
  1935. 0 === a.digits && (-1 !== i.indexOf(".") ? i = i.substring(0, i.indexOf(".")) : -1 !== i.indexOf(",") && (i = i.substring(0, i.indexOf(",")))),
  1936. "" !== a.radixPoint && isFinite(a.digits) && -1 !== i.indexOf(a.radixPoint)) {
  1937. var u = i.split(a.radixPoint)[1].match(new RegExp("\\d*"))[0];
  1938. if (parseInt(a.digits) < u.toString().length) {
  1939. var c = Math.pow(10, parseInt(a.digits));
  1940. i = i.replace(t.escapeRegex(a.radixPoint), "."), i = (i = Math.round(parseFloat(i) * c) / c).toString().replace(".", a.radixPoint);
  1941. }
  1942. }
  1943. return function(t, n) {
  1944. if (n.numericInput) {
  1945. var i = e.inArray(n.radixPoint, t);
  1946. -1 === i && (t.push(n.radixPoint), i = t.length - 1);
  1947. for (var a = 1; a <= n.digits; a++) t[i + a] = t[i + a] || "0";
  1948. }
  1949. return t;
  1950. }(i.toString().split(""), a).join("");
  1951. },
  1952. onKeyDown: function(n, i, a, r) {
  1953. var o = e(this);
  1954. if (n.ctrlKey) switch (n.keyCode) {
  1955. case t.keyCode.UP:
  1956. o.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(r.step)), o.trigger("setvalue");
  1957. break;
  1958. case t.keyCode.DOWN:
  1959. o.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(r.step)), o.trigger("setvalue");
  1960. }
  1961. }
  1962. },
  1963. currency: {
  1964. prefix: "$ ",
  1965. groupSeparator: ",",
  1966. alias: "numeric",
  1967. placeholder: "0",
  1968. autoGroup: !0,
  1969. digits: 2,
  1970. digitsOptional: !1,
  1971. clearMaskOnLostFocus: !1
  1972. },
  1973. decimal: {
  1974. alias: "numeric"
  1975. },
  1976. integer: {
  1977. alias: "numeric",
  1978. digits: 0,
  1979. radixPoint: ""
  1980. },
  1981. percentage: {
  1982. alias: "numeric",
  1983. digits: 2,
  1984. digitsOptional: !0,
  1985. radixPoint: ".",
  1986. placeholder: "0",
  1987. autoGroup: !1,
  1988. min: 0,
  1989. max: 100,
  1990. suffix: " %",
  1991. allowMinus: !1
  1992. }
  1993. }), t;
  1994. }) ? i.apply(t, a) : i) || (e.exports = r);
  1995. }, function(e, t, n) {
  1996. "use strict";
  1997. var i, a, r;
  1998. "function" == typeof Symbol && Symbol.iterator, a = [ n(1), n(0) ], void 0 === (r = "function" == typeof (i = function(e, t) {
  1999. return t.extendDefinitions({
  2000. A: {
  2001. validator: "[A-Za-zА-яЁёÀ-ÿµ]",
  2002. casing: "upper"
  2003. },
  2004. "&": {
  2005. validator: "[0-9A-Za-zА-яЁёÀ-ÿµ]",
  2006. casing: "upper"
  2007. },
  2008. "#": {
  2009. validator: "[0-9A-Fa-f]",
  2010. casing: "upper"
  2011. }
  2012. }), t.extendAliases({
  2013. cssunit: {
  2014. regex: "[+-]?[0-9]+\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)"
  2015. },
  2016. url: {
  2017. regex: "(https?|ftp)//.*",
  2018. autoUnmask: !1
  2019. },
  2020. ip: {
  2021. mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]",
  2022. definitions: {
  2023. i: {
  2024. validator: function(e, t, n, i, a) {
  2025. return n - 1 > -1 && "." !== t.buffer[n - 1] ? (e = t.buffer[n - 1] + e, e = n - 2 > -1 && "." !== t.buffer[n - 2] ? t.buffer[n - 2] + e : "0" + e) : e = "00" + e,
  2026. new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(e);
  2027. }
  2028. }
  2029. },
  2030. onUnMask: function(e, t, n) {
  2031. return e;
  2032. },
  2033. inputmode: "numeric"
  2034. },
  2035. email: {
  2036. mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]",
  2037. greedy: !1,
  2038. casing: "lower",
  2039. onBeforePaste: function(e, t) {
  2040. return (e = e.toLowerCase()).replace("mailto:", "");
  2041. },
  2042. definitions: {
  2043. "*": {
  2044. validator: "[0-91-9A-Za-zА-яЁёÀ-ÿµ!#$%&'*+/=?^_`{|}~-]"
  2045. },
  2046. "-": {
  2047. validator: "[0-9A-Za-z-]"
  2048. }
  2049. },
  2050. onUnMask: function(e, t, n) {
  2051. return e;
  2052. },
  2053. inputmode: "email"
  2054. },
  2055. mac: {
  2056. mask: "##:##:##:##:##:##"
  2057. },
  2058. vin: {
  2059. mask: "V{13}9{4}",
  2060. definitions: {
  2061. V: {
  2062. validator: "[A-HJ-NPR-Za-hj-npr-z\\d]",
  2063. casing: "upper"
  2064. }
  2065. },
  2066. clearIncomplete: !0,
  2067. autoUnmask: !0
  2068. }
  2069. }), t;
  2070. }) ? i.apply(t, a) : i) || (e.exports = r);
  2071. }, function(e, t, n) {
  2072. "use strict";
  2073. var i;
  2074. "function" == typeof Symbol && Symbol.iterator, void 0 === (i = function() {
  2075. return document;
  2076. }.call(t, n, t, e)) || (e.exports = i);
  2077. }, function(e, t, n) {
  2078. "use strict";
  2079. var i;
  2080. "function" == typeof Symbol && Symbol.iterator, void 0 === (i = function() {
  2081. return window;
  2082. }.call(t, n, t, e)) || (e.exports = i);
  2083. }, function(e, t, n) {
  2084. "use strict";
  2085. var i, a, r;
  2086. "function" == typeof Symbol && Symbol.iterator, a = [ n(1), n(0) ], void 0 === (r = "function" == typeof (i = function(e, t) {
  2087. var n = {
  2088. d: [ "[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", Date.prototype.getDate ],
  2089. dd: [ "0[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", function() {
  2090. return o(Date.prototype.getDate.call(this), 2);
  2091. } ],
  2092. ddd: [ "" ],
  2093. dddd: [ "" ],
  2094. m: [ "[1-9]|1[012]", Date.prototype.setMonth, "month", function() {
  2095. return Date.prototype.getMonth.call(this) + 1;
  2096. } ],
  2097. mm: [ "0[1-9]|1[012]", Date.prototype.setMonth, "month", function() {
  2098. return o(Date.prototype.getMonth.call(this) + 1, 2);
  2099. } ],
  2100. mmm: [ "" ],
  2101. mmmm: [ "" ],
  2102. yy: [ "[0-9]{2}", Date.prototype.setFullYear, "year", function() {
  2103. return o(Date.prototype.getFullYear.call(this), 2);
  2104. } ],
  2105. yyyy: [ "[0-9]{4}", Date.prototype.setFullYear, "year", function() {
  2106. return o(Date.prototype.getFullYear.call(this), 4);
  2107. } ],
  2108. h: [ "[1-9]|1[0-2]", Date.prototype.setHours, "hours", Date.prototype.getHours ],
  2109. hh: [ "0[1-9]|1[0-2]", Date.prototype.setHours, "hours", function() {
  2110. return o(Date.prototype.getHours.call(this), 2);
  2111. } ],
  2112. hhh: [ "[0-9]+", Date.prototype.setHours, "hours", Date.prototype.getHours ],
  2113. H: [ "1?[0-9]|2[0-3]", Date.prototype.setHours, "hours", Date.prototype.getHours ],
  2114. HH: [ "[01][0-9]|2[0-3]", Date.prototype.setHours, "hours", function() {
  2115. return o(Date.prototype.getHours.call(this), 2);
  2116. } ],
  2117. HHH: [ "[0-9]+", Date.prototype.setHours, "hours", Date.prototype.getHours ],
  2118. M: [ "[1-5]?[0-9]", Date.prototype.setMinutes, "minutes", Date.prototype.getMinutes ],
  2119. MM: [ "[0-5][0-9]", Date.prototype.setMinutes, "minutes", function() {
  2120. return o(Date.prototype.getMinutes.call(this), 2);
  2121. } ],
  2122. s: [ "[1-5]?[0-9]", Date.prototype.setSeconds, "seconds", Date.prototype.getSeconds ],
  2123. ss: [ "[0-5][0-9]", Date.prototype.setSeconds, "seconds", function() {
  2124. return o(Date.prototype.getSeconds.call(this), 2);
  2125. } ],
  2126. l: [ "[0-9]{3}", Date.prototype.setMilliseconds, "milliseconds", function() {
  2127. return o(Date.prototype.getMilliseconds.call(this), 3);
  2128. } ],
  2129. L: [ "[0-9]{2}", Date.prototype.setMilliseconds, "milliseconds", function() {
  2130. return o(Date.prototype.getMilliseconds.call(this), 2);
  2131. } ],
  2132. t: [ "[ap]" ],
  2133. tt: [ "[ap]m" ],
  2134. T: [ "[AP]" ],
  2135. TT: [ "[AP]M" ],
  2136. Z: [ "" ],
  2137. o: [ "" ],
  2138. S: [ "" ]
  2139. }, i = {
  2140. isoDate: "yyyy-mm-dd",
  2141. isoTime: "HH:MM:ss",
  2142. isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
  2143. isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
  2144. };
  2145. function a(e) {
  2146. if (!e.tokenizer) {
  2147. var t = [];
  2148. for (var i in n) -1 === t.indexOf(i[0]) && t.push(i[0]);
  2149. e.tokenizer = "(" + t.join("+|") + ")+?|.", e.tokenizer = new RegExp(e.tokenizer, "g");
  2150. }
  2151. return e.tokenizer;
  2152. }
  2153. function r(e, i, r) {
  2154. for (var o, s = ""; o = a(r).exec(e); ) if (void 0 === i) if (n[o[0]]) s += "(" + n[o[0]][0] + ")"; else switch (o[0]) {
  2155. case "[":
  2156. s += "(";
  2157. break;
  2158. case "]":
  2159. s += ")?";
  2160. break;
  2161. default:
  2162. s += t.escapeRegex(o[0]);
  2163. } else if (n[o[0]]) {
  2164. s += n[o[0]][3].call(i.date);
  2165. } else s += o[0];
  2166. return s;
  2167. }
  2168. function o(e, t) {
  2169. for (e = String(e), t = t || 2; e.length < t; ) e = "0" + e;
  2170. return e;
  2171. }
  2172. function s(e, t, i) {
  2173. var r, o, s, l, u = {
  2174. date: new Date(1, 0, 1)
  2175. }, c = e;
  2176. function f(e, t, n) {
  2177. e[r] = function(e) {
  2178. var t;
  2179. if (i.min && i.min[r] || i.max && i.max[r]) {
  2180. var n = i.min && i.min[r] || i.max[r], a = i.max && i.max[r] || i.min[r];
  2181. for (t = e.replace(/[^0-9]/g, ""), t += (n.indexOf(t) < a.indexOf(t) ? a : n).toString().substr(t.length); !new RegExp(l).test(t); ) t--;
  2182. } else t = e.replace(/[^0-9]/g, "0");
  2183. return t;
  2184. }(t), e["raw" + r] = t, void 0 !== s && s.call(e.date, "month" == r ? parseInt(e[r]) - 1 : e[r]);
  2185. }
  2186. if ("string" == typeof c) {
  2187. for (;o = a(i).exec(t); ) {
  2188. var m = c.slice(0, o[0].length);
  2189. n.hasOwnProperty(o[0]) && (l = n[o[0]][0], r = n[o[0]][2], s = n[o[0]][1], f(u, m)),
  2190. c = c.slice(m.length);
  2191. }
  2192. return u;
  2193. }
  2194. }
  2195. return t.extendAliases({
  2196. datetime: {
  2197. mask: function(e) {
  2198. return n.S = e.i18n.ordinalSuffix.join("|"), e.inputFormat = i[e.inputFormat] || e.inputFormat,
  2199. e.displayFormat = i[e.displayFormat] || e.displayFormat || e.inputFormat, e.outputFormat = i[e.outputFormat] || e.outputFormat || e.inputFormat,
  2200. e.placeholder = "" !== e.placeholder ? e.placeholder : e.inputFormat.replace(/[\[\]]/, ""),
  2201. e.min = s(e.min, e.inputFormat, e), e.max = s(e.max, e.inputFormat, e), e.regex = r(e.inputFormat, void 0, e),
  2202. null;
  2203. },
  2204. placeholder: "",
  2205. inputFormat: "isoDateTime",
  2206. displayFormat: void 0,
  2207. outputFormat: void 0,
  2208. min: null,
  2209. max: null,
  2210. i18n: {
  2211. dayNames: [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ],
  2212. 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" ],
  2213. ordinalSuffix: [ "st", "nd", "rd", "th" ]
  2214. },
  2215. postValidation: function(e, t, n) {
  2216. var i = t, a = s(e.join(""), n.inputFormat, n);
  2217. return i && a.date.getTime() == a.date.getTime() && (i = (i = function(e, t) {
  2218. return (!isFinite(e.rawday) || "29" == e.day && !isFinite(e.rawyear) || new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day) && t;
  2219. }(a, i)) && function(e, t) {
  2220. var n = !0;
  2221. if (t.min) {
  2222. if (e.rawyear) {
  2223. var i = e.rawyear.replace(/[^0-9]/g, "");
  2224. n = t.min.year.substr(0, i.length) <= i;
  2225. }
  2226. e.year === e.rawyear && t.min.date.getTime() == t.min.date.getTime() && (n = t.min.date.getTime() <= e.date.getTime());
  2227. }
  2228. return n && t.max && t.max.date.getTime() == t.max.date.getTime() && (n = t.max.date.getTime() >= e.date.getTime()),
  2229. n;
  2230. }(a, n)), i;
  2231. },
  2232. onKeyDown: function(n, i, r, s) {
  2233. if (n.ctrlKey && n.keyCode === t.keyCode.RIGHT) {
  2234. for (var l, u = new Date(), c = ""; l = a(s).exec(s.inputFormat); ) "d" === l[0].charAt(0) ? c += o(u.getDate(), l[0].length) : "m" === l[0].charAt(0) ? c += o(u.getMonth() + 1, l[0].length) : "yyyy" === l[0] ? c += u.getFullYear().toString() : "y" === l[0].charAt(0) && (c += o(u.getYear(), l[0].length));
  2235. this.inputmask._valueSet(c), e(this).trigger("setvalue");
  2236. }
  2237. },
  2238. onUnMask: function(e, t, n) {
  2239. return r(n.outputFormat, s(e, n.inputFormat, n), n);
  2240. },
  2241. casing: function(e, t, n, i) {
  2242. return 0 == t.nativeDef.indexOf("[ap]") ? e.toLowerCase() : 0 == t.nativeDef.indexOf("[AP]") ? e.toUpperCase() : e;
  2243. },
  2244. insertMode: !1
  2245. }
  2246. }), t;
  2247. }) ? i.apply(t, a) : i) || (e.exports = r);
  2248. }, function(e, t, n) {
  2249. "use strict";
  2250. n(9), n(6), n(5), n(4);
  2251. var i = o(n(0)), a = o(n(1)), r = o(n(2));
  2252. function o(e) {
  2253. return e && e.__esModule ? e : {
  2254. default: e
  2255. };
  2256. }
  2257. a.default === r.default && n(3), window.Inputmask = i.default;
  2258. } ]);