jquery.inputmask.bundle.js 262 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860
  1. /*!
  2. * jquery.inputmask.bundle.js
  3. * https://github.com/RobinHerbots/Inputmask
  4. * Copyright (c) 2010 - 2017 Robin Herbots
  5. * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
  6. * Version: 3.3.7-40
  7. */
  8. !function(modules) {
  9. function __webpack_require__(moduleId) {
  10. if (installedModules[moduleId]) return installedModules[moduleId].exports;
  11. var module = installedModules[moduleId] = {
  12. i: moduleId,
  13. l: !1,
  14. exports: {}
  15. };
  16. return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__),
  17. module.l = !0, module.exports;
  18. }
  19. var installedModules = {};
  20. __webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.i = function(value) {
  21. return value;
  22. }, __webpack_require__.d = function(exports, name, getter) {
  23. __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, {
  24. configurable: !1,
  25. enumerable: !0,
  26. get: getter
  27. });
  28. }, __webpack_require__.n = function(module) {
  29. var getter = module && module.__esModule ? function() {
  30. return module.default;
  31. } : function() {
  32. return module;
  33. };
  34. return __webpack_require__.d(getter, "a", getter), getter;
  35. }, __webpack_require__.o = function(object, property) {
  36. return Object.prototype.hasOwnProperty.call(object, property);
  37. }, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 10);
  38. }([ function(module, exports, __webpack_require__) {
  39. "use strict";
  40. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  41. "function" == typeof Symbol && Symbol.iterator;
  42. !function(factory) {
  43. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2) ], __WEBPACK_AMD_DEFINE_FACTORY__ = factory,
  44. void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  45. }(function($) {
  46. return $;
  47. });
  48. }, function(module, exports, __webpack_require__) {
  49. "use strict";
  50. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__, _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  51. return typeof obj;
  52. } : function(obj) {
  53. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  54. };
  55. !function(factory) {
  56. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(12), __webpack_require__(11) ],
  57. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  58. }(function($, window, document, undefined) {
  59. function Inputmask(alias, options, internal) {
  60. if (!(this instanceof Inputmask)) return new Inputmask(alias, options, internal);
  61. this.el = undefined, this.events = {}, this.maskset = undefined, this.refreshValue = !1,
  62. !0 !== internal && ($.isPlainObject(alias) ? options = alias : (options = options || {},
  63. options.alias = alias), this.opts = $.extend(!0, {}, this.defaults, options), this.noMasksCache = options && options.definitions !== undefined,
  64. this.userOptions = options || {}, this.isRTL = this.opts.numericInput, resolveAlias(this.opts.alias, options, this.opts));
  65. }
  66. function resolveAlias(aliasStr, options, opts) {
  67. var aliasDefinition = Inputmask.prototype.aliases[aliasStr];
  68. return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, undefined, opts),
  69. $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : (null === opts.mask && (opts.mask = aliasStr),
  70. !1);
  71. }
  72. function generateMaskSet(opts, nocache) {
  73. function generateMask(mask, metadata, opts) {
  74. var regexMask = !1;
  75. if (null !== mask && "" !== mask || (regexMask = null !== opts.regex, regexMask ? (mask = opts.regex,
  76. mask = mask.replace(/^(\^)(.*)(\$)$/, "$2")) : (regexMask = !0, mask = ".*")), 1 === mask.length && !1 === opts.greedy && 0 !== opts.repeat && (opts.placeholder = ""),
  77. opts.repeat > 0 || "*" === opts.repeat || "+" === opts.repeat) {
  78. var repeatStart = "*" === opts.repeat ? 0 : "+" === opts.repeat ? 1 : opts.repeat;
  79. mask = opts.groupmarker.start + mask + opts.groupmarker.end + opts.quantifiermarker.start + repeatStart + "," + opts.repeat + opts.quantifiermarker.end;
  80. }
  81. var masksetDefinition, maskdefKey = regexMask ? "regex_" + opts.regex : opts.numericInput ? mask.split("").reverse().join("") : mask;
  82. return Inputmask.prototype.masksCache[maskdefKey] === undefined || !0 === nocache ? (masksetDefinition = {
  83. mask: mask,
  84. maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts),
  85. validPositions: {},
  86. _buffer: undefined,
  87. buffer: undefined,
  88. tests: {},
  89. metadata: metadata,
  90. maskLength: undefined
  91. }, !0 !== nocache && (Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition,
  92. masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]))) : masksetDefinition = $.extend(!0, {}, Inputmask.prototype.masksCache[maskdefKey]),
  93. masksetDefinition;
  94. }
  95. if ($.isFunction(opts.mask) && (opts.mask = opts.mask(opts)), $.isArray(opts.mask)) {
  96. if (opts.mask.length > 1) {
  97. opts.keepStatic = null === opts.keepStatic || opts.keepStatic;
  98. var altMask = opts.groupmarker.start;
  99. return $.each(opts.numericInput ? opts.mask.reverse() : opts.mask, function(ndx, msk) {
  100. altMask.length > 1 && (altMask += opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start),
  101. msk.mask === undefined || $.isFunction(msk.mask) ? altMask += msk : altMask += msk.mask;
  102. }), altMask += opts.groupmarker.end, generateMask(altMask, opts.mask, opts);
  103. }
  104. opts.mask = opts.mask.pop();
  105. }
  106. return opts.mask && opts.mask.mask !== undefined && !$.isFunction(opts.mask.mask) ? generateMask(opts.mask.mask, opts.mask, opts) : generateMask(opts.mask, opts.mask, opts);
  107. }
  108. function maskScope(actionObj, maskset, opts) {
  109. function getMaskTemplate(baseOnInput, minimalPos, includeMode) {
  110. minimalPos = minimalPos || 0;
  111. var ndxIntlzr, test, testPos, maskTemplate = [], pos = 0, lvp = getLastValidPosition();
  112. -1 === (maxLength = el !== undefined ? el.maxLength : undefined) && (maxLength = undefined);
  113. do {
  114. !0 === baseOnInput && getMaskSet().validPositions[pos] ? (testPos = getMaskSet().validPositions[pos],
  115. test = testPos.match, ndxIntlzr = testPos.locator.slice(), maskTemplate.push(!0 === includeMode ? testPos.input : !1 === includeMode ? test.nativeDef : getPlaceholder(pos, test))) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
  116. test = testPos.match, ndxIntlzr = testPos.locator.slice(), (!1 === opts.jitMasking || pos < lvp || "number" == typeof opts.jitMasking && isFinite(opts.jitMasking) && opts.jitMasking > pos) && maskTemplate.push(!1 === includeMode ? test.nativeDef : getPlaceholder(pos, test))),
  117. pos++;
  118. } while ((maxLength === undefined || pos < maxLength) && (null !== test.fn || "" !== test.def) || minimalPos > pos);
  119. return "" === maskTemplate[maskTemplate.length - 1] && maskTemplate.pop(), getMaskSet().maskLength = pos + 1,
  120. maskTemplate;
  121. }
  122. function getMaskSet() {
  123. return maskset;
  124. }
  125. function resetMaskSet(soft) {
  126. var maskset = getMaskSet();
  127. maskset.buffer = undefined, !0 !== soft && (maskset.validPositions = {}, maskset.p = 0);
  128. }
  129. function getLastValidPosition(closestTo, strict, validPositions) {
  130. var before = -1, after = -1, valids = validPositions || getMaskSet().validPositions;
  131. closestTo === undefined && (closestTo = -1);
  132. for (var posNdx in valids) {
  133. var psNdx = parseInt(posNdx);
  134. valids[psNdx] && (strict || !0 !== valids[psNdx].generatedInput) && (psNdx <= closestTo && (before = psNdx),
  135. psNdx >= closestTo && (after = psNdx));
  136. }
  137. return -1 !== before && closestTo - before > 1 || after < closestTo ? before : after;
  138. }
  139. function stripValidPositions(start, end, nocheck, strict) {
  140. var i, startPos = start, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), needsValidation = !1;
  141. for (getMaskSet().p = start, i = end - 1; i >= startPos; i--) getMaskSet().validPositions[i] !== undefined && (!0 !== nocheck && (!getMaskSet().validPositions[i].match.optionality && function(pos) {
  142. var posMatch = getMaskSet().validPositions[pos];
  143. if (posMatch !== undefined && null === posMatch.match.fn) {
  144. var prevMatch = getMaskSet().validPositions[pos - 1], nextMatch = getMaskSet().validPositions[pos + 1];
  145. return prevMatch !== undefined && nextMatch !== undefined;
  146. }
  147. return !1;
  148. }(i) || !1 === opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts)) || delete getMaskSet().validPositions[i]);
  149. for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) {
  150. for (;getMaskSet().validPositions[startPos] !== undefined; ) startPos++;
  151. if (i < startPos && (i = startPos + 1), getMaskSet().validPositions[i] === undefined && isMask(i)) i++; else {
  152. var t = getTestTemplate(i);
  153. !1 === needsValidation && positionsClone[startPos] && positionsClone[startPos].match.def === t.match.def ? (getMaskSet().validPositions[startPos] = $.extend(!0, {}, positionsClone[startPos]),
  154. getMaskSet().validPositions[startPos].input = t.input, delete getMaskSet().validPositions[i],
  155. i++) : positionCanMatchDefinition(startPos, t.match.def) ? !1 !== isValid(startPos, t.input || getPlaceholder(i), !0) && (delete getMaskSet().validPositions[i],
  156. i++, needsValidation = !0) : isMask(i) || (i++, startPos--), startPos++;
  157. }
  158. }
  159. resetMaskSet(!0);
  160. }
  161. function determineTestTemplate(tests, guessNextBest) {
  162. for (var testPos, testPositions = tests, lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0)[0], lvTestAltArr = lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation].toString().split(",") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx],
  163. !(testPos.match && (opts.greedy && !0 !== testPos.match.optionalQuantifier || (!1 === testPos.match.optionality || !1 === testPos.match.newBlockMarker) && !0 !== testPos.match.optionalQuantifier) && (lvTest.alternation === undefined || lvTest.alternation !== testPos.alternation || testPos.locator[lvTest.alternation] !== undefined && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAltArr))) || !0 === guessNextBest && (null !== testPos.match.fn || /[0-9a-bA-Z]/.test(testPos.match.def))); ndx++) ;
  164. return testPos;
  165. }
  166. function getTestTemplate(pos, ndxIntlzr, tstPs) {
  167. return getMaskSet().validPositions[pos] || determineTestTemplate(getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs));
  168. }
  169. function getTest(pos) {
  170. return getMaskSet().validPositions[pos] ? getMaskSet().validPositions[pos] : getTests(pos)[0];
  171. }
  172. function positionCanMatchDefinition(pos, def) {
  173. for (var valid = !1, tests = getTests(pos), tndx = 0; tndx < tests.length; tndx++) if (tests[tndx].match && tests[tndx].match.def === def) {
  174. valid = !0;
  175. break;
  176. }
  177. return valid;
  178. }
  179. function getTests(pos, ndxIntlzr, tstPs) {
  180. function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {
  181. function handleMatch(match, loopNdx, quantifierRecurse) {
  182. function isFirstMatch(latestMatch, tokenGroup) {
  183. var firstMatch = 0 === $.inArray(latestMatch, tokenGroup.matches);
  184. return firstMatch || $.each(tokenGroup.matches, function(ndx, match) {
  185. if (!0 === match.isQuantifier && (firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]))) return !1;
  186. }), firstMatch;
  187. }
  188. function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {
  189. var bestMatch, indexPos;
  190. if (getMaskSet().validPositions[pos - 1] && targetAlternation && getMaskSet().tests[pos]) for (var vpAlternation = getMaskSet().validPositions[pos - 1].locator, tpAlternation = getMaskSet().tests[pos][0].locator, i = 0; i < targetAlternation; i++) if (vpAlternation[i] !== tpAlternation[i]) return vpAlternation.slice(targetAlternation + 1);
  191. return (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) && $.each(getMaskSet().tests[pos] || [ getMaskSet().validPositions[pos] ], function(ndx, lmnt) {
  192. var alternation = targetAlternation !== undefined ? targetAlternation : lmnt.alternation, ndxPos = lmnt.locator[alternation] !== undefined ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;
  193. (indexPos === undefined || ndxPos < indexPos) && -1 !== ndxPos && (bestMatch = lmnt,
  194. indexPos = ndxPos);
  195. }), bestMatch ? bestMatch.locator.slice((targetAlternation !== undefined ? targetAlternation : bestMatch.alternation) + 1) : targetAlternation !== undefined ? resolveNdxInitializer(pos, alternateNdx) : undefined;
  196. }
  197. if (testPos > 1e4) 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. " + getMaskSet().mask;
  198. if (testPos === pos && match.matches === undefined) return matches.push({
  199. match: match,
  200. locator: loopNdx.reverse(),
  201. cd: cacheDependency
  202. }), !0;
  203. if (match.matches !== undefined) {
  204. if (match.isGroup && quantifierRecurse !== match) {
  205. if (match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx)) return !0;
  206. } else if (match.isOptional) {
  207. var optionalToken = match;
  208. if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) {
  209. if (latestMatch = matches[matches.length - 1].match, !isFirstMatch(latestMatch, optionalToken)) return !0;
  210. insertStop = !0, testPos = pos;
  211. }
  212. } else if (match.isAlternator) {
  213. var maltMatches, alternateToken = match, malternateMatches = [], currentMatches = matches.slice(), loopNdxCnt = loopNdx.length, altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;
  214. if (-1 === altIndex || "string" == typeof altIndex) {
  215. var amndx, currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [];
  216. if ("string" == typeof altIndex) altIndexArr = altIndex.split(","); else for (amndx = 0; amndx < alternateToken.matches.length; amndx++) altIndexArr.push(amndx);
  217. for (var ndx = 0; ndx < altIndexArr.length; ndx++) {
  218. if (amndx = parseInt(altIndexArr[ndx]), matches = [], ndxInitializer = resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice(),
  219. !0 !== (match = handleMatch(alternateToken.matches[amndx] || maskToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) || match) && match !== undefined && altIndexArr[altIndexArr.length - 1] < alternateToken.matches.length) {
  220. var ntndx = $.inArray(match, maskToken.matches) + 1;
  221. maskToken.matches.length > ntndx && (match = handleMatch(maskToken.matches[ntndx], [ ntndx ].concat(loopNdx.slice(1, loopNdx.length)), quantifierRecurse)) && (altIndexArr.push(ntndx.toString()),
  222. $.each(matches, function(ndx, lmnt) {
  223. lmnt.alternation = loopNdx.length - 1;
  224. }));
  225. }
  226. maltMatches = matches.slice(), testPos = currentPos, matches = [];
  227. for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {
  228. var altMatch = maltMatches[ndx1], dropMatch = !1;
  229. altMatch.alternation = altMatch.alternation || loopNdxCnt;
  230. for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {
  231. var altMatch2 = malternateMatches[ndx2];
  232. if ("string" != typeof altIndex || -1 !== $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr)) {
  233. if (function(source, target) {
  234. return source.match.nativeDef === target.match.nativeDef || source.match.def === target.match.nativeDef || source.match.nativeDef === target.match.def;
  235. }(altMatch, altMatch2)) {
  236. dropMatch = !0, altMatch.alternation === altMatch2.alternation && -1 === altMatch2.locator[altMatch2.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) && (altMatch2.locator[altMatch2.alternation] = altMatch2.locator[altMatch2.alternation] + "," + altMatch.locator[altMatch.alternation],
  237. altMatch2.alternation = altMatch.alternation), altMatch.match.nativeDef === altMatch2.match.def && (altMatch.locator[altMatch.alternation] = altMatch2.locator[altMatch2.alternation],
  238. malternateMatches.splice(malternateMatches.indexOf(altMatch2), 1, altMatch));
  239. break;
  240. }
  241. if (altMatch.match.def === altMatch2.match.def) {
  242. dropMatch = !1;
  243. break;
  244. }
  245. if (function(source, target) {
  246. return null === source.match.fn && null !== target.match.fn && target.match.fn.test(source.match.def, getMaskSet(), pos, !1, opts, !1);
  247. }(altMatch, altMatch2) || function(source, target) {
  248. return null !== source.match.fn && null !== target.match.fn && target.match.fn.test(source.match.def.replace(/[\[\]]/g, ""), getMaskSet(), pos, !1, opts, !1);
  249. }(altMatch, altMatch2)) {
  250. altMatch.alternation == altMatch2.alternation && -1 === altMatch.locator[altMatch.alternation].toString().indexOf(altMatch2.locator[altMatch2.alternation].toString().split("")[0]) && (altMatch.na = altMatch.na || altMatch.locator[altMatch.alternation].toString(),
  251. -1 === altMatch.na.indexOf(altMatch.locator[altMatch.alternation].toString().split("")[0]) && (altMatch.na = altMatch.na + "," + altMatch.locator[altMatch2.alternation].toString().split("")[0]),
  252. dropMatch = !0, altMatch.locator[altMatch.alternation] = altMatch2.locator[altMatch2.alternation].toString().split("")[0] + "," + altMatch.locator[altMatch.alternation],
  253. malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch));
  254. break;
  255. }
  256. }
  257. }
  258. dropMatch || malternateMatches.push(altMatch);
  259. }
  260. }
  261. "string" == typeof altIndex && (malternateMatches = $.map(malternateMatches, function(lmnt, ndx) {
  262. if (isFinite(ndx)) {
  263. var alternation = lmnt.alternation, altLocArr = lmnt.locator[alternation].toString().split(",");
  264. lmnt.locator[alternation] = undefined, lmnt.alternation = undefined;
  265. for (var alndx = 0; alndx < altLocArr.length; alndx++) -1 !== $.inArray(altLocArr[alndx], altIndexArr) && (lmnt.locator[alternation] !== undefined ? (lmnt.locator[alternation] += ",",
  266. lmnt.locator[alternation] += altLocArr[alndx]) : lmnt.locator[alternation] = parseInt(altLocArr[alndx]),
  267. lmnt.alternation = alternation);
  268. if (lmnt.locator[alternation] !== undefined) return lmnt;
  269. }
  270. })), matches = currentMatches.concat(malternateMatches), testPos = pos, insertStop = matches.length > 0,
  271. match = malternateMatches.length > 0, ndxInitializer = ndxInitializerClone.slice();
  272. } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);
  273. if (match) return !0;
  274. } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) for (var qt = match, qndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) {
  275. var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];
  276. if (match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup)) {
  277. if (latestMatch = matches[matches.length - 1].match, latestMatch.optionalQuantifier = qndx > qt.quantifier.min - 1,
  278. isFirstMatch(latestMatch, tokenGroup)) {
  279. if (qndx > qt.quantifier.min - 1) {
  280. insertStop = !0, testPos = pos;
  281. break;
  282. }
  283. return !0;
  284. }
  285. return !0;
  286. }
  287. } else if (match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) return !0;
  288. } else testPos++;
  289. }
  290. for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) if (!0 !== maskToken.matches[tndx].isQuantifier) {
  291. var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);
  292. if (match && testPos === pos) return match;
  293. if (testPos > pos) break;
  294. }
  295. }
  296. function filterTests(tests) {
  297. if (opts.keepStatic && pos > 0 && tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0) && !0 !== tests[0].match.optionality && !0 !== tests[0].match.optionalQuantifier && null === tests[0].match.fn && !/[0-9a-bA-Z]/.test(tests[0].match.def)) {
  298. if (getMaskSet().validPositions[pos - 1] === undefined) return [ determineTestTemplate(tests) ];
  299. if (getMaskSet().validPositions[pos - 1].alternation === tests[0].alternation) return [ determineTestTemplate(tests) ];
  300. if (getMaskSet().validPositions[pos - 1]) return [ determineTestTemplate(tests) ];
  301. }
  302. return tests;
  303. }
  304. var latestMatch, maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = !1, cacheDependency = ndxIntlzr ? ndxIntlzr.join("") : "";
  305. if (pos > -1) {
  306. if (ndxIntlzr === undefined) {
  307. for (var test, previousPos = pos - 1; (test = getMaskSet().validPositions[previousPos] || getMaskSet().tests[previousPos]) === undefined && previousPos > -1; ) previousPos--;
  308. test !== undefined && previousPos > -1 && (ndxInitializer = function(tests) {
  309. var locator = [];
  310. return $.isArray(tests) || (tests = [ tests ]), tests.length > 0 && (tests[0].alternation === undefined ? (locator = determineTestTemplate(tests.slice()).locator.slice(),
  311. 0 === locator.length && (locator = tests[0].locator.slice())) : $.each(tests, function(ndx, tst) {
  312. if ("" !== tst.def) if (0 === locator.length) locator = tst.locator.slice(); else for (var i = 0; i < locator.length; i++) tst.locator[i] && -1 === locator[i].toString().indexOf(tst.locator[i]) && (locator[i] += "," + tst.locator[i]);
  313. })), locator;
  314. }(test), cacheDependency = ndxInitializer.join(""), testPos = previousPos);
  315. }
  316. if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) return filterTests(getMaskSet().tests[pos]);
  317. for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {
  318. if (resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]) && testPos === pos || testPos > pos) break;
  319. }
  320. }
  321. return (0 === matches.length || insertStop) && matches.push({
  322. match: {
  323. fn: null,
  324. cardinality: 0,
  325. optionality: !0,
  326. casing: null,
  327. def: "",
  328. placeholder: ""
  329. },
  330. locator: [],
  331. cd: cacheDependency
  332. }), ndxIntlzr !== undefined && getMaskSet().tests[pos] ? filterTests($.extend(!0, [], matches)) : (getMaskSet().tests[pos] = $.extend(!0, [], matches),
  333. console.log(pos + " - " + JSON.stringify(matches)), filterTests(getMaskSet().tests[pos]));
  334. }
  335. function getBufferTemplate() {
  336. return getMaskSet()._buffer === undefined && (getMaskSet()._buffer = getMaskTemplate(!1, 1),
  337. getMaskSet().buffer === undefined && (getMaskSet().buffer = getMaskSet()._buffer.slice())),
  338. getMaskSet()._buffer;
  339. }
  340. function getBuffer(noCache) {
  341. return getMaskSet().buffer !== undefined && !0 !== noCache || (getMaskSet().buffer = getMaskTemplate(!0, getLastValidPosition(), !0)),
  342. getMaskSet().buffer;
  343. }
  344. function refreshFromBuffer(start, end, buffer) {
  345. var i, p;
  346. if (!0 === start) resetMaskSet(), start = 0, end = buffer.length; else for (i = start; i < end; i++) delete getMaskSet().validPositions[i];
  347. for (p = start, i = start; i < end; i++) if (resetMaskSet(!0), buffer[i] !== opts.skipOptionalPartCharacter) {
  348. var valResult = isValid(p, buffer[i], !0, !0);
  349. !1 !== valResult && (resetMaskSet(!0), p = valResult.caret !== undefined ? valResult.caret : valResult.pos + 1);
  350. }
  351. }
  352. function casing(elem, test, pos) {
  353. switch (opts.casing || test.casing) {
  354. case "upper":
  355. elem = elem.toUpperCase();
  356. break;
  357. case "lower":
  358. elem = elem.toLowerCase();
  359. break;
  360. case "title":
  361. var posBefore = getMaskSet().validPositions[pos - 1];
  362. elem = 0 === pos || posBefore && posBefore.input === String.fromCharCode(Inputmask.keyCode.SPACE) ? elem.toUpperCase() : elem.toLowerCase();
  363. break;
  364. default:
  365. if ($.isFunction(opts.casing)) {
  366. var args = Array.prototype.slice.call(arguments);
  367. args.push(getMaskSet().validPositions), elem = opts.casing.apply(this, args);
  368. }
  369. }
  370. return elem;
  371. }
  372. function checkAlternationMatch(altArr1, altArr2, na) {
  373. for (var naNdx, altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = !1, naArr = na !== undefined ? na.split(",") : [], i = 0; i < naArr.length; i++) -1 !== (naNdx = altArr1.indexOf(naArr[i])) && altArr1.splice(naNdx, 1);
  374. for (var alndx = 0; alndx < altArr1.length; alndx++) if (-1 !== $.inArray(altArr1[alndx], altArrC)) {
  375. isMatch = !0;
  376. break;
  377. }
  378. return isMatch;
  379. }
  380. function isValid(pos, c, strict, fromSetValid, fromAlternate) {
  381. function isSelection(posObj) {
  382. var selection = isRTL ? posObj.begin - posObj.end > 1 || posObj.begin - posObj.end == 1 : posObj.end - posObj.begin > 1 || posObj.end - posObj.begin == 1;
  383. return selection && 0 === posObj.begin && posObj.end === getMaskSet().maskLength ? "full" : selection;
  384. }
  385. function _isValid(position, c, strict) {
  386. var rslt = !1;
  387. return $.each(getTests(position), function(ndx, tst) {
  388. for (var test = tst.match, loopend = c ? 1 : 0, chrs = "", i = test.cardinality; i > loopend; i--) chrs += getBufferElement(position - (i - 1));
  389. if (c && (chrs += c), getBuffer(!0), !1 !== (rslt = null != test.fn ? test.fn.test(chrs, getMaskSet(), position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && "" !== test.def && {
  390. c: getPlaceholder(position, test, !0) || test.def,
  391. pos: position
  392. })) {
  393. var elem = rslt.c !== undefined ? rslt.c : c;
  394. elem = elem === opts.skipOptionalPartCharacter && null === test.fn ? getPlaceholder(position, test, !0) || test.def : elem;
  395. var validatedPos = position, possibleModifiedBuffer = getBuffer();
  396. if (rslt.remove !== undefined && ($.isArray(rslt.remove) || (rslt.remove = [ rslt.remove ]),
  397. $.each(rslt.remove.sort(function(a, b) {
  398. return b - a;
  399. }), function(ndx, lmnt) {
  400. stripValidPositions(lmnt, lmnt + 1, !0);
  401. })), rslt.insert !== undefined && ($.isArray(rslt.insert) || (rslt.insert = [ rslt.insert ]),
  402. $.each(rslt.insert.sort(function(a, b) {
  403. return a - b;
  404. }), function(ndx, lmnt) {
  405. isValid(lmnt.pos, lmnt.c, !0, fromSetValid);
  406. })), rslt.refreshFromBuffer) {
  407. var refresh = rslt.refreshFromBuffer;
  408. if (refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, possibleModifiedBuffer),
  409. rslt.pos === undefined && rslt.c === undefined) return rslt.pos = getLastValidPosition(),
  410. !1;
  411. if ((validatedPos = rslt.pos !== undefined ? rslt.pos : position) !== position) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0, fromSetValid)),
  412. !1;
  413. } else if (!0 !== rslt && rslt.pos !== undefined && rslt.pos !== position && (validatedPos = rslt.pos,
  414. refreshFromBuffer(position, validatedPos, getBuffer().slice()), validatedPos !== position)) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)),
  415. !1;
  416. return (!0 === rslt || rslt.pos !== undefined || rslt.c !== undefined) && (ndx > 0 && resetMaskSet(!0),
  417. setValidPosition(validatedPos, $.extend({}, tst, {
  418. input: casing(elem, test, validatedPos)
  419. }), fromSetValid, isSelection(pos)) || (rslt = !1), !1);
  420. }
  421. }), rslt;
  422. }
  423. function setValidPosition(pos, validTest, fromSetValid, isSelection) {
  424. if (isSelection || opts.insertMode && getMaskSet().validPositions[pos] !== undefined && fromSetValid === undefined) {
  425. var i, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), lvp = getLastValidPosition(undefined, !0);
  426. for (i = pos; i <= lvp; i++) delete getMaskSet().validPositions[i];
  427. getMaskSet().validPositions[pos] = $.extend(!0, {}, validTest);
  428. var j, valid = !0, vps = getMaskSet().validPositions, needsValidation = !1, initialLength = getMaskSet().maskLength;
  429. for (i = j = pos; i <= lvp; i++) {
  430. var t = positionsClone[i];
  431. if (t !== undefined) for (var posMatch = j; posMatch < getMaskSet().maskLength && (null === t.match.fn && vps[i] && (!0 === vps[i].match.optionalQuantifier || !0 === vps[i].match.optionality) || null != t.match.fn); ) {
  432. if (posMatch++, !1 === needsValidation && positionsClone[posMatch] && positionsClone[posMatch].match.def === t.match.def) getMaskSet().validPositions[posMatch] = $.extend(!0, {}, positionsClone[posMatch]),
  433. getMaskSet().validPositions[posMatch].input = t.input, fillMissingNonMask(posMatch),
  434. j = posMatch, valid = !0; else if (positionCanMatchDefinition(posMatch, t.match.def)) {
  435. var result = isValid(posMatch, t.input, !0, !0);
  436. valid = !1 !== result, j = result.caret || result.insert ? getLastValidPosition() : posMatch,
  437. needsValidation = !0;
  438. } else if (!(valid = !0 === t.generatedInput) && posMatch >= getMaskSet().maskLength - 1) break;
  439. if (getMaskSet().maskLength < initialLength && (getMaskSet().maskLength = initialLength),
  440. valid) break;
  441. }
  442. if (!valid) break;
  443. }
  444. if (!valid) return getMaskSet().validPositions = $.extend(!0, {}, positionsClone),
  445. resetMaskSet(!0), !1;
  446. } else getMaskSet().validPositions[pos] = $.extend(!0, {}, validTest);
  447. return resetMaskSet(!0), !0;
  448. }
  449. function fillMissingNonMask(maskPos) {
  450. for (var pndx = maskPos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ;
  451. var testTemplate, testsFromPos;
  452. for (pndx++; pndx < maskPos; pndx++) getMaskSet().validPositions[pndx] === undefined && (!1 === opts.jitMasking || opts.jitMasking > pndx) && (testsFromPos = getTests(pndx, getTestTemplate(pndx - 1).locator, pndx - 1).slice(),
  453. "" === testsFromPos[testsFromPos.length - 1].match.def && testsFromPos.pop(), (testTemplate = determineTestTemplate(testsFromPos)) && (testTemplate.match.def === opts.radixPointDefinitionSymbol || !isMask(pndx, !0) || $.inArray(opts.radixPoint, getBuffer()) < pndx && testTemplate.match.fn && testTemplate.match.fn.test(getPlaceholder(pndx), getMaskSet(), pndx, !1, opts)) && !1 !== (result = _isValid(pndx, getPlaceholder(pndx, testTemplate.match, !0) || (null == testTemplate.match.fn ? testTemplate.match.def : "" !== getPlaceholder(pndx) ? getPlaceholder(pndx) : getBuffer()[pndx]), !0)) && (getMaskSet().validPositions[result.pos || pndx].generatedInput = !0));
  454. }
  455. strict = !0 === strict;
  456. var maskPos = pos;
  457. pos.begin !== undefined && (maskPos = isRTL && !isSelection(pos) ? pos.end : pos.begin);
  458. var result = !0, positionsClone = $.extend(!0, {}, getMaskSet().validPositions);
  459. if ($.isFunction(opts.preValidation) && !strict && !0 !== fromSetValid && (result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts)),
  460. !0 === result) {
  461. if (fillMissingNonMask(maskPos), isSelection(pos) && (handleRemove(undefined, Inputmask.keyCode.DELETE, pos, !0),
  462. maskPos = getMaskSet().p), maskPos < getMaskSet().maskLength && (maxLength === undefined || maskPos < maxLength) && (result = _isValid(maskPos, c, strict),
  463. (!strict || !0 === fromSetValid) && !1 === result)) {
  464. var currentPosValid = getMaskSet().validPositions[maskPos];
  465. if (!currentPosValid || null !== currentPosValid.match.fn || currentPosValid.match.def !== c && c !== opts.skipOptionalPartCharacter) {
  466. if ((opts.insertMode || getMaskSet().validPositions[seekNext(maskPos)] === undefined) && !isMask(maskPos, !0)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) if (!1 !== (result = _isValid(nPos, c, strict))) {
  467. !function(originalPos, newPos) {
  468. var vp = getMaskSet().validPositions[newPos];
  469. if (vp) for (var targetLocator = vp.locator, tll = targetLocator.length, ps = originalPos; ps < newPos; ps++) if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, !0)) {
  470. var tests = getTests(ps).slice(), bestMatch = determineTestTemplate(tests, !0), equality = -1;
  471. "" === tests[tests.length - 1].match.def && tests.pop(), $.each(tests, function(ndx, tst) {
  472. for (var i = 0; i < tll; i++) {
  473. if (tst.locator[i] === undefined || !checkAlternationMatch(tst.locator[i].toString().split(","), targetLocator[i].toString().split(","), tst.na)) {
  474. var targetAI = targetLocator[i], bestMatchAI = bestMatch.locator[i], tstAI = tst.locator[i];
  475. targetAI - bestMatchAI > Math.abs(targetAI - tstAI) && (bestMatch = tst);
  476. break;
  477. }
  478. equality < i && (equality = i, bestMatch = tst);
  479. }
  480. }), bestMatch = $.extend({}, bestMatch, {
  481. input: getPlaceholder(ps, bestMatch.match, !0) || bestMatch.match.def
  482. }), bestMatch.generatedInput = !0, setValidPosition(ps, bestMatch, !0), getMaskSet().validPositions[newPos] = undefined,
  483. _isValid(newPos, vp.input, !0);
  484. }
  485. }(maskPos, result.pos !== undefined ? result.pos : nPos), maskPos = nPos;
  486. break;
  487. }
  488. } else result = {
  489. caret: seekNext(maskPos)
  490. };
  491. }
  492. !1 === result && opts.keepStatic && !strict && !0 !== fromAlternate && (result = function(pos, c, strict) {
  493. var lastAlt, alternation, altPos, prevAltPos, i, validPos, altNdxs, decisionPos, validPsClone = $.extend(!0, {}, getMaskSet().validPositions), isValidRslt = !1, lAltPos = getLastValidPosition();
  494. for (prevAltPos = getMaskSet().validPositions[lAltPos]; lAltPos >= 0; lAltPos--) if ((altPos = getMaskSet().validPositions[lAltPos]) && altPos.alternation !== undefined) {
  495. if (lastAlt = lAltPos, alternation = getMaskSet().validPositions[lastAlt].alternation,
  496. prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) break;
  497. prevAltPos = altPos;
  498. }
  499. if (alternation !== undefined) {
  500. decisionPos = parseInt(lastAlt);
  501. var decisionTaker = prevAltPos.locator[prevAltPos.alternation || alternation] !== undefined ? prevAltPos.locator[prevAltPos.alternation || alternation] : altNdxs[0];
  502. decisionTaker.length > 0 && (decisionTaker = decisionTaker.split(",")[0]);
  503. var possibilityPos = getMaskSet().validPositions[decisionPos], prevPos = getMaskSet().validPositions[decisionPos - 1];
  504. $.each(getTests(decisionPos, prevPos ? prevPos.locator : undefined, decisionPos - 1), function(ndx, test) {
  505. altNdxs = test.locator[alternation] ? test.locator[alternation].toString().split(",") : [];
  506. for (var mndx = 0; mndx < altNdxs.length; mndx++) {
  507. var validInputs = [], staticInputsBeforePos = 0, staticInputsBeforePosAlternate = 0, verifyValidInput = !1;
  508. if (decisionTaker < altNdxs[mndx] && (test.na === undefined || -1 === $.inArray(altNdxs[mndx], test.na.split(",")) || -1 === $.inArray(decisionTaker.toString(), altNdxs))) {
  509. getMaskSet().validPositions[decisionPos] = $.extend(!0, {}, test);
  510. var possibilities = getMaskSet().validPositions[decisionPos].locator;
  511. for (getMaskSet().validPositions[decisionPos].locator[alternation] = parseInt(altNdxs[mndx]),
  512. null == test.match.fn ? (possibilityPos.input !== test.match.def && (verifyValidInput = !0,
  513. !0 !== possibilityPos.generatedInput && validInputs.push(possibilityPos.input)),
  514. staticInputsBeforePosAlternate++, getMaskSet().validPositions[decisionPos].generatedInput = !/[0-9a-bA-Z]/.test(test.match.def),
  515. getMaskSet().validPositions[decisionPos].input = test.match.def) : getMaskSet().validPositions[decisionPos].input = possibilityPos.input,
  516. i = decisionPos + 1; i < getLastValidPosition(undefined, !0) + 1; i++) validPos = getMaskSet().validPositions[i],
  517. validPos && !0 !== validPos.generatedInput && /[0-9a-bA-Z]/.test(validPos.input) ? validInputs.push(validPos.input) : i < pos && staticInputsBeforePos++,
  518. delete getMaskSet().validPositions[i];
  519. for (verifyValidInput && validInputs[0] === test.match.def && validInputs.shift(),
  520. resetMaskSet(!0), isValidRslt = !0; validInputs.length > 0; ) {
  521. var input = validInputs.shift();
  522. if (input !== opts.skipOptionalPartCharacter && !(isValidRslt = isValid(getLastValidPosition(undefined, !0) + 1, input, !1, fromSetValid, !0))) break;
  523. }
  524. if (isValidRslt) {
  525. getMaskSet().validPositions[decisionPos].locator = possibilities;
  526. var targetLvp = getLastValidPosition(pos) + 1;
  527. for (i = decisionPos + 1; i < getLastValidPosition() + 1; i++) ((validPos = getMaskSet().validPositions[i]) === undefined || null == validPos.match.fn) && i < pos + (staticInputsBeforePosAlternate - staticInputsBeforePos) && staticInputsBeforePosAlternate++;
  528. pos += staticInputsBeforePosAlternate - staticInputsBeforePos, isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid, !0);
  529. }
  530. if (isValidRslt) return !1;
  531. resetMaskSet(), getMaskSet().validPositions = $.extend(!0, {}, validPsClone);
  532. }
  533. }
  534. });
  535. }
  536. return isValidRslt;
  537. }(maskPos, c, strict)), !0 === result && (result = {
  538. pos: maskPos
  539. });
  540. }
  541. if ($.isFunction(opts.postValidation) && !1 !== result && !strict && !0 !== fromSetValid) {
  542. var postResult = opts.postValidation(getBuffer(!0), result, opts);
  543. if (postResult.refreshFromBuffer && postResult.buffer) {
  544. var refresh = postResult.refreshFromBuffer;
  545. refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, postResult.buffer);
  546. }
  547. result = !0 === postResult ? result : postResult;
  548. }
  549. return result && result.pos === undefined && (result.pos = maskPos), !1 === result && (resetMaskSet(!0),
  550. getMaskSet().validPositions = $.extend(!0, {}, positionsClone)), result;
  551. }
  552. function isMask(pos, strict) {
  553. var test = getTestTemplate(pos).match;
  554. if ("" === test.def && (test = getTest(pos).match), null != test.fn) return test.fn;
  555. if (!0 !== strict && pos > -1) {
  556. var tests = getTests(pos);
  557. return tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0);
  558. }
  559. return !1;
  560. }
  561. function seekNext(pos, newBlock) {
  562. var maskL = getMaskSet().maskLength;
  563. if (pos >= maskL) return maskL;
  564. var position = pos;
  565. for (getTests(maskL + 1).length > 1 && (getMaskTemplate(!0, maskL + 1, !0), maskL = getMaskSet().maskLength); ++position < maskL && (!0 === newBlock && (!0 !== getTest(position).match.newBlockMarker || !isMask(position)) || !0 !== newBlock && !isMask(position)); ) ;
  566. return position;
  567. }
  568. function seekPrevious(pos, newBlock) {
  569. var tests, position = pos;
  570. if (position <= 0) return 0;
  571. for (;--position > 0 && (!0 === newBlock && !0 !== getTest(position).match.newBlockMarker || !0 !== newBlock && !isMask(position) && (tests = getTests(position),
  572. tests.length < 2 || 2 === tests.length && "" === tests[1].match.def)); ) ;
  573. return position;
  574. }
  575. function getBufferElement(position) {
  576. return getMaskSet().validPositions[position] === undefined ? getPlaceholder(position) : getMaskSet().validPositions[position].input;
  577. }
  578. function writeBuffer(input, buffer, caretPos, event, triggerInputEvent) {
  579. if (event && $.isFunction(opts.onBeforeWrite)) {
  580. var result = opts.onBeforeWrite(event, buffer, caretPos, opts);
  581. if (result) {
  582. if (result.refreshFromBuffer) {
  583. var refresh = result.refreshFromBuffer;
  584. refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer || buffer),
  585. buffer = getBuffer(!0);
  586. }
  587. caretPos !== undefined && (caretPos = result.caret !== undefined ? result.caret : caretPos);
  588. }
  589. }
  590. input !== undefined && (input.inputmask._valueSet(buffer.join("")), caretPos === undefined || event !== undefined && "blur" === event.type ? renderColorMask(input, buffer, caretPos) : android && "input" === event.type ? setTimeout(function() {
  591. caret(input, caretPos);
  592. }, 0) : caret(input, caretPos), !0 === triggerInputEvent && (skipInputEvent = !0,
  593. $(input).trigger("input")));
  594. }
  595. function getPlaceholder(pos, test, returnPL) {
  596. if (test = test || getTest(pos).match, test.placeholder !== undefined || !0 === returnPL) return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder;
  597. if (null === test.fn) {
  598. if (pos > -1 && getMaskSet().validPositions[pos] === undefined) {
  599. var prevTest, tests = getTests(pos), staticAlternations = [];
  600. if (tests.length > 1 + ("" === tests[tests.length - 1].match.def ? 1 : 0)) for (var i = 0; i < tests.length; i++) if (!0 !== tests[i].match.optionality && !0 !== tests[i].match.optionalQuantifier && (null === tests[i].match.fn || prevTest === undefined || !1 !== tests[i].match.fn.test(prevTest.match.def, getMaskSet(), pos, !0, opts)) && (staticAlternations.push(tests[i]),
  601. null === tests[i].match.fn && (prevTest = tests[i]), staticAlternations.length > 1 && /[0-9a-bA-Z]/.test(staticAlternations[0].match.def))) return opts.placeholder.charAt(pos % opts.placeholder.length);
  602. }
  603. return test.def;
  604. }
  605. return opts.placeholder.charAt(pos % opts.placeholder.length);
  606. }
  607. function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {
  608. function isTemplateMatch(ndx, charCodes) {
  609. return -1 !== getBufferTemplate().slice(ndx, seekNext(ndx)).join("").indexOf(charCodes) && !isMask(ndx) && getTest(ndx).match.nativeDef === charCodes.charAt(charCodes.length - 1);
  610. }
  611. var inputValue = nptvl.slice(), charCodes = "", initialNdx = 0, result = undefined;
  612. if (resetMaskSet(), getMaskSet().p = seekNext(-1), !strict) if (!0 !== opts.autoUnmask) {
  613. var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(""), matches = inputValue.join("").match(new RegExp("^" + Inputmask.escapeRegex(staticInput), "g"));
  614. matches && matches.length > 0 && (inputValue.splice(0, matches.length * staticInput.length),
  615. initialNdx = seekNext(initialNdx));
  616. } else initialNdx = seekNext(initialNdx);
  617. if ($.each(inputValue, function(ndx, charCode) {
  618. if (charCode !== undefined) {
  619. var keypress = new $.Event("_checkval");
  620. keypress.which = charCode.charCodeAt(0), charCodes += charCode;
  621. var lvp = getLastValidPosition(undefined, !0), lvTest = getMaskSet().validPositions[lvp], nextTest = getTestTemplate(lvp + 1, lvTest ? lvTest.locator.slice() : undefined, lvp);
  622. if (!isTemplateMatch(initialNdx, charCodes) || strict || opts.autoUnmask) {
  623. var pos = strict ? ndx : null == nextTest.match.fn && nextTest.match.optionality && lvp + 1 < getMaskSet().p ? lvp + 1 : getMaskSet().p;
  624. result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, strict, pos),
  625. initialNdx = pos + 1, charCodes = "";
  626. } else result = EventHandlers.keypressEvent.call(input, keypress, !0, !1, !0, lvp + 1);
  627. if (!1 !== result && !strict && $.isFunction(opts.onBeforeWrite)) {
  628. var fp = result.forwardPosition;
  629. if (result = opts.onBeforeWrite(keypress, getBuffer(), result.forwardPosition, opts),
  630. result.forwardPosition = fp, result && result.refreshFromBuffer) {
  631. var refresh = result.refreshFromBuffer;
  632. refreshFromBuffer(!0 === refresh ? refresh : refresh.start, refresh.end, result.buffer),
  633. resetMaskSet(!0), result.caret && (getMaskSet().p = result.caret, result.forwardPosition = result.caret);
  634. }
  635. }
  636. }
  637. }), writeOut) {
  638. var caretPos = undefined;
  639. document.activeElement === input && result && (caretPos = opts.numericInput ? seekPrevious(result.forwardPosition) : result.forwardPosition),
  640. writeBuffer(input, getBuffer(), caretPos, initiatingEvent || new $.Event("checkval"), initiatingEvent && "input" === initiatingEvent.type);
  641. }
  642. }
  643. function unmaskedvalue(input) {
  644. if (input) {
  645. if (input.inputmask === undefined) return input.value;
  646. input.inputmask && input.inputmask.refreshValue && EventHandlers.setValueEvent.call(input);
  647. }
  648. var umValue = [], vps = getMaskSet().validPositions;
  649. for (var pndx in vps) vps[pndx].match && null != vps[pndx].match.fn && umValue.push(vps[pndx].input);
  650. var unmaskedValue = 0 === umValue.length ? "" : (isRTL ? umValue.reverse() : umValue).join("");
  651. if ($.isFunction(opts.onUnMask)) {
  652. var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join("");
  653. unmaskedValue = opts.onUnMask(bufferValue, unmaskedValue, opts);
  654. }
  655. return unmaskedValue;
  656. }
  657. function caret(input, begin, end, notranslate) {
  658. function translatePosition(pos) {
  659. if (!0 !== notranslate && isRTL && "number" == typeof pos && (!opts.greedy || "" !== opts.placeholder)) {
  660. pos = getBuffer().join("").length - pos;
  661. }
  662. return pos;
  663. }
  664. var range;
  665. if (begin === undefined) return input.setSelectionRange ? (begin = input.selectionStart,
  666. end = input.selectionEnd) : window.getSelection ? (range = window.getSelection().getRangeAt(0),
  667. range.commonAncestorContainer.parentNode !== input && range.commonAncestorContainer !== input || (begin = range.startOffset,
  668. end = range.endOffset)) : document.selection && document.selection.createRange && (range = document.selection.createRange(),
  669. begin = 0 - range.duplicate().moveStart("character", -input.inputmask._valueGet().length),
  670. end = begin + range.text.length), {
  671. begin: translatePosition(begin),
  672. end: translatePosition(end)
  673. };
  674. if (begin.begin !== undefined && (end = begin.end, begin = begin.begin), "number" == typeof begin) {
  675. begin = translatePosition(begin), end = translatePosition(end), end = "number" == typeof end ? end : begin;
  676. var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;
  677. if (input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0, mobile || !1 !== opts.insertMode || begin !== end || end++,
  678. input.setSelectionRange) input.selectionStart = begin, input.selectionEnd = end; else if (window.getSelection) {
  679. if (range = document.createRange(), input.firstChild === undefined || null === input.firstChild) {
  680. var textNode = document.createTextNode("");
  681. input.appendChild(textNode);
  682. }
  683. range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length),
  684. range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length),
  685. range.collapse(!0);
  686. var sel = window.getSelection();
  687. sel.removeAllRanges(), sel.addRange(range);
  688. } else input.createTextRange && (range = input.createTextRange(), range.collapse(!0),
  689. range.moveEnd("character", end), range.moveStart("character", begin), range.select());
  690. renderColorMask(input, undefined, {
  691. begin: begin,
  692. end: end
  693. });
  694. }
  695. }
  696. function determineLastRequiredPosition(returnDefinition) {
  697. var pos, testPos, buffer = getBuffer(), bl = buffer.length, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = lvTest !== undefined ? lvTest.locator.slice() : undefined;
  698. for (pos = lvp + 1; pos < buffer.length; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
  699. ndxIntlzr = testPos.locator.slice(), positions[pos] = $.extend(!0, {}, testPos);
  700. var lvTestAlt = lvTest && lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation] : undefined;
  701. for (pos = bl - 1; pos > lvp && (testPos = positions[pos], (testPos.match.optionality || testPos.match.optionalQuantifier && testPos.match.newBlockMarker || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && null != testPos.match.fn || null === testPos.match.fn && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAlt.toString().split(",")) && "" !== getTests(pos)[0].def)) && buffer[pos] === getPlaceholder(pos, testPos.match)); pos--) bl--;
  702. return returnDefinition ? {
  703. l: bl,
  704. def: positions[bl] ? positions[bl].match : undefined
  705. } : bl;
  706. }
  707. function clearOptionalTail(buffer) {
  708. for (var validPos, rl = determineLastRequiredPosition(), bl = buffer.length, lv = getMaskSet().validPositions[getLastValidPosition()]; rl < bl && !isMask(rl, !0) && (validPos = lv !== undefined ? getTestTemplate(rl, lv.locator.slice(""), lv) : getTest(rl)) && !0 !== validPos.match.optionality && (!0 !== validPos.match.optionalQuantifier && !0 !== validPos.match.newBlockMarker || rl + 1 === bl && "" === (lv !== undefined ? getTestTemplate(rl + 1, lv.locator.slice(""), lv) : getTest(rl + 1)).match.def); ) rl++;
  709. for (;(validPos = getMaskSet().validPositions[rl - 1]) && validPos && validPos.match.optionality && validPos.input === opts.skipOptionalPartCharacter; ) rl--;
  710. return buffer.splice(rl), buffer;
  711. }
  712. function isComplete(buffer) {
  713. if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts);
  714. if ("*" === opts.repeat) return undefined;
  715. var complete = !1, lrp = determineLastRequiredPosition(!0), aml = seekPrevious(lrp.l);
  716. if (lrp.def === undefined || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {
  717. complete = !0;
  718. for (var i = 0; i <= aml; i++) {
  719. var test = getTestTemplate(i).match;
  720. if (null !== test.fn && getMaskSet().validPositions[i] === undefined && !0 !== test.optionality && !0 !== test.optionalQuantifier || null === test.fn && buffer[i] !== getPlaceholder(i, test)) {
  721. complete = !1;
  722. break;
  723. }
  724. }
  725. }
  726. return complete;
  727. }
  728. function handleRemove(input, k, pos, strict, fromIsValid) {
  729. if ((opts.numericInput || isRTL) && (k === Inputmask.keyCode.BACKSPACE ? k = Inputmask.keyCode.DELETE : k === Inputmask.keyCode.DELETE && (k = Inputmask.keyCode.BACKSPACE),
  730. isRTL)) {
  731. var pend = pos.end;
  732. pos.end = pos.begin, pos.begin = pend;
  733. }
  734. k === Inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || !1 === opts.insertMode) ? (pos.begin = seekPrevious(pos.begin),
  735. getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator && pos.begin--) : k === Inputmask.keyCode.DELETE && pos.begin === pos.end && (pos.end = isMask(pos.end, !0) && getMaskSet().validPositions[pos.end] && getMaskSet().validPositions[pos.end].input !== opts.radixPoint ? pos.end + 1 : seekNext(pos.end) + 1,
  736. getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator && pos.end++),
  737. stripValidPositions(pos.begin, pos.end, !1, strict), !0 !== strict && function() {
  738. if (opts.keepStatic) {
  739. for (var validInputs = [], lastAlt = getLastValidPosition(-1, !0), positionsClone = $.extend(!0, {}, getMaskSet().validPositions), prevAltPos = getMaskSet().validPositions[lastAlt]; lastAlt >= 0; lastAlt--) {
  740. var altPos = getMaskSet().validPositions[lastAlt];
  741. if (altPos) {
  742. if (!0 !== altPos.generatedInput && /[0-9a-bA-Z]/.test(altPos.input) && validInputs.push(altPos.input),
  743. delete getMaskSet().validPositions[lastAlt], altPos.alternation !== undefined && altPos.locator[altPos.alternation] !== prevAltPos.locator[altPos.alternation]) break;
  744. prevAltPos = altPos;
  745. }
  746. }
  747. if (lastAlt > -1) for (getMaskSet().p = seekNext(getLastValidPosition(-1, !0)); validInputs.length > 0; ) {
  748. var keypress = new $.Event("keypress");
  749. keypress.which = validInputs.pop().charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !1, !1, getMaskSet().p);
  750. } else getMaskSet().validPositions = $.extend(!0, {}, positionsClone);
  751. }
  752. }();
  753. var lvp = getLastValidPosition(pos.begin, !0);
  754. if (lvp < pos.begin) getMaskSet().p = seekNext(lvp); else if (!0 !== strict && (getMaskSet().p = pos.begin,
  755. !0 !== fromIsValid)) for (;getMaskSet().p < lvp && getMaskSet().validPositions[getMaskSet().p] === undefined; ) getMaskSet().p++;
  756. }
  757. function initializeColorMask(input) {
  758. function findCaretPos(clientx) {
  759. var caretPos, e = document.createElement("span");
  760. for (var style in computedStyle) isNaN(style) && -1 !== style.indexOf("font") && (e.style[style] = computedStyle[style]);
  761. e.style.textTransform = computedStyle.textTransform, e.style.letterSpacing = computedStyle.letterSpacing,
  762. e.style.position = "absolute", e.style.height = "auto", e.style.width = "auto",
  763. e.style.visibility = "hidden", e.style.whiteSpace = "nowrap", document.body.appendChild(e);
  764. var itl, inputText = input.inputmask._valueGet(), previousWidth = 0;
  765. for (caretPos = 0, itl = inputText.length; caretPos <= itl; caretPos++) {
  766. if (e.innerHTML += inputText.charAt(caretPos) || "_", e.offsetWidth >= clientx) {
  767. var offset1 = clientx - previousWidth, offset2 = e.offsetWidth - clientx;
  768. e.innerHTML = inputText.charAt(caretPos), offset1 -= e.offsetWidth / 3, caretPos = offset1 < offset2 ? caretPos - 1 : caretPos;
  769. break;
  770. }
  771. previousWidth = e.offsetWidth;
  772. }
  773. return document.body.removeChild(e), caretPos;
  774. }
  775. function position() {
  776. colorMask.style.position = "absolute", colorMask.style.top = offset.top + "px",
  777. colorMask.style.left = offset.left + "px", colorMask.style.width = parseInt(input.offsetWidth) - parseInt(computedStyle.paddingLeft) - parseInt(computedStyle.paddingRight) - parseInt(computedStyle.borderLeftWidth) - parseInt(computedStyle.borderRightWidth) + "px",
  778. colorMask.style.height = parseInt(input.offsetHeight) - parseInt(computedStyle.paddingTop) - parseInt(computedStyle.paddingBottom) - parseInt(computedStyle.borderTopWidth) - parseInt(computedStyle.borderBottomWidth) + "px",
  779. colorMask.style.lineHeight = colorMask.style.height, colorMask.style.zIndex = isNaN(computedStyle.zIndex) ? -1 : computedStyle.zIndex - 1,
  780. colorMask.style.webkitAppearance = "textfield", colorMask.style.mozAppearance = "textfield",
  781. colorMask.style.Appearance = "textfield";
  782. }
  783. var offset = $(input).position(), computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null);
  784. colorMask = document.createElement("div"), document.body.appendChild(colorMask);
  785. for (var style in computedStyle) computedStyle.hasOwnProperty(style) && isNaN(style) && "cssText" !== style && -1 == style.indexOf("webkit") && (colorMask.style[style] = computedStyle[style]);
  786. input.style.backgroundColor = "transparent", input.style.color = "transparent",
  787. input.style.webkitAppearance = "caret", input.style.mozAppearance = "caret", input.style.Appearance = "caret",
  788. position(), $(window).on("resize", function(e) {
  789. offset = $(input).position(), computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null),
  790. position();
  791. }), $(input).on("click", function(e) {
  792. return caret(input, findCaretPos(e.clientX)), EventHandlers.clickEvent.call(this, [ e ]);
  793. }), $(input).on("keydown", function(e) {
  794. e.shiftKey || !1 === opts.insertMode || setTimeout(function() {
  795. renderColorMask(input);
  796. }, 0);
  797. });
  798. }
  799. function renderColorMask(input, buffer, caretPos) {
  800. function handleStatic() {
  801. isStatic || null !== test.fn && testPos.input !== undefined ? isStatic && null !== test.fn && testPos.input !== undefined && (isStatic = !1,
  802. maskTemplate += "</span>") : (isStatic = !0, maskTemplate += "<span class='im-static''>");
  803. }
  804. if (colorMask !== undefined) {
  805. buffer = buffer || getBuffer(), caretPos === undefined ? caretPos = caret(input) : caretPos.begin === undefined && (caretPos = {
  806. begin: caretPos,
  807. end: caretPos
  808. });
  809. var maskTemplate = "", isStatic = !1;
  810. if ("" != buffer) {
  811. var ndxIntlzr, test, testPos, pos = 0, lvp = getLastValidPosition();
  812. do {
  813. pos === caretPos.begin && document.activeElement === input && (maskTemplate += "<span class='im-caret' style='border-right-width: 1px;border-right-style: solid;'></span>"),
  814. getMaskSet().validPositions[pos] ? (testPos = getMaskSet().validPositions[pos],
  815. test = testPos.match, ndxIntlzr = testPos.locator.slice(), handleStatic(), maskTemplate += testPos.input) : (testPos = getTestTemplate(pos, ndxIntlzr, pos - 1),
  816. test = testPos.match, ndxIntlzr = testPos.locator.slice(), (!1 === opts.jitMasking || pos < lvp || "number" == typeof opts.jitMasking && isFinite(opts.jitMasking) && opts.jitMasking > pos) && (handleStatic(),
  817. maskTemplate += getPlaceholder(pos, test))), pos++;
  818. } while ((maxLength === undefined || pos < maxLength) && (null !== test.fn || "" !== test.def) || lvp > pos);
  819. }
  820. colorMask.innerHTML = maskTemplate;
  821. }
  822. }
  823. maskset = maskset || this.maskset, opts = opts || this.opts;
  824. var undoValue, $el, maxLength, colorMask, valueBuffer, el = this.el, isRTL = this.isRTL, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, mouseEnter = !1, EventRuler = {
  825. on: function(input, eventName, eventHandler) {
  826. var ev = function(e) {
  827. if (this.inputmask === undefined && "FORM" !== this.nodeName) {
  828. var imOpts = $.data(this, "_inputmask_opts");
  829. imOpts ? new Inputmask(imOpts).mask(this) : EventRuler.off(this);
  830. } else {
  831. if ("setvalue" === e.type || "FORM" === this.nodeName || !(this.disabled || this.readOnly && !("keydown" === e.type && e.ctrlKey && 67 === e.keyCode || !1 === opts.tabThrough && e.keyCode === Inputmask.keyCode.TAB))) {
  832. switch (e.type) {
  833. case "input":
  834. if (!0 === skipInputEvent) return skipInputEvent = !1, e.preventDefault();
  835. break;
  836. case "keydown":
  837. skipKeyPressEvent = !1, skipInputEvent = !1;
  838. break;
  839. case "keypress":
  840. if (!0 === skipKeyPressEvent) return e.preventDefault();
  841. skipKeyPressEvent = !0;
  842. break;
  843. case "click":
  844. if (iemobile || iphone) {
  845. var that = this, args = arguments;
  846. return setTimeout(function() {
  847. eventHandler.apply(that, args);
  848. }, 0), !1;
  849. }
  850. }
  851. var returnVal = eventHandler.apply(this, arguments);
  852. return !1 === returnVal && (e.preventDefault(), e.stopPropagation()), returnVal;
  853. }
  854. e.preventDefault();
  855. }
  856. };
  857. input.inputmask.events[eventName] = input.inputmask.events[eventName] || [], input.inputmask.events[eventName].push(ev),
  858. -1 !== $.inArray(eventName, [ "submit", "reset" ]) ? null != input.form && $(input.form).on(eventName, ev) : $(input).on(eventName, ev);
  859. },
  860. off: function(input, event) {
  861. if (input.inputmask && input.inputmask.events) {
  862. var events;
  863. event ? (events = [], events[event] = input.inputmask.events[event]) : events = input.inputmask.events,
  864. $.each(events, function(eventName, evArr) {
  865. for (;evArr.length > 0; ) {
  866. var ev = evArr.pop();
  867. -1 !== $.inArray(eventName, [ "submit", "reset" ]) ? null != input.form && $(input.form).off(eventName, ev) : $(input).off(eventName, ev);
  868. }
  869. delete input.inputmask.events[eventName];
  870. });
  871. }
  872. }
  873. }, EventHandlers = {
  874. keydownEvent: function(e) {
  875. var input = this, $input = $(input), k = e.keyCode, pos = caret(input);
  876. if (k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && k === Inputmask.keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === Inputmask.keyCode.X && !function(eventName) {
  877. var el = document.createElement("input"), evName = "on" + eventName, isSupported = evName in el;
  878. return isSupported || (el.setAttribute(evName, "return;"), isSupported = "function" == typeof el[evName]),
  879. el = null, isSupported;
  880. }("cut")) e.preventDefault(), handleRemove(input, k, pos), writeBuffer(input, getBuffer(!0), getMaskSet().p, e, input.inputmask._valueGet() !== getBuffer().join("")),
  881. input.inputmask._valueGet() === getBufferTemplate().join("") ? $input.trigger("cleared") : !0 === isComplete(getBuffer()) && $input.trigger("complete"); else if (k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN) {
  882. e.preventDefault();
  883. var caretPos = seekNext(getLastValidPosition());
  884. opts.insertMode || caretPos !== getMaskSet().maskLength || e.shiftKey || caretPos--,
  885. caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, !0);
  886. } else k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP ? (e.preventDefault(),
  887. caret(input, 0, e.shiftKey ? pos.begin : 0, !0)) : (opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || 90 === k && e.ctrlKey) && !0 !== e.altKey ? (checkVal(input, !0, !1, undoValue.split("")),
  888. $input.trigger("click")) : k !== Inputmask.keyCode.INSERT || e.shiftKey || e.ctrlKey ? !0 === opts.tabThrough && k === Inputmask.keyCode.TAB ? (!0 === e.shiftKey ? (null === getTest(pos.begin).match.fn && (pos.begin = seekNext(pos.begin)),
  889. pos.end = seekPrevious(pos.begin, !0), pos.begin = seekPrevious(pos.end, !0)) : (pos.begin = seekNext(pos.begin, !0),
  890. pos.end = seekNext(pos.begin, !0), pos.end < getMaskSet().maskLength && pos.end--),
  891. pos.begin < getMaskSet().maskLength && (e.preventDefault(), caret(input, pos.begin, pos.end))) : e.shiftKey || !1 === opts.insertMode && (k === Inputmask.keyCode.RIGHT ? setTimeout(function() {
  892. var caretPos = caret(input);
  893. caret(input, caretPos.begin);
  894. }, 0) : k === Inputmask.keyCode.LEFT && setTimeout(function() {
  895. var caretPos = caret(input);
  896. caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1);
  897. }, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin !== getMaskSet().maskLength ? pos.begin : pos.begin - 1));
  898. opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts), ignorable = -1 !== $.inArray(k, opts.ignorables);
  899. },
  900. keypressEvent: function(e, checkval, writeOut, strict, ndx) {
  901. var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;
  902. if (!(!0 === checkval || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable)) return k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join("") && (undoValue = getBuffer().join(""),
  903. setTimeout(function() {
  904. $input.trigger("change");
  905. }, 0)), !0;
  906. if (k) {
  907. 46 === k && !1 === e.shiftKey && "" !== opts.radixPoint && (k = opts.radixPoint.charCodeAt(0));
  908. var forwardPosition, pos = checkval ? {
  909. begin: ndx,
  910. end: ndx
  911. } : caret(input), c = String.fromCharCode(k);
  912. getMaskSet().writeOutBuffer = !0;
  913. var valResult = isValid(pos, c, strict);
  914. if (!1 !== valResult && (resetMaskSet(!0), forwardPosition = valResult.caret !== undefined ? valResult.caret : checkval ? valResult.pos + 1 : seekNext(valResult.pos),
  915. getMaskSet().p = forwardPosition), !1 !== writeOut && (setTimeout(function() {
  916. opts.onKeyValidation.call(input, k, valResult, opts);
  917. }, 0), getMaskSet().writeOutBuffer && !1 !== valResult)) {
  918. var buffer = getBuffer();
  919. writeBuffer(input, buffer, opts.numericInput && valResult.caret === undefined ? seekPrevious(forwardPosition) : forwardPosition, e, !0 !== checkval),
  920. !0 !== checkval && setTimeout(function() {
  921. !0 === isComplete(buffer) && $input.trigger("complete");
  922. }, 0);
  923. }
  924. if (e.preventDefault(), checkval) return !1 !== valResult && (valResult.forwardPosition = forwardPosition),
  925. valResult;
  926. }
  927. },
  928. pasteEvent: function(e) {
  929. var tempValue, input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(!0), caretPos = caret(input);
  930. isRTL && (tempValue = caretPos.end, caretPos.end = caretPos.begin, caretPos.begin = tempValue);
  931. var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);
  932. if (valueBeforeCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join("") && (valueBeforeCaret = ""),
  933. valueAfterCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(caretPos.end).join("") && (valueAfterCaret = ""),
  934. isRTL && (tempValue = valueBeforeCaret, valueBeforeCaret = valueAfterCaret, valueAfterCaret = tempValue),
  935. window.clipboardData && window.clipboardData.getData) inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret; else {
  936. if (!ev.clipboardData || !ev.clipboardData.getData) return !0;
  937. inputValue = valueBeforeCaret + ev.clipboardData.getData("text/plain") + valueAfterCaret;
  938. }
  939. var pasteValue = inputValue;
  940. if ($.isFunction(opts.onBeforePaste)) {
  941. if (!1 === (pasteValue = opts.onBeforePaste(inputValue, opts))) return e.preventDefault();
  942. pasteValue || (pasteValue = inputValue);
  943. }
  944. return checkVal(input, !1, !1, isRTL ? pasteValue.split("").reverse() : pasteValue.toString().split("")),
  945. writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()), e, undoValue !== getBuffer().join("")),
  946. !0 === isComplete(getBuffer()) && $input.trigger("complete"), e.preventDefault();
  947. },
  948. inputFallBackEvent: function(e) {
  949. var input = this, inputValue = input.inputmask._valueGet();
  950. if (getBuffer().join("") !== inputValue) {
  951. var caretPos = caret(input);
  952. if ("." === inputValue.charAt(caretPos.begin - 1) && "" !== opts.radixPoint && (inputValue = inputValue.split(""),
  953. inputValue[caretPos.begin - 1] = opts.radixPoint.charAt(0), inputValue = inputValue.join("")),
  954. inputValue.charAt(caretPos.begin - 1) === opts.radixPoint && inputValue.length > getBuffer().length) {
  955. var keypress = new $.Event("keypress");
  956. return keypress.which = opts.radixPoint.charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !0, !1, caretPos.begin),
  957. !1;
  958. }
  959. if (inputValue = inputValue.replace(new RegExp("(" + Inputmask.escapeRegex(getBufferTemplate().join("")) + ")*"), ""),
  960. iemobile) {
  961. var inputChar = inputValue.replace(getBuffer().join(""), "");
  962. if (1 === inputChar.length) {
  963. var keypress = new $.Event("keypress");
  964. return keypress.which = inputChar.charCodeAt(0), EventHandlers.keypressEvent.call(input, keypress, !0, !0, !1, getMaskSet().validPositions[caretPos.begin - 1] ? caretPos.begin : caretPos.begin - 1),
  965. !1;
  966. }
  967. }
  968. if (caretPos.begin > inputValue.length && (caret(input, inputValue.length), caretPos = caret(input)),
  969. getBuffer().length - inputValue.length != 1 || inputValue.charAt(caretPos.begin) === getBuffer()[caretPos.begin] || inputValue.charAt(caretPos.begin + 1) === getBuffer()[caretPos.begin] || isMask(caretPos.begin)) {
  970. var stickyParts = [], bufferTemplate = getBufferTemplate().join("");
  971. for (stickyParts.push(inputValue.substr(0, caretPos.begin)), stickyParts.push(inputValue.substr(caretPos.begin)); null === inputValue.match(Inputmask.escapeRegex(bufferTemplate) + "$"); ) bufferTemplate = bufferTemplate.slice(1);
  972. inputValue = inputValue.replace(bufferTemplate, ""), $.isFunction(opts.onBeforeMask) && (inputValue = opts.onBeforeMask(inputValue, opts) || inputValue),
  973. checkVal(input, !0, !1, inputValue.split(""), e), function(input, frontPart, backPart) {
  974. var targetPos = caret(input).begin, currentValue = input.inputmask._valueGet(), pos = currentValue.indexOf(frontPart), currentPos = targetPos;
  975. if (0 === pos && targetPos !== frontPart.length) targetPos = frontPart.length; else {
  976. for (;null === currentValue.match(Inputmask.escapeRegex(backPart) + "$"); ) backPart = backPart.substr(1);
  977. var pos2 = currentValue.indexOf(backPart);
  978. -1 !== pos2 && "" !== backPart && targetPos > pos2 && pos2 > pos && (targetPos = pos2);
  979. }
  980. isMask(targetPos) || (targetPos = seekNext(targetPos)), currentPos !== targetPos && (caret(input, targetPos),
  981. android && setTimeout(function() {
  982. caret(input, targetPos);
  983. }, 0));
  984. }(input, stickyParts[0], stickyParts[1]), !0 === isComplete(getBuffer()) && $(input).trigger("complete");
  985. } else e.keyCode = Inputmask.keyCode.BACKSPACE, EventHandlers.keydownEvent.call(input, e);
  986. e.preventDefault();
  987. }
  988. },
  989. setValueEvent: function(e) {
  990. this.inputmask.refreshValue = !1;
  991. var input = this, value = input.inputmask._valueGet(!0);
  992. $.isFunction(opts.onBeforeMask) && (value = opts.onBeforeMask(value, opts) || value),
  993. value = value.split(""), checkVal(input, !0, !1, isRTL ? value.reverse() : value),
  994. undoValue = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join("") && input.inputmask._valueSet("");
  995. },
  996. focusEvent: function(e) {
  997. var input = this, nptValue = input.inputmask._valueGet();
  998. opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && "" === nptValue) && (input.inputmask._valueGet() !== getBuffer().join("") ? writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())) : !1 === mouseEnter && caret(input, seekNext(getLastValidPosition()))),
  999. !0 === opts.positionCaretOnTab && !1 === mouseEnter && (writeBuffer(input, getBuffer(), caret(input)),
  1000. EventHandlers.clickEvent.apply(input, [ e, !0 ])), undoValue = getBuffer().join("");
  1001. },
  1002. mouseleaveEvent: function(e) {
  1003. var input = this;
  1004. if (mouseEnter = !1, opts.clearMaskOnLostFocus && document.activeElement !== input) {
  1005. var buffer = getBuffer().slice(), nptValue = input.inputmask._valueGet();
  1006. nptValue !== input.getAttribute("placeholder") && "" !== nptValue && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer),
  1007. writeBuffer(input, buffer));
  1008. }
  1009. },
  1010. clickEvent: function(e, tabbed) {
  1011. function doRadixFocus(clickPos) {
  1012. if ("" !== opts.radixPoint) {
  1013. var vps = getMaskSet().validPositions;
  1014. if (vps[clickPos] === undefined || vps[clickPos].input === getPlaceholder(clickPos)) {
  1015. if (clickPos < seekNext(-1)) return !0;
  1016. var radixPos = $.inArray(opts.radixPoint, getBuffer());
  1017. if (-1 !== radixPos) {
  1018. for (var vp in vps) if (radixPos < vp && vps[vp].input !== getPlaceholder(vp)) return !1;
  1019. return !0;
  1020. }
  1021. }
  1022. }
  1023. return !1;
  1024. }
  1025. var input = this;
  1026. setTimeout(function() {
  1027. if (document.activeElement === input) {
  1028. var selectedCaret = caret(input);
  1029. if (tabbed && (isRTL ? selectedCaret.end = selectedCaret.begin : selectedCaret.begin = selectedCaret.end),
  1030. selectedCaret.begin === selectedCaret.end) switch (opts.positionCaretOnClick) {
  1031. case "none":
  1032. break;
  1033. case "radixFocus":
  1034. if (doRadixFocus(selectedCaret.begin)) {
  1035. var radixPos = getBuffer().join("").indexOf(opts.radixPoint);
  1036. caret(input, opts.numericInput ? seekNext(radixPos) : radixPos);
  1037. break;
  1038. }
  1039. default:
  1040. var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, !0), lastPosition = seekNext(lvclickPosition);
  1041. if (clickPosition < lastPosition) caret(input, isMask(clickPosition) || isMask(clickPosition - 1) ? clickPosition : seekNext(clickPosition)); else {
  1042. var placeholder = getPlaceholder(lastPosition), lvp = getMaskSet().validPositions[lvclickPosition], tt = getTestTemplate(lastPosition, lvp ? lvp.match.locator : undefined, lvp);
  1043. if ("" !== placeholder && getBuffer()[lastPosition] !== placeholder && !0 !== tt.match.optionalQuantifier || !isMask(lastPosition) && tt.match.def === placeholder) {
  1044. var newPos = seekNext(lastPosition);
  1045. clickPosition >= newPos && (lastPosition = newPos);
  1046. }
  1047. caret(input, lastPosition);
  1048. }
  1049. }
  1050. }
  1051. }, 0);
  1052. },
  1053. dblclickEvent: function(e) {
  1054. var input = this;
  1055. setTimeout(function() {
  1056. caret(input, 0, seekNext(getLastValidPosition()));
  1057. }, 0);
  1058. },
  1059. cutEvent: function(e) {
  1060. var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e, clipboardData = window.clipboardData || ev.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end);
  1061. clipboardData.setData("text", isRTL ? clipData.reverse().join("") : clipData.join("")),
  1062. document.execCommand && document.execCommand("copy"), handleRemove(input, Inputmask.keyCode.DELETE, pos),
  1063. writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join("")),
  1064. input.inputmask._valueGet() === getBufferTemplate().join("") && $input.trigger("cleared");
  1065. },
  1066. blurEvent: function(e) {
  1067. var $input = $(this), input = this;
  1068. if (input.inputmask) {
  1069. var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();
  1070. "" !== nptValue && (opts.clearMaskOnLostFocus && (-1 === getLastValidPosition() && nptValue === getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)),
  1071. !1 === isComplete(buffer) && (setTimeout(function() {
  1072. $input.trigger("incomplete");
  1073. }, 0), opts.clearIncomplete && (resetMaskSet(), buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())),
  1074. writeBuffer(input, buffer, undefined, e)), undoValue !== getBuffer().join("") && (undoValue = buffer.join(""),
  1075. $input.trigger("change"));
  1076. }
  1077. },
  1078. mouseenterEvent: function(e) {
  1079. var input = this;
  1080. mouseEnter = !0, document.activeElement !== input && opts.showMaskOnHover && input.inputmask._valueGet() !== getBuffer().join("") && writeBuffer(input, getBuffer());
  1081. },
  1082. submitEvent: function(e) {
  1083. undoValue !== getBuffer().join("") && $el.trigger("change"), opts.clearMaskOnLostFocus && -1 === getLastValidPosition() && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join("") && el.inputmask._valueSet(""),
  1084. opts.removeMaskOnSubmit && (el.inputmask._valueSet(el.inputmask.unmaskedvalue(), !0),
  1085. setTimeout(function() {
  1086. writeBuffer(el, getBuffer());
  1087. }, 0));
  1088. },
  1089. resetEvent: function(e) {
  1090. el.inputmask.refreshValue = !0, setTimeout(function() {
  1091. $el.trigger("setvalue");
  1092. }, 0);
  1093. }
  1094. };
  1095. if (actionObj !== undefined) switch (actionObj.action) {
  1096. case "isComplete":
  1097. return el = actionObj.el, isComplete(getBuffer());
  1098. case "unmaskedvalue":
  1099. return el !== undefined && actionObj.value === undefined || (valueBuffer = actionObj.value,
  1100. valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(valueBuffer, opts) || valueBuffer : valueBuffer).split(""),
  1101. checkVal(undefined, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite(undefined, getBuffer(), 0, opts)),
  1102. unmaskedvalue(el);
  1103. case "mask":
  1104. !function(elem) {
  1105. EventRuler.off(elem);
  1106. var isSupported = function(input, opts) {
  1107. var elementType = input.getAttribute("type"), isSupported = "INPUT" === input.tagName && -1 !== $.inArray(elementType, opts.supportsInputType) || input.isContentEditable || "TEXTAREA" === input.tagName;
  1108. if (!isSupported) if ("INPUT" === input.tagName) {
  1109. var el = document.createElement("input");
  1110. el.setAttribute("type", elementType), isSupported = "text" === el.type, el = null;
  1111. } else isSupported = "partial";
  1112. return !1 !== isSupported && function(npt) {
  1113. function getter() {
  1114. return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== getLastValidPosition() || !0 !== opts.nullable ? document.activeElement === this && opts.clearMaskOnLostFocus ? (isRTL ? clearOptionalTail(getBuffer().slice()).reverse() : clearOptionalTail(getBuffer().slice())).join("") : valueGet.call(this) : "" : valueGet.call(this);
  1115. }
  1116. function setter(value) {
  1117. valueSet.call(this, value), this.inputmask && $(this).trigger("setvalue");
  1118. }
  1119. var valueGet, valueSet;
  1120. if (!npt.inputmask.__valueGet) {
  1121. if (!0 !== opts.noValuePatching) {
  1122. if (Object.getOwnPropertyDescriptor) {
  1123. "function" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = "object" === _typeof("test".__proto__) ? function(object) {
  1124. return object.__proto__;
  1125. } : function(object) {
  1126. return object.constructor.prototype;
  1127. });
  1128. var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), "value") : undefined;
  1129. valueProperty && valueProperty.get && valueProperty.set ? (valueGet = valueProperty.get,
  1130. valueSet = valueProperty.set, Object.defineProperty(npt, "value", {
  1131. get: getter,
  1132. set: setter,
  1133. configurable: !0
  1134. })) : "INPUT" !== npt.tagName && (valueGet = function() {
  1135. return this.textContent;
  1136. }, valueSet = function(value) {
  1137. this.textContent = value;
  1138. }, Object.defineProperty(npt, "value", {
  1139. get: getter,
  1140. set: setter,
  1141. configurable: !0
  1142. }));
  1143. } else document.__lookupGetter__ && npt.__lookupGetter__("value") && (valueGet = npt.__lookupGetter__("value"),
  1144. valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter),
  1145. npt.__defineSetter__("value", setter));
  1146. npt.inputmask.__valueGet = valueGet, npt.inputmask.__valueSet = valueSet;
  1147. }
  1148. npt.inputmask._valueGet = function(overruleRTL) {
  1149. return isRTL && !0 !== overruleRTL ? valueGet.call(this.el).split("").reverse().join("") : valueGet.call(this.el);
  1150. }, npt.inputmask._valueSet = function(value, overruleRTL) {
  1151. valueSet.call(this.el, null === value || value === undefined ? "" : !0 !== overruleRTL && isRTL ? value.split("").reverse().join("") : value);
  1152. }, valueGet === undefined && (valueGet = function() {
  1153. return this.value;
  1154. }, valueSet = function(value) {
  1155. this.value = value;
  1156. }, function(type) {
  1157. if ($.valHooks && ($.valHooks[type] === undefined || !0 !== $.valHooks[type].inputmaskpatch)) {
  1158. var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {
  1159. return elem.value;
  1160. }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {
  1161. return elem.value = value, elem;
  1162. };
  1163. $.valHooks[type] = {
  1164. get: function(elem) {
  1165. if (elem.inputmask) {
  1166. if (elem.inputmask.opts.autoUnmask) return elem.inputmask.unmaskedvalue();
  1167. var result = valhookGet(elem);
  1168. return -1 !== getLastValidPosition(undefined, undefined, elem.inputmask.maskset.validPositions) || !0 !== opts.nullable ? result : "";
  1169. }
  1170. return valhookGet(elem);
  1171. },
  1172. set: function(elem, value) {
  1173. var result, $elem = $(elem);
  1174. return result = valhookSet(elem, value), elem.inputmask && $elem.trigger("setvalue"),
  1175. result;
  1176. },
  1177. inputmaskpatch: !0
  1178. };
  1179. }
  1180. }(npt.type), function(npt) {
  1181. EventRuler.on(npt, "mouseenter", function(event) {
  1182. var $input = $(this);
  1183. this.inputmask._valueGet() !== getBuffer().join("") && $input.trigger("setvalue");
  1184. });
  1185. }(npt));
  1186. }
  1187. }(input), isSupported;
  1188. }(elem, opts);
  1189. if (!1 !== isSupported && (el = elem, $el = $(el), !0 === opts.colorMask && initializeColorMask(el),
  1190. android && (el.hasOwnProperty("inputmode") && (el.inputmode = opts.inputmode, el.setAttribute("inputmode", opts.inputmode)),
  1191. "rtfm" === opts.androidHack && (!0 !== opts.colorMask && initializeColorMask(el),
  1192. el.type = "password")), !0 === isSupported && (EventRuler.on(el, "submit", EventHandlers.submitEvent),
  1193. EventRuler.on(el, "reset", EventHandlers.resetEvent), EventRuler.on(el, "mouseenter", EventHandlers.mouseenterEvent),
  1194. EventRuler.on(el, "blur", EventHandlers.blurEvent), EventRuler.on(el, "focus", EventHandlers.focusEvent),
  1195. EventRuler.on(el, "mouseleave", EventHandlers.mouseleaveEvent), !0 !== opts.colorMask && EventRuler.on(el, "click", EventHandlers.clickEvent),
  1196. EventRuler.on(el, "dblclick", EventHandlers.dblclickEvent), EventRuler.on(el, "paste", EventHandlers.pasteEvent),
  1197. EventRuler.on(el, "dragdrop", EventHandlers.pasteEvent), EventRuler.on(el, "drop", EventHandlers.pasteEvent),
  1198. EventRuler.on(el, "cut", EventHandlers.cutEvent), EventRuler.on(el, "complete", opts.oncomplete),
  1199. EventRuler.on(el, "incomplete", opts.onincomplete), EventRuler.on(el, "cleared", opts.oncleared),
  1200. android || !0 === opts.inputEventOnly || (EventRuler.on(el, "keydown", EventHandlers.keydownEvent),
  1201. EventRuler.on(el, "keypress", EventHandlers.keypressEvent)), EventRuler.on(el, "compositionstart", $.noop),
  1202. EventRuler.on(el, "compositionupdate", $.noop), EventRuler.on(el, "compositionend", $.noop),
  1203. EventRuler.on(el, "keyup", $.noop), EventRuler.on(el, "input", EventHandlers.inputFallBackEvent),
  1204. EventRuler.on(el, "beforeinput", $.noop)), EventRuler.on(el, "setvalue", EventHandlers.setValueEvent),
  1205. undoValue = getBufferTemplate().join(""), "" !== el.inputmask._valueGet(!0) || !1 === opts.clearMaskOnLostFocus || document.activeElement === el)) {
  1206. var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(el.inputmask._valueGet(!0), opts) || el.inputmask._valueGet(!0) : el.inputmask._valueGet(!0);
  1207. "" !== initialValue && checkVal(el, !0, !1, isRTL ? initialValue.split("").reverse() : initialValue.split(""));
  1208. var buffer = getBuffer().slice();
  1209. undoValue = buffer.join(""), !1 === isComplete(buffer) && opts.clearIncomplete && resetMaskSet(),
  1210. opts.clearMaskOnLostFocus && document.activeElement !== el && (-1 === getLastValidPosition() ? buffer = [] : clearOptionalTail(buffer)),
  1211. writeBuffer(el, buffer), document.activeElement === el && caret(el, seekNext(getLastValidPosition()));
  1212. }
  1213. }(el);
  1214. break;
  1215. case "format":
  1216. return valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(actionObj.value, opts) || actionObj.value : actionObj.value).split(""),
  1217. checkVal(undefined, !0, !1, isRTL ? valueBuffer.reverse() : valueBuffer), actionObj.metadata ? {
  1218. value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""),
  1219. metadata: maskScope.call(this, {
  1220. action: "getmetadata"
  1221. }, maskset, opts)
  1222. } : isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join("");
  1223. case "isValid":
  1224. actionObj.value ? (valueBuffer = actionObj.value.split(""), checkVal(undefined, !0, !0, isRTL ? valueBuffer.reverse() : valueBuffer)) : actionObj.value = getBuffer().join("");
  1225. for (var buffer = getBuffer(), rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ;
  1226. return buffer.splice(rl, lmib + 1 - rl), isComplete(buffer) && actionObj.value === getBuffer().join("");
  1227. case "getemptymask":
  1228. return getBufferTemplate().join("");
  1229. case "remove":
  1230. if (el && el.inputmask) {
  1231. $el = $(el), el.inputmask._valueSet(opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(!0)),
  1232. EventRuler.off(el);
  1233. Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), "value") && el.inputmask.__valueGet && Object.defineProperty(el, "value", {
  1234. get: el.inputmask.__valueGet,
  1235. set: el.inputmask.__valueSet,
  1236. configurable: !0
  1237. }) : document.__lookupGetter__ && el.__lookupGetter__("value") && el.inputmask.__valueGet && (el.__defineGetter__("value", el.inputmask.__valueGet),
  1238. el.__defineSetter__("value", el.inputmask.__valueSet)), el.inputmask = undefined;
  1239. }
  1240. return el;
  1241. case "getmetadata":
  1242. if ($.isArray(maskset.metadata)) {
  1243. var maskTarget = getMaskTemplate(!0, 0, !1).join("");
  1244. return $.each(maskset.metadata, function(ndx, mtdt) {
  1245. if (mtdt.mask === maskTarget) return maskTarget = mtdt, !1;
  1246. }), maskTarget;
  1247. }
  1248. return maskset.metadata;
  1249. }
  1250. }
  1251. var ua = navigator.userAgent, mobile = /mobile/i.test(ua), iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile, android = /android/i.test(ua) && !iemobile;
  1252. return Inputmask.prototype = {
  1253. dataAttribute: "data-inputmask",
  1254. defaults: {
  1255. placeholder: "_",
  1256. optionalmarker: {
  1257. start: "[",
  1258. end: "]"
  1259. },
  1260. quantifiermarker: {
  1261. start: "{",
  1262. end: "}"
  1263. },
  1264. groupmarker: {
  1265. start: "(",
  1266. end: ")"
  1267. },
  1268. alternatormarker: "|",
  1269. escapeChar: "\\",
  1270. mask: null,
  1271. regex: null,
  1272. oncomplete: $.noop,
  1273. onincomplete: $.noop,
  1274. oncleared: $.noop,
  1275. repeat: 0,
  1276. greedy: !0,
  1277. autoUnmask: !1,
  1278. removeMaskOnSubmit: !1,
  1279. clearMaskOnLostFocus: !0,
  1280. insertMode: !0,
  1281. clearIncomplete: !1,
  1282. alias: null,
  1283. onKeyDown: $.noop,
  1284. onBeforeMask: null,
  1285. onBeforePaste: function(pastedValue, opts) {
  1286. return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask(pastedValue, opts) : pastedValue;
  1287. },
  1288. onBeforeWrite: null,
  1289. onUnMask: null,
  1290. showMaskOnFocus: !0,
  1291. showMaskOnHover: !0,
  1292. onKeyValidation: $.noop,
  1293. skipOptionalPartCharacter: " ",
  1294. numericInput: !1,
  1295. rightAlign: !1,
  1296. undoOnEscape: !0,
  1297. radixPoint: "",
  1298. radixPointDefinitionSymbol: undefined,
  1299. groupSeparator: "",
  1300. keepStatic: null,
  1301. positionCaretOnTab: !0,
  1302. tabThrough: !1,
  1303. supportsInputType: [ "text", "tel", "password" ],
  1304. 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 ],
  1305. isComplete: null,
  1306. canClearPosition: $.noop,
  1307. preValidation: null,
  1308. postValidation: null,
  1309. staticDefinitionSymbol: undefined,
  1310. jitMasking: !1,
  1311. nullable: !0,
  1312. inputEventOnly: !1,
  1313. noValuePatching: !1,
  1314. positionCaretOnClick: "lvp",
  1315. casing: null,
  1316. inputmode: "verbatim",
  1317. colorMask: !1,
  1318. androidHack: !1
  1319. },
  1320. definitions: {
  1321. "9": {
  1322. validator: "[0-9]",
  1323. cardinality: 1,
  1324. definitionSymbol: "*"
  1325. },
  1326. a: {
  1327. validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  1328. cardinality: 1,
  1329. definitionSymbol: "*"
  1330. },
  1331. "*": {
  1332. validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  1333. cardinality: 1
  1334. }
  1335. },
  1336. aliases: {},
  1337. masksCache: {},
  1338. mask: function(elems) {
  1339. function importAttributeOptions(npt, opts, userOptions, dataAttribute) {
  1340. function importOption(option, optionData) {
  1341. null !== (optionData = optionData !== undefined ? optionData : npt.getAttribute(dataAttribute + "-" + option)) && ("string" == typeof optionData && (0 === option.indexOf("on") ? optionData = window[optionData] : "false" === optionData ? optionData = !1 : "true" === optionData && (optionData = !0)),
  1342. userOptions[option] = optionData);
  1343. }
  1344. ("rtl" === npt.dir || opts.rightAlign) && (npt.style.textAlign = "right"), ("rtl" === npt.dir || opts.numericInput) && (npt.dir = "ltr",
  1345. npt.removeAttribute("dir"), opts.isRTL = !0);
  1346. var option, dataoptions, optionData, p, attrOptions = npt.getAttribute(dataAttribute);
  1347. if (attrOptions && "" !== attrOptions && (attrOptions = attrOptions.replace(new RegExp("'", "g"), '"'),
  1348. dataoptions = JSON.parse("{" + attrOptions + "}")), dataoptions) {
  1349. optionData = undefined;
  1350. for (p in dataoptions) if ("alias" === p.toLowerCase()) {
  1351. optionData = dataoptions[p];
  1352. break;
  1353. }
  1354. }
  1355. importOption("alias", optionData), userOptions.alias && resolveAlias(userOptions.alias, userOptions, opts);
  1356. for (option in opts) {
  1357. if (dataoptions) {
  1358. optionData = undefined;
  1359. for (p in dataoptions) if (p.toLowerCase() === option.toLowerCase()) {
  1360. optionData = dataoptions[p];
  1361. break;
  1362. }
  1363. }
  1364. importOption(option, optionData);
  1365. }
  1366. return $.extend(!0, opts, userOptions), opts;
  1367. }
  1368. var that = this;
  1369. return "string" == typeof elems && (elems = document.getElementById(elems) || document.querySelectorAll(elems)),
  1370. elems = elems.nodeName ? [ elems ] : elems, $.each(elems, function(ndx, el) {
  1371. var scopedOpts = $.extend(!0, {}, that.opts);
  1372. importAttributeOptions(el, scopedOpts, $.extend(!0, {}, that.userOptions), that.dataAttribute);
  1373. var maskset = generateMaskSet(scopedOpts, that.noMasksCache);
  1374. maskset !== undefined && (el.inputmask !== undefined && el.inputmask.remove(), el.inputmask = new Inputmask(undefined, undefined, !0),
  1375. el.inputmask.opts = scopedOpts, el.inputmask.noMasksCache = that.noMasksCache, el.inputmask.userOptions = $.extend(!0, {}, that.userOptions),
  1376. el.inputmask.isRTL = scopedOpts.isRTL, el.inputmask.el = el, el.inputmask.maskset = maskset,
  1377. $.data(el, "_inputmask_opts", scopedOpts), maskScope.call(el.inputmask, {
  1378. action: "mask"
  1379. }));
  1380. }), elems && elems[0] ? elems[0].inputmask || this : this;
  1381. },
  1382. option: function(options, noremask) {
  1383. return "string" == typeof options ? this.opts[options] : "object" === (void 0 === options ? "undefined" : _typeof(options)) ? ($.extend(this.userOptions, options),
  1384. this.el && !0 !== noremask && this.mask(this.el), this) : void 0;
  1385. },
  1386. unmaskedvalue: function(value) {
  1387. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1388. maskScope.call(this, {
  1389. action: "unmaskedvalue",
  1390. value: value
  1391. });
  1392. },
  1393. remove: function() {
  1394. return maskScope.call(this, {
  1395. action: "remove"
  1396. });
  1397. },
  1398. getemptymask: function() {
  1399. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1400. maskScope.call(this, {
  1401. action: "getemptymask"
  1402. });
  1403. },
  1404. hasMaskedValue: function() {
  1405. return !this.opts.autoUnmask;
  1406. },
  1407. isComplete: function() {
  1408. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1409. maskScope.call(this, {
  1410. action: "isComplete"
  1411. });
  1412. },
  1413. getmetadata: function() {
  1414. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1415. maskScope.call(this, {
  1416. action: "getmetadata"
  1417. });
  1418. },
  1419. isValid: function(value) {
  1420. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1421. maskScope.call(this, {
  1422. action: "isValid",
  1423. value: value
  1424. });
  1425. },
  1426. format: function(value, metadata) {
  1427. return this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache),
  1428. maskScope.call(this, {
  1429. action: "format",
  1430. value: value,
  1431. metadata: metadata
  1432. });
  1433. },
  1434. analyseMask: function(mask, regexMask, opts) {
  1435. function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {
  1436. this.matches = [], this.openGroup = isGroup || !1, this.alternatorGroup = !1, this.isGroup = isGroup || !1,
  1437. this.isOptional = isOptional || !1, this.isQuantifier = isQuantifier || !1, this.isAlternator = isAlternator || !1,
  1438. this.quantifier = {
  1439. min: 1,
  1440. max: 1
  1441. };
  1442. }
  1443. function insertTestDefinition(mtoken, element, position) {
  1444. position = position !== undefined ? position : mtoken.matches.length;
  1445. var prevMatch = mtoken.matches[position - 1];
  1446. if (regexMask) 0 === element.indexOf("[") || escaped ? mtoken.matches.splice(position++, 0, {
  1447. fn: new RegExp(element, opts.casing ? "i" : ""),
  1448. cardinality: 1,
  1449. optionality: mtoken.isOptional,
  1450. newBlockMarker: prevMatch === undefined || prevMatch.def !== element,
  1451. casing: null,
  1452. def: element,
  1453. placeholder: undefined,
  1454. nativeDef: element
  1455. }) : $.each(element.split(""), function(ndx, lmnt) {
  1456. prevMatch = mtoken.matches[position - 1], mtoken.matches.splice(position++, 0, {
  1457. fn: null,
  1458. cardinality: 0,
  1459. optionality: mtoken.isOptional,
  1460. newBlockMarker: prevMatch === undefined || prevMatch.def !== lmnt && null !== prevMatch.fn,
  1461. casing: null,
  1462. def: opts.staticDefinitionSymbol || lmnt,
  1463. placeholder: opts.staticDefinitionSymbol !== undefined ? lmnt : undefined,
  1464. nativeDef: lmnt
  1465. });
  1466. }), escaped = !1; else {
  1467. var maskdef = (opts.definitions ? opts.definitions[element] : undefined) || Inputmask.prototype.definitions[element];
  1468. if (maskdef && !escaped) {
  1469. for (var prevalidators = maskdef.prevalidator, prevalidatorsL = prevalidators ? prevalidators.length : 0, i = 1; i < maskdef.cardinality; i++) {
  1470. var prevalidator = prevalidatorsL >= i ? prevalidators[i - 1] : [], validator = prevalidator.validator, cardinality = prevalidator.cardinality;
  1471. mtoken.matches.splice(position++, 0, {
  1472. fn: validator ? "string" == typeof validator ? new RegExp(validator, opts.casing ? "i" : "") : new function() {
  1473. this.test = validator;
  1474. }() : new RegExp("."),
  1475. cardinality: cardinality || 1,
  1476. optionality: mtoken.isOptional,
  1477. newBlockMarker: prevMatch === undefined || prevMatch.def !== (maskdef.definitionSymbol || element),
  1478. casing: maskdef.casing,
  1479. def: maskdef.definitionSymbol || element,
  1480. placeholder: maskdef.placeholder,
  1481. nativeDef: element
  1482. }), prevMatch = mtoken.matches[position - 1];
  1483. }
  1484. mtoken.matches.splice(position++, 0, {
  1485. fn: maskdef.validator ? "string" == typeof maskdef.validator ? new RegExp(maskdef.validator, opts.casing ? "i" : "") : new function() {
  1486. this.test = maskdef.validator;
  1487. }() : new RegExp("."),
  1488. cardinality: maskdef.cardinality,
  1489. optionality: mtoken.isOptional,
  1490. newBlockMarker: prevMatch === undefined || prevMatch.def !== (maskdef.definitionSymbol || element),
  1491. casing: maskdef.casing,
  1492. def: maskdef.definitionSymbol || element,
  1493. placeholder: maskdef.placeholder,
  1494. nativeDef: element
  1495. });
  1496. } else mtoken.matches.splice(position++, 0, {
  1497. fn: null,
  1498. cardinality: 0,
  1499. optionality: mtoken.isOptional,
  1500. newBlockMarker: prevMatch === undefined || prevMatch.def !== element && null !== prevMatch.fn,
  1501. casing: null,
  1502. def: opts.staticDefinitionSymbol || element,
  1503. placeholder: opts.staticDefinitionSymbol !== undefined ? element : undefined,
  1504. nativeDef: element
  1505. }), escaped = !1;
  1506. }
  1507. }
  1508. function verifyGroupMarker(maskToken) {
  1509. maskToken && maskToken.matches && $.each(maskToken.matches, function(ndx, token) {
  1510. var nextToken = maskToken.matches[ndx + 1];
  1511. (nextToken === undefined || nextToken.matches === undefined || !1 === nextToken.isQuantifier) && token && token.isGroup && (token.isGroup = !1,
  1512. regexMask || (insertTestDefinition(token, opts.groupmarker.start, 0), !0 !== token.openGroup && insertTestDefinition(token, opts.groupmarker.end))),
  1513. verifyGroupMarker(token);
  1514. });
  1515. }
  1516. function defaultCase() {
  1517. if (openenings.length > 0) {
  1518. if (currentOpeningToken = openenings[openenings.length - 1], insertTestDefinition(currentOpeningToken, m),
  1519. currentOpeningToken.isAlternator) {
  1520. alternator = openenings.pop();
  1521. for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1;
  1522. openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1],
  1523. currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);
  1524. }
  1525. } else insertTestDefinition(currentToken, m);
  1526. }
  1527. function reverseTokens(maskToken) {
  1528. maskToken.matches = maskToken.matches.reverse();
  1529. for (var match in maskToken.matches) if (maskToken.matches.hasOwnProperty(match)) {
  1530. var intMatch = parseInt(match);
  1531. if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {
  1532. var qt = maskToken.matches[match];
  1533. maskToken.matches.splice(match, 1), maskToken.matches.splice(intMatch + 1, 0, qt);
  1534. }
  1535. maskToken.matches[match].matches !== undefined ? maskToken.matches[match] = reverseTokens(maskToken.matches[match]) : maskToken.matches[match] = function(st) {
  1536. return st === opts.optionalmarker.start ? st = opts.optionalmarker.end : st === opts.optionalmarker.end ? st = opts.optionalmarker.start : st === opts.groupmarker.start ? st = opts.groupmarker.end : st === opts.groupmarker.end && (st = opts.groupmarker.start),
  1537. st;
  1538. }(maskToken.matches[match]);
  1539. }
  1540. return maskToken;
  1541. }
  1542. var match, m, openingToken, currentOpeningToken, alternator, lastMatch, groupToken, tokenizer = /(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})|[^.?*+^${[]()|\\]+|./g, regexTokenizer = /\[\^?]?(?:[^\\\]]+|\\[\S\s]?)*]?|\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\S\s]?)|\((?:\?[:=!]?)?|(?:[?*+]|\{[0-9]+(?:,[0-9]*)?\})\??|[^.?*+^${[()|\\]+|./g, escaped = !1, currentToken = new MaskToken(), openenings = [], maskTokens = [];
  1543. for (regexMask && (opts.optionalmarker.start = undefined, opts.optionalmarker.end = undefined); match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask); ) {
  1544. if (m = match[0], regexMask && !0 !== escaped) switch (m.charAt(0)) {
  1545. case "?":
  1546. m = "{0,1}";
  1547. break;
  1548. case "+":
  1549. case "*":
  1550. m = "{" + m + "}";
  1551. }
  1552. if (escaped) defaultCase(); else switch (m.charAt(0)) {
  1553. case opts.escapeChar:
  1554. escaped = !0, regexMask && defaultCase();
  1555. break;
  1556. case opts.optionalmarker.end:
  1557. case opts.groupmarker.end:
  1558. if (openingToken = openenings.pop(), openingToken.openGroup = !1, openingToken !== undefined) if (openenings.length > 0) {
  1559. if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(openingToken),
  1560. currentOpeningToken.isAlternator) {
  1561. alternator = openenings.pop();
  1562. for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1,
  1563. alternator.matches[mndx].alternatorGroup = !1;
  1564. openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1],
  1565. currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator);
  1566. }
  1567. } else currentToken.matches.push(openingToken); else defaultCase();
  1568. break;
  1569. case opts.optionalmarker.start:
  1570. openenings.push(new MaskToken(!1, !0));
  1571. break;
  1572. case opts.groupmarker.start:
  1573. openenings.push(new MaskToken(!0));
  1574. break;
  1575. case opts.quantifiermarker.start:
  1576. var quantifier = new MaskToken(!1, !1, !0);
  1577. m = m.replace(/[{}]/g, "");
  1578. var mq = m.split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);
  1579. if ("*" !== mq1 && "+" !== mq1 || (mq0 = "*" === mq1 ? 0 : 1), quantifier.quantifier = {
  1580. min: mq0,
  1581. max: mq1
  1582. }, openenings.length > 0) {
  1583. var matches = openenings[openenings.length - 1].matches;
  1584. match = matches.pop(), match.isGroup || (groupToken = new MaskToken(!0), groupToken.matches.push(match),
  1585. match = groupToken), matches.push(match), matches.push(quantifier);
  1586. } else match = currentToken.matches.pop(), match.isGroup || (regexMask && null === match.fn && "." === match.def && (match.fn = new RegExp(match.def, opts.casing ? "i" : "")),
  1587. groupToken = new MaskToken(!0), groupToken.matches.push(match), match = groupToken),
  1588. currentToken.matches.push(match), currentToken.matches.push(quantifier);
  1589. break;
  1590. case opts.alternatormarker:
  1591. if (openenings.length > 0) {
  1592. currentOpeningToken = openenings[openenings.length - 1];
  1593. var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];
  1594. lastMatch = currentOpeningToken.openGroup && (subToken.matches === undefined || !1 === subToken.isGroup && !1 === subToken.isAlternator) ? openenings.pop() : currentOpeningToken.matches.pop();
  1595. } else lastMatch = currentToken.matches.pop();
  1596. if (lastMatch.isAlternator) openenings.push(lastMatch); else if (lastMatch.alternatorGroup ? (alternator = openenings.pop(),
  1597. lastMatch.alternatorGroup = !1) : alternator = new MaskToken(!1, !1, !1, !0), alternator.matches.push(lastMatch),
  1598. openenings.push(alternator), lastMatch.openGroup) {
  1599. lastMatch.openGroup = !1;
  1600. var alternatorGroup = new MaskToken(!0);
  1601. alternatorGroup.alternatorGroup = !0, openenings.push(alternatorGroup);
  1602. }
  1603. break;
  1604. default:
  1605. defaultCase();
  1606. }
  1607. }
  1608. for (;openenings.length > 0; ) openingToken = openenings.pop(), currentToken.matches.push(openingToken);
  1609. return currentToken.matches.length > 0 && (verifyGroupMarker(currentToken), maskTokens.push(currentToken)),
  1610. (opts.numericInput || opts.isRTL) && reverseTokens(maskTokens[0]), maskTokens;
  1611. }
  1612. }, Inputmask.extendDefaults = function(options) {
  1613. $.extend(!0, Inputmask.prototype.defaults, options);
  1614. }, Inputmask.extendDefinitions = function(definition) {
  1615. $.extend(!0, Inputmask.prototype.definitions, definition);
  1616. }, Inputmask.extendAliases = function(alias) {
  1617. $.extend(!0, Inputmask.prototype.aliases, alias);
  1618. }, Inputmask.format = function(value, options, metadata) {
  1619. return Inputmask(options).format(value, metadata);
  1620. }, Inputmask.unmask = function(value, options) {
  1621. return Inputmask(options).unmaskedvalue(value);
  1622. }, Inputmask.isValid = function(value, options) {
  1623. return Inputmask(options).isValid(value);
  1624. }, Inputmask.remove = function(elems) {
  1625. $.each(elems, function(ndx, el) {
  1626. el.inputmask && el.inputmask.remove();
  1627. });
  1628. }, Inputmask.escapeRegex = function(str) {
  1629. var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ];
  1630. return str.replace(new RegExp("(\\" + specials.join("|\\") + ")", "gim"), "\\$1");
  1631. }, Inputmask.keyCode = {
  1632. ALT: 18,
  1633. BACKSPACE: 8,
  1634. BACKSPACE_SAFARI: 127,
  1635. CAPS_LOCK: 20,
  1636. COMMA: 188,
  1637. COMMAND: 91,
  1638. COMMAND_LEFT: 91,
  1639. COMMAND_RIGHT: 93,
  1640. CONTROL: 17,
  1641. DELETE: 46,
  1642. DOWN: 40,
  1643. END: 35,
  1644. ENTER: 13,
  1645. ESCAPE: 27,
  1646. HOME: 36,
  1647. INSERT: 45,
  1648. LEFT: 37,
  1649. MENU: 93,
  1650. NUMPAD_ADD: 107,
  1651. NUMPAD_DECIMAL: 110,
  1652. NUMPAD_DIVIDE: 111,
  1653. NUMPAD_ENTER: 108,
  1654. NUMPAD_MULTIPLY: 106,
  1655. NUMPAD_SUBTRACT: 109,
  1656. PAGE_DOWN: 34,
  1657. PAGE_UP: 33,
  1658. PERIOD: 190,
  1659. RIGHT: 39,
  1660. SHIFT: 16,
  1661. SPACE: 32,
  1662. TAB: 9,
  1663. UP: 38,
  1664. WINDOWS: 91,
  1665. X: 88
  1666. }, Inputmask;
  1667. });
  1668. }, function(module, exports) {
  1669. module.exports = jQuery;
  1670. }, function(module, exports, __webpack_require__) {
  1671. "use strict";
  1672. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  1673. "function" == typeof Symbol && Symbol.iterator;
  1674. !function(factory) {
  1675. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ],
  1676. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  1677. }(function($, Inputmask) {
  1678. function isLeapYear(year) {
  1679. return isNaN(year) || 29 === new Date(year, 2, 0).getDate();
  1680. }
  1681. return Inputmask.extendAliases({
  1682. "dd/mm/yyyy": {
  1683. mask: "1/2/y",
  1684. placeholder: "dd/mm/yyyy",
  1685. regex: {
  1686. val1pre: new RegExp("[0-3]"),
  1687. val1: new RegExp("0[1-9]|[12][0-9]|3[01]"),
  1688. val2pre: function(separator) {
  1689. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  1690. return new RegExp("((0[1-9]|[12][0-9]|3[01])" + escapedSeparator + "[01])");
  1691. },
  1692. val2: function(separator) {
  1693. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  1694. return new RegExp("((0[1-9]|[12][0-9])" + escapedSeparator + "(0[1-9]|1[012]))|(30" + escapedSeparator + "(0[13-9]|1[012]))|(31" + escapedSeparator + "(0[13578]|1[02]))");
  1695. }
  1696. },
  1697. leapday: "29/02/",
  1698. separator: "/",
  1699. yearrange: {
  1700. minyear: 1900,
  1701. maxyear: 2099
  1702. },
  1703. isInYearRange: function(chrs, minyear, maxyear) {
  1704. if (isNaN(chrs)) return !1;
  1705. var enteredyear = parseInt(chrs.concat(minyear.toString().slice(chrs.length))), enteredyear2 = parseInt(chrs.concat(maxyear.toString().slice(chrs.length)));
  1706. return !isNaN(enteredyear) && (minyear <= enteredyear && enteredyear <= maxyear) || !isNaN(enteredyear2) && (minyear <= enteredyear2 && enteredyear2 <= maxyear);
  1707. },
  1708. determinebaseyear: function(minyear, maxyear, hint) {
  1709. var currentyear = new Date().getFullYear();
  1710. if (minyear > currentyear) return minyear;
  1711. if (maxyear < currentyear) {
  1712. for (var maxYearPrefix = maxyear.toString().slice(0, 2), maxYearPostfix = maxyear.toString().slice(2, 4); maxyear < maxYearPrefix + hint; ) maxYearPrefix--;
  1713. var maxxYear = maxYearPrefix + maxYearPostfix;
  1714. return minyear > maxxYear ? minyear : maxxYear;
  1715. }
  1716. if (minyear <= currentyear && currentyear <= maxyear) {
  1717. for (var currentYearPrefix = currentyear.toString().slice(0, 2); maxyear < currentYearPrefix + hint; ) currentYearPrefix--;
  1718. var currentYearAndHint = currentYearPrefix + hint;
  1719. return currentYearAndHint < minyear ? minyear : currentYearAndHint;
  1720. }
  1721. return currentyear;
  1722. },
  1723. onKeyDown: function(e, buffer, caretPos, opts) {
  1724. var $input = $(this);
  1725. if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
  1726. var today = new Date();
  1727. $input.val(today.getDate().toString() + (today.getMonth() + 1).toString() + today.getFullYear().toString()),
  1728. $input.trigger("setvalue");
  1729. }
  1730. },
  1731. getFrontValue: function(mask, buffer, opts) {
  1732. for (var start = 0, length = 0, i = 0; i < mask.length && "2" !== mask.charAt(i); i++) {
  1733. var definition = opts.definitions[mask.charAt(i)];
  1734. definition ? (start += length, length = definition.cardinality) : length++;
  1735. }
  1736. return buffer.join("").substr(start, length);
  1737. },
  1738. postValidation: function(buffer, currentResult, opts) {
  1739. var dayMonthValue, year, bufferStr = buffer.join("");
  1740. return 0 === opts.mask.indexOf("y") ? (year = bufferStr.substr(0, 4), dayMonthValue = bufferStr.substring(4, 10)) : (year = bufferStr.substring(6, 10),
  1741. dayMonthValue = bufferStr.substr(0, 6)), currentResult && (dayMonthValue !== opts.leapday || isLeapYear(year));
  1742. },
  1743. definitions: {
  1744. "1": {
  1745. validator: function(chrs, maskset, pos, strict, opts) {
  1746. var isValid = opts.regex.val1.test(chrs);
  1747. return strict || isValid || chrs.charAt(1) !== opts.separator && -1 === "-./".indexOf(chrs.charAt(1)) || !(isValid = opts.regex.val1.test("0" + chrs.charAt(0))) ? isValid : (maskset.buffer[pos - 1] = "0",
  1748. {
  1749. refreshFromBuffer: {
  1750. start: pos - 1,
  1751. end: pos
  1752. },
  1753. pos: pos,
  1754. c: chrs.charAt(0)
  1755. });
  1756. },
  1757. cardinality: 2,
  1758. prevalidator: [ {
  1759. validator: function(chrs, maskset, pos, strict, opts) {
  1760. var pchrs = chrs;
  1761. isNaN(maskset.buffer[pos + 1]) || (pchrs += maskset.buffer[pos + 1]);
  1762. var isValid = 1 === pchrs.length ? opts.regex.val1pre.test(pchrs) : opts.regex.val1.test(pchrs);
  1763. if (!strict && !isValid) {
  1764. if (isValid = opts.regex.val1.test(chrs + "0")) return maskset.buffer[pos] = chrs,
  1765. maskset.buffer[++pos] = "0", {
  1766. pos: pos,
  1767. c: "0"
  1768. };
  1769. if (isValid = opts.regex.val1.test("0" + chrs)) return maskset.buffer[pos] = "0",
  1770. pos++, {
  1771. pos: pos
  1772. };
  1773. }
  1774. return isValid;
  1775. },
  1776. cardinality: 1
  1777. } ]
  1778. },
  1779. "2": {
  1780. validator: function(chrs, maskset, pos, strict, opts) {
  1781. var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts);
  1782. -1 !== frontValue.indexOf(opts.placeholder[0]) && (frontValue = "01" + opts.separator);
  1783. var isValid = opts.regex.val2(opts.separator).test(frontValue + chrs);
  1784. return strict || isValid || chrs.charAt(1) !== opts.separator && -1 === "-./".indexOf(chrs.charAt(1)) || !(isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs.charAt(0))) ? isValid : (maskset.buffer[pos - 1] = "0",
  1785. {
  1786. refreshFromBuffer: {
  1787. start: pos - 1,
  1788. end: pos
  1789. },
  1790. pos: pos,
  1791. c: chrs.charAt(0)
  1792. });
  1793. },
  1794. cardinality: 2,
  1795. prevalidator: [ {
  1796. validator: function(chrs, maskset, pos, strict, opts) {
  1797. isNaN(maskset.buffer[pos + 1]) || (chrs += maskset.buffer[pos + 1]);
  1798. var frontValue = opts.getFrontValue(maskset.mask, maskset.buffer, opts);
  1799. -1 !== frontValue.indexOf(opts.placeholder[0]) && (frontValue = "01" + opts.separator);
  1800. var isValid = 1 === chrs.length ? opts.regex.val2pre(opts.separator).test(frontValue + chrs) : opts.regex.val2(opts.separator).test(frontValue + chrs);
  1801. return strict || isValid || !(isValid = opts.regex.val2(opts.separator).test(frontValue + "0" + chrs)) ? isValid : (maskset.buffer[pos] = "0",
  1802. pos++, {
  1803. pos: pos
  1804. });
  1805. },
  1806. cardinality: 1
  1807. } ]
  1808. },
  1809. y: {
  1810. validator: function(chrs, maskset, pos, strict, opts) {
  1811. return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
  1812. },
  1813. cardinality: 4,
  1814. prevalidator: [ {
  1815. validator: function(chrs, maskset, pos, strict, opts) {
  1816. var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
  1817. if (!strict && !isValid) {
  1818. var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 1);
  1819. if (isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0),
  1820. {
  1821. pos: pos
  1822. };
  1823. if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs + "0").toString().slice(0, 2),
  1824. isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(0),
  1825. maskset.buffer[pos++] = yearPrefix.charAt(1), {
  1826. pos: pos
  1827. };
  1828. }
  1829. return isValid;
  1830. },
  1831. cardinality: 1
  1832. }, {
  1833. validator: function(chrs, maskset, pos, strict, opts) {
  1834. var isValid = opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
  1835. if (!strict && !isValid) {
  1836. var yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2);
  1837. if (isValid = opts.isInYearRange(chrs[0] + yearPrefix[1] + chrs[1], opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos++] = yearPrefix.charAt(1),
  1838. {
  1839. pos: pos
  1840. };
  1841. if (yearPrefix = opts.determinebaseyear(opts.yearrange.minyear, opts.yearrange.maxyear, chrs).toString().slice(0, 2),
  1842. isValid = opts.isInYearRange(yearPrefix + chrs, opts.yearrange.minyear, opts.yearrange.maxyear)) return maskset.buffer[pos - 1] = yearPrefix.charAt(0),
  1843. maskset.buffer[pos++] = yearPrefix.charAt(1), maskset.buffer[pos++] = chrs.charAt(0),
  1844. {
  1845. refreshFromBuffer: {
  1846. start: pos - 3,
  1847. end: pos
  1848. },
  1849. pos: pos
  1850. };
  1851. }
  1852. return isValid;
  1853. },
  1854. cardinality: 2
  1855. }, {
  1856. validator: function(chrs, maskset, pos, strict, opts) {
  1857. return opts.isInYearRange(chrs, opts.yearrange.minyear, opts.yearrange.maxyear);
  1858. },
  1859. cardinality: 3
  1860. } ]
  1861. }
  1862. },
  1863. insertMode: !1,
  1864. autoUnmask: !1
  1865. },
  1866. "mm/dd/yyyy": {
  1867. placeholder: "mm/dd/yyyy",
  1868. alias: "dd/mm/yyyy",
  1869. regex: {
  1870. val2pre: function(separator) {
  1871. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  1872. return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])");
  1873. },
  1874. val2: function(separator) {
  1875. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  1876. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)");
  1877. },
  1878. val1pre: new RegExp("[01]"),
  1879. val1: new RegExp("0[1-9]|1[012]")
  1880. },
  1881. leapday: "02/29/",
  1882. onKeyDown: function(e, buffer, caretPos, opts) {
  1883. var $input = $(this);
  1884. if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
  1885. var today = new Date();
  1886. $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()),
  1887. $input.trigger("setvalue");
  1888. }
  1889. }
  1890. },
  1891. "yyyy/mm/dd": {
  1892. mask: "y/1/2",
  1893. placeholder: "yyyy/mm/dd",
  1894. alias: "mm/dd/yyyy",
  1895. leapday: "/02/29",
  1896. onKeyDown: function(e, buffer, caretPos, opts) {
  1897. var $input = $(this);
  1898. if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
  1899. var today = new Date();
  1900. $input.val(today.getFullYear().toString() + (today.getMonth() + 1).toString() + today.getDate().toString()),
  1901. $input.trigger("setvalue");
  1902. }
  1903. }
  1904. },
  1905. "dd.mm.yyyy": {
  1906. mask: "1.2.y",
  1907. placeholder: "dd.mm.yyyy",
  1908. leapday: "29.02.",
  1909. separator: ".",
  1910. alias: "dd/mm/yyyy"
  1911. },
  1912. "dd-mm-yyyy": {
  1913. mask: "1-2-y",
  1914. placeholder: "dd-mm-yyyy",
  1915. leapday: "29-02-",
  1916. separator: "-",
  1917. alias: "dd/mm/yyyy"
  1918. },
  1919. "mm.dd.yyyy": {
  1920. mask: "1.2.y",
  1921. placeholder: "mm.dd.yyyy",
  1922. leapday: "02.29.",
  1923. separator: ".",
  1924. alias: "mm/dd/yyyy"
  1925. },
  1926. "mm-dd-yyyy": {
  1927. mask: "1-2-y",
  1928. placeholder: "mm-dd-yyyy",
  1929. leapday: "02-29-",
  1930. separator: "-",
  1931. alias: "mm/dd/yyyy"
  1932. },
  1933. "yyyy.mm.dd": {
  1934. mask: "y.1.2",
  1935. placeholder: "yyyy.mm.dd",
  1936. leapday: ".02.29",
  1937. separator: ".",
  1938. alias: "yyyy/mm/dd"
  1939. },
  1940. "yyyy-mm-dd": {
  1941. mask: "y-1-2",
  1942. placeholder: "yyyy-mm-dd",
  1943. leapday: "-02-29",
  1944. separator: "-",
  1945. alias: "yyyy/mm/dd"
  1946. },
  1947. datetime: {
  1948. mask: "1/2/y h:s",
  1949. placeholder: "dd/mm/yyyy hh:mm",
  1950. alias: "dd/mm/yyyy",
  1951. regex: {
  1952. hrspre: new RegExp("[012]"),
  1953. hrs24: new RegExp("2[0-4]|1[3-9]"),
  1954. hrs: new RegExp("[01][0-9]|2[0-4]"),
  1955. ampm: new RegExp("^[a|p|A|P][m|M]"),
  1956. mspre: new RegExp("[0-5]"),
  1957. ms: new RegExp("[0-5][0-9]")
  1958. },
  1959. timeseparator: ":",
  1960. hourFormat: "24",
  1961. definitions: {
  1962. h: {
  1963. validator: function(chrs, maskset, pos, strict, opts) {
  1964. if ("24" === opts.hourFormat && 24 === parseInt(chrs, 10)) return maskset.buffer[pos - 1] = "0",
  1965. maskset.buffer[pos] = "0", {
  1966. refreshFromBuffer: {
  1967. start: pos - 1,
  1968. end: pos
  1969. },
  1970. c: "0"
  1971. };
  1972. var isValid = opts.regex.hrs.test(chrs);
  1973. if (!strict && !isValid && (chrs.charAt(1) === opts.timeseparator || -1 !== "-.:".indexOf(chrs.charAt(1))) && (isValid = opts.regex.hrs.test("0" + chrs.charAt(0)))) return maskset.buffer[pos - 1] = "0",
  1974. maskset.buffer[pos] = chrs.charAt(0), pos++, {
  1975. refreshFromBuffer: {
  1976. start: pos - 2,
  1977. end: pos
  1978. },
  1979. pos: pos,
  1980. c: opts.timeseparator
  1981. };
  1982. if (isValid && "24" !== opts.hourFormat && opts.regex.hrs24.test(chrs)) {
  1983. var tmp = parseInt(chrs, 10);
  1984. return 24 === tmp ? (maskset.buffer[pos + 5] = "a", maskset.buffer[pos + 6] = "m") : (maskset.buffer[pos + 5] = "p",
  1985. maskset.buffer[pos + 6] = "m"), tmp -= 12, tmp < 10 ? (maskset.buffer[pos] = tmp.toString(),
  1986. maskset.buffer[pos - 1] = "0") : (maskset.buffer[pos] = tmp.toString().charAt(1),
  1987. maskset.buffer[pos - 1] = tmp.toString().charAt(0)), {
  1988. refreshFromBuffer: {
  1989. start: pos - 1,
  1990. end: pos + 6
  1991. },
  1992. c: maskset.buffer[pos]
  1993. };
  1994. }
  1995. return isValid;
  1996. },
  1997. cardinality: 2,
  1998. prevalidator: [ {
  1999. validator: function(chrs, maskset, pos, strict, opts) {
  2000. var isValid = opts.regex.hrspre.test(chrs);
  2001. return strict || isValid || !(isValid = opts.regex.hrs.test("0" + chrs)) ? isValid : (maskset.buffer[pos] = "0",
  2002. pos++, {
  2003. pos: pos
  2004. });
  2005. },
  2006. cardinality: 1
  2007. } ]
  2008. },
  2009. s: {
  2010. validator: "[0-5][0-9]",
  2011. cardinality: 2,
  2012. prevalidator: [ {
  2013. validator: function(chrs, maskset, pos, strict, opts) {
  2014. var isValid = opts.regex.mspre.test(chrs);
  2015. return strict || isValid || !(isValid = opts.regex.ms.test("0" + chrs)) ? isValid : (maskset.buffer[pos] = "0",
  2016. pos++, {
  2017. pos: pos
  2018. });
  2019. },
  2020. cardinality: 1
  2021. } ]
  2022. },
  2023. t: {
  2024. validator: function(chrs, maskset, pos, strict, opts) {
  2025. return opts.regex.ampm.test(chrs + "m");
  2026. },
  2027. casing: "lower",
  2028. cardinality: 1
  2029. }
  2030. },
  2031. insertMode: !1,
  2032. autoUnmask: !1
  2033. },
  2034. datetime12: {
  2035. mask: "1/2/y h:s t\\m",
  2036. placeholder: "dd/mm/yyyy hh:mm xm",
  2037. alias: "datetime",
  2038. hourFormat: "12"
  2039. },
  2040. "mm/dd/yyyy hh:mm xm": {
  2041. mask: "1/2/y h:s t\\m",
  2042. placeholder: "mm/dd/yyyy hh:mm xm",
  2043. alias: "datetime12",
  2044. regex: {
  2045. val2pre: function(separator) {
  2046. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2047. return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])");
  2048. },
  2049. val2: function(separator) {
  2050. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2051. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)");
  2052. },
  2053. val1pre: new RegExp("[01]"),
  2054. val1: new RegExp("0[1-9]|1[012]")
  2055. },
  2056. leapday: "02/29/",
  2057. onKeyDown: function(e, buffer, caretPos, opts) {
  2058. var $input = $(this);
  2059. if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {
  2060. var today = new Date();
  2061. $input.val((today.getMonth() + 1).toString() + today.getDate().toString() + today.getFullYear().toString()),
  2062. $input.trigger("setvalue");
  2063. }
  2064. }
  2065. },
  2066. "hh:mm t": {
  2067. mask: "h:s t\\m",
  2068. placeholder: "hh:mm xm",
  2069. alias: "datetime",
  2070. hourFormat: "12"
  2071. },
  2072. "h:s t": {
  2073. mask: "h:s t\\m",
  2074. placeholder: "hh:mm xm",
  2075. alias: "datetime",
  2076. hourFormat: "12"
  2077. },
  2078. "hh:mm:ss": {
  2079. mask: "h:s:s",
  2080. placeholder: "hh:mm:ss",
  2081. alias: "datetime",
  2082. autoUnmask: !1
  2083. },
  2084. "hh:mm": {
  2085. mask: "h:s",
  2086. placeholder: "hh:mm",
  2087. alias: "datetime",
  2088. autoUnmask: !1
  2089. },
  2090. date: {
  2091. alias: "dd/mm/yyyy"
  2092. },
  2093. "mm/yyyy": {
  2094. mask: "1/y",
  2095. placeholder: "mm/yyyy",
  2096. leapday: "donotuse",
  2097. separator: "/",
  2098. alias: "mm/dd/yyyy"
  2099. },
  2100. shamsi: {
  2101. regex: {
  2102. val2pre: function(separator) {
  2103. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2104. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "[0-3])");
  2105. },
  2106. val2: function(separator) {
  2107. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2108. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[1-9]|1[012])" + escapedSeparator + "30)|((0[1-6])" + escapedSeparator + "31)");
  2109. },
  2110. val1pre: new RegExp("[01]"),
  2111. val1: new RegExp("0[1-9]|1[012]")
  2112. },
  2113. yearrange: {
  2114. minyear: 1300,
  2115. maxyear: 1499
  2116. },
  2117. mask: "y/1/2",
  2118. leapday: "/12/30",
  2119. placeholder: "yyyy/mm/dd",
  2120. alias: "mm/dd/yyyy",
  2121. clearIncomplete: !0
  2122. },
  2123. "yyyy-mm-dd hh:mm:ss": {
  2124. mask: "y-1-2 h:s:s",
  2125. placeholder: "yyyy-mm-dd hh:mm:ss",
  2126. alias: "datetime",
  2127. separator: "-",
  2128. leapday: "-02-29",
  2129. regex: {
  2130. val2pre: function(separator) {
  2131. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2132. return new RegExp("((0[13-9]|1[012])" + escapedSeparator + "[0-3])|(02" + escapedSeparator + "[0-2])");
  2133. },
  2134. val2: function(separator) {
  2135. var escapedSeparator = Inputmask.escapeRegex.call(this, separator);
  2136. return new RegExp("((0[1-9]|1[012])" + escapedSeparator + "(0[1-9]|[12][0-9]))|((0[13-9]|1[012])" + escapedSeparator + "30)|((0[13578]|1[02])" + escapedSeparator + "31)");
  2137. },
  2138. val1pre: new RegExp("[01]"),
  2139. val1: new RegExp("0[1-9]|1[012]")
  2140. },
  2141. onKeyDown: function(e, buffer, caretPos, opts) {}
  2142. }
  2143. }), Inputmask;
  2144. });
  2145. }, function(module, exports, __webpack_require__) {
  2146. "use strict";
  2147. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  2148. "function" == typeof Symbol && Symbol.iterator;
  2149. !function(factory) {
  2150. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ],
  2151. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2152. }(function($, Inputmask) {
  2153. return Inputmask.extendDefinitions({
  2154. A: {
  2155. validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  2156. cardinality: 1,
  2157. casing: "upper"
  2158. },
  2159. "&": {
  2160. validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]",
  2161. cardinality: 1,
  2162. casing: "upper"
  2163. },
  2164. "#": {
  2165. validator: "[0-9A-Fa-f]",
  2166. cardinality: 1,
  2167. casing: "upper"
  2168. }
  2169. }), Inputmask.extendAliases({
  2170. url: {
  2171. definitions: {
  2172. i: {
  2173. validator: ".",
  2174. cardinality: 1
  2175. }
  2176. },
  2177. mask: "(\\http://)|(\\http\\s://)|(ftp://)|(ftp\\s://)i{+}",
  2178. insertMode: !1,
  2179. autoUnmask: !1,
  2180. inputmode: "url"
  2181. },
  2182. ip: {
  2183. mask: "i[i[i]].i[i[i]].i[i[i]].i[i[i]]",
  2184. definitions: {
  2185. i: {
  2186. validator: function(chrs, maskset, pos, strict, opts) {
  2187. return pos - 1 > -1 && "." !== maskset.buffer[pos - 1] ? (chrs = maskset.buffer[pos - 1] + chrs,
  2188. chrs = pos - 2 > -1 && "." !== maskset.buffer[pos - 2] ? maskset.buffer[pos - 2] + chrs : "0" + chrs) : chrs = "00" + chrs,
  2189. new RegExp("25[0-5]|2[0-4][0-9]|[01][0-9][0-9]").test(chrs);
  2190. },
  2191. cardinality: 1
  2192. }
  2193. },
  2194. onUnMask: function(maskedValue, unmaskedValue, opts) {
  2195. return maskedValue;
  2196. },
  2197. inputmode: "numeric"
  2198. },
  2199. email: {
  2200. mask: "*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]",
  2201. greedy: !1,
  2202. onBeforePaste: function(pastedValue, opts) {
  2203. return pastedValue = pastedValue.toLowerCase(), pastedValue.replace("mailto:", "");
  2204. },
  2205. definitions: {
  2206. "*": {
  2207. validator: "[0-9A-Za-z!#$%&'*+/=?^_`{|}~-]",
  2208. cardinality: 1,
  2209. casing: "lower"
  2210. },
  2211. "-": {
  2212. validator: "[0-9A-Za-z-]",
  2213. cardinality: 1,
  2214. casing: "lower"
  2215. }
  2216. },
  2217. onUnMask: function(maskedValue, unmaskedValue, opts) {
  2218. return maskedValue;
  2219. },
  2220. inputmode: "email"
  2221. },
  2222. mac: {
  2223. mask: "##:##:##:##:##:##"
  2224. },
  2225. vin: {
  2226. mask: "V{13}9{4}",
  2227. definitions: {
  2228. V: {
  2229. validator: "[A-HJ-NPR-Za-hj-npr-z\\d]",
  2230. cardinality: 1,
  2231. casing: "upper"
  2232. }
  2233. },
  2234. clearIncomplete: !0,
  2235. autoUnmask: !0
  2236. }
  2237. }), Inputmask;
  2238. });
  2239. }, function(module, exports, __webpack_require__) {
  2240. "use strict";
  2241. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  2242. "function" == typeof Symbol && Symbol.iterator;
  2243. !function(factory) {
  2244. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ],
  2245. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2246. }(function($, Inputmask, undefined) {
  2247. function autoEscape(txt, opts) {
  2248. for (var escapedTxt = "", i = 0; i < txt.length; i++) Inputmask.prototype.definitions[txt.charAt(i)] || opts.definitions[txt.charAt(i)] || opts.optionalmarker.start === txt.charAt(i) || opts.optionalmarker.end === txt.charAt(i) || opts.quantifiermarker.start === txt.charAt(i) || opts.quantifiermarker.end === txt.charAt(i) || opts.groupmarker.start === txt.charAt(i) || opts.groupmarker.end === txt.charAt(i) || opts.alternatormarker === txt.charAt(i) ? escapedTxt += "\\" + txt.charAt(i) : escapedTxt += txt.charAt(i);
  2249. return escapedTxt;
  2250. }
  2251. return Inputmask.extendAliases({
  2252. numeric: {
  2253. mask: function(opts) {
  2254. if (0 !== opts.repeat && isNaN(opts.integerDigits) && (opts.integerDigits = opts.repeat),
  2255. opts.repeat = 0, opts.groupSeparator === opts.radixPoint && ("." === opts.radixPoint ? opts.groupSeparator = "," : "," === opts.radixPoint ? opts.groupSeparator = "." : opts.groupSeparator = ""),
  2256. " " === opts.groupSeparator && (opts.skipOptionalPartCharacter = undefined), opts.autoGroup = opts.autoGroup && "" !== opts.groupSeparator,
  2257. opts.autoGroup && ("string" == typeof opts.groupSize && isFinite(opts.groupSize) && (opts.groupSize = parseInt(opts.groupSize)),
  2258. isFinite(opts.integerDigits))) {
  2259. var seps = Math.floor(opts.integerDigits / opts.groupSize), mod = opts.integerDigits % opts.groupSize;
  2260. opts.integerDigits = parseInt(opts.integerDigits) + (0 === mod ? seps - 1 : seps),
  2261. opts.integerDigits < 1 && (opts.integerDigits = "*");
  2262. }
  2263. opts.placeholder.length > 1 && (opts.placeholder = opts.placeholder.charAt(0)),
  2264. "radixFocus" === opts.positionCaretOnClick && "" === opts.placeholder && !1 === opts.integerOptional && (opts.positionCaretOnClick = "lvp"),
  2265. opts.definitions[";"] = opts.definitions["~"], opts.definitions[";"].definitionSymbol = "~",
  2266. !0 === opts.numericInput && (opts.positionCaretOnClick = "radixFocus" === opts.positionCaretOnClick ? "lvp" : opts.positionCaretOnClick,
  2267. opts.digitsOptional = !1, isNaN(opts.digits) && (opts.digits = 2), opts.decimalProtect = !1);
  2268. var mask = "[+]";
  2269. if (mask += autoEscape(opts.prefix, opts), !0 === opts.integerOptional ? mask += "~{1," + opts.integerDigits + "}" : mask += "~{" + opts.integerDigits + "}",
  2270. opts.digits !== undefined) {
  2271. opts.radixPointDefinitionSymbol = opts.decimalProtect ? ":" : opts.radixPoint;
  2272. var dq = opts.digits.toString().split(",");
  2273. isFinite(dq[0] && dq[1] && isFinite(dq[1])) ? mask += opts.radixPointDefinitionSymbol + ";{" + opts.digits + "}" : (isNaN(opts.digits) || parseInt(opts.digits) > 0) && (opts.digitsOptional ? mask += "[" + opts.radixPointDefinitionSymbol + ";{1," + opts.digits + "}]" : mask += opts.radixPointDefinitionSymbol + ";{" + opts.digits + "}");
  2274. }
  2275. return mask += autoEscape(opts.suffix, opts), mask += "[-]", opts.greedy = !1, mask;
  2276. },
  2277. placeholder: "",
  2278. greedy: !1,
  2279. digits: "*",
  2280. digitsOptional: !0,
  2281. enforceDigitsOnBlur: !1,
  2282. radixPoint: ".",
  2283. positionCaretOnClick: "radixFocus",
  2284. groupSize: 3,
  2285. groupSeparator: "",
  2286. autoGroup: !1,
  2287. allowMinus: !0,
  2288. negationSymbol: {
  2289. front: "-",
  2290. back: ""
  2291. },
  2292. integerDigits: "+",
  2293. integerOptional: !0,
  2294. prefix: "",
  2295. suffix: "",
  2296. rightAlign: !0,
  2297. decimalProtect: !0,
  2298. min: null,
  2299. max: null,
  2300. step: 1,
  2301. insertMode: !0,
  2302. autoUnmask: !1,
  2303. unmaskAsNumber: !1,
  2304. inputmode: "numeric",
  2305. preValidation: function(buffer, pos, c, isSelection, opts) {
  2306. if ("-" === c || c == opts.negationSymbol.front) return !0 === opts.allowMinus && (opts.isNegative = opts.isNegative === undefined || !opts.isNegative,
  2307. "" === buffer.join("") || {
  2308. caret: pos,
  2309. dopost: !0
  2310. });
  2311. if (!1 === isSelection && c === opts.radixPoint && opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0)) {
  2312. var radixPos = $.inArray(opts.radixPoint, buffer);
  2313. if (-1 !== radixPos) return !0 === opts.numericInput ? pos === radixPos : {
  2314. caret: radixPos + 1
  2315. };
  2316. }
  2317. return !0;
  2318. },
  2319. postValidation: function(buffer, currentResult, opts) {
  2320. var suffix = opts.suffix.split(""), prefix = opts.prefix.split("");
  2321. if (currentResult.pos == undefined && currentResult.caret !== undefined && !0 !== currentResult.dopost) return currentResult;
  2322. var caretPos = currentResult.caret != undefined ? currentResult.caret : currentResult.pos, maskedValue = buffer.slice();
  2323. opts.numericInput && (caretPos = maskedValue.length - caretPos - 1, maskedValue = maskedValue.reverse());
  2324. var charAtPos = maskedValue[caretPos];
  2325. if (charAtPos === opts.groupSeparator && (caretPos += 1, charAtPos = maskedValue[caretPos]),
  2326. caretPos == maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;
  2327. charAtPos !== undefined && charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back && (maskedValue[caretPos] = "?",
  2328. opts.prefix.length > 0 && caretPos >= (!1 === opts.isNegative ? 1 : 0) && caretPos < opts.prefix.length - 1 + (!1 === opts.isNegative ? 1 : 0) ? prefix[caretPos - (!1 === opts.isNegative ? 1 : 0)] = "?" : opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0) && (suffix[caretPos - (maskedValue.length - opts.suffix.length - (!1 === opts.isNegative ? 1 : 0))] = "?")),
  2329. prefix = prefix.join(""), suffix = suffix.join("");
  2330. var processValue = maskedValue.join("").replace(prefix, "");
  2331. if (processValue = processValue.replace(suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2332. processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), ""),
  2333. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
  2334. isNaN(opts.placeholder) && (processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), "g"), "")),
  2335. processValue.length > 1 && 1 !== processValue.indexOf(opts.radixPoint) && ("0" == charAtPos && (processValue = processValue.replace(/^\?/g, "")),
  2336. processValue = processValue.replace(/^0/g, "")), processValue.charAt(0) === opts.radixPoint && "" !== opts.radixPoint && !0 !== opts.numericInput && (processValue = "0" + processValue),
  2337. "" !== processValue) {
  2338. if (processValue = processValue.split(""), (!opts.digitsOptional || opts.enforceDigitsOnBlur && "blur" === currentResult.event) && isFinite(opts.digits)) {
  2339. var radixPosition = $.inArray(opts.radixPoint, processValue), rpb = $.inArray(opts.radixPoint, maskedValue);
  2340. -1 === radixPosition && (processValue.push(opts.radixPoint), radixPosition = processValue.length - 1);
  2341. for (var i = 1; i <= opts.digits; i++) opts.digitsOptional && (!opts.enforceDigitsOnBlur || "blur" !== currentResult.event) || processValue[radixPosition + i] !== undefined && processValue[radixPosition + i] !== opts.placeholder.charAt(0) ? -1 !== rpb && maskedValue[rpb + i] !== undefined && (processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i]) : processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);
  2342. }
  2343. !0 !== opts.autoGroup || "" === opts.groupSeparator || charAtPos === opts.radixPoint && currentResult.pos === undefined && !currentResult.dopost ? processValue = processValue.join("") : (processValue = Inputmask(function(buffer, opts) {
  2344. var postMask = "";
  2345. if (postMask += "(" + opts.groupSeparator + "*{" + opts.groupSize + "}){*}", "" !== opts.radixPoint) {
  2346. var radixSplit = buffer.join("").split(opts.radixPoint);
  2347. radixSplit[1] && (postMask += opts.radixPoint + "*{" + radixSplit[1].match(/^\d*\??\d*/)[0].length + "}");
  2348. }
  2349. return postMask;
  2350. }(processValue, opts), {
  2351. numericInput: !0,
  2352. jitMasking: !0,
  2353. definitions: {
  2354. "*": {
  2355. validator: "[0-9?]",
  2356. cardinality: 1
  2357. }
  2358. }
  2359. }).format(processValue.join("")), processValue.charAt(0) === opts.groupSeparator && processValue.substr(1));
  2360. }
  2361. if (opts.isNegative && "blur" === currentResult.event && (opts.isNegative = "0" !== processValue),
  2362. processValue = prefix + processValue, processValue += suffix, opts.isNegative && (processValue = opts.negationSymbol.front + processValue,
  2363. processValue += opts.negationSymbol.back), processValue = processValue.split(""),
  2364. charAtPos !== undefined) if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) caretPos = $.inArray("?", processValue),
  2365. caretPos > -1 ? processValue[caretPos] = charAtPos : caretPos = currentResult.caret || 0; else if (charAtPos === opts.radixPoint || charAtPos === opts.negationSymbol.front || charAtPos === opts.negationSymbol.back) {
  2366. var newCaretPos = $.inArray(charAtPos, processValue);
  2367. -1 !== newCaretPos && (caretPos = newCaretPos);
  2368. }
  2369. opts.numericInput && (caretPos = processValue.length - caretPos - 1, processValue = processValue.reverse());
  2370. var rslt = {
  2371. caret: charAtPos === undefined || currentResult.pos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,
  2372. buffer: processValue,
  2373. refreshFromBuffer: currentResult.dopost || buffer.join("") !== processValue.join("")
  2374. };
  2375. return rslt.refreshFromBuffer ? rslt : currentResult;
  2376. },
  2377. onBeforeWrite: function(e, buffer, caretPos, opts) {
  2378. if (e) switch (e.type) {
  2379. case "keydown":
  2380. return opts.postValidation(buffer, {
  2381. caret: caretPos,
  2382. dopost: !0
  2383. }, opts);
  2384. case "blur":
  2385. case "checkval":
  2386. var unmasked;
  2387. if (function(opts) {
  2388. opts.parseMinMaxOptions === undefined && (null !== opts.min && (opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2389. "," === opts.radixPoint && (opts.min = opts.min.replace(opts.radixPoint, ".")),
  2390. opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN, isNaN(opts.min) && (opts.min = Number.MIN_VALUE)),
  2391. null !== opts.max && (opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2392. "," === opts.radixPoint && (opts.max = opts.max.replace(opts.radixPoint, ".")),
  2393. opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN, isNaN(opts.max) && (opts.max = Number.MAX_VALUE)),
  2394. opts.parseMinMaxOptions = "done");
  2395. }(opts), null !== opts.min || null !== opts.max) {
  2396. if (unmasked = opts.onUnMask(buffer.join(""), undefined, $.extend({}, opts, {
  2397. unmaskAsNumber: !0
  2398. })), null !== opts.min && unmasked < opts.min) return opts.isNegative = opts.min < 0,
  2399. opts.postValidation(opts.min.toString().replace(".", opts.radixPoint).split(""), {
  2400. caret: caretPos,
  2401. dopost: !0,
  2402. placeholder: "0"
  2403. }, opts);
  2404. if (null !== opts.max && unmasked > opts.max) return opts.isNegative = opts.max < 0,
  2405. opts.postValidation(opts.max.toString().replace(".", opts.radixPoint).split(""), {
  2406. caret: caretPos,
  2407. dopost: !0,
  2408. placeholder: "0"
  2409. }, opts);
  2410. }
  2411. return opts.postValidation(buffer, {
  2412. caret: caretPos,
  2413. dopost: !0,
  2414. placeholder: "0",
  2415. event: "blur"
  2416. }, opts);
  2417. case "_checkval":
  2418. return {
  2419. caret: caretPos
  2420. };
  2421. }
  2422. },
  2423. regex: {
  2424. integerPart: function(opts, emptyCheck) {
  2425. return emptyCheck ? new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?") : new RegExp("[" + Inputmask.escapeRegex(opts.negationSymbol.front) + "+]?\\d+");
  2426. },
  2427. integerNPart: function(opts) {
  2428. return new RegExp("[\\d" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + "]+");
  2429. }
  2430. },
  2431. definitions: {
  2432. "~": {
  2433. validator: function(chrs, maskset, pos, strict, opts, isSelection) {
  2434. var isValid = strict ? new RegExp("[0-9" + Inputmask.escapeRegex(opts.groupSeparator) + "]").test(chrs) : new RegExp("[0-9]").test(chrs);
  2435. if (!0 === isValid) {
  2436. if (!0 !== opts.numericInput && maskset.validPositions[pos] !== undefined && "~" === maskset.validPositions[pos].match.def && !isSelection) {
  2437. var processValue = maskset.buffer.join("");
  2438. processValue = processValue.replace(new RegExp("[-" + Inputmask.escapeRegex(opts.negationSymbol.front) + "]", "g"), ""),
  2439. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), "");
  2440. var pvRadixSplit = processValue.split(opts.radixPoint);
  2441. pvRadixSplit.length > 1 && (pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0))),
  2442. "0" === pvRadixSplit[0] && (pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0))),
  2443. processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || "";
  2444. var bufferTemplate = maskset._buffer.join("");
  2445. for (processValue === opts.radixPoint && (processValue = bufferTemplate); null === processValue.match(Inputmask.escapeRegex(bufferTemplate) + "$"); ) bufferTemplate = bufferTemplate.slice(1);
  2446. processValue = processValue.replace(bufferTemplate, ""), processValue = processValue.split(""),
  2447. isValid = processValue[pos] === undefined ? {
  2448. pos: pos,
  2449. remove: pos
  2450. } : {
  2451. pos: pos
  2452. };
  2453. }
  2454. } else strict || chrs !== opts.radixPoint || maskset.validPositions[pos - 1] !== undefined || (maskset.buffer[pos] = "0",
  2455. isValid = {
  2456. pos: pos + 1
  2457. });
  2458. return isValid;
  2459. },
  2460. cardinality: 1
  2461. },
  2462. "+": {
  2463. validator: function(chrs, maskset, pos, strict, opts) {
  2464. return opts.allowMinus && ("-" === chrs || chrs === opts.negationSymbol.front);
  2465. },
  2466. cardinality: 1,
  2467. placeholder: ""
  2468. },
  2469. "-": {
  2470. validator: function(chrs, maskset, pos, strict, opts) {
  2471. return opts.allowMinus && chrs === opts.negationSymbol.back;
  2472. },
  2473. cardinality: 1,
  2474. placeholder: ""
  2475. },
  2476. ":": {
  2477. validator: function(chrs, maskset, pos, strict, opts) {
  2478. var radix = "[" + Inputmask.escapeRegex(opts.radixPoint) + "]", isValid = new RegExp(radix).test(chrs);
  2479. return isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint && (isValid = {
  2480. caret: pos + 1
  2481. }), isValid;
  2482. },
  2483. cardinality: 1,
  2484. placeholder: function(opts) {
  2485. return opts.radixPoint;
  2486. }
  2487. }
  2488. },
  2489. onUnMask: function(maskedValue, unmaskedValue, opts) {
  2490. if ("" === unmaskedValue && !0 === opts.nullable) return unmaskedValue;
  2491. var processValue = maskedValue.replace(opts.prefix, "");
  2492. return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2493. "" !== opts.placeholder.charAt(0) && (processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), "g"), "0")),
  2494. opts.unmaskAsNumber ? ("" !== opts.radixPoint && -1 !== processValue.indexOf(opts.radixPoint) && (processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), ".")),
  2495. processValue = processValue.replace(new RegExp("^" + Inputmask.escapeRegex(opts.negationSymbol.front)), "-"),
  2496. processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + "$"), ""),
  2497. Number(processValue)) : processValue;
  2498. },
  2499. isComplete: function(buffer, opts) {
  2500. var maskedValue = buffer.join("");
  2501. if (buffer.slice().join("") !== maskedValue) return !1;
  2502. var processValue = maskedValue.replace(opts.prefix, "");
  2503. return processValue = processValue.replace(opts.suffix, ""), processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2504. "," === opts.radixPoint && (processValue = processValue.replace(Inputmask.escapeRegex(opts.radixPoint), ".")),
  2505. isFinite(processValue);
  2506. },
  2507. onBeforeMask: function(initialValue, opts) {
  2508. if (opts.isNegative = undefined, initialValue = initialValue.toString().charAt(initialValue.length - 1) === opts.radixPoint ? initialValue.toString().substr(0, initialValue.length - 1) : initialValue.toString(),
  2509. "" !== opts.radixPoint && isFinite(initialValue)) {
  2510. var vs = initialValue.split("."), groupSize = "" !== opts.groupSeparator ? parseInt(opts.groupSize) : 0;
  2511. 2 === vs.length && (vs[0].length > groupSize || vs[1].length > groupSize || vs[0].length <= groupSize && vs[1].length < groupSize) && (initialValue = initialValue.replace(".", opts.radixPoint));
  2512. }
  2513. var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g);
  2514. if (dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""),
  2515. initialValue = initialValue.replace(",", opts.radixPoint)) : kommaMatches.length > dotMatches.length ? (initialValue = initialValue.replace(/,/g, ""),
  2516. initialValue = initialValue.replace(".", opts.radixPoint)) : initialValue = initialValue.indexOf(".") < initialValue.indexOf(",") ? initialValue.replace(/\./g, "") : initialValue = initialValue.replace(/,/g, "") : initialValue = initialValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), "g"), ""),
  2517. 0 === opts.digits && (-1 !== initialValue.indexOf(".") ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : -1 !== initialValue.indexOf(",") && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
  2518. "" !== opts.radixPoint && isFinite(opts.digits) && -1 !== initialValue.indexOf(opts.radixPoint)) {
  2519. var valueParts = initialValue.split(opts.radixPoint), decPart = valueParts[1].match(new RegExp("\\d*"))[0];
  2520. if (parseInt(opts.digits) < decPart.toString().length) {
  2521. var digitsFactor = Math.pow(10, parseInt(opts.digits));
  2522. initialValue = initialValue.replace(Inputmask.escapeRegex(opts.radixPoint), "."),
  2523. initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor,
  2524. initialValue = initialValue.toString().replace(".", opts.radixPoint);
  2525. }
  2526. }
  2527. return initialValue;
  2528. },
  2529. canClearPosition: function(maskset, position, lvp, strict, opts) {
  2530. var vp = maskset.validPositions[position], canClear = vp.input !== opts.radixPoint || null !== maskset.validPositions[position].match.fn && !1 === opts.decimalProtect || vp.input === opts.radixPoint && maskset.validPositions[position + 1] && null === maskset.validPositions[position + 1].match.fn || isFinite(vp.input) || position === lvp || vp.input === opts.groupSeparator || vp.input === opts.negationSymbol.front || vp.input === opts.negationSymbol.back;
  2531. return !canClear || "+" != vp.match.nativeDef && "-" != vp.match.nativeDef || (opts.isNegative = !1),
  2532. canClear;
  2533. },
  2534. onKeyDown: function(e, buffer, caretPos, opts) {
  2535. var $input = $(this);
  2536. if (e.ctrlKey) switch (e.keyCode) {
  2537. case Inputmask.keyCode.UP:
  2538. $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step)), $input.trigger("setvalue");
  2539. break;
  2540. case Inputmask.keyCode.DOWN:
  2541. $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step)), $input.trigger("setvalue");
  2542. }
  2543. }
  2544. },
  2545. currency: {
  2546. prefix: "$ ",
  2547. groupSeparator: ",",
  2548. alias: "numeric",
  2549. placeholder: "0",
  2550. autoGroup: !0,
  2551. digits: 2,
  2552. digitsOptional: !1,
  2553. clearMaskOnLostFocus: !1
  2554. },
  2555. decimal: {
  2556. alias: "numeric"
  2557. },
  2558. integer: {
  2559. alias: "numeric",
  2560. digits: 0,
  2561. radixPoint: ""
  2562. },
  2563. percentage: {
  2564. alias: "numeric",
  2565. digits: 2,
  2566. digitsOptional: !0,
  2567. radixPoint: ".",
  2568. placeholder: "0",
  2569. autoGroup: !1,
  2570. min: 0,
  2571. max: 100,
  2572. suffix: " %",
  2573. allowMinus: !1
  2574. }
  2575. }), Inputmask;
  2576. });
  2577. }, function(module, exports, __webpack_require__) {
  2578. "use strict";
  2579. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  2580. "function" == typeof Symbol && Symbol.iterator;
  2581. !function(factory) {
  2582. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ],
  2583. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2584. }(function($, Inputmask) {
  2585. function maskSort(a, b) {
  2586. var maska = (a.mask || a).replace(/#/g, "9").replace(/\)/, "9").replace(/[+()#-]/g, ""), maskb = (b.mask || b).replace(/#/g, "9").replace(/\)/, "9").replace(/[+()#-]/g, ""), maskas = (a.mask || a).split("#")[0], maskbs = (b.mask || b).split("#")[0];
  2587. return 0 === maskbs.indexOf(maskas) ? -1 : 0 === maskas.indexOf(maskbs) ? 1 : maska.localeCompare(maskb);
  2588. }
  2589. var analyseMaskBase = Inputmask.prototype.analyseMask;
  2590. return Inputmask.prototype.analyseMask = function(mask, regexMask, opts) {
  2591. function reduceVariations(masks, previousVariation, previousmaskGroup) {
  2592. previousVariation = previousVariation || "", previousmaskGroup = previousmaskGroup || maskGroups,
  2593. "" !== previousVariation && (previousmaskGroup[previousVariation] = {});
  2594. for (var variation = "", maskGroup = previousmaskGroup[previousVariation] || previousmaskGroup, i = masks.length - 1; i >= 0; i--) mask = masks[i].mask || masks[i],
  2595. variation = mask.substr(0, 1), maskGroup[variation] = maskGroup[variation] || [],
  2596. maskGroup[variation].unshift(mask.substr(1)), masks.splice(i, 1);
  2597. for (var ndx in maskGroup) maskGroup[ndx].length > 500 && reduceVariations(maskGroup[ndx].slice(), ndx, maskGroup);
  2598. }
  2599. function rebuild(maskGroup) {
  2600. var mask = "", submasks = [];
  2601. for (var ndx in maskGroup) $.isArray(maskGroup[ndx]) ? 1 === maskGroup[ndx].length ? submasks.push(ndx + maskGroup[ndx]) : submasks.push(ndx + opts.groupmarker.start + maskGroup[ndx].join(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start) + opts.groupmarker.end) : submasks.push(ndx + rebuild(maskGroup[ndx]));
  2602. return 1 === submasks.length ? mask += submasks[0] : mask += opts.groupmarker.start + submasks.join(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start) + opts.groupmarker.end,
  2603. mask;
  2604. }
  2605. var maskGroups = {};
  2606. return opts.phoneCodes && (opts.phoneCodes && opts.phoneCodes.length > 1e3 && (mask = mask.substr(1, mask.length - 2),
  2607. reduceVariations(mask.split(opts.groupmarker.end + opts.alternatormarker + opts.groupmarker.start)),
  2608. mask = rebuild(maskGroups)), mask = mask.replace(/9/g, "\\9")), analyseMaskBase.call(this, mask, regexMask, opts);
  2609. }, Inputmask.extendAliases({
  2610. abstractphone: {
  2611. groupmarker: {
  2612. start: "<",
  2613. end: ">"
  2614. },
  2615. countrycode: "",
  2616. phoneCodes: [],
  2617. mask: function(opts) {
  2618. return opts.definitions = {
  2619. "#": Inputmask.prototype.definitions[9]
  2620. }, opts.phoneCodes.sort(maskSort);
  2621. },
  2622. keepStatic: !0,
  2623. onBeforeMask: function(value, opts) {
  2624. var processedValue = value.replace(/^0{1,2}/, "").replace(/[\s]/g, "");
  2625. return (processedValue.indexOf(opts.countrycode) > 1 || -1 === processedValue.indexOf(opts.countrycode)) && (processedValue = "+" + opts.countrycode + processedValue),
  2626. processedValue;
  2627. },
  2628. onUnMask: function(maskedValue, unmaskedValue, opts) {
  2629. return maskedValue.replace(/[()#-]/g, "");
  2630. },
  2631. inputmode: "tel"
  2632. }
  2633. }), Inputmask;
  2634. });
  2635. }, function(module, exports, __webpack_require__) {
  2636. "use strict";
  2637. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
  2638. "function" == typeof Symbol && Symbol.iterator;
  2639. !function(factory) {
  2640. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(0), __webpack_require__(1) ],
  2641. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2642. }(function($, Inputmask) {
  2643. return Inputmask.extendAliases({
  2644. Regex: {
  2645. mask: "r",
  2646. greedy: !1,
  2647. repeat: "*",
  2648. regex: null,
  2649. regexTokens: null,
  2650. tokenizer: /\[\^?]?(?:[^\\\]]+|\\[\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,
  2651. quantifierFilter: /[0-9]+[^,]/,
  2652. isComplete: function(buffer, opts) {
  2653. return new RegExp(opts.regex, opts.casing ? "i" : "").test(buffer.join(""));
  2654. },
  2655. definitions: {
  2656. r: {
  2657. validator: function(chrs, maskset, pos, strict, opts) {
  2658. function RegexToken(isGroup, isQuantifier) {
  2659. this.matches = [], this.isGroup = isGroup || !1, this.isQuantifier = isQuantifier || !1,
  2660. this.quantifier = {
  2661. min: 1,
  2662. max: 1
  2663. }, this.repeaterPart = void 0;
  2664. }
  2665. function validateRegexToken(token, fromGroup) {
  2666. var isvalid = !1;
  2667. fromGroup && (regexPart += "(", openGroupCount++);
  2668. for (var mndx = 0; mndx < token.matches.length; mndx++) {
  2669. var matchToken = token.matches[mndx];
  2670. if (!0 === matchToken.isGroup) isvalid = validateRegexToken(matchToken, !0); else if (!0 === matchToken.isQuantifier) {
  2671. var crrntndx = $.inArray(matchToken, token.matches), matchGroup = token.matches[crrntndx - 1], regexPartBak = regexPart;
  2672. if (isNaN(matchToken.quantifier.max)) {
  2673. for (;matchToken.repeaterPart && matchToken.repeaterPart !== regexPart && matchToken.repeaterPart.length > regexPart.length && !(isvalid = validateRegexToken(matchGroup, !0)); ) ;
  2674. isvalid = isvalid || validateRegexToken(matchGroup, !0), isvalid && (matchToken.repeaterPart = regexPart),
  2675. regexPart = regexPartBak + matchToken.quantifier.max;
  2676. } else {
  2677. for (var i = 0, qm = matchToken.quantifier.max - 1; i < qm && !(isvalid = validateRegexToken(matchGroup, !0)); i++) ;
  2678. regexPart = regexPartBak + "{" + matchToken.quantifier.min + "," + matchToken.quantifier.max + "}";
  2679. }
  2680. } else if (void 0 !== matchToken.matches) for (var k = 0; k < matchToken.length && !(isvalid = validateRegexToken(matchToken[k], fromGroup)); k++) ; else {
  2681. var testExp;
  2682. if ("[" == matchToken.charAt(0)) {
  2683. testExp = regexPart, testExp += matchToken;
  2684. for (var j = 0; j < openGroupCount; j++) testExp += ")";
  2685. var exp = new RegExp("^(" + testExp + ")$", opts.casing ? "i" : "");
  2686. isvalid = exp.test(bufferStr);
  2687. } else for (var l = 0, tl = matchToken.length; l < tl; l++) if ("\\" !== matchToken.charAt(l)) {
  2688. testExp = regexPart, testExp += matchToken.substr(0, l + 1), testExp = testExp.replace(/\|$/, "");
  2689. for (var j = 0; j < openGroupCount; j++) testExp += ")";
  2690. var exp = new RegExp("^(" + testExp + ")$", opts.casing ? "i" : "");
  2691. if (isvalid = exp.test(bufferStr)) break;
  2692. }
  2693. regexPart += matchToken;
  2694. }
  2695. if (isvalid) break;
  2696. }
  2697. return fromGroup && (regexPart += ")", openGroupCount--), isvalid;
  2698. }
  2699. var bufferStr, groupToken, cbuffer = maskset.buffer.slice(), regexPart = "", isValid = !1, openGroupCount = 0;
  2700. null === opts.regexTokens && function() {
  2701. var match, m, currentToken = new RegexToken(), opengroups = [];
  2702. for (opts.regexTokens = []; match = opts.tokenizer.exec(opts.regex); ) switch (m = match[0],
  2703. m.charAt(0)) {
  2704. case "(":
  2705. opengroups.push(new RegexToken(!0));
  2706. break;
  2707. case ")":
  2708. groupToken = opengroups.pop(), opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(groupToken) : currentToken.matches.push(groupToken);
  2709. break;
  2710. case "{":
  2711. case "+":
  2712. case "*":
  2713. var quantifierToken = new RegexToken(!1, !0);
  2714. m = m.replace(/[{}]/g, "");
  2715. var mq = m.split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 === mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);
  2716. if (quantifierToken.quantifier = {
  2717. min: mq0,
  2718. max: mq1
  2719. }, opengroups.length > 0) {
  2720. var matches = opengroups[opengroups.length - 1].matches;
  2721. match = matches.pop(), match.isGroup || (groupToken = new RegexToken(!0), groupToken.matches.push(match),
  2722. match = groupToken), matches.push(match), matches.push(quantifierToken);
  2723. } else match = currentToken.matches.pop(), match.isGroup || (groupToken = new RegexToken(!0),
  2724. groupToken.matches.push(match), match = groupToken), currentToken.matches.push(match),
  2725. currentToken.matches.push(quantifierToken);
  2726. break;
  2727. default:
  2728. opengroups.length > 0 ? opengroups[opengroups.length - 1].matches.push(m) : currentToken.matches.push(m);
  2729. }
  2730. currentToken.matches.length > 0 && opts.regexTokens.push(currentToken);
  2731. }(), cbuffer.splice(pos, 0, chrs), bufferStr = cbuffer.join("");
  2732. for (var i = 0; i < opts.regexTokens.length; i++) {
  2733. var regexToken = opts.regexTokens[i];
  2734. if (isValid = validateRegexToken(regexToken, regexToken.isGroup)) break;
  2735. }
  2736. return isValid;
  2737. },
  2738. cardinality: 1
  2739. }
  2740. }
  2741. }
  2742. }), Inputmask;
  2743. });
  2744. }, function(module, exports, __webpack_require__) {
  2745. "use strict";
  2746. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__, _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) {
  2747. return typeof obj;
  2748. } : function(obj) {
  2749. return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
  2750. };
  2751. !function(factory) {
  2752. __WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(2), __webpack_require__(1) ],
  2753. __WEBPACK_AMD_DEFINE_FACTORY__ = factory, void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = "function" == typeof __WEBPACK_AMD_DEFINE_FACTORY__ ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2754. }(function($, Inputmask) {
  2755. return void 0 === $.fn.inputmask && ($.fn.inputmask = function(fn, options) {
  2756. var nptmask, input = this[0];
  2757. if (void 0 === options && (options = {}), "string" == typeof fn) switch (fn) {
  2758. case "unmaskedvalue":
  2759. return input && input.inputmask ? input.inputmask.unmaskedvalue() : $(input).val();
  2760. case "remove":
  2761. return this.each(function() {
  2762. this.inputmask && this.inputmask.remove();
  2763. });
  2764. case "getemptymask":
  2765. return input && input.inputmask ? input.inputmask.getemptymask() : "";
  2766. case "hasMaskedValue":
  2767. return !(!input || !input.inputmask) && input.inputmask.hasMaskedValue();
  2768. case "isComplete":
  2769. return !input || !input.inputmask || input.inputmask.isComplete();
  2770. case "getmetadata":
  2771. return input && input.inputmask ? input.inputmask.getmetadata() : void 0;
  2772. case "setvalue":
  2773. $(input).val(options), input && void 0 === input.inputmask && $(input).triggerHandler("setvalue");
  2774. break;
  2775. case "option":
  2776. if ("string" != typeof options) return this.each(function() {
  2777. if (void 0 !== this.inputmask) return this.inputmask.option(options);
  2778. });
  2779. if (input && void 0 !== input.inputmask) return input.inputmask.option(options);
  2780. break;
  2781. default:
  2782. return options.alias = fn, nptmask = new Inputmask(options), this.each(function() {
  2783. nptmask.mask(this);
  2784. });
  2785. } else {
  2786. if ("object" == (void 0 === fn ? "undefined" : _typeof(fn))) return nptmask = new Inputmask(fn),
  2787. void 0 === fn.mask && void 0 === fn.alias ? this.each(function() {
  2788. if (void 0 !== this.inputmask) return this.inputmask.option(fn);
  2789. nptmask.mask(this);
  2790. }) : this.each(function() {
  2791. nptmask.mask(this);
  2792. });
  2793. if (void 0 === fn) return this.each(function() {
  2794. nptmask = new Inputmask(options), nptmask.mask(this);
  2795. });
  2796. }
  2797. }), $.fn.inputmask;
  2798. });
  2799. }, function(module, exports, __webpack_require__) {
  2800. var content = __webpack_require__(13);
  2801. "string" == typeof content && (content = [ [ module.i, content, "" ] ]);
  2802. __webpack_require__(19)(content, {});
  2803. content.locals && (module.exports = content.locals);
  2804. }, function(module, exports, __webpack_require__) {
  2805. "use strict";
  2806. function _interopRequireDefault(obj) {
  2807. return obj && obj.__esModule ? obj : {
  2808. default: obj
  2809. };
  2810. }
  2811. __webpack_require__(9), __webpack_require__(3), __webpack_require__(4), __webpack_require__(5),
  2812. __webpack_require__(6), __webpack_require__(7);
  2813. var _inputmask = __webpack_require__(1), _inputmask2 = _interopRequireDefault(_inputmask), _inputmask3 = __webpack_require__(0), _inputmask4 = _interopRequireDefault(_inputmask3), _jquery = __webpack_require__(2), _jquery2 = _interopRequireDefault(_jquery);
  2814. _inputmask4.default === _jquery2.default && __webpack_require__(8), window.Inputmask = _inputmask2.default;
  2815. }, function(module, exports, __webpack_require__) {
  2816. "use strict";
  2817. var __WEBPACK_AMD_DEFINE_RESULT__;
  2818. "function" == typeof Symbol && Symbol.iterator;
  2819. void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  2820. return document;
  2821. }.call(exports, __webpack_require__, exports, module)) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2822. }, function(module, exports, __webpack_require__) {
  2823. "use strict";
  2824. var __WEBPACK_AMD_DEFINE_RESULT__;
  2825. "function" == typeof Symbol && Symbol.iterator;
  2826. void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = function() {
  2827. return window;
  2828. }.call(exports, __webpack_require__, exports, module)) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__);
  2829. }, function(module, exports, __webpack_require__) {
  2830. exports = module.exports = __webpack_require__(16)(void 0), exports.push([ module.i, ".im-caret {\r\n\t-webkit-animation: 1s blink step-end infinite;\r\n\tanimation: 1s blink step-end infinite;\r\n}\r\n\r\n@keyframes blink {\r\n\tfrom, to {\r\n\t\tborder-right-color: black;\r\n\t}\r\n\t50% {\r\n\t\tborder-right-color: transparent;\r\n\t}\r\n}\r\n\r\n@-webkit-keyframes blink {\r\n\tfrom, to {\r\n\t\tborder-right-color: black;\r\n\t}\r\n\t50% {\r\n\t\tborder-right-color: transparent;\r\n\t}\r\n}\r\n\r\n.im-static {\r\n\tcolor: grey;\r\n}\r\n", "" ]);
  2831. }, function(module, exports, __webpack_require__) {
  2832. "use strict";
  2833. function placeHoldersCount(b64) {
  2834. var len = b64.length;
  2835. if (len % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
  2836. return "=" === b64[len - 2] ? 2 : "=" === b64[len - 1] ? 1 : 0;
  2837. }
  2838. function byteLength(b64) {
  2839. return 3 * b64.length / 4 - placeHoldersCount(b64);
  2840. }
  2841. function toByteArray(b64) {
  2842. var i, j, l, tmp, placeHolders, arr, len = b64.length;
  2843. placeHolders = placeHoldersCount(b64), arr = new Arr(3 * len / 4 - placeHolders),
  2844. l = placeHolders > 0 ? len - 4 : len;
  2845. var L = 0;
  2846. for (i = 0, j = 0; i < l; i += 4, j += 3) tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)],
  2847. arr[L++] = tmp >> 16 & 255, arr[L++] = tmp >> 8 & 255, arr[L++] = 255 & tmp;
  2848. return 2 === placeHolders ? (tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4,
  2849. arr[L++] = 255 & tmp) : 1 === placeHolders && (tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2,
  2850. arr[L++] = tmp >> 8 & 255, arr[L++] = 255 & tmp), arr;
  2851. }
  2852. function tripletToBase64(num) {
  2853. return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[63 & num];
  2854. }
  2855. function encodeChunk(uint8, start, end) {
  2856. for (var tmp, output = [], i = start; i < end; i += 3) tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2],
  2857. output.push(tripletToBase64(tmp));
  2858. return output.join("");
  2859. }
  2860. function fromByteArray(uint8) {
  2861. for (var tmp, len = uint8.length, extraBytes = len % 3, output = "", parts = [], i = 0, len2 = len - extraBytes; i < len2; i += 16383) parts.push(encodeChunk(uint8, i, i + 16383 > len2 ? len2 : i + 16383));
  2862. return 1 === extraBytes ? (tmp = uint8[len - 1], output += lookup[tmp >> 2], output += lookup[tmp << 4 & 63],
  2863. output += "==") : 2 === extraBytes && (tmp = (uint8[len - 2] << 8) + uint8[len - 1],
  2864. output += lookup[tmp >> 10], output += lookup[tmp >> 4 & 63], output += lookup[tmp << 2 & 63],
  2865. output += "="), parts.push(output), parts.join("");
  2866. }
  2867. exports.byteLength = byteLength, exports.toByteArray = toByteArray, exports.fromByteArray = fromByteArray;
  2868. for (var lookup = [], revLookup = [], Arr = "undefined" != typeof Uint8Array ? Uint8Array : Array, code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", i = 0, len = code.length; i < len; ++i) lookup[i] = code[i],
  2869. revLookup[code.charCodeAt(i)] = i;
  2870. revLookup["-".charCodeAt(0)] = 62, revLookup["_".charCodeAt(0)] = 63;
  2871. }, function(module, exports, __webpack_require__) {
  2872. "use strict";
  2873. (function(global) {
  2874. function kMaxLength() {
  2875. return Buffer.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823;
  2876. }
  2877. function createBuffer(that, length) {
  2878. if (kMaxLength() < length) throw new RangeError("Invalid typed array length");
  2879. return Buffer.TYPED_ARRAY_SUPPORT ? (that = new Uint8Array(length), that.__proto__ = Buffer.prototype) : (null === that && (that = new Buffer(length)),
  2880. that.length = length), that;
  2881. }
  2882. function Buffer(arg, encodingOrOffset, length) {
  2883. if (!(Buffer.TYPED_ARRAY_SUPPORT || this instanceof Buffer)) return new Buffer(arg, encodingOrOffset, length);
  2884. if ("number" == typeof arg) {
  2885. if ("string" == typeof encodingOrOffset) throw new Error("If encoding is specified then the first argument must be a string");
  2886. return allocUnsafe(this, arg);
  2887. }
  2888. return from(this, arg, encodingOrOffset, length);
  2889. }
  2890. function from(that, value, encodingOrOffset, length) {
  2891. if ("number" == typeof value) throw new TypeError('"value" argument must not be a number');
  2892. return "undefined" != typeof ArrayBuffer && value instanceof ArrayBuffer ? fromArrayBuffer(that, value, encodingOrOffset, length) : "string" == typeof value ? fromString(that, value, encodingOrOffset) : fromObject(that, value);
  2893. }
  2894. function assertSize(size) {
  2895. if ("number" != typeof size) throw new TypeError('"size" argument must be a number');
  2896. if (size < 0) throw new RangeError('"size" argument must not be negative');
  2897. }
  2898. function alloc(that, size, fill, encoding) {
  2899. return assertSize(size), size <= 0 ? createBuffer(that, size) : void 0 !== fill ? "string" == typeof encoding ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill) : createBuffer(that, size);
  2900. }
  2901. function allocUnsafe(that, size) {
  2902. if (assertSize(size), that = createBuffer(that, size < 0 ? 0 : 0 | checked(size)),
  2903. !Buffer.TYPED_ARRAY_SUPPORT) for (var i = 0; i < size; ++i) that[i] = 0;
  2904. return that;
  2905. }
  2906. function fromString(that, string, encoding) {
  2907. if ("string" == typeof encoding && "" !== encoding || (encoding = "utf8"), !Buffer.isEncoding(encoding)) throw new TypeError('"encoding" must be a valid string encoding');
  2908. var length = 0 | byteLength(string, encoding);
  2909. that = createBuffer(that, length);
  2910. var actual = that.write(string, encoding);
  2911. return actual !== length && (that = that.slice(0, actual)), that;
  2912. }
  2913. function fromArrayLike(that, array) {
  2914. var length = array.length < 0 ? 0 : 0 | checked(array.length);
  2915. that = createBuffer(that, length);
  2916. for (var i = 0; i < length; i += 1) that[i] = 255 & array[i];
  2917. return that;
  2918. }
  2919. function fromArrayBuffer(that, array, byteOffset, length) {
  2920. if (array.byteLength, byteOffset < 0 || array.byteLength < byteOffset) throw new RangeError("'offset' is out of bounds");
  2921. if (array.byteLength < byteOffset + (length || 0)) throw new RangeError("'length' is out of bounds");
  2922. return array = void 0 === byteOffset && void 0 === length ? new Uint8Array(array) : void 0 === length ? new Uint8Array(array, byteOffset) : new Uint8Array(array, byteOffset, length),
  2923. Buffer.TYPED_ARRAY_SUPPORT ? (that = array, that.__proto__ = Buffer.prototype) : that = fromArrayLike(that, array),
  2924. that;
  2925. }
  2926. function fromObject(that, obj) {
  2927. if (Buffer.isBuffer(obj)) {
  2928. var len = 0 | checked(obj.length);
  2929. return that = createBuffer(that, len), 0 === that.length ? that : (obj.copy(that, 0, 0, len),
  2930. that);
  2931. }
  2932. if (obj) {
  2933. if ("undefined" != typeof ArrayBuffer && obj.buffer instanceof ArrayBuffer || "length" in obj) return "number" != typeof obj.length || isnan(obj.length) ? createBuffer(that, 0) : fromArrayLike(that, obj);
  2934. if ("Buffer" === obj.type && isArray(obj.data)) return fromArrayLike(that, obj.data);
  2935. }
  2936. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.");
  2937. }
  2938. function checked(length) {
  2939. if (length >= kMaxLength()) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + kMaxLength().toString(16) + " bytes");
  2940. return 0 | length;
  2941. }
  2942. function SlowBuffer(length) {
  2943. return +length != length && (length = 0), Buffer.alloc(+length);
  2944. }
  2945. function byteLength(string, encoding) {
  2946. if (Buffer.isBuffer(string)) return string.length;
  2947. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) return string.byteLength;
  2948. "string" != typeof string && (string = "" + string);
  2949. var len = string.length;
  2950. if (0 === len) return 0;
  2951. for (var loweredCase = !1; ;) switch (encoding) {
  2952. case "ascii":
  2953. case "latin1":
  2954. case "binary":
  2955. return len;
  2956. case "utf8":
  2957. case "utf-8":
  2958. case void 0:
  2959. return utf8ToBytes(string).length;
  2960. case "ucs2":
  2961. case "ucs-2":
  2962. case "utf16le":
  2963. case "utf-16le":
  2964. return 2 * len;
  2965. case "hex":
  2966. return len >>> 1;
  2967. case "base64":
  2968. return base64ToBytes(string).length;
  2969. default:
  2970. if (loweredCase) return utf8ToBytes(string).length;
  2971. encoding = ("" + encoding).toLowerCase(), loweredCase = !0;
  2972. }
  2973. }
  2974. function slowToString(encoding, start, end) {
  2975. var loweredCase = !1;
  2976. if ((void 0 === start || start < 0) && (start = 0), start > this.length) return "";
  2977. if ((void 0 === end || end > this.length) && (end = this.length), end <= 0) return "";
  2978. if (end >>>= 0, start >>>= 0, end <= start) return "";
  2979. for (encoding || (encoding = "utf8"); ;) switch (encoding) {
  2980. case "hex":
  2981. return hexSlice(this, start, end);
  2982. case "utf8":
  2983. case "utf-8":
  2984. return utf8Slice(this, start, end);
  2985. case "ascii":
  2986. return asciiSlice(this, start, end);
  2987. case "latin1":
  2988. case "binary":
  2989. return latin1Slice(this, start, end);
  2990. case "base64":
  2991. return base64Slice(this, start, end);
  2992. case "ucs2":
  2993. case "ucs-2":
  2994. case "utf16le":
  2995. case "utf-16le":
  2996. return utf16leSlice(this, start, end);
  2997. default:
  2998. if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
  2999. encoding = (encoding + "").toLowerCase(), loweredCase = !0;
  3000. }
  3001. }
  3002. function swap(b, n, m) {
  3003. var i = b[n];
  3004. b[n] = b[m], b[m] = i;
  3005. }
  3006. function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
  3007. if (0 === buffer.length) return -1;
  3008. if ("string" == typeof byteOffset ? (encoding = byteOffset, byteOffset = 0) : byteOffset > 2147483647 ? byteOffset = 2147483647 : byteOffset < -2147483648 && (byteOffset = -2147483648),
  3009. byteOffset = +byteOffset, isNaN(byteOffset) && (byteOffset = dir ? 0 : buffer.length - 1),
  3010. byteOffset < 0 && (byteOffset = buffer.length + byteOffset), byteOffset >= buffer.length) {
  3011. if (dir) return -1;
  3012. byteOffset = buffer.length - 1;
  3013. } else if (byteOffset < 0) {
  3014. if (!dir) return -1;
  3015. byteOffset = 0;
  3016. }
  3017. if ("string" == typeof val && (val = Buffer.from(val, encoding)), Buffer.isBuffer(val)) return 0 === val.length ? -1 : arrayIndexOf(buffer, val, byteOffset, encoding, dir);
  3018. if ("number" == typeof val) return val &= 255, Buffer.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? dir ? Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) : Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) : arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir);
  3019. throw new TypeError("val must be string, number or Buffer");
  3020. }
  3021. function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
  3022. function read(buf, i) {
  3023. return 1 === indexSize ? buf[i] : buf.readUInt16BE(i * indexSize);
  3024. }
  3025. var indexSize = 1, arrLength = arr.length, valLength = val.length;
  3026. if (void 0 !== encoding && ("ucs2" === (encoding = String(encoding).toLowerCase()) || "ucs-2" === encoding || "utf16le" === encoding || "utf-16le" === encoding)) {
  3027. if (arr.length < 2 || val.length < 2) return -1;
  3028. indexSize = 2, arrLength /= 2, valLength /= 2, byteOffset /= 2;
  3029. }
  3030. var i;
  3031. if (dir) {
  3032. var foundIndex = -1;
  3033. for (i = byteOffset; i < arrLength; i++) if (read(arr, i) === read(val, -1 === foundIndex ? 0 : i - foundIndex)) {
  3034. if (-1 === foundIndex && (foundIndex = i), i - foundIndex + 1 === valLength) return foundIndex * indexSize;
  3035. } else -1 !== foundIndex && (i -= i - foundIndex), foundIndex = -1;
  3036. } else for (byteOffset + valLength > arrLength && (byteOffset = arrLength - valLength),
  3037. i = byteOffset; i >= 0; i--) {
  3038. for (var found = !0, j = 0; j < valLength; j++) if (read(arr, i + j) !== read(val, j)) {
  3039. found = !1;
  3040. break;
  3041. }
  3042. if (found) return i;
  3043. }
  3044. return -1;
  3045. }
  3046. function hexWrite(buf, string, offset, length) {
  3047. offset = Number(offset) || 0;
  3048. var remaining = buf.length - offset;
  3049. length ? (length = Number(length)) > remaining && (length = remaining) : length = remaining;
  3050. var strLen = string.length;
  3051. if (strLen % 2 != 0) throw new TypeError("Invalid hex string");
  3052. length > strLen / 2 && (length = strLen / 2);
  3053. for (var i = 0; i < length; ++i) {
  3054. var parsed = parseInt(string.substr(2 * i, 2), 16);
  3055. if (isNaN(parsed)) return i;
  3056. buf[offset + i] = parsed;
  3057. }
  3058. return i;
  3059. }
  3060. function utf8Write(buf, string, offset, length) {
  3061. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
  3062. }
  3063. function asciiWrite(buf, string, offset, length) {
  3064. return blitBuffer(asciiToBytes(string), buf, offset, length);
  3065. }
  3066. function latin1Write(buf, string, offset, length) {
  3067. return asciiWrite(buf, string, offset, length);
  3068. }
  3069. function base64Write(buf, string, offset, length) {
  3070. return blitBuffer(base64ToBytes(string), buf, offset, length);
  3071. }
  3072. function ucs2Write(buf, string, offset, length) {
  3073. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
  3074. }
  3075. function base64Slice(buf, start, end) {
  3076. return 0 === start && end === buf.length ? base64.fromByteArray(buf) : base64.fromByteArray(buf.slice(start, end));
  3077. }
  3078. function utf8Slice(buf, start, end) {
  3079. end = Math.min(buf.length, end);
  3080. for (var res = [], i = start; i < end; ) {
  3081. var firstByte = buf[i], codePoint = null, bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
  3082. if (i + bytesPerSequence <= end) {
  3083. var secondByte, thirdByte, fourthByte, tempCodePoint;
  3084. switch (bytesPerSequence) {
  3085. case 1:
  3086. firstByte < 128 && (codePoint = firstByte);
  3087. break;
  3088. case 2:
  3089. secondByte = buf[i + 1], 128 == (192 & secondByte) && (tempCodePoint = (31 & firstByte) << 6 | 63 & secondByte) > 127 && (codePoint = tempCodePoint);
  3090. break;
  3091. case 3:
  3092. secondByte = buf[i + 1], thirdByte = buf[i + 2], 128 == (192 & secondByte) && 128 == (192 & thirdByte) && (tempCodePoint = (15 & firstByte) << 12 | (63 & secondByte) << 6 | 63 & thirdByte) > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343) && (codePoint = tempCodePoint);
  3093. break;
  3094. case 4:
  3095. secondByte = buf[i + 1], thirdByte = buf[i + 2], fourthByte = buf[i + 3], 128 == (192 & secondByte) && 128 == (192 & thirdByte) && 128 == (192 & fourthByte) && (tempCodePoint = (15 & firstByte) << 18 | (63 & secondByte) << 12 | (63 & thirdByte) << 6 | 63 & fourthByte) > 65535 && tempCodePoint < 1114112 && (codePoint = tempCodePoint);
  3096. }
  3097. }
  3098. null === codePoint ? (codePoint = 65533, bytesPerSequence = 1) : codePoint > 65535 && (codePoint -= 65536,
  3099. res.push(codePoint >>> 10 & 1023 | 55296), codePoint = 56320 | 1023 & codePoint),
  3100. res.push(codePoint), i += bytesPerSequence;
  3101. }
  3102. return decodeCodePointsArray(res);
  3103. }
  3104. function decodeCodePointsArray(codePoints) {
  3105. var len = codePoints.length;
  3106. if (len <= MAX_ARGUMENTS_LENGTH) return String.fromCharCode.apply(String, codePoints);
  3107. for (var res = "", i = 0; i < len; ) res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
  3108. return res;
  3109. }
  3110. function asciiSlice(buf, start, end) {
  3111. var ret = "";
  3112. end = Math.min(buf.length, end);
  3113. for (var i = start; i < end; ++i) ret += String.fromCharCode(127 & buf[i]);
  3114. return ret;
  3115. }
  3116. function latin1Slice(buf, start, end) {
  3117. var ret = "";
  3118. end = Math.min(buf.length, end);
  3119. for (var i = start; i < end; ++i) ret += String.fromCharCode(buf[i]);
  3120. return ret;
  3121. }
  3122. function hexSlice(buf, start, end) {
  3123. var len = buf.length;
  3124. (!start || start < 0) && (start = 0), (!end || end < 0 || end > len) && (end = len);
  3125. for (var out = "", i = start; i < end; ++i) out += toHex(buf[i]);
  3126. return out;
  3127. }
  3128. function utf16leSlice(buf, start, end) {
  3129. for (var bytes = buf.slice(start, end), res = "", i = 0; i < bytes.length; i += 2) res += String.fromCharCode(bytes[i] + 256 * bytes[i + 1]);
  3130. return res;
  3131. }
  3132. function checkOffset(offset, ext, length) {
  3133. if (offset % 1 != 0 || offset < 0) throw new RangeError("offset is not uint");
  3134. if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
  3135. }
  3136. function checkInt(buf, value, offset, ext, max, min) {
  3137. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
  3138. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
  3139. if (offset + ext > buf.length) throw new RangeError("Index out of range");
  3140. }
  3141. function objectWriteUInt16(buf, value, offset, littleEndian) {
  3142. value < 0 && (value = 65535 + value + 1);
  3143. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) buf[offset + i] = (value & 255 << 8 * (littleEndian ? i : 1 - i)) >>> 8 * (littleEndian ? i : 1 - i);
  3144. }
  3145. function objectWriteUInt32(buf, value, offset, littleEndian) {
  3146. value < 0 && (value = 4294967295 + value + 1);
  3147. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) buf[offset + i] = value >>> 8 * (littleEndian ? i : 3 - i) & 255;
  3148. }
  3149. function checkIEEE754(buf, value, offset, ext, max, min) {
  3150. if (offset + ext > buf.length) throw new RangeError("Index out of range");
  3151. if (offset < 0) throw new RangeError("Index out of range");
  3152. }
  3153. function writeFloat(buf, value, offset, littleEndian, noAssert) {
  3154. return noAssert || checkIEEE754(buf, value, offset, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  3155. ieee754.write(buf, value, offset, littleEndian, 23, 4), offset + 4;
  3156. }
  3157. function writeDouble(buf, value, offset, littleEndian, noAssert) {
  3158. return noAssert || checkIEEE754(buf, value, offset, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  3159. ieee754.write(buf, value, offset, littleEndian, 52, 8), offset + 8;
  3160. }
  3161. function base64clean(str) {
  3162. if (str = stringtrim(str).replace(INVALID_BASE64_RE, ""), str.length < 2) return "";
  3163. for (;str.length % 4 != 0; ) str += "=";
  3164. return str;
  3165. }
  3166. function stringtrim(str) {
  3167. return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
  3168. }
  3169. function toHex(n) {
  3170. return n < 16 ? "0" + n.toString(16) : n.toString(16);
  3171. }
  3172. function utf8ToBytes(string, units) {
  3173. units = units || 1 / 0;
  3174. for (var codePoint, length = string.length, leadSurrogate = null, bytes = [], i = 0; i < length; ++i) {
  3175. if ((codePoint = string.charCodeAt(i)) > 55295 && codePoint < 57344) {
  3176. if (!leadSurrogate) {
  3177. if (codePoint > 56319) {
  3178. (units -= 3) > -1 && bytes.push(239, 191, 189);
  3179. continue;
  3180. }
  3181. if (i + 1 === length) {
  3182. (units -= 3) > -1 && bytes.push(239, 191, 189);
  3183. continue;
  3184. }
  3185. leadSurrogate = codePoint;
  3186. continue;
  3187. }
  3188. if (codePoint < 56320) {
  3189. (units -= 3) > -1 && bytes.push(239, 191, 189), leadSurrogate = codePoint;
  3190. continue;
  3191. }
  3192. codePoint = 65536 + (leadSurrogate - 55296 << 10 | codePoint - 56320);
  3193. } else leadSurrogate && (units -= 3) > -1 && bytes.push(239, 191, 189);
  3194. if (leadSurrogate = null, codePoint < 128) {
  3195. if ((units -= 1) < 0) break;
  3196. bytes.push(codePoint);
  3197. } else if (codePoint < 2048) {
  3198. if ((units -= 2) < 0) break;
  3199. bytes.push(codePoint >> 6 | 192, 63 & codePoint | 128);
  3200. } else if (codePoint < 65536) {
  3201. if ((units -= 3) < 0) break;
  3202. bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, 63 & codePoint | 128);
  3203. } else {
  3204. if (!(codePoint < 1114112)) throw new Error("Invalid code point");
  3205. if ((units -= 4) < 0) break;
  3206. bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, 63 & codePoint | 128);
  3207. }
  3208. }
  3209. return bytes;
  3210. }
  3211. function asciiToBytes(str) {
  3212. for (var byteArray = [], i = 0; i < str.length; ++i) byteArray.push(255 & str.charCodeAt(i));
  3213. return byteArray;
  3214. }
  3215. function utf16leToBytes(str, units) {
  3216. for (var c, hi, lo, byteArray = [], i = 0; i < str.length && !((units -= 2) < 0); ++i) c = str.charCodeAt(i),
  3217. hi = c >> 8, lo = c % 256, byteArray.push(lo), byteArray.push(hi);
  3218. return byteArray;
  3219. }
  3220. function base64ToBytes(str) {
  3221. return base64.toByteArray(base64clean(str));
  3222. }
  3223. function blitBuffer(src, dst, offset, length) {
  3224. for (var i = 0; i < length && !(i + offset >= dst.length || i >= src.length); ++i) dst[i + offset] = src[i];
  3225. return i;
  3226. }
  3227. function isnan(val) {
  3228. return val !== val;
  3229. }
  3230. var base64 = __webpack_require__(14), ieee754 = __webpack_require__(17), isArray = __webpack_require__(18);
  3231. exports.Buffer = Buffer, exports.SlowBuffer = SlowBuffer, exports.INSPECT_MAX_BYTES = 50,
  3232. Buffer.TYPED_ARRAY_SUPPORT = void 0 !== global.TYPED_ARRAY_SUPPORT ? global.TYPED_ARRAY_SUPPORT : function() {
  3233. try {
  3234. var arr = new Uint8Array(1);
  3235. return arr.__proto__ = {
  3236. __proto__: Uint8Array.prototype,
  3237. foo: function() {
  3238. return 42;
  3239. }
  3240. }, 42 === arr.foo() && "function" == typeof arr.subarray && 0 === arr.subarray(1, 1).byteLength;
  3241. } catch (e) {
  3242. return !1;
  3243. }
  3244. }(), exports.kMaxLength = kMaxLength(), Buffer.poolSize = 8192, Buffer._augment = function(arr) {
  3245. return arr.__proto__ = Buffer.prototype, arr;
  3246. }, Buffer.from = function(value, encodingOrOffset, length) {
  3247. return from(null, value, encodingOrOffset, length);
  3248. }, Buffer.TYPED_ARRAY_SUPPORT && (Buffer.prototype.__proto__ = Uint8Array.prototype,
  3249. Buffer.__proto__ = Uint8Array, "undefined" != typeof Symbol && Symbol.species && Buffer[Symbol.species] === Buffer && Object.defineProperty(Buffer, Symbol.species, {
  3250. value: null,
  3251. configurable: !0
  3252. })), Buffer.alloc = function(size, fill, encoding) {
  3253. return alloc(null, size, fill, encoding);
  3254. }, Buffer.allocUnsafe = function(size) {
  3255. return allocUnsafe(null, size);
  3256. }, Buffer.allocUnsafeSlow = function(size) {
  3257. return allocUnsafe(null, size);
  3258. }, Buffer.isBuffer = function(b) {
  3259. return !(null == b || !b._isBuffer);
  3260. }, Buffer.compare = function(a, b) {
  3261. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) throw new TypeError("Arguments must be Buffers");
  3262. if (a === b) return 0;
  3263. for (var x = a.length, y = b.length, i = 0, len = Math.min(x, y); i < len; ++i) if (a[i] !== b[i]) {
  3264. x = a[i], y = b[i];
  3265. break;
  3266. }
  3267. return x < y ? -1 : y < x ? 1 : 0;
  3268. }, Buffer.isEncoding = function(encoding) {
  3269. switch (String(encoding).toLowerCase()) {
  3270. case "hex":
  3271. case "utf8":
  3272. case "utf-8":
  3273. case "ascii":
  3274. case "latin1":
  3275. case "binary":
  3276. case "base64":
  3277. case "ucs2":
  3278. case "ucs-2":
  3279. case "utf16le":
  3280. case "utf-16le":
  3281. return !0;
  3282. default:
  3283. return !1;
  3284. }
  3285. }, Buffer.concat = function(list, length) {
  3286. if (!isArray(list)) throw new TypeError('"list" argument must be an Array of Buffers');
  3287. if (0 === list.length) return Buffer.alloc(0);
  3288. var i;
  3289. if (void 0 === length) for (length = 0, i = 0; i < list.length; ++i) length += list[i].length;
  3290. var buffer = Buffer.allocUnsafe(length), pos = 0;
  3291. for (i = 0; i < list.length; ++i) {
  3292. var buf = list[i];
  3293. if (!Buffer.isBuffer(buf)) throw new TypeError('"list" argument must be an Array of Buffers');
  3294. buf.copy(buffer, pos), pos += buf.length;
  3295. }
  3296. return buffer;
  3297. }, Buffer.byteLength = byteLength, Buffer.prototype._isBuffer = !0, Buffer.prototype.swap16 = function() {
  3298. var len = this.length;
  3299. if (len % 2 != 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
  3300. for (var i = 0; i < len; i += 2) swap(this, i, i + 1);
  3301. return this;
  3302. }, Buffer.prototype.swap32 = function() {
  3303. var len = this.length;
  3304. if (len % 4 != 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
  3305. for (var i = 0; i < len; i += 4) swap(this, i, i + 3), swap(this, i + 1, i + 2);
  3306. return this;
  3307. }, Buffer.prototype.swap64 = function() {
  3308. var len = this.length;
  3309. if (len % 8 != 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
  3310. for (var i = 0; i < len; i += 8) swap(this, i, i + 7), swap(this, i + 1, i + 6),
  3311. swap(this, i + 2, i + 5), swap(this, i + 3, i + 4);
  3312. return this;
  3313. }, Buffer.prototype.toString = function() {
  3314. var length = 0 | this.length;
  3315. return 0 === length ? "" : 0 === arguments.length ? utf8Slice(this, 0, length) : slowToString.apply(this, arguments);
  3316. }, Buffer.prototype.equals = function(b) {
  3317. if (!Buffer.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
  3318. return this === b || 0 === Buffer.compare(this, b);
  3319. }, Buffer.prototype.inspect = function() {
  3320. var str = "", max = exports.INSPECT_MAX_BYTES;
  3321. return this.length > 0 && (str = this.toString("hex", 0, max).match(/.{2}/g).join(" "),
  3322. this.length > max && (str += " ... ")), "<Buffer " + str + ">";
  3323. }, Buffer.prototype.compare = function(target, start, end, thisStart, thisEnd) {
  3324. if (!Buffer.isBuffer(target)) throw new TypeError("Argument must be a Buffer");
  3325. if (void 0 === start && (start = 0), void 0 === end && (end = target ? target.length : 0),
  3326. void 0 === thisStart && (thisStart = 0), void 0 === thisEnd && (thisEnd = this.length),
  3327. start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) throw new RangeError("out of range index");
  3328. if (thisStart >= thisEnd && start >= end) return 0;
  3329. if (thisStart >= thisEnd) return -1;
  3330. if (start >= end) return 1;
  3331. if (start >>>= 0, end >>>= 0, thisStart >>>= 0, thisEnd >>>= 0, this === target) return 0;
  3332. for (var x = thisEnd - thisStart, y = end - start, len = Math.min(x, y), thisCopy = this.slice(thisStart, thisEnd), targetCopy = target.slice(start, end), i = 0; i < len; ++i) if (thisCopy[i] !== targetCopy[i]) {
  3333. x = thisCopy[i], y = targetCopy[i];
  3334. break;
  3335. }
  3336. return x < y ? -1 : y < x ? 1 : 0;
  3337. }, Buffer.prototype.includes = function(val, byteOffset, encoding) {
  3338. return -1 !== this.indexOf(val, byteOffset, encoding);
  3339. }, Buffer.prototype.indexOf = function(val, byteOffset, encoding) {
  3340. return bidirectionalIndexOf(this, val, byteOffset, encoding, !0);
  3341. }, Buffer.prototype.lastIndexOf = function(val, byteOffset, encoding) {
  3342. return bidirectionalIndexOf(this, val, byteOffset, encoding, !1);
  3343. }, Buffer.prototype.write = function(string, offset, length, encoding) {
  3344. if (void 0 === offset) encoding = "utf8", length = this.length, offset = 0; else if (void 0 === length && "string" == typeof offset) encoding = offset,
  3345. length = this.length, offset = 0; else {
  3346. if (!isFinite(offset)) throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  3347. offset |= 0, isFinite(length) ? (length |= 0, void 0 === encoding && (encoding = "utf8")) : (encoding = length,
  3348. length = void 0);
  3349. }
  3350. var remaining = this.length - offset;
  3351. if ((void 0 === length || length > remaining) && (length = remaining), string.length > 0 && (length < 0 || offset < 0) || offset > this.length) throw new RangeError("Attempt to write outside buffer bounds");
  3352. encoding || (encoding = "utf8");
  3353. for (var loweredCase = !1; ;) switch (encoding) {
  3354. case "hex":
  3355. return hexWrite(this, string, offset, length);
  3356. case "utf8":
  3357. case "utf-8":
  3358. return utf8Write(this, string, offset, length);
  3359. case "ascii":
  3360. return asciiWrite(this, string, offset, length);
  3361. case "latin1":
  3362. case "binary":
  3363. return latin1Write(this, string, offset, length);
  3364. case "base64":
  3365. return base64Write(this, string, offset, length);
  3366. case "ucs2":
  3367. case "ucs-2":
  3368. case "utf16le":
  3369. case "utf-16le":
  3370. return ucs2Write(this, string, offset, length);
  3371. default:
  3372. if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
  3373. encoding = ("" + encoding).toLowerCase(), loweredCase = !0;
  3374. }
  3375. }, Buffer.prototype.toJSON = function() {
  3376. return {
  3377. type: "Buffer",
  3378. data: Array.prototype.slice.call(this._arr || this, 0)
  3379. };
  3380. };
  3381. var MAX_ARGUMENTS_LENGTH = 4096;
  3382. Buffer.prototype.slice = function(start, end) {
  3383. var len = this.length;
  3384. start = ~~start, end = void 0 === end ? len : ~~end, start < 0 ? (start += len) < 0 && (start = 0) : start > len && (start = len),
  3385. end < 0 ? (end += len) < 0 && (end = 0) : end > len && (end = len), end < start && (end = start);
  3386. var newBuf;
  3387. if (Buffer.TYPED_ARRAY_SUPPORT) newBuf = this.subarray(start, end), newBuf.__proto__ = Buffer.prototype; else {
  3388. var sliceLen = end - start;
  3389. newBuf = new Buffer(sliceLen, void 0);
  3390. for (var i = 0; i < sliceLen; ++i) newBuf[i] = this[i + start];
  3391. }
  3392. return newBuf;
  3393. }, Buffer.prototype.readUIntLE = function(offset, byteLength, noAssert) {
  3394. offset |= 0, byteLength |= 0, noAssert || checkOffset(offset, byteLength, this.length);
  3395. for (var val = this[offset], mul = 1, i = 0; ++i < byteLength && (mul *= 256); ) val += this[offset + i] * mul;
  3396. return val;
  3397. }, Buffer.prototype.readUIntBE = function(offset, byteLength, noAssert) {
  3398. offset |= 0, byteLength |= 0, noAssert || checkOffset(offset, byteLength, this.length);
  3399. for (var val = this[offset + --byteLength], mul = 1; byteLength > 0 && (mul *= 256); ) val += this[offset + --byteLength] * mul;
  3400. return val;
  3401. }, Buffer.prototype.readUInt8 = function(offset, noAssert) {
  3402. return noAssert || checkOffset(offset, 1, this.length), this[offset];
  3403. }, Buffer.prototype.readUInt16LE = function(offset, noAssert) {
  3404. return noAssert || checkOffset(offset, 2, this.length), this[offset] | this[offset + 1] << 8;
  3405. }, Buffer.prototype.readUInt16BE = function(offset, noAssert) {
  3406. return noAssert || checkOffset(offset, 2, this.length), this[offset] << 8 | this[offset + 1];
  3407. }, Buffer.prototype.readUInt32LE = function(offset, noAssert) {
  3408. return noAssert || checkOffset(offset, 4, this.length), (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + 16777216 * this[offset + 3];
  3409. }, Buffer.prototype.readUInt32BE = function(offset, noAssert) {
  3410. return noAssert || checkOffset(offset, 4, this.length), 16777216 * this[offset] + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
  3411. }, Buffer.prototype.readIntLE = function(offset, byteLength, noAssert) {
  3412. offset |= 0, byteLength |= 0, noAssert || checkOffset(offset, byteLength, this.length);
  3413. for (var val = this[offset], mul = 1, i = 0; ++i < byteLength && (mul *= 256); ) val += this[offset + i] * mul;
  3414. return mul *= 128, val >= mul && (val -= Math.pow(2, 8 * byteLength)), val;
  3415. }, Buffer.prototype.readIntBE = function(offset, byteLength, noAssert) {
  3416. offset |= 0, byteLength |= 0, noAssert || checkOffset(offset, byteLength, this.length);
  3417. for (var i = byteLength, mul = 1, val = this[offset + --i]; i > 0 && (mul *= 256); ) val += this[offset + --i] * mul;
  3418. return mul *= 128, val >= mul && (val -= Math.pow(2, 8 * byteLength)), val;
  3419. }, Buffer.prototype.readInt8 = function(offset, noAssert) {
  3420. return noAssert || checkOffset(offset, 1, this.length), 128 & this[offset] ? -1 * (255 - this[offset] + 1) : this[offset];
  3421. }, Buffer.prototype.readInt16LE = function(offset, noAssert) {
  3422. noAssert || checkOffset(offset, 2, this.length);
  3423. var val = this[offset] | this[offset + 1] << 8;
  3424. return 32768 & val ? 4294901760 | val : val;
  3425. }, Buffer.prototype.readInt16BE = function(offset, noAssert) {
  3426. noAssert || checkOffset(offset, 2, this.length);
  3427. var val = this[offset + 1] | this[offset] << 8;
  3428. return 32768 & val ? 4294901760 | val : val;
  3429. }, Buffer.prototype.readInt32LE = function(offset, noAssert) {
  3430. return noAssert || checkOffset(offset, 4, this.length), this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
  3431. }, Buffer.prototype.readInt32BE = function(offset, noAssert) {
  3432. return noAssert || checkOffset(offset, 4, this.length), this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
  3433. }, Buffer.prototype.readFloatLE = function(offset, noAssert) {
  3434. return noAssert || checkOffset(offset, 4, this.length), ieee754.read(this, offset, !0, 23, 4);
  3435. }, Buffer.prototype.readFloatBE = function(offset, noAssert) {
  3436. return noAssert || checkOffset(offset, 4, this.length), ieee754.read(this, offset, !1, 23, 4);
  3437. }, Buffer.prototype.readDoubleLE = function(offset, noAssert) {
  3438. return noAssert || checkOffset(offset, 8, this.length), ieee754.read(this, offset, !0, 52, 8);
  3439. }, Buffer.prototype.readDoubleBE = function(offset, noAssert) {
  3440. return noAssert || checkOffset(offset, 8, this.length), ieee754.read(this, offset, !1, 52, 8);
  3441. }, Buffer.prototype.writeUIntLE = function(value, offset, byteLength, noAssert) {
  3442. if (value = +value, offset |= 0, byteLength |= 0, !noAssert) {
  3443. checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength) - 1, 0);
  3444. }
  3445. var mul = 1, i = 0;
  3446. for (this[offset] = 255 & value; ++i < byteLength && (mul *= 256); ) this[offset + i] = value / mul & 255;
  3447. return offset + byteLength;
  3448. }, Buffer.prototype.writeUIntBE = function(value, offset, byteLength, noAssert) {
  3449. if (value = +value, offset |= 0, byteLength |= 0, !noAssert) {
  3450. checkInt(this, value, offset, byteLength, Math.pow(2, 8 * byteLength) - 1, 0);
  3451. }
  3452. var i = byteLength - 1, mul = 1;
  3453. for (this[offset + i] = 255 & value; --i >= 0 && (mul *= 256); ) this[offset + i] = value / mul & 255;
  3454. return offset + byteLength;
  3455. }, Buffer.prototype.writeUInt8 = function(value, offset, noAssert) {
  3456. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 1, 255, 0),
  3457. Buffer.TYPED_ARRAY_SUPPORT || (value = Math.floor(value)), this[offset] = 255 & value,
  3458. offset + 1;
  3459. }, Buffer.prototype.writeUInt16LE = function(value, offset, noAssert) {
  3460. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 2, 65535, 0),
  3461. Buffer.TYPED_ARRAY_SUPPORT ? (this[offset] = 255 & value, this[offset + 1] = value >>> 8) : objectWriteUInt16(this, value, offset, !0),
  3462. offset + 2;
  3463. }, Buffer.prototype.writeUInt16BE = function(value, offset, noAssert) {
  3464. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 2, 65535, 0),
  3465. Buffer.TYPED_ARRAY_SUPPORT ? (this[offset] = value >>> 8, this[offset + 1] = 255 & value) : objectWriteUInt16(this, value, offset, !1),
  3466. offset + 2;
  3467. }, Buffer.prototype.writeUInt32LE = function(value, offset, noAssert) {
  3468. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 4, 4294967295, 0),
  3469. Buffer.TYPED_ARRAY_SUPPORT ? (this[offset + 3] = value >>> 24, this[offset + 2] = value >>> 16,
  3470. this[offset + 1] = value >>> 8, this[offset] = 255 & value) : objectWriteUInt32(this, value, offset, !0),
  3471. offset + 4;
  3472. }, Buffer.prototype.writeUInt32BE = function(value, offset, noAssert) {
  3473. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 4, 4294967295, 0),
  3474. Buffer.TYPED_ARRAY_SUPPORT ? (this[offset] = value >>> 24, this[offset + 1] = value >>> 16,
  3475. this[offset + 2] = value >>> 8, this[offset + 3] = 255 & value) : objectWriteUInt32(this, value, offset, !1),
  3476. offset + 4;
  3477. }, Buffer.prototype.writeIntLE = function(value, offset, byteLength, noAssert) {
  3478. if (value = +value, offset |= 0, !noAssert) {
  3479. var limit = Math.pow(2, 8 * byteLength - 1);
  3480. checkInt(this, value, offset, byteLength, limit - 1, -limit);
  3481. }
  3482. var i = 0, mul = 1, sub = 0;
  3483. for (this[offset] = 255 & value; ++i < byteLength && (mul *= 256); ) value < 0 && 0 === sub && 0 !== this[offset + i - 1] && (sub = 1),
  3484. this[offset + i] = (value / mul >> 0) - sub & 255;
  3485. return offset + byteLength;
  3486. }, Buffer.prototype.writeIntBE = function(value, offset, byteLength, noAssert) {
  3487. if (value = +value, offset |= 0, !noAssert) {
  3488. var limit = Math.pow(2, 8 * byteLength - 1);
  3489. checkInt(this, value, offset, byteLength, limit - 1, -limit);
  3490. }
  3491. var i = byteLength - 1, mul = 1, sub = 0;
  3492. for (this[offset + i] = 255 & value; --i >= 0 && (mul *= 256); ) value < 0 && 0 === sub && 0 !== this[offset + i + 1] && (sub = 1),
  3493. this[offset + i] = (value / mul >> 0) - sub & 255;
  3494. return offset + byteLength;
  3495. }, Buffer.prototype.writeInt8 = function(value, offset, noAssert) {
  3496. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 1, 127, -128),
  3497. Buffer.TYPED_ARRAY_SUPPORT || (value = Math.floor(value)), value < 0 && (value = 255 + value + 1),
  3498. this[offset] = 255 & value, offset + 1;
  3499. }, Buffer.prototype.writeInt16LE = function(value, offset, noAssert) {
  3500. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 2, 32767, -32768),
  3501. Buffer.TYPED_ARRAY_SUPPORT ? (this[offset] = 255 & value, this[offset + 1] = value >>> 8) : objectWriteUInt16(this, value, offset, !0),
  3502. offset + 2;
  3503. }, Buffer.prototype.writeInt16BE = function(value, offset, noAssert) {
  3504. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 2, 32767, -32768),
  3505. Buffer.TYPED_ARRAY_SUPPORT ? (this[offset] = value >>> 8, this[offset + 1] = 255 & value) : objectWriteUInt16(this, value, offset, !1),
  3506. offset + 2;
  3507. }, Buffer.prototype.writeInt32LE = function(value, offset, noAssert) {
  3508. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 4, 2147483647, -2147483648),
  3509. Buffer.TYPED_ARRAY_SUPPORT ? (this[offset] = 255 & value, this[offset + 1] = value >>> 8,
  3510. this[offset + 2] = value >>> 16, this[offset + 3] = value >>> 24) : objectWriteUInt32(this, value, offset, !0),
  3511. offset + 4;
  3512. }, Buffer.prototype.writeInt32BE = function(value, offset, noAssert) {
  3513. return value = +value, offset |= 0, noAssert || checkInt(this, value, offset, 4, 2147483647, -2147483648),
  3514. value < 0 && (value = 4294967295 + value + 1), Buffer.TYPED_ARRAY_SUPPORT ? (this[offset] = value >>> 24,
  3515. this[offset + 1] = value >>> 16, this[offset + 2] = value >>> 8, this[offset + 3] = 255 & value) : objectWriteUInt32(this, value, offset, !1),
  3516. offset + 4;
  3517. }, Buffer.prototype.writeFloatLE = function(value, offset, noAssert) {
  3518. return writeFloat(this, value, offset, !0, noAssert);
  3519. }, Buffer.prototype.writeFloatBE = function(value, offset, noAssert) {
  3520. return writeFloat(this, value, offset, !1, noAssert);
  3521. }, Buffer.prototype.writeDoubleLE = function(value, offset, noAssert) {
  3522. return writeDouble(this, value, offset, !0, noAssert);
  3523. }, Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) {
  3524. return writeDouble(this, value, offset, !1, noAssert);
  3525. }, Buffer.prototype.copy = function(target, targetStart, start, end) {
  3526. if (start || (start = 0), end || 0 === end || (end = this.length), targetStart >= target.length && (targetStart = target.length),
  3527. targetStart || (targetStart = 0), end > 0 && end < start && (end = start), end === start) return 0;
  3528. if (0 === target.length || 0 === this.length) return 0;
  3529. if (targetStart < 0) throw new RangeError("targetStart out of bounds");
  3530. if (start < 0 || start >= this.length) throw new RangeError("sourceStart out of bounds");
  3531. if (end < 0) throw new RangeError("sourceEnd out of bounds");
  3532. end > this.length && (end = this.length), target.length - targetStart < end - start && (end = target.length - targetStart + start);
  3533. var i, len = end - start;
  3534. if (this === target && start < targetStart && targetStart < end) for (i = len - 1; i >= 0; --i) target[i + targetStart] = this[i + start]; else if (len < 1e3 || !Buffer.TYPED_ARRAY_SUPPORT) for (i = 0; i < len; ++i) target[i + targetStart] = this[i + start]; else Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);
  3535. return len;
  3536. }, Buffer.prototype.fill = function(val, start, end, encoding) {
  3537. if ("string" == typeof val) {
  3538. if ("string" == typeof start ? (encoding = start, start = 0, end = this.length) : "string" == typeof end && (encoding = end,
  3539. end = this.length), 1 === val.length) {
  3540. var code = val.charCodeAt(0);
  3541. code < 256 && (val = code);
  3542. }
  3543. if (void 0 !== encoding && "string" != typeof encoding) throw new TypeError("encoding must be a string");
  3544. if ("string" == typeof encoding && !Buffer.isEncoding(encoding)) throw new TypeError("Unknown encoding: " + encoding);
  3545. } else "number" == typeof val && (val &= 255);
  3546. if (start < 0 || this.length < start || this.length < end) throw new RangeError("Out of range index");
  3547. if (end <= start) return this;
  3548. start >>>= 0, end = void 0 === end ? this.length : end >>> 0, val || (val = 0);
  3549. var i;
  3550. if ("number" == typeof val) for (i = start; i < end; ++i) this[i] = val; else {
  3551. var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString()), len = bytes.length;
  3552. for (i = 0; i < end - start; ++i) this[i + start] = bytes[i % len];
  3553. }
  3554. return this;
  3555. };
  3556. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
  3557. }).call(exports, __webpack_require__(21));
  3558. }, function(module, exports, __webpack_require__) {
  3559. (function(Buffer) {
  3560. function cssWithMappingToString(item, useSourceMap) {
  3561. var content = item[1] || "", cssMapping = item[3];
  3562. if (!cssMapping) return content;
  3563. if (useSourceMap) {
  3564. var sourceMapping = toComment(cssMapping), sourceURLs = cssMapping.sources.map(function(source) {
  3565. return "/*# sourceURL=" + cssMapping.sourceRoot + source + " */";
  3566. });
  3567. return [ content ].concat(sourceURLs).concat([ sourceMapping ]).join("\n");
  3568. }
  3569. return [ content ].join("\n");
  3570. }
  3571. function toComment(sourceMap) {
  3572. return "/*# sourceMappingURL=data:application/json;charset=utf-8;base64," + new Buffer(JSON.stringify(sourceMap)).toString("base64") + " */";
  3573. }
  3574. module.exports = function(useSourceMap) {
  3575. var list = [];
  3576. return list.toString = function() {
  3577. return this.map(function(item) {
  3578. var content = cssWithMappingToString(item, useSourceMap);
  3579. return item[2] ? "@media " + item[2] + "{" + content + "}" : content;
  3580. }).join("");
  3581. }, list.i = function(modules, mediaQuery) {
  3582. "string" == typeof modules && (modules = [ [ null, modules, "" ] ]);
  3583. for (var alreadyImportedModules = {}, i = 0; i < this.length; i++) {
  3584. var id = this[i][0];
  3585. "number" == typeof id && (alreadyImportedModules[id] = !0);
  3586. }
  3587. for (i = 0; i < modules.length; i++) {
  3588. var item = modules[i];
  3589. "number" == typeof item[0] && alreadyImportedModules[item[0]] || (mediaQuery && !item[2] ? item[2] = mediaQuery : mediaQuery && (item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"),
  3590. list.push(item));
  3591. }
  3592. }, list;
  3593. };
  3594. }).call(exports, __webpack_require__(15).Buffer);
  3595. }, function(module, exports) {
  3596. exports.read = function(buffer, offset, isLE, mLen, nBytes) {
  3597. var e, m, eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, nBits = -7, i = isLE ? nBytes - 1 : 0, d = isLE ? -1 : 1, s = buffer[offset + i];
  3598. for (i += d, e = s & (1 << -nBits) - 1, s >>= -nBits, nBits += eLen; nBits > 0; e = 256 * e + buffer[offset + i],
  3599. i += d, nBits -= 8) ;
  3600. for (m = e & (1 << -nBits) - 1, e >>= -nBits, nBits += mLen; nBits > 0; m = 256 * m + buffer[offset + i],
  3601. i += d, nBits -= 8) ;
  3602. if (0 === e) e = 1 - eBias; else {
  3603. if (e === eMax) return m ? NaN : 1 / 0 * (s ? -1 : 1);
  3604. m += Math.pow(2, mLen), e -= eBias;
  3605. }
  3606. return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
  3607. }, exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
  3608. var e, m, c, eLen = 8 * nBytes - mLen - 1, eMax = (1 << eLen) - 1, eBias = eMax >> 1, rt = 23 === mLen ? Math.pow(2, -24) - Math.pow(2, -77) : 0, i = isLE ? 0 : nBytes - 1, d = isLE ? 1 : -1, s = value < 0 || 0 === value && 1 / value < 0 ? 1 : 0;
  3609. for (value = Math.abs(value), isNaN(value) || value === 1 / 0 ? (m = isNaN(value) ? 1 : 0,
  3610. e = eMax) : (e = Math.floor(Math.log(value) / Math.LN2), value * (c = Math.pow(2, -e)) < 1 && (e--,
  3611. c *= 2), value += e + eBias >= 1 ? rt / c : rt * Math.pow(2, 1 - eBias), value * c >= 2 && (e++,
  3612. c /= 2), e + eBias >= eMax ? (m = 0, e = eMax) : e + eBias >= 1 ? (m = (value * c - 1) * Math.pow(2, mLen),
  3613. e += eBias) : (m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen), e = 0)); mLen >= 8; buffer[offset + i] = 255 & m,
  3614. i += d, m /= 256, mLen -= 8) ;
  3615. for (e = e << mLen | m, eLen += mLen; eLen > 0; buffer[offset + i] = 255 & e, i += d,
  3616. e /= 256, eLen -= 8) ;
  3617. buffer[offset + i - d] |= 128 * s;
  3618. };
  3619. }, function(module, exports) {
  3620. var toString = {}.toString;
  3621. module.exports = Array.isArray || function(arr) {
  3622. return "[object Array]" == toString.call(arr);
  3623. };
  3624. }, function(module, exports, __webpack_require__) {
  3625. function addStylesToDom(styles, options) {
  3626. for (var i = 0; i < styles.length; i++) {
  3627. var item = styles[i], domStyle = stylesInDom[item.id];
  3628. if (domStyle) {
  3629. domStyle.refs++;
  3630. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](item.parts[j]);
  3631. for (;j < item.parts.length; j++) domStyle.parts.push(addStyle(item.parts[j], options));
  3632. } else {
  3633. for (var parts = [], j = 0; j < item.parts.length; j++) parts.push(addStyle(item.parts[j], options));
  3634. stylesInDom[item.id] = {
  3635. id: item.id,
  3636. refs: 1,
  3637. parts: parts
  3638. };
  3639. }
  3640. }
  3641. }
  3642. function listToStyles(list) {
  3643. for (var styles = [], newStyles = {}, i = 0; i < list.length; i++) {
  3644. var item = list[i], id = item[0], css = item[1], media = item[2], sourceMap = item[3], part = {
  3645. css: css,
  3646. media: media,
  3647. sourceMap: sourceMap
  3648. };
  3649. newStyles[id] ? newStyles[id].parts.push(part) : styles.push(newStyles[id] = {
  3650. id: id,
  3651. parts: [ part ]
  3652. });
  3653. }
  3654. return styles;
  3655. }
  3656. function insertStyleElement(options, styleElement) {
  3657. var styleTarget = getElement(options.insertInto);
  3658. if (!styleTarget) throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
  3659. var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
  3660. if ("top" === options.insertAt) lastStyleElementInsertedAtTop ? lastStyleElementInsertedAtTop.nextSibling ? styleTarget.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling) : styleTarget.appendChild(styleElement) : styleTarget.insertBefore(styleElement, styleTarget.firstChild),
  3661. styleElementsInsertedAtTop.push(styleElement); else {
  3662. if ("bottom" !== options.insertAt) throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
  3663. styleTarget.appendChild(styleElement);
  3664. }
  3665. }
  3666. function removeStyleElement(styleElement) {
  3667. styleElement.parentNode.removeChild(styleElement);
  3668. var idx = styleElementsInsertedAtTop.indexOf(styleElement);
  3669. idx >= 0 && styleElementsInsertedAtTop.splice(idx, 1);
  3670. }
  3671. function createStyleElement(options) {
  3672. var styleElement = document.createElement("style");
  3673. return options.attrs.type = "text/css", attachTagAttrs(styleElement, options.attrs),
  3674. insertStyleElement(options, styleElement), styleElement;
  3675. }
  3676. function createLinkElement(options) {
  3677. var linkElement = document.createElement("link");
  3678. return options.attrs.type = "text/css", options.attrs.rel = "stylesheet", attachTagAttrs(linkElement, options.attrs),
  3679. insertStyleElement(options, linkElement), linkElement;
  3680. }
  3681. function attachTagAttrs(element, attrs) {
  3682. Object.keys(attrs).forEach(function(key) {
  3683. element.setAttribute(key, attrs[key]);
  3684. });
  3685. }
  3686. function addStyle(obj, options) {
  3687. var styleElement, update, remove;
  3688. if (options.singleton) {
  3689. var styleIndex = singletonCounter++;
  3690. styleElement = singletonElement || (singletonElement = createStyleElement(options)),
  3691. update = applyToSingletonTag.bind(null, styleElement, styleIndex, !1), remove = applyToSingletonTag.bind(null, styleElement, styleIndex, !0);
  3692. } else obj.sourceMap && "function" == typeof URL && "function" == typeof URL.createObjectURL && "function" == typeof URL.revokeObjectURL && "function" == typeof Blob && "function" == typeof btoa ? (styleElement = createLinkElement(options),
  3693. update = updateLink.bind(null, styleElement, options), remove = function() {
  3694. removeStyleElement(styleElement), styleElement.href && URL.revokeObjectURL(styleElement.href);
  3695. }) : (styleElement = createStyleElement(options), update = applyToTag.bind(null, styleElement),
  3696. remove = function() {
  3697. removeStyleElement(styleElement);
  3698. });
  3699. return update(obj), function(newObj) {
  3700. if (newObj) {
  3701. if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) return;
  3702. update(obj = newObj);
  3703. } else remove();
  3704. };
  3705. }
  3706. function applyToSingletonTag(styleElement, index, remove, obj) {
  3707. var css = remove ? "" : obj.css;
  3708. if (styleElement.styleSheet) styleElement.styleSheet.cssText = replaceText(index, css); else {
  3709. var cssNode = document.createTextNode(css), childNodes = styleElement.childNodes;
  3710. childNodes[index] && styleElement.removeChild(childNodes[index]), childNodes.length ? styleElement.insertBefore(cssNode, childNodes[index]) : styleElement.appendChild(cssNode);
  3711. }
  3712. }
  3713. function applyToTag(styleElement, obj) {
  3714. var css = obj.css, media = obj.media;
  3715. if (media && styleElement.setAttribute("media", media), styleElement.styleSheet) styleElement.styleSheet.cssText = css; else {
  3716. for (;styleElement.firstChild; ) styleElement.removeChild(styleElement.firstChild);
  3717. styleElement.appendChild(document.createTextNode(css));
  3718. }
  3719. }
  3720. function updateLink(linkElement, options, obj) {
  3721. var css = obj.css, sourceMap = obj.sourceMap, autoFixUrls = void 0 === options.convertToAbsoluteUrls && sourceMap;
  3722. (options.convertToAbsoluteUrls || autoFixUrls) && (css = fixUrls(css)), sourceMap && (css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */");
  3723. var blob = new Blob([ css ], {
  3724. type: "text/css"
  3725. }), oldSrc = linkElement.href;
  3726. linkElement.href = URL.createObjectURL(blob), oldSrc && URL.revokeObjectURL(oldSrc);
  3727. }
  3728. var stylesInDom = {}, isOldIE = function(fn) {
  3729. var memo;
  3730. return function() {
  3731. return void 0 === memo && (memo = fn.apply(this, arguments)), memo;
  3732. };
  3733. }(function() {
  3734. return window && document && document.all && !window.atob;
  3735. }), getElement = function(fn) {
  3736. var memo = {};
  3737. return function(selector) {
  3738. return void 0 === memo[selector] && (memo[selector] = fn.call(this, selector)),
  3739. memo[selector];
  3740. };
  3741. }(function(styleTarget) {
  3742. return document.querySelector(styleTarget);
  3743. }), singletonElement = null, singletonCounter = 0, styleElementsInsertedAtTop = [], fixUrls = __webpack_require__(20);
  3744. module.exports = function(list, options) {
  3745. if ("undefined" != typeof DEBUG && DEBUG && "object" != typeof document) throw new Error("The style-loader cannot be used in a non-browser environment");
  3746. options = options || {}, options.attrs = "object" == typeof options.attrs ? options.attrs : {},
  3747. void 0 === options.singleton && (options.singleton = isOldIE()), void 0 === options.insertInto && (options.insertInto = "head"),
  3748. void 0 === options.insertAt && (options.insertAt = "bottom");
  3749. var styles = listToStyles(list);
  3750. return addStylesToDom(styles, options), function(newList) {
  3751. for (var mayRemove = [], i = 0; i < styles.length; i++) {
  3752. var item = styles[i], domStyle = stylesInDom[item.id];
  3753. domStyle.refs--, mayRemove.push(domStyle);
  3754. }
  3755. if (newList) {
  3756. addStylesToDom(listToStyles(newList), options);
  3757. }
  3758. for (var i = 0; i < mayRemove.length; i++) {
  3759. var domStyle = mayRemove[i];
  3760. if (0 === domStyle.refs) {
  3761. for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
  3762. delete stylesInDom[domStyle.id];
  3763. }
  3764. }
  3765. };
  3766. };
  3767. var replaceText = function() {
  3768. var textStore = [];
  3769. return function(index, replacement) {
  3770. return textStore[index] = replacement, textStore.filter(Boolean).join("\n");
  3771. };
  3772. }();
  3773. }, function(module, exports) {
  3774. module.exports = function(css) {
  3775. var location = "undefined" != typeof window && window.location;
  3776. if (!location) throw new Error("fixUrls requires window.location");
  3777. if (!css || "string" != typeof css) return css;
  3778. var baseUrl = location.protocol + "//" + location.host, currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
  3779. return css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
  3780. var unquotedOrigUrl = origUrl.trim().replace(/^"(.*)"$/, function(o, $1) {
  3781. return $1;
  3782. }).replace(/^'(.*)'$/, function(o, $1) {
  3783. return $1;
  3784. });
  3785. if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(unquotedOrigUrl)) return fullMatch;
  3786. var newUrl;
  3787. return newUrl = 0 === unquotedOrigUrl.indexOf("//") ? unquotedOrigUrl : 0 === unquotedOrigUrl.indexOf("/") ? baseUrl + unquotedOrigUrl : currentDir + unquotedOrigUrl.replace(/^\.\//, ""),
  3788. "url(" + JSON.stringify(newUrl) + ")";
  3789. });
  3790. };
  3791. }, function(module, exports) {
  3792. var g;
  3793. g = function() {
  3794. return this;
  3795. }();
  3796. try {
  3797. g = g || Function("return this")() || (0, eval)("this");
  3798. } catch (e) {
  3799. "object" == typeof window && (g = window);
  3800. }
  3801. module.exports = g;
  3802. } ]);