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AE9C,OAAID,EAAO,GACF,EACEA,EAAO,EACT,EAGAA,C,wDCjDX,IAAAE,E,0FAAAA,EA0BA,SAAmCpB,EAAUC,GAC3C,MAAMC,GAAY,EAAIC,EAAAC,QAAeJ,GAC/BK,GAAa,EAAIF,EAAAC,QAAeH,GAEtC,OAAOC,EAAUmB,cAAgBhB,EAAWgB,a","sources":["src/InputValidators.ts","node_modules/.pnpm/date-fns@3.1.0/node_modules/date-fns/addYears.js","src/Common/ageVerification.ts","node_modules/.pnpm/date-fns@3.1.0/node_modules/date-fns/differenceInYears.js","node_modules/.pnpm/date-fns@3.1.0/node_modules/date-fns/compareAsc.js","node_modules/.pnpm/date-fns@3.1.0/node_modules/date-fns/differenceInCalendarYears.js"],"sourcesContent":["import { addYears } from 'date-fns/addYears';\nimport { getDateWithoutTime } from './DateUtils';\nimport { ssnYearSymbols } from './Common/ageVerification';\n\nconst emailRegex =\n\t/^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\nexport function isValidEmail(email: string): boolean {\n\treturn emailRegex.test(email);\n}\n\nconst zipCodeRegex = /^[0-9]{5}$/;\nexport function isValidZipCode(zipCode: string): boolean {\n\treturn zipCodeRegex.test(zipCode);\n}\n\nconst intRegex = /^[0-9]+$/;\n\nexport function isValidInteger(value: string, minValue?: number, maxValue?: number) {\n\tif (!value) {\n\t\treturn true;\n\t}\n\n\tif (!intRegex.test(value)) {\n\t\treturn false;\n\t}\n\n\tconst parsedValue = parseInt(value);\n\tif (isNaN(parsedValue)) {\n\t\treturn false;\n\t}\n\tif ((minValue !== undefined && parsedValue < minValue) || (maxValue !== undefined && parsedValue > maxValue)) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nconst phoneRegex = /^[+]?([0-9\\s-]{7,20})$/;\n\nexport function isValidPhoneNumber(value: string) {\n\treturn phoneRegex.test(value);\n}\n\nconst ssnRegex = /^[0-3][0-9][0-1][0-9]{3}[-+ABCDEFUVWXY][0-9]{3}[0-9ABCDEFHJKLMNPRSTUVWXY]$/i;\n\n// prettier-ignore\nconst ssnCheckLetters = ['a','b','c','d','e','f','h','j','k','l','m','n','p','r','s','t','u','v','w','x','y'];\n\nexport function isValidSSN(value: string, mustBeOfLegalAge = false) {\n\tif (!value || value === '') {\n\t\treturn true;\n\t}\n\tconst normalizedValue = value.toUpperCase();\n\n\tconst regexMatches = ssnRegex.test(normalizedValue);\n\tif (!regexMatches) {\n\t\treturn false;\n\t}\n\n\tconst dateValue = Date.parse(\n\t\t`${ssnYearSymbols[normalizedValue[6]]}${normalizedValue.substring(4, 6)}-${normalizedValue.substring(\n\t\t\t2,\n\t\t\t4,\n\t\t)}-${normalizedValue.substring(0, 2)}`,\n\t);\n\n\tif (isNaN(dateValue)) {\n\t\treturn false;\n\t}\n\n\tif (mustBeOfLegalAge) {\n\t\tif (getDateWithoutTime(new Date(dateValue)) > addYears(getDateWithoutTime(new Date()), -18)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tconst checkDigit = calculateSSNCheckDigit(value);\n\treturn value[10].toLowerCase() === checkDigit;\n}\n\nfunction calculateSSNCheckDigit(value: string): string {\n\tconst sum = parseInt(\n\t\tvalue[0] + value[1] + value[2] + value[3] + value[4] + value[5] + value[7] + value[8] + value[9],\n\t);\n\n\tconst mod = sum % 31;\n\n\tif (mod < 10) {\n\t\treturn mod.toString();\n\t}\n\n\treturn ssnCheckLetters[mod - 10];\n}\n","\"use strict\";\nexports.addYears = addYears;\nvar _index = require(\"./addMonths.js\");\n\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param amount - The amount of years to be added.\n *\n * @returns The new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nfunction addYears(date, amount) {\n return (0, _index.addMonths)(date, amount * 12);\n}\n","import { differenceInYears } from 'date-fns/differenceInYears';\n\nexport const ssnYearSymbols: Record<string, string> = {\n\t['+']: '18',\n\n\t['-']: '19',\n\t['U']: '19',\n\t['V']: '19',\n\t['W']: '19',\n\t['X']: '19',\n\t['Y']: '19',\n\n\t['A']: '20',\n\t['B']: '20',\n\t['C']: '20',\n\t['D']: '20',\n\t['E']: '20',\n\t['F']: '20',\n};\n\nexport function isOver110YearsOld(ssn: string): boolean {\n\tif (ssn.length != 11) {\n\t\treturn false;\n\t}\n\n\tconst centurySymbol = ssn[6];\n\tconst birthYear = parseInt(ssnYearSymbols[centurySymbol] + ssn.substring(4, 6));\n\treturn differenceInYears(new Date(), new Date(birthYear, 0)) > 110;\n}\n","\"use strict\";\nexports.differenceInYears = differenceInYears;\nvar _index = require(\"./compareAsc.js\");\nvar _index2 = require(\"./differenceInCalendarYears.js\");\nvar _index3 = require(\"./toDate.js\");\n\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n *\n * @returns The number of full years\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\nfunction differenceInYears(dateLeft, dateRight) {\n const _dateLeft = (0, _index3.toDate)(dateLeft);\n const _dateRight = (0, _index3.toDate)(dateRight);\n\n const sign = (0, _index.compareAsc)(_dateLeft, _dateRight);\n const difference = Math.abs(\n (0, _index2.differenceInCalendarYears)(_dateLeft, _dateRight),\n );\n\n // Set both dates to a valid leap year for accurate comparison when dealing\n // with leap days\n _dateLeft.setFullYear(1584);\n _dateRight.setFullYear(1584);\n\n // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n const isLastYearNotFull =\n (0, _index.compareAsc)(_dateLeft, _dateRight) === -sign;\n const result = sign * (difference - +isLastYearNotFull);\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}\n","\"use strict\";\nexports.compareAsc = compareAsc;\nvar _index = require(\"./toDate.js\");\n\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The first date to compare\n * @param dateRight - The second date to compare\n *\n * @returns The result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nfunction compareAsc(dateLeft, dateRight) {\n const _dateLeft = (0, _index.toDate)(dateLeft);\n const _dateRight = (0, _index.toDate)(dateRight);\n\n const diff = _dateLeft.getTime() - _dateRight.getTime();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n","\"use strict\";\nexports.differenceInCalendarYears = differenceInCalendarYears;\nvar _index = require(\"./toDate.js\");\n\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param dateLeft - The later date\n * @param dateRight - The earlier date\n\n * @returns The number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nfunction differenceInCalendarYears(dateLeft, dateRight) {\n const _dateLeft = (0, _index.toDate)(dateLeft);\n const _dateRight = (0, _index.toDate)(dateRight);\n\n return _dateLeft.getFullYear() - _dateRight.getFullYear();\n}\n"],"names":["$5t5Yf","parcelRequire","emailRegex","isValidEmail","email","test","zipCodeRegex","isValidZipCode","zipCode","intRegex","isValidInteger","value","minValue","maxValue","parsedValue","parseInt","isNaN","undefined","phoneRegex","isValidPhoneNumber","ssnRegex","ssnCheckLetters","isValidSSN","mustBeOfLegalAge","normalizedValue","toUpperCase","dateValue","Date","parse","ssnYearSymbols","substring","getDateWithoutTime","addYears","checkDigit","sum","mod","toString","calculateSSNCheckDigit","toLowerCase","$3fb44ad377b698c3$export$3d83eec43f4ea476","date","amount","$jVawl","addMonths","$ltzjN","U","V","W","X","Y","A","B","C","D","E","F","isOver110YearsOld","ssn","length","centurySymbol","birthYear","differenceInYears","$fa27b3e38b8ac7d8$export$ed6bf486f68899ca","dateLeft","dateRight","_dateLeft","$58hle","toDate","_dateRight","sign","$6F6Cs","compareAsc","difference","Math","abs","$lW54u","differenceInCalendarYears","setFullYear","isLastYearNotFull","result","$4d9bb4dd3d82814d$export$fe114145ae75d197","diff","getTime","$ff82f2d0f6122647$export$c06dce8b38891685","getFullYear"],"version":3,"file":"DirectRental.76dcae8e.js.map"}