/* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ /* * Input Mask Core * http://github.com/RobinHerbots/jquery.inputmask * Copyright (c) Robin Herbots * Licensed under the MIT license */ /* Input Mask plugin dependencyLib http://github.com/RobinHerbots/jquery.inputmask Copyright (c) Robin Herbots Licensed under the MIT license */ /* Input Mask plugin extensions http://github.com/RobinHerbots/inputmask Copyright (c) Robin Herbots Licensed under the MIT license */ /* && !latestMatch.optionalQuantifier */ /* && getTest.call(inputmask, pos + 1).match.def == "" */ /* , args... */ /* 0 */ /* 1 */ /* 10 */ /* 11 */ /* 12 */ /* 13 */ /* 14 */ /* 15 */ /* 16 */ /* 17 */ /* 18 */ /* 19 */ /* 2 */ /* 20 */ /* 21 */ /* 22 */ /* 23 */ /* 24 */ /* 25 */ /* 26 */ /* 27 */ /* 28 */ /* 29 */ /* 3 */ /* 30 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 */ /* false */ /* harmony default export */ /* if (maskset.validPositions[ndx] === undefined && inputValue[ndx] === getPlaceholder.call(inputmask, ndx) && isMask.call(inputmask, ndx, true) && isValid.call(inputmask, ndx, inputValue[ndx], true, undefined, true, true) === false) { inputmask.caretPos.begin++; } else */ /* opts.clearMaskOnLostFocus && */ /* single char replacement */ /* t.match.def !== "+" */ /* useDateObject && (dateParts["year"] === undefined || dateParts["yearSet"]) && */ /* || pos < lvp */ /*! * dist/inputmask * https://github.com/RobinHerbots/Inputmask * Copyright (c) 2010 - 2026 Robin Herbots * Licensed under the MIT license * Version: 5.0.10 */ /************************************************************************/ /******/ /***/ // caret(that, that.inputmask.caretPos, undefined, true); // eventHandler.apply(that, args); // args = arguments; // buffer: alignDigits(opts.min.toString().replace(".", opts.radixPoint).split(""), opts.digits, opts).reverse() // console.log(opts.placeholder.charAt(currentToken.matches.length % opts.placeholder.length)); // continue; // refreshFromBuffer: true, // return false; // return; // setTimeout(function () { //needed for caret selection when entering a char on Android 8 - #1818 // }, 0); // match = tmpMatch; // matches = groupToken.matches; // matches = match.matches; //remap target matches // matches.push(groupToken); //push the group // matches.push(match); //push back alternator // var groupToken = new MaskToken(true); // var tmpMatch = matches.pop(); // (If fromIndex is undefined, this step produces the value 0.) // buffer = buffer.slice(); //prevent uncontrolled manipulation of the internal buffer // "resolveNdxInitializer", // : targetAlternation || // ? newAlternateMloc.split(":")[1] // Date.now() - inputmask.lastInputEvent.time < 10 && // alternateNdx, // bestMatch // inputmask.lastInputEvent && // inputmask.lastInputEvent.data === e.data // pos, // return; // sliceStart, // slocator, // targetAlternation, // a. Let k be len + n. // a. Let k be n. // b. If k < 0, let k be 0. // "$ ", // "(" // "(?.)\\[(?[^\\]]*)\\]", remove named capture group @2428 // ",", // | "." // ".", // | "," // #2195 trigger keyup to help some other plugins to track changes // #2423 // #2855 // #841 // ) { // ); // ./node_modules/inputmask/dist/inputmask.mjs // ./src/export/lib/jquery/jquery-plugin.js // 1. Let O be ? ToObject(this value). // 17:46:21 // 2. Let len be ? ToLength(? Get(O, "length")). // 2007-06-09 // 2007-06-09T17:46:21 // 3. If len is 0, return false. // 4. Let n be ? ToInteger(fromIndex). // 5. If n ≥ 0, then // 6. Else n < 0, // 7. Repeat, while k < len // 8. Return false // > instead of >= because we want to allow to type a bigger number // ? matches lazy quantifiers // ADD +1 to whole // Apply masking only if it's not a File and the element has inputmask // Check for IE =< 8 // Check if module is in cache // Create a new module (and put it into the cache) // Cursor placed at or before the prefix on a field with no digits // Day of the month as digits; leading zero for single-digit days. // Day of the month as digits; no leading zero for single-digit days. // Day of the week as a three-letter abbreviation. // Day of the week as its full name. // EXTERNAL MODULE: ./node_modules/inputmask/dist/inputmask.js // EXTERNAL MODULE: ./node_modules/script-loader/index.js!./node_modules/jquery-ui/dist/jquery-ui.min.js // EXTERNAL MODULE: ./node_modules/script-loader/index.js!./node_modules/jquery-ui/ui/widgets/datepicker.js // Early return if no valid element // Execute the module function // Extend the base object // GMT/UTC timezone offset, e.g. -0500 or +0230. // Get the original value from FormData // Group closing // Group opening // Handle a deep copy situation // Handle case when target is a string or something (possible in deep copy) // Home or page_up // Hours; leading zero for single-digit hours (12-hour clock). // Hours; leading zero for single-digit hours (24-hour clock). // Hours; no leading zero for single-digit hours (12-hour clock). // Hours; no leading zero for single-digit hours (24-hour clock). // Hours; no limit; set maximum digits // IE // IE before version 9 // JQuery => Inputmask // Japanese IME hack #2662 // Lowercase, single-character time marker string: a or p. // Mark input as processed to prevent duplicate handling by keyEvent // Math.floor , fn(x) // Milliseconds. 2 digits. // Milliseconds. 3 digits. // Minutes; leading zero for single-digit minutes. Uppercase MM unlike CF timeFormat's mm to avoid conflict with months. // Minutes; no leading zero for single-digit minutes. Uppercase M unlike CF timeFormat's m to avoid conflict with months. // Month as a three-letter abbreviation. // Month as digits; leading zero for single-digit months. // Month as digits; no leading zero for single-digit months. // Month as its full name. // NOTE: === provides the correct "SameValueZero" comparison needed here. // Never move original objects, clone them // Only deal with non-null/undefined values // Prevent duplicate input processing between keyEvent and inputFallBackEvent // Prevent duplicate input processing between keyEvent and inputFallBackEvent #2855 // Prevent never-ending loop // Quantifier // Recurse if we're merging plain objects or arrays // Return the exports of the module // Return the modified object // Seconds; leading zero for single-digit seconds. // Seconds; no leading zero for single-digit seconds. // Skip the boolean and the target // TODO FIX RECURSIVE QUANTIFIERS // TODO NEEDS BETTER CHECK WHEN TO ALTERNATE ~ opts regex isn"t good enough // The custom event that will be created // The module cache // The require function // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. // This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk. // This fixes Chinese IME duplication issue on Safari #2855 // This fixes Chinese IME duplication issue on Safari where both events fire for the same input // Thx to https://github.com/slevithan/regex-colorizer for the regexTokenizer regex // Time to show validation error on form submit // US timezone abbreviation, e.g. EST or MDT. With non-US timezones or in the Opera browser, the GMT/UTC offset is returned, e.g. GMT-0500 // Unicode Categories // Year as last two digits; leading zero for years less than 10. // [].slice as alternate for Array.from (Yandex browser) // \uFF11-\uFF19 #1606 // a character which can be used to skip an optional part of a mask // a. Let elementK be the result of ? Get(O, ! ToString(k)). // add check if it is supported by the browser // add inputmask namespace to event // alfanumeric uppercasing // alias is another alias // aliases definitions // align buffers // align to the right // all browsers except IE before version 9 // allow for character substitution // allow instanciating without new // allow mask to be a preprocessing fn - should return a valid mask // allows for tabbing through the different parts of the masked field // alternation = tests[0].locator.length - 1; // alternations within group // always set a value to strict to prevent possible strange behavior in the extensions // always set jitOffset, isvalid checks when to apply // apply defaults, definitions, aliases // apply mask // apply mask only if the type is not natively supported // automatically unmask when retrieving the value with $.fn.val or value if the browser supports __lookupGetter__ or getOwnPropertyDescriptor // b. If SameValueZero(searchElement, elementK) is true, return true. // backspace, delete, and escape get special treatment // backspace/delete // basic insert // bind creates a new eventhandler (wrap) // bind events // bind value // breakout loop // c. Increase k by 1. // cacheDependency is set on all tests, just check on the first // callback to implement autocomplete on certain keys for example. args => event, buffer, caretPos, opts // check for a valid date ~ an invalid date returns NaN which isn't equal // check for groupSeparator is a hack for the numerics as we don't want the render of the groupSeparator beforehand // check if an entry in mloc match the alternateNdx on targetAlternation // check leading zeros // check on matches.length instead of match to handle quantifier in a recursive call // check on the number of tests // check wheter the returned value is masked or not; currently only works reliable when using jquery.val fn to retrieve the value // checkVal.call(inputmask, el, false, true, isRTL ? buffer.reverse() : buffer); // cleanup optionality marking // clear all // clear data // clear getbuffer // clear the incomplete input on blur // clearout optional tail of the mask // clone the currentPositions // cloneback // commandObj.rewritePosition = undefined; // console.log( // console.log(" - " + JSON.stringify(tests)); // console.log(" optionality = " + optionalityLevel); // console.log("N " + newBuffer); // console.log("O " + oldBuffer); // console.log("alternate 0"); // console.log("alternate 1"); // console.log("caret " + inputmask.caretPos.begin); // console.log("distance", distance, tstLocator, prevLocator); // console.log("inputFormat", opts.regex); // console.log("mask", mask); // console.log("mergeLocators", pos, tests, locator); // console.log("mlocDistance", mlocDistance); // console.log("ndxInit", ndxInitializer); // console.log("returned result " + JSON.stringify(endResult)); // console.log("revalidateMask " + fromIsValid); // console.log("stored " + pos + " - " + JSON.stringify(matches)); // console.log("trackbackPositions " + originalPos + " " + newPos); // console.log(JSON.stringify(maskTokens)); // console.log(JSON.stringify(placeHolder)); // console.log(`calcPos ${calcPos}`); // console.log(`match ${masksetHint} ${calcPos} >= ${pos + 1}`); // console.log(`match.index ${match.index}`); // console.log(altMask); // console.log(caretPos); // console.log(e.inputType); // console.log(e.type); // console.log(element, position, currentToken.matches.length); // console.log(mask); // console.log(masksetHint); // console.log(match); // console.log(pos + " " + qt.quantifier.min + " " + latestMatch.optionalQuantifier); // console.log(pos, JSON.stringify(matches)); // continue // convert min and max options // correct clipboardData // correct position ~ pos in front of shifted targetMatch // dance around the radixPoint // data attribute prefix used for attribute binding // delete all free statics // delete maskset.validPositions[i++]; // delete~backspace // determine index initializer // dev option - testing inputfallback behavior // disable autocorrect // disable value property patching // disallow radixpoint when value is smaller than min // do not allow numeric input in datetime alias // do not alter the masklength when just retrieving the maskdefinition // do not recurse when already passed the beginning // does the input match on a further position? // don't mark alternate groups as group // el.inputmask.isRTL = scopedOpts.isRTL || scopedOpts.numericInput; // else based on the template // enable by default when passing multiple masks when the option is not explicitly specified // enforce greedy false // enforce placeholder to single // escape && undo && #762 // eslint-disable-next-line eqeqeq // eslint-disable-next-line no-extend-native // eslint-disable-next-line no-fallthrough // eslint-disable-next-line no-global-assign // eslint-disable-next-line no-sequences // eslint-disable-next-line no-unused-expressions // excluded alternations // executes after unmasking to allow postprocessing of the unmaskedvalue. args => maskedValue, unmaskedValue, opts // executes before masking the initial value to allow preprocessing of the initial value. args => initialValue, opts => return processedValue // executes before masking the pasted value to allow preprocessing of the pasted value. args => pastedValue, opts => return processedValue // executes before writing to the masked element. args => event, opts // executes on every key-press with the result of isValid. Params: key, result, opts // executes when the mask is cleared // executes when the mask is complete // executes when the mask is incomplete and focus is lost // extra definitions // fallback to lvp // fallback when keypress is not triggered // fill in best positions according the current input // finance people input style // find best matching // find last modified alternation // find previous valid // find the closest match to the previous one // find the last position that is not optional ~ isoptional and newblockmarker == "master" // for each mlocMatch check the calculated distance // for use in valhook ~ context switch // force autounmasking when remasking // forced refresh from the value form.reset // format used to input the date // full validate target // fully alternated => reset // fuzzy merge matches // generalize // generate template // get function definition // get original event from jquery event // get the current decisionPos to exclude ~ needs to be before restoring the initial validation // global options // hackery to solve a mask like ([0]9)|(2a) ~ note the static 0 is optional ~ see unittest ivaninDarpatov // handle alternator (a) | (b) case // handle alternator a | b case // handle dir=rtl // handle numeric negate symbol offset, due to dynamic jit masking // happens when cloning an object with jquery.clone // hexadecimal // hide placeholder with single non-greedy mask // hook to postValidate the result from isValid. Usefull for validating the entry as a whole. args => buffer, pos, c, currentResult, opts, maskset, strict, fromCheckval, fromAlternate => return true/false/json // hook to preValidate the input. Usefull for validating regardless the definition. args => buffer, pos, char, isSelection, opts, maskset, caretPos, strict => return true/false/command object // http://rion.io/2013/09/10/validating-social-security-numbers-through-regular-expressions-2/ // https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings?view=netframework-4.7 // https://en.wikipedia.org/wiki/Domain_name#Domain_name_space // https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names // https://en.wikipedia.org/wiki/Social_Security_number // https://en.wikipedia.org/wiki/Vehicle_identification_number // https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-date-time-string-format // https://tc39.github.io/ecma262/#sec-array.prototype.includes // https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table // if ( // if (!$(input).is(":visible")) { // if (!isMask(nPos, true)) { // if ((k === 44 || k === 46) && e.location === 3 && opts.radixPoint !== "") k = opts.radixPoint.charCodeAt(0); // if (currentPos !== 0) { // if (locNdx > alternation) return; // if (match.isAlternator) { //handle quantifier in an alternation [0-9]{2}|[0-9]{3} // if (mobile) { //this causes problem see #2220 // if (opts.insertModeVisual && opts.insertMode === false && begin === (end - 1)) end--; //correct caret for insert/overwrite mode // if (typeof ndx === "string") ndx = parseInt(ndx.split(",")[0]); // if (typeof opts.placeholder === "string") // if no events defined, remove all events // if the alternation index is higher than the current one resolve it to the alternation // ignore beginswith and endswith as in masking this makes no point // ignore if jit is not desirable // import data-inputmask attributes // in the decimal part (#2615) // includeMode true => input, undefined => placeholder, false => mask // indian numbering system // indicate a forced refresh when there is a call to the value before leaving the triggering event fn // indicate a refresh from the inputvalue is needed (form.reset) // indicator for an optional from the definition // init options // initialize the buffer and getmasklength // inputfallback strips some elements out of the inputarray. $.each logically presents them as undefined // insert // insert a stop // insert a stopelemnt when there is an alternate - needed for non-greedy option // insert between // insert match above general match // insert position(s) // insert the input or overwrite the input // insert: [{pos: pos, c: "0"}, {pos: pos + 1, c: c}], // integrate shadowroot into maskcope // internal use of datetime alias // invalidate // ip-address mask // is regex a subset // jquery.val fallback // just in time masking ~ only mask while typing, can n (number), true or false // just make sure the maskLength gets initialized in all cases (needed for isValid) // keepstatic modifies the output from the testdefinitions ~ so differentiate in the maskcache // key from mlocMatch // keydowncode == 229 compositionevent fallback // latest alternation // list with the supported input types // localize // loop needed to match further positions // lvp: // make inputmask available // make sure ignorable is ignored ;-) // make sure the buffer is set and correct // make the initialValue a valid javascript number for the parsefloat // make the loop continue when it is deliberately by a quantifier // map placeholder to placeholder object and set placeholder mappings // mark group as complete // mark matches with unMatchedAlternationStopped // mark optionality // mark optionality in matches // mark when there are unmatched alternations ex: mask: "(a|aa)" // mask += "[" + opts.radixPoint + "]"; // mask to apply when unmasking // mask-level casing. Options: null, "upper", "lower" or "title" or "follow" or callback args => elem, test, pos, validPositions return charValue // maskscope properties // maskset.tests[decisionPos] = undefined; //clear decisionPos // match the position after the group // maximum value // merge alias definition in the options // mergelocators for retrieving the correct locator match when merging // migrate to regex mask // minimum value // ndxInitializer contains a set of indexes to speedup searches in the mtokens // need to align the locators to be correct // needed for Chrome ~ initial selection clears after the clickevent // needed for FF // needed for alternated position after overtype selection // needed to keep original selection when remasking // needs to be in the same format as the inputfornat // needs to be in the same format as the inputfornat, // needs tobe null instead of undefined as the extend method does not consider props with the undefined value // needs update => https://en.wikipedia.org/wiki/URL // newAlternateMloc // no decision taken ~ take smallest as decider // no extra required positions // no module.id needed // no module.loaded needed // nodejs // none, lvp (based on the last valid position (default), radixFocus (position caret to radixpoint on initial click), select (select the whole input), ignore (ignore the click and continue the mask) // not perfect, but ok for now // null check is needed for IE8 => otherwise converts to "null" // number aliases // number of fractionalDigits // number ~ specify that values which are set are in textform (radix point is same as in the options) or in numberform (radixpoint = .) // numeric basic properties // numericInput input direction style (input shifts to the left while holding the caret position) // only adjust when not a selection // only allow radixfocus when placeholder = 0 // only check with the first alternate // only include non generated input with multiple masks (check on metadata) and without keepStatic true // optional closing // optional opening // options default // opts.placeholder = opts.placeholder !== "" ? opts.placeholder : opts.inputFormat.replace(/[[\]]/, ""); // override for isComplete - args => buffer, opts - return true || false // padding function // parse format to regex string // parse the given format and return a mask pattern // pickup alias from dataAttribute // pickup alias from dataAttribute-alias // placeholder object modifies the output from the testdefinitions ~ so differentiate in the maskcache // pos == true => generalize // position the caret when in focus // position was a position object - used to handle a delete by typing over a selection // preValidation result // pressing escape reverts the value to the value before focus // prevent conflict with default skipOptionalPartCharacter // prevent loop see #698 // prioritize full tests for caching // qndx + 1 as the index starts from 0 // read maxlength prop from el // refresh tests after possible alternating // regex mask alternator ex: [01][0-9]|2[0-3] => ([01][0-9]|2[0-3]) // regex, valueSetter, type, displayformatter, #entries (optional) // regexp alt syntax // register domevent // regular expression as a mask // remask // remove no alternate indexes from alternation array // remove position(s) // remove the mask before submitting the form. // repeat the mask n times // repetitions of the mask: * ~ forever, otherwise specify an integer // replace selection // reposition & revalidate others // reposition quantifier // reset & revert // reset alternation excludes // reset click counter to correctly determine the caretposition in checkval // resolve aliases // resolve possible formatAlias // restore position // restore the value property // return mask metadata if exists // return nothing instead of the buffertemplate when the user hasn't entered anything. // return the default (empty) mask value, usefull for setting the default value in validation // return true / false / undefined (repeat *) // return validposition on generalise // return { // revalidate the new position to update the locator value // revert validation changes // search for next possible match // see issue #1199 // see issue #2311 // seekPrevious.call(inputmask, lrp.l); // selecting the caret shows as a selection on iphone // selection clears an alternated keepstatic mask ~ #2189 // set a clone to prevent overwriting some props // set correct match state // set default as none (~ auto); when a custom placeholder is passed it will be used // set extra options || retrieve value of a current option // set temporary leap year in dateObj // set the correct ndxInitializer // set the tokenGroup as quantifierRecurse marker // shift position of the mask entries on entry and deletion. // should be extended with the toplevel domains at the end // should check if is sequence starting from 0 // show selected caret when insertmode = false // show the mask-placeholder when hovering the empty input // show the mask-placeholder when the input has focus // single-character time marker string: A or P. // skip when triggered from within inputmask // soft ~ undefined reset validpositions; soft = false also reset tests; soft = true only reset the maskset // special treat the decimal separator // specify a definitionSymbol for static content, used to make matches for alternators // specify the inputmode // static // static and not dynamically generated ~ does not occur in regex mask ~ numeric alias def is not a valid entry // static fn on inputmask // stop default action but allow propagation // stop possible loop // stop quantifierloop && search for next possible match // store inputmask instance on the input with element reference // store native property getter // strict true ~ no correction or autofill // strip negation symbol on blur when value is 0 // strip off alternation marker // strip spaces from targetTemplate // supported codes for formatting // take corrective action if possible // test definition => {fn: RegExp/function, static: true/false optionality: bool, newBlockMarker: bool, casing: null/upper/lower, def: definitionSymbol, placeholder: placeholder, mask: real maskDefinition} // the offset is set in the quantifierloop when git masking is used // their is a position offset // this is not a group but a normal mask => convert // this needs a better solution, but his will do for now // this needs to be in a separate part and not directly in decimalPart to allow rounding // this will result in the least distance to select the correct test result in determineTestTemplate // this will triggeer a refreshfrombuffer // timeout needed for IE // tobe put on prototype? // todo put on prototype? // todo put on the prototype? // track caret internally // track insertStop set inside a symmetric alternation // track last input event to prevent duplicates #2855 // treat equal separator and radixpoint // trigger change on submit if any // trigger domevent // true: allocated buffer for the mask and repetitions - false: allocate only if needed // try alternating when the validation fails // try alternating when the validation succeeds // try some shifting // try to keep the mask static while typing. Decisions to alter the mask will be posponed if possible // two-character time marker string: AM or PM. // two-character time marker string: am or pm. // unbind all events // unbind all events - to make sure that no other mask will interfere when re-masking // unbind to dom events // unmasking format // update dateParts // update result // update separator definition // use the default defined definitions from the prototype // user passed options // validated match //we still need some hackery for the + validator (numeric alias) // visual format when the input looses focus // webpackBootstrap // when END or PAGE_DOWN pressed set position at lastmatch // when a dateObjValue is passed a datestring in the requested format is returned // when a group pass along to the quantifier // when enabled the caret position is set after the latest valid position on TAB // when the namespace is not defined (global namespace), we need to clean up all events in all namespaces // would otherwise fall through to alternation switching and land // wrap the mask in a group to form a regex alternator ([01][0-9]|2[0-3]) // writeout the value // { // } // };