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AiB,CACtB,UAAW,MACb,EAE2B,OAA1B,MAAS,CAAE,KAAM,KAAM,CAAC,GALdA,EAKgB,uBACA,OAA1B,MAAS,CAAE,KAAM,KAAM,CAAC,GANdA,EAMgB,0BACf,OAAX,MAAS,GAPCA,EAOC,2BAPDA,EAAN,OADN,MAAc,8BAA8B,GAChCA,CAA0B,ECGvC,MAAM,GAAoBE,GAEpBC,GAAyB,CAACtD,EAA2BC,GAA0BG,GAA4BwB,CAAoB,EAE/H2B,GAA+B,CAAClD,CAA4B,EAE5DmD,GAAwB,CAACb,CAA2B,EAEpDc,GAAwC,CAACN,CAA0B,EAEzE,OAAe,CAAC,GAAG,GAAY,GAAGG,GAAiB,GAAGC,GAAuB,GAAGC,GAAgB,GAAGC,EAA8B,C","sources":["webpack://dot-com/./app/assets/javascript/components/shared/utils/scroll.ts","webpack://dot-com/./app/assets/javascript/components/shared/utils/coverages.ts","webpack://dot-com/./app/assets/javascript/components/shared/utils/driver-license-validation.ts","webpack://dot-com/./app/assets/javascript/components/shared/autocomplete/autocomplete.ts","webpack://dot-com/./app/assets/javascript/components/shared/datepicker/datepicker.ts","webpack://dot-com/./app/assets/javascript/components/shared/datepicker/date-input-mask.ts","webpack://dot-com/./app/assets/javascript/components/shared/file-upload/file-upload.ts","webpack://dot-com/./app/assets/javascript/components/shared/modal/modal.ts","webpack://dot-com/./app/assets/javascript/components/shared/toggle/toggle.ts","webpack://dot-com/./app/assets/javascript/components/shared/password-toggle/password-toggle.ts","webpack://dot-com/./app/assets/javascript/components/shared/validation/utilities/input.ts","webpack://dot-com/./app/assets/javascript/components/shared/validation/validators/input.ts","webpack://dot-com/./app/assets/javascript/components/shared/validation/validators/date.ts","webpack://dot-com/./app/assets/javascript/components/shared/validation/validators/pii.ts","webpack://dot-com/./app/assets/javascript/components/shared/validation/form-validation.ts","webpack://dot-com/./app/assets/javascript/components/shared/modal/modal-view-component.ts","webpack://dot-com/./app/assets/javascript/components/shared/standard-time/standard-time.ts","webpack://dot-com/./app/assets/javascript/components/shared/magic-form/magic-form.ts","webpack://dot-com/./app/assets/javascript/components/shared/magic-form/magic-fieldset.ts","webpack://dot-com/./app/assets/javascript/components/shared/copier/copier.ts","webpack://dot-com/./app/assets/javascript/components/shared/accordion/accordion.ts","webpack://dot-com/./app/assets/javascript/components/shared/accordion/accordion-helper.ts","webpack://dot-com/./app/assets/javascript/components/shared/autocomplete/remote-autocomplete.ts","webpack://dot-com/./app/assets/javascript/components/shared/analytics/fullstory.ts","webpack://dot-com/./app/assets/javascript/components/shared/table-filter/table-filter.ts","webpack://dot-com/./app/assets/javascript/components/shared/index.ts","webpack://dot-com/./app/assets/javascript/components/quote/abandonment-modal.ts","webpack://dot-com/./app/assets/javascript/components/sales_funnel/rce.ts","webpack://dot-com/./app/assets/javascript/components/shared/policy-application.ts","webpack://dot-com/./app/assets/javascript/components/opportunity/mark-duplicate-button.ts","webpack://dot-com/./app/assets/javascript/services/quote_note.service.ts","webpack://dot-com/./app/assets/javascript/services/quote_restore.service.ts","webpack://dot-com/./app/assets/javascript/components/shared/utils/utils.service.ts","webpack://dot-com/./app/assets/javascript/components/quotes-table/quote-differences-utils.ts","webpack://dot-com/./app/assets/javascript/components/quotes-table/quote-restore-modal.ts","webpack://dot-com/./app/assets/javascript/components/quotes-table/quote-endorse-modal.ts","webpack://dot-com/./app/assets/javascript/services/quote_endorse.service.ts","webpack://dot-com/./app/assets/javascript/components/quotes-table/quotes-table.ts","webpack://dot-com/./app/assets/javascript/services/license-numbers.service.ts","webpack://dot-com/./app/assets/javascript/components/csrs/license-numbers-form.ts","webpack://dot-com/./app/assets/javascript/components/policy_administration/cancellation-decisions-table.ts","webpack://dot-com/./app/assets/javascript/components/index.ts"],"sourcesContent":["export function addScrollReturn(window: any, document: any, localStorage: any): void {\n window.addEventListener(\"pagehide\", function () {\n let scrollTop = document.scrollingElement.scrollTop.toString()\n localStorage.setItem(\"scrollTop\", scrollTop)\n })\n if (localStorage.scrollTop) {\n document.scrollingElement.scrollTo({ top: Number(localStorage.getItem(\"scrollTop\")) })\n }\n}\n","export const ZERO_VALUE = \"Decline\"\n\nexport interface SelectData {\n text: string\n value: string\n defaultSelected: boolean\n selected: boolean\n}\n\nexport interface SelectDefaults {\n [k: string]: SelectData[]\n}\nexport function getDefaultFor(document: Document, id: string) {\n let options = (document.getElementById(id) as HTMLSelectElement).options\n let returnArray: SelectData[] = []\n for (let i = 0; i < options.length; i++) {\n returnArray.push({\n text: options[i].text,\n value: options[i].value,\n defaultSelected: options[i].defaultSelected,\n selected: options[i].selected\n })\n }\n let returnMap = {}\n returnMap[id] = returnArray\n return returnMap\n}\n\nexport function removeOptions(selectElement: HTMLSelectElement): HTMLSelectElement {\n let length = selectElement.options.length - 1\n for (let i = length; i >= 0; i--) {\n selectElement.options.remove(i)\n }\n return selectElement\n}\n\nexport function copyNoCoverageElement(defaultOptionValues: SelectDefaults, element: HTMLSelectElement) {\n for (let i = 0; i < defaultOptionValues[element.id]?.length; i++) {\n if (defaultOptionValues[element.id][i].value === ZERO_VALUE) {\n element.options.add(\n new Option(\n defaultOptionValues[element.id][i].text,\n defaultOptionValues[element.id][i].value,\n defaultOptionValues[element.id][i].defaultSelected,\n true\n )\n )\n }\n }\n}\nexport const removeNoneIfSelected = (\n defaultOptionValues: SelectDefaults,\n isSelectedElements: HTMLSelectElement[],\n toRemove: HTMLSelectElement[]\n) => {\n if (isSelectedElements.every(exportObject.isZero)) {\n return\n }\n for (let element of toRemove as HTMLSelectElement[]) {\n exportObject.removeOptions(element)\n exportObject.copyOriginalOption(defaultOptionValues, element)\n exportObject.removeNoneOption(element)\n }\n}\n\nexport const isZero = (ele: HTMLSelectElement): boolean => {\n return ele.value === ZERO_VALUE\n}\n\nexport const setElementToNoneIfNotSelected = (\n defaultOptionValues: SelectDefaults,\n elements: HTMLSelectElement[],\n neededElements: HTMLSelectElement[]\n) => {\n {\n if (!neededElements.some(exportObject.isZero)) {\n return\n }\n for (let element of elements) {\n exportObject.removeOptions(element)\n exportObject.copyNoCoverageElement(defaultOptionValues, element)\n }\n }\n}\n\nexport const parseCoverages = (value: string): number => {\n let maybeValue = value.split(\"/\")[0]?.replace(\"$\", \"\").replace(\"k\", \"\").replace(\",\", \"\")\n if (maybeValue === ZERO_VALUE) {\n return 0\n }\n return Number(maybeValue)\n}\nexport const setToNone = (element: HTMLSelectElement) => {\n element.value = ZERO_VALUE\n}\n\nexport const findIndex = (element: HTMLSelectElement, value: string): number => {\n for (let i = 0; i < element.options.length; i++) {\n if (element.options[i].value === value) {\n return i\n }\n }\n}\n\nexport const getZeroOrSelectedFrom = (element: HTMLSelectElement): string => {\n if (element.options.length > 0) {\n return element.options[element.options.selectedIndex].value\n }\n return \"0\"\n}\n\nexport const lessThanOrEqualTo = (larger: HTMLSelectElement, smaller: HTMLSelectElement): HTMLSelectElement => {\n let largerSelectedValue = exportObject.parseCoverages(larger.options[larger.options.selectedIndex].value)\n let smallerSelectedValue = exportObject.parseCoverages(exportObject.getZeroOrSelectedFrom(smaller))\n let validSmaller = smallerSelectedValue < largerSelectedValue\n smaller = exportObject.removeOptions(smaller)\n for (let i = 0; i < larger.options.length; i++) {\n let largerValue = exportObject.parseCoverages(larger.options[i].value)\n if (largerSelectedValue >= largerValue) {\n let selected = validSmaller ? largerValue === smallerSelectedValue : larger.options[i].selected\n smaller.options.add(new Option(larger.options[i].text, larger.options[i].value, larger.options[i].defaultSelected, selected))\n }\n }\n return smaller\n}\n\nexport const copyOriginalOption = (defaultOptionValues: SelectDefaults, element: HTMLSelectElement) => {\n for (let i = 0; i < defaultOptionValues[element.id].length; i++) {\n element.options.add(\n new Option(\n defaultOptionValues[element.id][i].text,\n defaultOptionValues[element.id][i].value,\n defaultOptionValues[element.id][i].defaultSelected,\n defaultOptionValues[element.id][i].selected\n )\n )\n }\n}\nexport const setEqual = (from: HTMLSelectElement, to: HTMLSelectElement) => {\n to.value = from.value\n}\n\nexport const removeNoneOption = (element: HTMLSelectElement): HTMLSelectElement => {\n const zeroIndex = exportObject.findIndex(element, ZERO_VALUE)\n element.options.remove(zeroIndex)\n return element\n}\n\nexport const exportObject = {\n ZERO_VALUE,\n isZero,\n getDefaultFor,\n removeOptions,\n copyNoCoverageElement,\n setElementToNoneIfNotSelected,\n parseCoverages,\n setToNone,\n findIndex,\n getZeroOrSelectedFrom,\n lessThanOrEqualTo,\n removeNoneOption,\n copyOriginalOption,\n setEqual,\n removeNoneIfSelected\n}\n\nObject.defineProperty(exportObject, \"isZero\", {\n value: isZero,\n writable: true,\n configurable: true\n})\n\nObject.defineProperty(exportObject, \"removeOptions\", {\n value: removeOptions,\n writable: true,\n configurable: true\n})\n\nObject.defineProperty(exportObject, \"copyNoCoverageElement\", {\n value: copyNoCoverageElement,\n writable: true,\n configurable: true\n})\n\nObject.defineProperty(exportObject, \"parseCoverages\", {\n value: parseCoverages,\n writable: true,\n configurable: true\n})\n\nObject.defineProperty(exportObject, \"getZeroOrSelectedFrom\", {\n value: getZeroOrSelectedFrom,\n writable: true,\n configurable: true\n})\n\nObject.defineProperty(exportObject, \"removeOptions\", {\n value: removeOptions,\n writable: true,\n configurable: true\n})\n","const MATCHERS = [\n {\n name: \"AL\",\n matchRegExps: [/\\d{7}/],\n error: \"Alabama driver's license numbers are seven numbers. For example, 6996164.\"\n },\n {\n name: \"AK\",\n matchRegExps: [/\\d{7}/],\n error: \"Alaska driver's license numbers are seven numbers. For example, 6244114.\"\n },\n {\n name: \"AZ\",\n matchRegExps: [/[a-zA-Z]\\d{8}/, /\\d{9}/],\n error:\n \"Arizona driver's license numbers are nine numbers, for example 113654424, or may consist of one letter, and eight numbers, for example B13654424. \"\n },\n {\n name: \"AR\",\n matchRegExps: [/9\\d{8}/],\n error: \"Arkansas driver's license numbers are nine numbers that always begins with 9. For example, 999000680.\"\n },\n {\n name: \"CA\",\n matchRegExps: [/[a-zA-Z]\\d{7}/],\n error: \"California driver's license numbers consist of one letter and seven numbers. For example, A0002144.\"\n },\n {\n name: \"CO\",\n matchRegExps: [/\\d{2}-\\d{3}-\\d{4}/],\n error: \"Colorado driver's license numbers are nine numbers formatted as ##-###-####. For example, 94-33-0101.\"\n },\n {\n name: \"CT\",\n matchRegExps: [/\\d{9}/],\n error: \"Connecticut driver's license numbers are nine numbers. For example, 146825129.\"\n },\n {\n name: \"DE\",\n matchRegExps: [/\\d{7}/],\n error: \"Delaware driver's license numbers are a seven numbers. For example, 1232805.\"\n },\n {\n name: \"FL\",\n matchRegExps: [\n /[a-zA-Z] \\d{3} \\d{3} \\d{3} \\d{3}/,\n /[a-zA-Z]\\d{12}/,\n /[a-zA-Z]\\d{3}-\\d{3}-\\d{2}-\\d{3}-\\d/,\n /[a-zA-Z]-\\d{3}-\\d{3}-\\d{3}-\\d{3}/\n ],\n error:\n \"Florida driver's license numbers consist of one letter and 12 numbers, unformatted. For example, G544061739250. Florida driver's license numbers may also consist of one letter and 12 numbers, using the format L##-###-##-###-#. For example, G544-061-73-925-0. \"\n },\n {\n name: \"GA\",\n matchRegExps: [/\\d{9}/],\n error: \"Georgia driver's license numbers are nine numbers. For example, 099999999.\"\n },\n {\n name: \"HI\",\n matchRegExps: [/[a-zA-Z]\\d{8}/],\n error: \"Hawaii driver's license numbers consist of one letter and eight numbers. For example, H00000002.\"\n },\n {\n name: \"ID\",\n matchRegExps: [/[a-zA-Z]{2}\\d{6}[a-zA-Z]/],\n error: \"Idaho driver's license numbers consist of two letters, six numbers, and one letter. For example, AA123456Z.\"\n },\n {\n name: \"IL\",\n matchRegExps: [/[a-zA-Z]\\d{3}-\\d{4}-\\d{4}/, /[a-zA-Z]\\d{11}/],\n error:\n \"Illinois driver's license numbers consist of one letter and 11 numbers formatted as L###-####-####. For example, D400-7836-0001. It may also consist of one letter and 11 numbers. For example D40078360001.\"\n },\n {\n name: \"IN\",\n matchRegExps: [/\\d{4}-\\d{2}-\\d{4}/],\n error: \"Indiana driver's license numbers consist of 10 numbers formatted as ####-##-####. For example, 0299-11-6078.\"\n },\n {\n name: \"IA\",\n matchRegExps: [/\\d{9}/, /\\d{3}[a-zA-Z]{2}\\d{4}/],\n error:\n \"Iowa driver's license numbers are a nine numbers. For example, 123456789. Iowa driver's license numbers may also consist of three numbers, two letters, and four letters. For example, 123AB9755.\"\n },\n {\n name: \"KS\",\n matchRegExps: [/[a-zA-Z]\\d{2}-\\d{2}-\\d{4}/],\n error: \"Kansas driver's license numbers consist of one letter and eight numbers formatted as L##-##-####. For example, K00-09-7443.\"\n },\n {\n name: \"KY\",\n matchRegExps: [/[a-zA-Z]\\d{2}-\\d{3}-\\d{3}/],\n error: \"Kentucky driver's license numbers consist of one letter and eight numbers formatted as L##-###-###. For example, V12-345-678. \"\n },\n {\n name: \"LA\",\n matchRegExps: [/\\d{9}/],\n error: \"Louisiana driver's license numbers are a nine numbers. For example, 007000100.\"\n },\n {\n name: \"ME\",\n matchRegExps: [/\\d{7}/],\n error: \"Maine driver's license numbers are seven numbers. For example, 0015000.\"\n },\n {\n name: \"MD\",\n matchRegExps: [/[a-zA-Z]-\\d{3}-\\d{3}-\\d{3}-\\d{3}/, /[a-zA-Z]\\d{12}/],\n error:\n \"Maryland driver's license numbers consist of one letter and 12 numbers, unformatted. For example, S514778616977. They may also consist of one letter and 12 numbers formatted as L-###-###-###-###. For example, S-514-778-616-977.\"\n },\n {\n name: \"MA\",\n matchRegExps: [/[a-zA-Z]\\d{9}/],\n error:\n \"Maryland driver's license numbers consist of one letter and 12 numbers, unformatted. For example, S514778616977. They may also consist of one letter and 12 numbers formatted as L-###-###-###-###. For example, S-514-778-616-977.\"\n },\n {\n name: \"MI\",\n matchRegExps: [/[a-zA-Z]\\s\\d{3}\\s\\d{3}\\s\\d{3}\\s\\d{3}/, /[a-zA-Z]\\d{12}/],\n error:\n \"Michigan driver's license numbers consist of one letter and 12 numbers, unformatted. For example, P800000224322. They may also be one letter and 12 numbers formatted as L ### ### ### ###. For example, P 800 000 224 312. \"\n },\n {\n name: \"MN\",\n matchRegExps: [/[a-zA-Z]\\d{12}/],\n error: \"Minnesota driver's license numbers consist of one letter and 12 numbers, unformatted. For example, P800000224322.\"\n },\n {\n name: \"MS\",\n matchRegExps: [/\\d{3}-\\d{2}-\\d{4}/],\n error:\n \"Mississippi driver's license numbers are nine numbers formatted like a Social Security number as ###-##-####. For example, 125-01-2050.\"\n },\n {\n name: \"MO\",\n matchRegExps: [/[a-zA-Z]\\d{9}/],\n error: \"Missouri driver's license numbers consist of one letter and nine numbers. For example, F050256006.\"\n },\n {\n name: \"MT\",\n matchRegExps: [/\\d{9}/, /\\d{9}41\\d{2}/, /\\d{9}0{4}/],\n error:\n \"Montana driver's license numbers are a nine numbers. For example, 626926253. They also may be 13 digits in length with First 2 digits equaling the month of birth, the Next 3 digits randomly assigned, the next 4 digits the year of birth, the next 2 digits being 41, the last 2 digits being the day of birth. Prior licenses used either the licensee’s Social Security number or the Social Security number followed by four zeros.\"\n },\n {\n name: \"NE\",\n matchRegExps: [/[a-zA-Z]\\d{8}/],\n error: \"Nebraska driver's license numbers consist of one letter and eight numbers. For example, A20600249.\"\n },\n {\n name: \"NV\",\n matchRegExps: [/\\d{10}/],\n error: \"Nevada driver's license numbers consist of 10 numbers. For example, 0002102201.\"\n },\n {\n name: \"NH\",\n matchRegExps: [/(0[1-9]|1[0-2])[a-zA-Z]{3}\\d{2}(0[1-9]|[1-2][0-9]|3[0-1])\\d/],\n error:\n \"New Hampshire driver's license numbers are 10 numbers. The first 2 characters are the month of birth, the next character is the first letter of the last name, the next character is the last letter of the last name, the next character is the first character of the first name, the next two digits are the year of birth, the next two digits are the day of birth, the final digit prevents duplication.\"\n },\n {\n name: \"NJ\",\n matchRegExps: [/[a-zA-Z]\\d{14}/, /[a-zA-Z]\\d{4} \\d{5} \\d{5}/],\n error: \"New Jersey driver's license numbers consist of one letter and 14 numbers formatted as L#### ##### ##### or L##############.\"\n },\n {\n name: \"NM\",\n matchRegExps: [/\\d{9}/],\n error: \"New Mexico driver's license numbers are nine numbers. For example, 013696424.\"\n },\n {\n name: \"NY\",\n matchRegExps: [/\\d{3} \\d{3} \\d{3}/, /\\d{9}/],\n error: \"New Mexico driver's license numbers are nine numbers. For example, 013696424.\"\n },\n {\n name: \"NC\",\n matchRegExps: [/\\d{12}/],\n error: \"North Carolina driver's license numbers are 12 numbers. For example, 8013303159.\"\n },\n {\n name: \"ND\",\n matchRegExps: [/[a-zA-Z]{3}-\\d{2}-\\d{4}/],\n error:\n \"North Dakota driver's license numbers are nine numbers, the first 3 letters of the licensee’s last name (if the last name is only 2 letters, the third character will be an “X”), the next 2-digit year of birth, and finally there are 4 digits. For examples AUS-92-1234.\"\n },\n {\n name: \"OH\",\n matchRegExps: [/[a-zA-Z]{2}[0-9]{3,7}/, /[a-zA-Z]\\d{4,8}/, /\\d{8}/],\n error:\n \"Ohio driver's license numbers are two letters and six numbers. For example, TL545796. There can also be one letter and 4 to 8 numbers. For example, T54579689. There can also be eight numbers. For example, 54579689.\"\n },\n {\n name: \"OK\",\n matchRegExps: [/[a-zA-Z]\\d{9}/],\n error: \"Oklahoma driver's license numbers consist of one letter and nine numbers. For example, B000062835.\"\n },\n {\n name: \"OR\",\n matchRegExps: [/\\d{7}/],\n error: \"Oregon driver's license numbers are a seven numbers. For example, 6110033.\"\n },\n {\n name: \"PA\",\n matchRegExps: [/\\d{2}\\s\\d{3}\\s\\d{3}/],\n error: \"Pennsylvania driver's license numbers are eight numbers formatted as ## ### ###. For example, 99 900 104.\"\n },\n {\n name: \"RI\",\n matchRegExps: [/[1-9]{2}\\d{5}/],\n error:\n \"Rhode Island driver's license numbers are seven numbers. The first two digits are the year the license was issued (2008 is indicated by “28”). For example, 2858889.\"\n },\n {\n name: \"SC\",\n matchRegExps: [/\\d{9}/],\n error: \"South Carolina driver's license numbers are a nine numbers. For example, 100179226.\"\n },\n {\n name: \"SD\",\n matchRegExps: [/\\d{8}/],\n error: \"South Dakota driver's license numbers are eight numbers. For example, 00616775. \"\n },\n {\n name: \"TN\",\n matchRegExps: [/\\d{7,9}/],\n error: \"Tennessee driver's license numbers can consist of eight or nine numbers. For example, 101915638.\"\n },\n {\n name: \"TX\",\n matchRegExps: [/\\d{8}/],\n error: \"Texas driver's license numbers are eight numbers. For example, 17600550. \"\n },\n {\n name: \"UT\",\n matchRegExps: [/\\d{9}/],\n error: \"Utah driver's license numbers are a nine numbers. For example, 400138831.\"\n },\n {\n name: \"VT\",\n matchRegExps: [/\\d{8}/, /\\d{7}[a-zA-Z]/],\n error:\n \"Vermont driver's license numbers are eight numbers. For example, 17600550. They may also consist of seven numbers and one letter. For example, 8205059A. \"\n },\n {\n name: \"VA\",\n matchRegExps: [/[a-zA-Z]\\d{8}/, /[a-zA-Z]\\d{2}-\\d{2}-\\d{4}/],\n error:\n \"Virginia driver's license numbers consist of one letter and eight numbers. For example, A20600249. Virginia driver's license numbers may also consist of one letter and eight numbers formatted as L##-##-####. For example, T16-70-0185.\"\n },\n {\n name: \"WA\",\n matchRegExps: [/[a-zA-Z]{3}\\*\\*[a-zA-Z]{2}\\d{3}[a-zA-Z]\\d/],\n error:\n \"Washington driver's license numbers use the format: three letters ** two letters, three numbers, one letter, and one number. For example, DOE**MJ501P1.\"\n },\n {\n name: \"DC\",\n matchRegExps: [/\\d{7}/],\n error: \"Washington, D.C. driver's license numbers are a seven numbers. For example, 9992616. \"\n },\n {\n name: \"WV\",\n matchRegExps: [/\\d{7}/, /[a-zA-Z]\\d{6}/],\n error:\n \"West Virginia driver's license numbers are a seven numbers. For example, 1899168. They may also consist of one letter and six numbers. For example, R899168. \"\n },\n {\n name: \"WV\",\n matchRegExps: [/\\d{7}/, /[a-zA-Z]\\d{6}/],\n error:\n \"West Virginia driver's license numbers are a seven numbers. For example, 1899168. They may also consist of one letter and six numbers. For example, R899168. \"\n },\n {\n name: \"WI\",\n matchRegExps: [/[a-zA-Z]\\d{3}-\\d{4}-\\d{4}-\\d{2}/],\n error:\n \"Wisconsin driver's license numbers are one letter and 13 numbers formatted as L###-####-####-##. For example, J525-4209-0465-05. \"\n },\n {\n name: \"WY\",\n matchRegExps: [/\\d{6}-\\d{3}/],\n error: \"Wyoming driver's license numbers are nine numbers formatted as ######-###. For example, 050070-003. \"\n },\n {\n name: \"international\",\n matchRegExps: [/\\d{1,40}/], // There is no established format for international driver's licenses; this is ignored in validation\n error: \"International Drivers License Error\"\n }\n]\nexport function driverLicenseValidation(licenseNumber: string): string[] {\n const matches: string[] = []\n for (const matcher of MATCHERS) {\n if (createTestMatcher(matcher.matchRegExps).test(licenseNumber)) {\n matches.push(matcher.name)\n }\n }\n return matches\n}\n\nfunction createTestMatcher(matchRegExps: RegExp[]): RegExp {\n let finalMatchString = matchRegExps.map(regex => regex.source).join(\"$|^\")\n return new RegExp(`^${finalMatchString}$`)\n}\n\nfunction getErrorForState(state: string): string | null {\n for (const o of MATCHERS) {\n if (o.name === state.toUpperCase()) {\n return o.error\n }\n }\n return \"Invalid State\"\n}\n\nfunction removeValidations(licenseNumber: HTMLInputElement, licenseState: HTMLSelectElement) {\n licenseNumber.parentNode.querySelector(\".form-help--invalid\")?.remove()\n licenseState.parentNode.querySelector(\".form-help--invalid\")?.remove()\n}\n\nfunction invalid(licenseNumber: HTMLInputElement, licenseState: HTMLSelectElement) {\n if (licenseState.value === \"international\") {\n return false\n } else {\n return !driverLicenseValidation(licenseNumber.value).includes(licenseState.value)\n }\n}\n\nfunction addValidationMessage(errorMessage: string, toAdd: HTMLElement) {\n const htmlDivElement = document.createElement(\"div\")\n htmlDivElement.className = \"form-help form-help--invalid\"\n htmlDivElement.innerText = errorMessage\n toAdd.parentNode.appendChild(htmlDivElement)\n}\n\nexport function validateForm(formID: string, licenseStateSelector: string, licenseNumberSelector: string) {\n const form = document.querySelector(formID) as HTMLFormElement\n const licenseState = form.querySelector(licenseStateSelector) as HTMLSelectElement\n const licenseNumber = form.querySelector(licenseNumberSelector) as HTMLInputElement\n licenseNumber.onblur = _ => {\n removeValidations(licenseNumber, licenseState)\n if (invalid(licenseNumber, licenseState)) {\n addValidationMessage(getErrorForState(licenseState.value), licenseNumber)\n return\n }\n form.submit()\n }\n\n licenseState.onchange = _ => {\n removeValidations(licenseNumber, licenseState)\n if (invalid(licenseNumber, licenseState)) {\n addValidationMessage(getErrorForState(licenseState.value), licenseState)\n return\n }\n form.submit()\n }\n}\n","import { LitElement, html, TemplateResult } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { AutocompleteList } from \"../utils/interfaces\"\nimport { FormValidationComponent } from \"../validation/form-validation\"\n\n@customElement(\"kin-autocomplete\")\nexport class AutocompleteComponent extends LitElement {\n // @property() means the value can come from the DOM attribute of the same name on the custom element\n // whereas the rest of the items are properties on the class.\n @property() name: string\n @property() additionalClasses: string\n @property() inputId: string\n @property() label: string\n @property() isRequired: boolean = false\n @property() isDisabled: boolean = false\n @property() multipleLabel: string = \"Selected Items\"\n @property() minimum: number = 2\n @property() minimumMultiple: number = 1\n @property() limit: number\n @property() originalRequired: string\n // Ruby defaults to certain values, although that's not necessarily what's desired. We can declare to ignore that here.\n @property() renderBlank: boolean = null\n prunedList: AutocompleteList[] = []\n list: AutocompleteList[] = []\n multipleSelectedList: Set = new Set()\n value: string = \"\"\n multiple: boolean = false\n suggestionListActive: boolean\n listItems: HTMLElement[]\n onChangeEvent: CustomEvent\n validator: FormValidationComponent\n\n // We don't need Shadow DOM in this component.\n createRenderRoot() {\n return this\n }\n\n firstUpdated() {\n this.originalRequired = this.getAttribute(\"isRequired\")\n\n if (this.associatedSelectElement.multiple) {\n this.multiple = true\n this.minimum = 1\n if (this.originalRequired != \"true\") {\n this.minimumMultiple = 0\n }\n }\n\n this.initializeAutocomplete()\n this.addEventListeners()\n\n this.fillInputs()\n\n if (this.multiple && this.originalRequired == \"true\") {\n if (this.multipleSelectedList.size >= this.minimumMultiple) {\n this.isRequired = false\n } else {\n this.isRequired = true\n }\n }\n\n super.requestUpdate()\n }\n\n initializeAutocomplete() {\n // Let's get our input into a good format.\n // Using querySelector() here because we have multiple instances of IDs on a page. Once that is fixed, we can\n // use more precise functions such as getElementById()\n this.getOptions()\n\n this.prunedList = this.list\n super.requestUpdate()\n }\n\n getOptions() {\n this.list = []\n\n this.list = Array.from(this.associatedSelectElement.options).map(item => {\n return {\n text: item.text,\n value: item.value,\n selected: item.selected,\n disabled: item.disabled,\n priority: item.dataset.priority ? true : false\n }\n })\n }\n\n public reinitialize(clearInput: boolean = true) {\n this.list = []\n this.prunedList = []\n if (clearInput) {\n this.associatedSelectElement.value = null\n }\n if (this.multiple) {\n this.multipleSelectedList.clear()\n }\n this.initializeAutocomplete()\n this.fillInputs()\n super.requestUpdate()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.removeEventListeners()\n }\n\n addEventListeners() {\n document.addEventListener(\"click\", e => {\n if (!(e.target as HTMLElement).closest(\"kin-autocomplete\") && this.suggestionListActive) {\n this.deactivateSuggestionBox(false)\n }\n })\n this.autocompleteInput.addEventListener(\"input\", (e: InputEvent) => this.handleInput(e))\n this.autocompleteInput.addEventListener(\"keydown\", (e: KeyboardEvent) => this.handleKey(e))\n this.querySelector(\".autocomplete__list\").addEventListener(\"keydown\", (e: KeyboardEvent) => this.handleKey(e))\n\n // We only want to disable fields when they're not already disabled via the ViewComponent\n if (this.isWithinModal && this.getClientRects().length === 0 && !this.isDisabled) {\n document.addEventListener(\"kin-modal:open\", (e: CustomEvent) => this.handleCurrentState(e))\n document.addEventListener(\"kin-modal:close\", (e: CustomEvent) => this.handleCurrentState(e))\n }\n }\n\n removeEventListeners() {\n document.addEventListener(\"click\", e => {\n if (!(e.target as HTMLElement).closest(\"kin-autocomplete\") && this.suggestionListActive) {\n this.deactivateSuggestionBox(false)\n }\n })\n this.autocompleteInput.removeEventListener(\"input\", (e: InputEvent) => this.handleInput(e))\n this.autocompleteInput.removeEventListener(\"keydown\", (e: KeyboardEvent) => this.handleKey(e))\n this.querySelector(\".autocomplete__list\").removeEventListener(\"keydown\", (e: KeyboardEvent) => this.handleKey(e))\n\n if (this.isWithinModal && this.getClientRects().length === 0 && !this.isDisabled) {\n document.removeEventListener(\"kin-modal:open\", (e: CustomEvent) => this.handleCurrentState(e))\n document.removeEventListener(\"kin-modal:close\", (e: CustomEvent) => this.handleCurrentState(e))\n }\n }\n\n render() {\n return html`\n \n \n ${this.label}\n \n \n \n \n \n
\n
    \n ${this.prunedList.map(item => {\n if (this.multiple) {\n if (!item.selected && !item.disabled) {\n return html`\n
  • \n \n ${this.changeRenderedName(item)}\n \n
  • \n `\n }\n } else {\n if (!item.disabled) {\n return html`\n
  • \n \n ${this.changeRenderedName(item)}\n \n
  • \n `\n }\n }\n })}\n ${this.prunedList.map(item => {\n if (item.disabled) {\n return html`\n
  • \n \n
  • \n `\n }\n })}\n
\n ${this.multiple && this.limit !== undefined\n ? html`\n Please select up to ${this.limit} items (${this.multipleSelectedList.size} selected)\n `\n : \"\"}\n
\n \n ${this.multiple && this.multipleSelectedList.size !== 0\n ? html`\n
\n
\n ${this.multipleLabel}\n
    \n ${Array.from(this.multipleSelectedList).map(item => {\n return html`\n
  • \n \n ${item.text}\n \n
  • \n `\n })}\n
\n
\n
\n `\n : \"\"}\n `\n }\n\n toggleList() {\n if (this.suggestionListActive) {\n this.deactivateSuggestionBox()\n } else {\n this.value = \"\"\n this.activateSuggestionBox()\n }\n super.requestUpdate()\n }\n\n fillInputs() {\n if (this.multiple) {\n Array.from(this.associatedSelectElement.selectedOptions).forEach(opt => {\n if (opt.value !== \"\") {\n let itemToAdd = this.list.find(item => item.value === opt.value)\n this.multipleSelectedList.add(itemToAdd)\n }\n })\n } else {\n if (this.associatedSelectElement.value && this.associatedSelectElement.value.length > 0 && this.renderBlank === null) {\n let value = this.associatedSelectElement.value\n if (this.associatedSelectElement.querySelector(`option[value=\"${value}\"]`) != null) {\n this.value = (this.associatedSelectElement.querySelector(`option[value=\"${value}\"]`) as HTMLOptionElement).textContent\n }\n } else {\n this.value = \"\"\n }\n }\n\n super.requestUpdate()\n }\n\n handleClick(e: MouseEvent | KeyboardEvent) {\n let clickedButton = e.target as HTMLElement\n\n if (clickedButton.tagName !== \"button\") {\n clickedButton = clickedButton.closest(\"button\")\n }\n\n let value = clickedButton.getAttribute(\"data-value\")\n if (value !== null) {\n this.setValue(value)\n }\n }\n\n handleCurrentState(e?: CustomEvent) {\n if (!this.isWithinModal) {\n return\n }\n\n if (e.detail.id === this.closest(\"kin-modal, kin-view-modal\").id) {\n this.getClientRects().length === 0 ? this.toggleDisabledState(true) : this.toggleDisabledState(false)\n }\n }\n\n toggleDisabledState(disabled: boolean) {\n this.autocompleteTrigger.disabled = disabled\n this.autocompleteInput.disabled = disabled\n this.isDisabled = disabled\n this.requestUpdate()\n }\n\n isValueSelected(name: string): boolean {\n return this.value === name\n }\n\n handleKey(e: KeyboardEvent) {\n if (e.code === \"ArrowDown\") {\n this.navigateDown(e)\n }\n\n if (e.code === \"ArrowUp\") {\n this.navigateUp(e)\n }\n\n if (e.code === \"Enter\" && this.prunedList.length === 1) {\n e.preventDefault()\n if (this.prunedList[0].disabled) {\n return\n }\n\n this.setValue(this.prunedList[0].value)\n this.deactivateSuggestionBox()\n super.requestUpdate()\n } else if (e.code === \"Enter\" && e.srcElement instanceof HTMLButtonElement) {\n e.preventDefault()\n if (!e.srcElement.disabled) {\n this.setValue((e.srcElement as HTMLElement).dataset.value)\n }\n } else if (e.code === \"Enter\") {\n e.preventDefault()\n }\n\n if (e.code === \"Escape\" && this.suggestionListActive) {\n this.deactivateSuggestionBox()\n }\n }\n\n handleInput(e: InputEvent) {\n if ((e.target as HTMLInputElement).value) {\n this.prunedList = []\n this.value = (e.target as HTMLInputElement).value\n this.list.forEach(item => {\n if (this.isProperSearchResult(item)) {\n this.prunedList.push(item)\n }\n })\n\n if (this.prunedList.length && this.value.length >= this.minimum) {\n this.activateSuggestionBox()\n }\n } else {\n this.value = \"\"\n this.prunedList = this.list\n }\n\n super.requestUpdate()\n }\n\n isProperSearchResult(item: AutocompleteList): boolean {\n return item.text.toLowerCase().includes(this.value.toLowerCase())\n }\n\n activateSuggestionBox() {\n this.throwOverflowEvent({ allow: true })\n\n if (!this.value && this.multiple) {\n this.prunedList = this.list\n }\n\n this.suggestionListActive = true\n this.querySelector(\".autocomplete__list\").scrollTo(0, 0)\n ;(this.querySelector(`#${this.inputId}__input`) as HTMLInputElement).focus()\n super.requestUpdate()\n }\n\n deactivateSuggestionBox(focus: boolean = true) {\n this.throwOverflowEvent({ allow: false })\n\n this.suggestionListActive = false\n\n if (focus) {\n ;(this.querySelector(`#${this.inputId}__input`) as HTMLInputElement).focus()\n }\n\n if (this.associatedSelectElement.value && !this.multiple) {\n let text = this.associatedSelectElement.selectedOptions[0].textContent\n this.value = text\n } else {\n this.value = \"\"\n }\n\n super.requestUpdate()\n }\n\n throwOverflowEvent(detail: { allow: boolean }) {\n let overflowEvent = new CustomEvent(\"kin-modal:overflow\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: detail\n })\n this.dispatchEvent(overflowEvent)\n }\n\n navigateUp(e: Event) {\n e.preventDefault()\n if (this.suggestionListActive && this.listItems.length > 0) {\n let index = this.findFocusableListItems(e.srcElement as HTMLElement)\n\n if (index < this.listItems.length && index !== 0) {\n this.listItems[index - 1].focus()\n }\n\n if (index === 0) {\n this.listItems[this.listItems.length - 1].focus()\n }\n }\n }\n\n navigateDown(e: Event) {\n e.preventDefault()\n\n if (!this.suggestionListActive) {\n this.activateSuggestionBox()\n }\n\n let index = this.findFocusableListItems(e.srcElement as HTMLElement)\n\n if (index !== -1 && this.listItems.length > 0) {\n if (index < this.listItems.length - 1) {\n this.listItems[index + 1].focus()\n } else {\n this.listItems[0].focus()\n }\n } else {\n this.listItems[0].focus()\n }\n }\n\n findFocusableListItems(src: HTMLElement): number {\n this.listItems = Array.from(this.querySelectorAll(\".autocomplete__list button\"))\n\n return this.listItems.indexOf(src)\n }\n\n changeRenderedName(item: AutocompleteList): TemplateResult {\n if (this.value?.length === 0) {\n return html` ${item.text} `\n }\n\n // TODO: Make this a common util for escaping regex values\n let textToMatch = this.value.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n\n let span = document.createElement(\"span\")\n let regex = new RegExp(\"(\" + textToMatch + \")\", \"gi\")\n let value = item.text.replace(regex, match => `${match}`)\n span.innerHTML = value\n return html` ${span} `\n }\n\n updateMultipleAssociatedField(value?: string) {\n if (value !== undefined) {\n let itemToAdd = this.prunedList.find(item => item.value == value)\n this.multipleSelectedList.add(itemToAdd)\n }\n\n Array.from(this.associatedSelectElement.options).forEach(opt => {\n opt.selected = false\n })\n\n this.multipleSelectedList.forEach(item => {\n if (item !== undefined) {\n let toSelect = Array.from(this.associatedSelectElement.options).find(opt => opt.text === item.text)\n toSelect.selected = true\n this.list.find(listItem => listItem.value === item.value).selected = true\n }\n })\n\n if (this.limitExceeded) {\n this.deactivateSuggestionBox()\n }\n\n if (this.multipleSelectedList.size >= this.minimumMultiple) {\n this.isRequired = false\n } else {\n this.isRequired = true\n }\n\n this.onChangeEvent = new CustomEvent(\"kin-autocomplete:change\", {\n bubbles: true,\n detail: {\n id: this.inputId,\n name: this.value,\n value: this.associatedSelectElement.selectedOptions,\n consideredValid: this.consideredValid\n }\n })\n this.dispatchEvent(this.onChangeEvent)\n\n this.requestUpdate()\n }\n\n deleteFromMultipleList(e: MouseEvent) {\n let value = (e.target as HTMLElement).getAttribute(\"data-value\")\n let itemToDelete = this.prunedList.find(item => item.value === value)\n\n this.multipleSelectedList.delete(itemToDelete)\n itemToDelete.selected = false\n\n this.onChangeEvent = new CustomEvent(\"kin-autocomplete:change\", {\n bubbles: true,\n detail: { id: this.inputId, name: this.value, value: null, consideredValid: this.consideredValid }\n })\n this.dispatchEvent(this.onChangeEvent)\n\n this.requestUpdate()\n\n this.updateMultipleAssociatedField()\n }\n\n public setValueFromExternalSource(dataValue: string): void {\n if (!dataValue) {\n return\n }\n\n let matchingItem = this.list.find(item => item.value == dataValue)\n\n if (matchingItem) {\n this.setValue(matchingItem.value)\n }\n }\n\n setValue(dataValue: string): void {\n let itemToSelectValue = this.prunedList.find(item => item.value == dataValue)\n\n if (itemToSelectValue.disabled) {\n return\n }\n\n if (this.multiple) {\n if (!this.limitExceeded) {\n this.updateMultipleAssociatedField(String(dataValue))\n this.value = \"\"\n this.deactivateSuggestionBox()\n }\n } else {\n this.value = itemToSelectValue.text\n ;(document.getElementById(this.inputId + \"__input\") as HTMLInputElement).value = itemToSelectValue.text\n ;(this.associatedSelectElement.querySelector(`option[value=\"${itemToSelectValue.value}\"]`) as HTMLOptionElement).selected = true\n this.associatedSelectElement.value = itemToSelectValue.value\n this.deactivateSuggestionBox()\n\n this.onChangeEvent = new CustomEvent(\"kin-autocomplete:change\", {\n bubbles: true,\n detail: { id: this.inputId, name: this.value, value: itemToSelectValue.value, consideredValid: this.consideredValid }\n })\n this.dispatchEvent(this.onChangeEvent)\n }\n this.requestUpdate()\n }\n\n get limitExceeded() {\n return this.multipleSelectedList.size >= this.limit\n }\n\n get consideredValid() {\n if (this.isDisabled) {\n return true\n } else if (this.multiple) {\n return this.multipleSelectedList.size !== 0 && !this.limitExceeded && this.associatedSelectElement.selectedOptions.length > 0\n } else {\n return this.isRequired ? this.associatedSelectElement.value !== \"\" : true\n }\n }\n\n get autocompleteInput(): HTMLInputElement {\n return this.querySelector(`#${this.inputId}__input`)\n }\n\n get associatedSelectElement(): HTMLSelectElement {\n return document.querySelector(`select#${this.inputId}`)\n }\n\n get isWithinModal(): HTMLElement | null {\n return this.closest(\"kin-modal\") || this.closest(\"kin-view-modal\")\n }\n\n get autocompleteTrigger(): HTMLButtonElement {\n return this.querySelector(\".autocomplete__trigger\")\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport {\n accountForUTC,\n getLastMonth,\n getNextMonth,\n getFirstDayOfMonth,\n calculateLastDayOfMonth,\n daysInMonth,\n parseDates,\n includesDate\n} from \"../validation/utilities/date\"\n\ninterface DatePickerRange {\n startDate: Date\n endDate: Date\n}\n\ninterface Calendar {\n date?: Date\n active: boolean\n year: number\n}\n\ninterface CalendarDays extends Calendar {\n day: number\n month: number\n}\n\ninterface CalendarMonths extends Calendar {\n month: number\n year: number\n}\n\nconst MONTHS = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"]\nconst DAYS_OF_WEEK_ABBREVIATED = [\"S\", \"M\", \"T\", \"W\", \"Th\", \"F\", \"S\"]\n\n/*\nkin-datepicker\n\nThis can be used on its own added to an element, or via the ViewComponent 'Shared::UI::DatepickerComponent'\n*/\n\n@customElement(\"kin-datepicker\")\nexport class DatePickerComponent extends LitElement {\n @property() startDate: string\n @property() endDate: string\n @property({ type: Array }) disallowedDates: string[] = []\n @property() disallowedDatesMessage: string\n @property() inputId: string\n @property() dateId: string\n @property() value: string\n @property() isActive: boolean = false\n @property() id: string = \"datepicker__date\"\n @property({ type: Boolean }) absolutelyPositioned: boolean = false // To fix modal issue until I come up with a new fix.\n range: DatePickerRange = { startDate: new Date(1900, 0, 1), endDate: new Date(2100, 0, 0) }\n disallowedDatesParsed: Date[] = []\n today: Date = new Date(Date.now())\n current: Date\n selectedDate: Date\n monthView: boolean = true\n yearView: boolean = false\n decadeView: boolean = false\n days: CalendarDays[][] = []\n months: CalendarMonths[][] = []\n years: Calendar[][] = []\n onChangeEvent: CustomEvent\n datepickerContainer: HTMLElement = null\n\n // Since we're not using slots, we don't need the Shady DOM.\n createRenderRoot() {\n return this\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n // Remove datepicker from DOM if browser doesn't support Intersection Observer (all do but IE 11, Safari < 12.1, Edge < 15, Firefox < 55)\n // TODO: Put this in a better area.\n if (!window.IntersectionObserver) {\n setTimeout(() => {\n document.querySelector(\".datepicker__container button\").classList.add(\"hidden\")\n })\n }\n\n this.datepickerContainer = this.closest(\".datepicker__container\")\n\n if (this.value !== undefined && this.value.length > 0) {\n this.selectedDate = accountForUTC(new Date(this.value))\n this.fillAssociatedInputs()\n } else if (this.associatedDateInput) {\n if ((this.associatedDateInput as HTMLInputElement).type === \"text\") {\n // Compatibility layer for Safari as it does not natively support on Desktop\n let value = (this.associatedDateInput as HTMLInputElement).value\n if (!isNaN(new Date(value).getFullYear())) {\n this.selectedDate = accountForUTC(new Date(value))\n this.fillAssociatedInputs()\n }\n } else {\n // If the date field in the form has a value, let's fill the input mask\n if ((document.getElementById(this.dateId) as HTMLInputElement).valueAsDate) {\n this.selectedDate = accountForUTC((document.getElementById(this.dateId) as HTMLInputElement).valueAsDate)\n this.fillAssociatedInputs()\n }\n }\n }\n\n if (this.datepickerContainer !== null) {\n this.datepickerContainer.addEventListener(\"kin-date-input:change\", (e: CustomEvent) => this.handleAssociatedInputChange(e))\n }\n\n // Build initial calendar\n this.parseRange(this.startDate, this.endDate)\n this.parseDisallowedDates()\n this.current = new Date(Date.now())\n this.buildWeeks()\n }\n\n disconnectedCallback() {\n if (this.datepickerContainer !== null) {\n this.datepickerContainer.removeEventListener(\"kin-date-input:change\", (e: CustomEvent) => this.handleAssociatedInputChange(e))\n }\n\n super.disconnectedCallback()\n }\n\n render() {\n return html`\n \n
\n
\n
\n
    \n
  • \n ${this.monthView\n ? html`\n \n `\n : \"\"}\n ${this.yearView\n ? html`\n \n `\n : \"\"}\n
  • \n
  • \n ${this.monthView\n ? html`\n \n `\n : \"\"}\n ${this.decadeView\n ? html`\n \n `\n : \"\"}\n
  • \n ${this.monthView && this.disallowedDatesMessage\n ? html`\n \n
    \n \n
    \n

    ${this.disallowedDatesMessage}

    \n
    \n
    \n
    \n `\n : \"\"}\n
\n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n ${this.monthView\n ? html`\n \n \n \n \n ${DAYS_OF_WEEK_ABBREVIATED.map(day => {\n return html` `\n })}\n \n \n \n ${this.days.map((day, i) => {\n return html`\n \n ${day.map(day => {\n if (day.active && this.inRange(day.date)) {\n if (this.selectedDate && this.compareDay(day.date, this.selectedDate)) {\n return html`\n \n `\n } else if (this.compareDay(day.date, this.today)) {\n return html`\n \n `\n } else {\n return html`\n \n `\n }\n } else {\n return html`\n \n `\n }\n })}\n \n `\n })}\n \n ${!(this.isCurrentMonth && this.isCurrentYear)\n ? html`\n \n \n \n \n \n `\n : ``}\n
\n ${this.currentMonthName}${this.currentYear}\n
${day}
\n \n \n \n \n \n \n \n
\n \n
\n `\n : \"\"}\n ${this.decadeView\n ? html`\n \n \n \n ${this.years.map(year => {\n return html`\n \n ${year.map(year => {\n if (this.inRange(new Date(year.year, this.current.getMonth(), this.current.getDate()))) {\n return html`\n \n `\n } else {\n return html`\n \n `\n }\n })}\n \n `\n })}\n \n
\n \n \n \n
\n `\n : \"\"}\n ${this.yearView\n ? html`\n \n \n \n ${this.months.map(month => {\n return html`\n \n ${month.map(month => {\n if (this.inRange(new Date(month.year, month.month, 1))) {\n return html`\n \n `\n } else {\n return html`\n \n `\n }\n })}\n \n `\n })}\n \n
\n \n \n \n
\n `\n : \"\"}\n
\n \n `\n }\n\n disableClickEvents(e: Event) {\n e.preventDefault()\n }\n\n handleAssociatedInputChange(e: CustomEvent) {\n let value = e.detail.value\n\n if (!isNaN(new Date(value).getFullYear())) {\n this.selectedDate = accountForUTC(new Date(value))\n this.fillAssociatedInputs(false)\n }\n }\n\n fillAssociatedInputs(fillAssociated: boolean = true) {\n // This is required due to the element somehow not being available til the next cycle.\n // TODO: Investigate this issue.\n setTimeout(() => {\n const dateOptions = { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" } as const\n let formattedDate = new Date(this.selectedDate).toLocaleDateString(\"en-US\", dateOptions)\n formattedDate = formattedDate.replace(/[^ -~]/g, \"\")\n if (fillAssociated) this.associatedMaskedInput.value = formattedDate\n this.onChangeEvent = new CustomEvent(\"kin-datepicker:change\", {\n bubbles: true,\n composed: true,\n detail: { id: this.inputId, date: this.selectedDate, dateString: formattedDate }\n })\n this.dispatchEvent(this.onChangeEvent)\n })\n\n // Safari on Desktop *still* doesn't support input type=\"date\" so this workaround should help us.\n if ((this.associatedDateInput as HTMLInputElement).type === \"text\") {\n const dateOptions = { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" } as const\n let formattedDate = new Date(this.selectedDate).toLocaleDateString(\"en-US\", dateOptions)\n formattedDate = formattedDate.replace(/[^ -~]/g, \"\")\n ;(this.associatedDateInput as HTMLInputElement).value = formattedDate\n return\n }\n\n this.associatedDateInput.valueAsDate = this.selectedDate\n }\n\n public toggle() {\n if (this.isActive) {\n this.close()\n } else {\n this.open()\n }\n }\n\n public open() {\n this.throwOverflowEvent({ allow: true })\n if (this.inputId && this.associatedMaskedInput.value) {\n this.current =\n !isNaN(new Date(this.associatedMaskedInput.value).getFullYear()) && this.inRange(new Date(this.associatedMaskedInput.value))\n ? new Date(this.associatedMaskedInput.value)\n : new Date(Date.now())\n this.buildWeeks()\n }\n\n const toggleButton = document.getElementById(`${this.id}_button`)\n\n if (toggleButton) {\n toggleButton.setAttribute(\"aria-expanded\", \"true\")\n }\n\n this.isActive = true\n }\n\n public close() {\n this.throwOverflowEvent({ allow: false })\n ;(this.parentNode.querySelector(\".datepicker__container__trigger\") as HTMLElement).focus()\n\n const toggleButton = document.getElementById(`${this.id}_button`)\n\n if (toggleButton) {\n toggleButton.setAttribute(\"aria-expanded\", \"false\")\n }\n\n this.isActive = false\n }\n\n public updateStartDate(startDate: string) {\n this.range.startDate = new Date(startDate)\n this.associatedMaskedInput.dataset.validateMinDate = startDate\n this.buildWeeks()\n }\n\n public updateEndDate(endDate: string) {\n this.range.endDate = new Date(endDate)\n this.associatedMaskedInput.dataset.validateMaxDate = endDate\n this.buildWeeks()\n }\n\n throwOverflowEvent(detail: { allow: boolean }) {\n let overflowEvent = new CustomEvent(\"kin-modal:overflow\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: detail\n })\n this.dispatchEvent(overflowEvent)\n }\n\n buildDaysInMonth(month: number, year: number, active = true): CalendarDays[] {\n let days = []\n const numberOfDays = daysInMonth(month, year)\n for (let i = 0; i < numberOfDays; i++) {\n days.push({ date: new Date(year, month, i + 1), day: i + 1, month: month, year: year, active: active })\n }\n\n return days\n }\n\n buildWeeks() {\n this.days = []\n\n const currentMonth = this.current.getMonth()\n const currentYear = this.current.getFullYear()\n const days = this.buildDaysInMonth(currentMonth, currentYear)\n const lastDayOfMonth = calculateLastDayOfMonth(currentMonth, currentYear)\n const lastMonth = getLastMonth(currentMonth, currentYear)\n const nextMonth = getNextMonth(currentMonth, currentYear)\n const firstDayOfMonth = getFirstDayOfMonth(currentMonth, currentYear)\n\n let beforeDays = this.buildAdjacentDays(lastMonth.getMonth(), lastMonth.getFullYear(), firstDayOfMonth)\n let endDays = this.buildAdjacentDays(nextMonth.getMonth(), nextMonth.getFullYear(), lastDayOfMonth, true)\n\n let scaffold: CalendarDays[] = []\n scaffold = beforeDays.concat(days)\n scaffold = scaffold.concat(endDays)\n\n let temp: CalendarDays[] = []\n\n scaffold.map((day, i) => {\n temp.push(day)\n if (Number.isInteger((i + 1) / 7)) {\n this.days.push(temp)\n temp = []\n }\n })\n\n super.requestUpdate()\n }\n\n buildAdjacentYears() {\n this.years = []\n\n let decadeStart = this.current.getFullYear() - 4\n let decadeEnd = this.current.getFullYear() + 5\n let scaffold: Calendar[] = []\n\n for (let i = 0; i < decadeEnd - decadeStart; i++) {\n scaffold.push({ year: decadeStart + i, active: this.current.getFullYear() === decadeStart + i })\n }\n\n let temp: Calendar[] = []\n\n scaffold.map((year, i) => {\n temp.push(year)\n if (Number.isInteger((i + 1) / 3)) {\n this.years.push(temp)\n temp = []\n }\n })\n\n super.requestUpdate()\n }\n\n buildAdjacentDays(month: number, year: number, dayOfWeek: number, forwards: boolean = false): CalendarDays[] {\n let daysInAdjacentMonth = this.buildDaysInMonth(month, year, false)\n\n if (forwards) {\n dayOfWeek = Math.abs(6 - dayOfWeek)\n daysInAdjacentMonth = daysInAdjacentMonth.slice(0, dayOfWeek)\n } else {\n daysInAdjacentMonth = daysInAdjacentMonth.slice(daysInAdjacentMonth.length - dayOfWeek, daysInAdjacentMonth.length)\n }\n\n return daysInAdjacentMonth\n }\n\n buildMonths() {\n let year = this.current.getFullYear()\n let month = this.current.getMonth()\n\n this.months = []\n\n let scaffold: CalendarMonths[] = []\n\n for (let i = 0; i < 12; i++) {\n scaffold.push({ month: i, active: this.current.getMonth() === month, year: year })\n }\n\n let temp: CalendarMonths[] = []\n\n scaffold.map((month, i) => {\n temp.push(month)\n if (Number.isInteger((i + 1) / 3)) {\n this.months.push(temp)\n temp = []\n }\n })\n\n super.requestUpdate()\n }\n\n parseRange(startDate?: string, endDate?: string) {\n if (startDate?.length > 0) {\n this.range.startDate = new Date(startDate)\n }\n if (endDate?.length > 0) {\n this.range.endDate = new Date(endDate)\n }\n }\n\n parseDisallowedDates() {\n this.disallowedDatesParsed = parseDates(this.disallowedDates)\n }\n\n inRange(date: Date) {\n if (this.monthView) {\n return this.range.startDate <= date && date <= this.range.endDate && !this.isDisallowedDate(date)\n }\n\n if (this.yearView) {\n return this.range.startDate.getMonth() <= date.getMonth() && date.getMonth() <= this.range.endDate.getMonth()\n }\n\n if (this.decadeView) {\n return this.range.startDate.getFullYear() <= date.getFullYear() && date.getFullYear() <= this.range.endDate.getFullYear()\n }\n }\n\n isDisallowedDate(date: Date): boolean {\n if (this.disallowedDatesParsed.length === 0) {\n return false\n }\n\n return includesDate(this.disallowedDatesParsed, date)\n }\n\n compareDay(day1: Date, day2: Date) {\n return day1.getMonth() === day2.getMonth() && day1.getDate() === day2.getDate() && day1.getFullYear() === day2.getFullYear()\n }\n\n handleState(state: string) {\n if (state === \"decade\") {\n this.yearView = false\n this.monthView = false\n this.decadeView = true\n this.buildAdjacentYears()\n } else if (state === \"year\") {\n this.yearView = true\n this.monthView = false\n this.decadeView = false\n this.buildMonths()\n } else if (state === \"month\") {\n this.yearView = false\n this.monthView = true\n this.decadeView = false\n this.buildWeeks()\n }\n\n ;(this.querySelector(`#datepicker__${this.id}__control-buttons button`) as HTMLElement).focus()\n super.requestUpdate()\n }\n\n onDateSelect(e: Event) {\n if (this.monthView) {\n let selectedDay = Number((e.composedPath()[0] as HTMLElement).innerText.replace(/[^0-9]+/g, \"\"))\n this.selectedDate = new Date(this.current)\n this.selectedDate.setDate(selectedDay)\n\n super.requestUpdate()\n\n this.fillAssociatedInputs()\n this.close()\n }\n\n if (this.decadeView) {\n let selectedYear = Number((e.composedPath()[0] as HTMLElement).innerText.replace(/[^0-9]+/g, \"\"))\n\n this.current.setFullYear(selectedYear)\n this.handleState(\"month\")\n }\n\n if (this.yearView) {\n let selectedMonth = Number((e.composedPath()[0] as HTMLElement).innerText.replace(/[^0-9]+/g, \"\"))\n\n this.current.setMonth(selectedMonth - 1)\n this.handleState(\"month\")\n }\n }\n\n switchToDecade() {\n this.buildAdjacentYears()\n this.handleState(\"decade\")\n }\n\n switchToYear() {\n this.handleState(\"year\")\n }\n\n switchToMonth() {\n this.handleState(\"month\")\n }\n\n public nextSet() {\n if (this.monthView) {\n this.current = getNextMonth(this.currentMonth, this.currentYear)\n this.buildWeeks()\n }\n\n if (this.yearView) {\n this.current.setFullYear(this.current.getFullYear() + 1)\n this.buildMonths()\n }\n\n if (this.decadeView) {\n this.current.setFullYear(this.current.getFullYear() + 9)\n this.buildAdjacentYears()\n }\n }\n\n public previousSet() {\n if (this.monthView) {\n this.current = getLastMonth(this.currentMonth, this.currentYear)\n this.buildWeeks()\n }\n\n if (this.yearView) {\n this.current.setFullYear(this.current.getFullYear() - 1)\n this.buildMonths()\n }\n\n if (this.decadeView) {\n this.current.setFullYear(this.current.getFullYear() - 9)\n this.buildAdjacentYears()\n }\n }\n\n moveToToday() {\n this.current = new Date(Date.now())\n this.buildWeeks()\n ;(this.querySelector(`#datepicker__${this.id}__control-buttons button`) as HTMLElement).focus()\n }\n\n get currentMonth() {\n return this.current.getMonth()\n }\n\n get isCurrentMonth() {\n return this.current.getMonth() === new Date(Date.now()).getMonth()\n }\n\n get isCurrentYear() {\n return this.current.getFullYear() == new Date(Date.now()).getFullYear()\n }\n\n get currentYear() {\n return this.current.getFullYear()\n }\n\n get currentMonthName() {\n return MONTHS[this.current.getMonth()]\n }\n\n get associatedMaskedInput() {\n return document.getElementById(this.inputId) as HTMLInputElement\n }\n\n get associatedDateInput() {\n return document.getElementById(this.dateId) as HTMLInputElement\n }\n\n get datepickerTrigger() {\n return this.datepickerContainer.querySelector(\".datepicker__container__trigger\")\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\n\n// TODO: Eventually, this needs to be implemented within kin-datepicker (datepicker.ts) utilizing /validators/display/mask.ts\n\n@customElement(\"kin-date-input-mask\")\nexport class DateInputMaskComponent extends LitElement {\n @property() mask: string = \"00/00/0000\"\n @property() inputId: string\n @property() hiddenInputId: string\n @property() label: string\n @property() name: string\n @property() value: any = \"\"\n @property() type: string = \"text\"\n @property() startDate: string = new Date(2000, 0, 1).toLocaleDateString(\"en-US\", { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" })\n @property() endDate: string = new Date(2100, 0, 0).toLocaleDateString(\"en-US\", { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" })\n @property() disallowedDates: string = \"[]\"\n @property() labelledBy: string\n @property() validationMessage: string = \"\"\n @property() isRequired: boolean = false\n maskIndicies: number[] = []\n maskSeparator: string = \"/\"\n onChangeEvent: CustomEvent\n\n connectedCallback() {\n super.connectedCallback()\n this.parseRange()\n }\n\n // createRenderRoot() disables the Shadow DOM, which isn't something we need here.\n createRenderRoot() {\n return this\n }\n\n firstUpdated() {\n if (this.validationMessage.length > 0) {\n this.querySelector(\"input\").setAttribute(\"data-validation-message\", this.validationMessage)\n }\n this.querySelector(\"input\").setAttribute(\"data-validate-min-date\", this.startDate)\n this.querySelector(\"input\").setAttribute(\"data-validate-max-date\", this.endDate)\n this.querySelector(\"input\").setAttribute(\"data-validate-disallowed-dates\", this.disallowedDates)\n }\n\n render() {\n return html`\n \n `\n }\n\n throwOnChange() {\n this.onChangeEvent = new CustomEvent(\"kin-date-input:change\", {\n bubbles: true,\n detail: { id: this.inputId }\n })\n this.dispatchEvent(this.onChangeEvent)\n }\n\n parseRange() {\n const dateOptions = { year: \"numeric\", month: \"2-digit\", day: \"2-digit\" } as const\n if (this.startDate.length === 0) {\n this.startDate = new Date(2000, 0, 1).toLocaleDateString(\"en-US\", dateOptions)\n }\n if (this.endDate.length === 0) {\n this.endDate = new Date(2100, 0, 0).toLocaleDateString(\"en-US\", dateOptions)\n }\n super.requestUpdate()\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property, query } from \"lit/decorators.js\"\nimport { refreshVisibleFields } from \"../utils/utils\"\nimport { DirectUpload } from \"activestorage\"\n\nlet defaultLabel = \"Drag and drop, or choose files\"\n\n@customElement(\"kin-file-upload\")\nexport class FileUploadComponent extends LitElement {\n @property() name: string\n @property() url: string\n @property() documentLabel: string\n @property() required: boolean\n @property() allowedSize: number = 10240 // 10 MB in KB\n @property() label: string = defaultLabel\n @property() types: string = \"pdf,docx,doc,jpg,png,jpeg,csv\"\n @property() authenticityToken: string\n @query(\".file-uploader\") uploadContainer: HTMLDivElement\n @query('input[type=\"file\"]') uploadInput: HTMLInputElement\n @query(\".file-uploader--file-name\") uploaderProgress: HTMLInputElement\n @query(\"#file-uploader--selected-file-container\") selectedFileContainer: HTMLDivElement\n @query(\"#blob-input\") blobInput: HTMLInputElement\n uploadingFile = false\n allowedTypes: string[] = []\n file: File\n directUploadUrl: string = \"/rails/active_storage/direct_uploads\"\n\n createRenderRoot() {\n return this\n }\n\n firstUpdated() {\n this.allowedTypes = this.types.split(\",\")\n this.initializeEventListeners()\n }\n\n disconnectedCallback() {\n this.removeEventListeners()\n }\n\n render() {\n return html`\n \n \n \n `\n }\n\n initializeEventListeners() {\n this.uploadInput.addEventListener(\"change\", (e: InputEvent) => this.handleInput(this.uploadInput))\n this.uploadContainer.addEventListener(\"dragenter\", (e: DragEvent) => this.handleDrag(e))\n this.uploadContainer.addEventListener(\"dragleave\", (e: DragEvent) => this.handleDrag(e))\n this.uploadContainer.addEventListener(\"dragover\", (e: DragEvent) => e.preventDefault())\n this.uploadContainer.addEventListener(\"drop\", (e: DragEvent) => this.handleDrop(e))\n }\n\n removeEventListeners() {\n this.uploadInput.removeEventListener(\"input\", (e: InputEvent) => this.handleInput(this.uploadInput))\n this.uploadContainer.removeEventListener(\"dragenter\", (e: DragEvent) => this.handleDrag(e))\n this.uploadContainer.removeEventListener(\"dragleave\", (e: DragEvent) => this.handleDrag(e))\n this.uploadContainer.removeEventListener(\"dragover\", (e: DragEvent) => e.preventDefault())\n this.uploadContainer.removeEventListener(\"drop\", (e: DragEvent) => this.handleDrop(e))\n }\n\n setContainerStatus(status: string = null) {\n let label = this.uploadContainer.querySelector(\".file-uploader--label\")\n\n if (status === null) {\n label.classList.remove(\"file-uploader--label__error\", \"file-uploader--label__active\")\n }\n\n if (status === \"active\") {\n label.classList.add(\"file-uploader--label__active\")\n }\n\n if (status === \"error\") {\n label.classList.add(\"file-uploader--label__error\")\n }\n }\n\n updateLabel(label: string) {\n this.label = label\n super.requestUpdate()\n }\n\n updateBlobID(value: string) {\n this.blobInput.focus()\n this.blobInput.value = value\n this.blobInput.blur()\n }\n\n setFileName(file: File) {\n this.uploaderProgress.textContent = file.name\n }\n\n handleProgressIndication() {\n if (this.uploaderProgress.classList.contains(\"uploaded\")) {\n this.uploaderProgress.classList.remove(\"uploaded\")\n }\n this.selectedFileContainer.classList.remove(\"hidden\")\n this.uploaderProgress.classList.add(\"active\")\n }\n\n endProgressIndication() {\n let uploaderProgress = document.querySelector(\".file-uploader--file-name\") as HTMLElement\n uploaderProgress.classList.remove(\"active\")\n uploaderProgress.classList.add(\"uploaded\")\n }\n\n handleDrag(e: DragEvent) {\n if (e.type === \"dragenter\") {\n this.setContainerStatus(\"active\")\n } else if (e.type === \"dragleave\") {\n this.setContainerStatus()\n }\n }\n\n handleDrop(e: DragEvent) {\n e.preventDefault()\n e.stopPropagation()\n let dt = e.dataTransfer\n let files = dt.files\n this.uploadInput.files = files\n if (files.length > 1) {\n this.handleError(`Multiple files detected. Please upload a single file.`)\n } else {\n let file = files[0]\n this.handleFile(file)\n }\n }\n\n handleInput(uploadInput: HTMLInputElement) {\n let files = uploadInput.files\n if (files.length > 1) {\n this.handleError(`Multiple files detected. Please upload a single file.`)\n } else {\n let file = files[0]\n this.handleFile(file)\n }\n }\n\n handleFile(file: File) {\n let upload: DirectUpload\n let fileExtension = file.name.split(\".\")[file.name.split(\".\").length - 1]\n\n if (!file) {\n return\n }\n\n if (file.size / 1024 > this.allowedSize) {\n return this.handleError(`Sorry files larger than ${this.allowedSize / 1024} MB are not allowed.`)\n }\n\n if (!this.allowedTypes.find(t => t === fileExtension)) {\n return this.handleError(\n `Sorry, ${fileExtension.toUpperCase()} files are not allowed. Allowed include (${this.types.toUpperCase().split(\",\").join(\", \")})`\n )\n }\n\n upload = new DirectUpload(file, this.directUploadUrl)\n this.setFileName(file)\n\n if (upload) {\n this.handleProgressIndication()\n this.uploadingFile = true\n upload.create((error, blob) => {\n if (error) {\n this.uploadingFile = false\n this.handleError(error)\n } else {\n this.uploadingFile = false\n this.endProgressIndication()\n this.updateBlobID(blob.id)\n this.updateUploadedFiles(upload)\n refreshVisibleFields()\n }\n })\n }\n }\n\n handleError(error: string) {\n let ogLabel = this.label\n this.setContainerStatus(\"error\")\n this.updateLabel(error)\n setTimeout(() => {\n this.updateLabel(ogLabel)\n this.setContainerStatus()\n }, 3000)\n }\n\n updateUploadedFiles(upload: DirectUpload) {\n this.setContainerStatus()\n this.file = upload.file\n super.requestUpdate()\n }\n\n removeUploadedFile() {\n if (this.uploadingFile) {\n return\n }\n this.updateBlobID(\"\")\n this.uploadInput.value = \"\"\n this.uploaderProgress.classList.remove(\"uploaded\")\n this.selectedFileContainer.classList.add(\"hidden\")\n }\n}\n","import { LitElement, html, css } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { refreshVisibleFields } from \"../utils/utils\"\n\nconst FOCUSABLE_ELEMENTS = [\n \"a[href]\",\n \"area[href]\",\n \"input:not([disabled]):not([type='hidden']):not([hidden]):not([aria-hidden]):not(.hidden)\",\n \"select:not([disabled]):not([aria-hidden]):not([hidden]):not(.hidden)\",\n \"textarea:not([disabled]):not([aria-hidden]):not([hidden]):not(.hidden)\",\n \"button:not([disabled]):not([aria-hidden]):not([hidden]):not(.hidden)\",\n \"iframe\",\n \"object\",\n \"embed\",\n \"[contenteditable]\",\n '[tabindex]:not([tabindex^=\"-\"])'\n].toString()\n\nconst WEB_COMPONENTS_TO_SEARCH_FOR = [\"kin-datepicker\", \"kin-date-input-mask\", \"kin-autocomplete\"].toString()\n\n/* NOTE: THIS IS THE OLD MODAL.\n *\n * Kin Modal Template:\n * \n *

Modal Header!

\n *
\n *

I'm a modal body!

\n *

I like things!

\n *
\n *
\n * \n *
\n *
\n *\n * There's also a ruby helper for this:\n *\n * = kin_modal :id do\n *\n * Open the modal by creating a button with an onClick event that calls:\n * -- this is a reference to the button so we can focus it when the modal closes #accessibility\n * -- id is the HTML ID that the modal has on , should be namespaced with \"modal__\"\n * = open_modal 'Text', id: id\n *\n * Close the modal by creating a button with an onClick event that calls:\n * = close_modal 'Text', id: id\n */\n\n@customElement(\"kin-modal\")\nexport class ModalComponent extends LitElement {\n @property() escapable: boolean = true\n @property() id: string\n @property() active: boolean = false\n returnElement: HTMLElement = document.body\n focusableElements: Element[] = []\n scrollPosition: number\n onOpenEvent: CustomEvent\n onCloseEvent: CustomEvent\n\n connectedCallback() {\n super.connectedCallback()\n this.active = false\n }\n\n static get styles() {\n // TODO: rename CSS namespace to \"modal\" after modals have been replaced.\n return css`\n .k-modal {\n display: none;\n }\n\n .k-modal.is-active {\n display: block;\n }\n\n .k-modal__overlay {\n position: fixed;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, 0.4);\n z-index: 100000;\n }\n\n .k-modal__content {\n position: fixed;\n left: 50vw;\n top: 50vh;\n max-height: calc(100% - 6em);\n z-index: 100013;\n background-color: #fff;\n min-width: 40em;\n max-width: 45em;\n box-shadow: 0 4px 12px rgba(33, 33, 33, 0.56);\n display: flex;\n flex-direction: column;\n flex: 0 1 auto;\n transform: translateX(-50%) translateY(-50%);\n }\n\n .k-modal__content__header__close {\n position: absolute;\n top: 4px;\n right: 4px;\n }\n\n .k-modal__content__header__close button {\n -webkit-appearance: none;\n appearance: none;\n border: 0;\n background: transparent;\n width: 44px;\n height: 44px;\n }\n\n .k-modal__content__header__close .n-icon {\n width: 16px;\n height: 16px;\n }\n\n .k-modal__content__body {\n flex: 0 1 auto;\n max-height: calc(100% - 72px);\n height: 100%;\n overflow-x: hidden;\n overflow-y: auto;\n }\n\n .k-modal__content__body--allow-overflow {\n overflow: visible;\n }\n .k-modal__content > div:not(.k-modal__content__footer--empty) {\n padding: 1em 2em;\n }\n\n .k-modal__content__body__footer {\n margin-top: 2em;\n }\n\n .k-modal .sr-only {\n position: absolute !important;\n height: 1px;\n width: 1px;\n overflow: hidden;\n clip: rect(1px 1px 1px 1px); /* IE6, IE7 */\n clip: rect(1px, 1px, 1px, 1px);\n white-space: nowrap; /* added line */\n }\n\n @media screen and (max-width: 42em) {\n .k-modal__content {\n left: 0;\n top: 0;\n transform: none;\n width: 100vw;\n height: 100vh;\n max-height: 100%;\n min-width: 100%;\n max-width: 100%;\n }\n }\n `\n }\n\n render() {\n return html`\n
\n
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n `\n }\n\n public open(e?: HTMLElement) {\n document.body.classList.add(\"has-open-modal\")\n this.focusableElements = this.getFocusableElements()\n\n this.addEventListeners()\n\n this.active = true\n this.returnElement = e || document.body\n\n this.focusFirstElement()\n\n setTimeout(() => {\n this.onOpenEvent = new CustomEvent(\"kin-modal:open\", {\n bubbles: true,\n detail: { id: this.id }\n })\n this.dispatchEvent(this.onOpenEvent)\n this.refreshFormValidation()\n })\n }\n\n public close() {\n this.active = false\n\n this.removeEventListeners()\n\n setTimeout(() => {\n this.refreshFormValidation()\n\n this.onCloseEvent = new CustomEvent(\"kin-modal:close\", {\n bubbles: true,\n detail: { id: this.id }\n })\n this.dispatchEvent(this.onCloseEvent)\n })\n\n this.returnElement.focus()\n document.body.classList.remove(\"has-open-modal\")\n }\n\n public addEventListeners() {\n this.addEventListener(\"keydown\", e => this.handleKey(e))\n this.addEventListener(\"kin-modal:overflow\", (e: CustomEvent) => this.allowOverflow(e.detail))\n }\n\n public removeEventListeners() {\n this.removeEventListener(\"keydown\", e => this.handleKey(e))\n this.removeEventListener(\"kin-modal:overflow\", (e: CustomEvent) => this.allowOverflow(e.detail))\n }\n\n allowOverflow(detail: { allow: boolean }) {\n if (detail === undefined || detail === null) return\n\n if (detail.allow === true) {\n this.shadowRoot.querySelector(\".k-modal__content__body\").classList.add(\"k-modal__content__body--allow-overflow\")\n }\n\n if (detail.allow === false) {\n this.shadowRoot.querySelector(\".k-modal__content__body\").classList.remove(\"k-modal__content__body--allow-overflow\")\n }\n }\n\n focusFirstElement() {\n setTimeout(() => {\n const close = this.shadowRoot.querySelector(\".k-modal__content__header__close button\")\n ;(close as HTMLElement).focus()\n })\n }\n\n // TODO: Abstract this away from ModalComponent\n refreshFormValidation() {\n if (this.querySelector(\"kin-form-validation\")) {\n refreshVisibleFields(this)\n } else if (this.closest(\"form\") && this.closest(\"form\").querySelector(\"kin-form-validation\")) {\n refreshVisibleFields(this.closest(\"form\"))\n }\n }\n\n handleKey(e: KeyboardEvent) {\n if (e.key === \"Tab\") {\n this.handleTab(e)\n }\n if (e.key === \"Escape\" && this.escapable) {\n this.close()\n }\n }\n\n handleTab(e: KeyboardEvent) {\n if (this.focusableElements.length === 0 || this.updated) {\n this.focusableElements = this.getFocusableElements()\n }\n\n // Necessary due to Shadow DOM not entirely giving us the item we want.\n const path = e.composedPath()\n\n // Exclude the custom element itself, since we don't need that in a modal implementation.\n const src = path.find(e => this.id && (e as HTMLElement).tagName !== \"KIN-MODAL\")\n if (src) {\n const index = this.focusableElements.indexOf(src as HTMLElement)\n if (index === this.focusableElements.length - 1 && !e.shiftKey) {\n e.preventDefault()\n ;(this.focusableElements[0] as HTMLElement).focus()\n }\n if (index < this.focusableElements.length - 1 && !e.shiftKey) {\n e.preventDefault()\n ;(this.focusableElements[index + 1] as HTMLElement).focus()\n }\n if (index < this.focusableElements.length - 1 && e.shiftKey && index !== 0) {\n e.preventDefault()\n ;(this.focusableElements[index - 1] as HTMLElement).focus()\n }\n if (index === 0 && e.shiftKey) {\n e.preventDefault()\n ;(this.focusableElements[this.focusableElements.length - 1] as HTMLElement).focus()\n }\n }\n }\n\n getFocusableElements(): Element[] {\n // Due to LitElement's implementation, we have to look both within the custom\n // element AND within the Shadow DOM to get all applicable elements\n let focusable: Element[] = [this.shadowRoot.querySelector(\".k-modal__content__header__close button\")]\n\n let slots = this.shadowRoot.querySelectorAll(\"slot\")\n slots.forEach(e => {\n let elements = e.assignedElements()\n\n if (elements.length === 1) {\n focusable = focusable.concat(Array.from(elements[0].querySelectorAll(FOCUSABLE_ELEMENTS)))\n }\n\n if (elements.length === 0 && e.name === \"footer\") {\n this.shadowRoot.querySelector(\".k-modal__content__footer\").classList.add(\"k-modal__content__footer--empty\")\n }\n })\n\n let possibleChildren = this.querySelectorAll(WEB_COMPONENTS_TO_SEARCH_FOR)\n\n // Account for other possible web components and their respective Shadow DOMs\n // NOTE: We don't need to account for those that don't have Shadow DOMs, as they\n // are already picked up by the above methods.\n // TODO: Abstract this somehow to alleviate need for ModalComponent to do this work.\n possibleChildren.forEach(child => {\n if (child.shadowRoot) {\n focusable = focusable.concat(Array.from(child.shadowRoot.querySelectorAll(FOCUSABLE_ELEMENTS)))\n }\n })\n\n // Remove invisible elements\n focusable = focusable.filter(el => el.getClientRects().length !== 0)\n\n // We have to filter out the custom element itself since it comes up in the above search.\n if (focusable.indexOf(this)) {\n focusable = focusable.filter(el => el.id !== this.id)\n }\n\n // Sort the things!\n focusable.sort(function (a, b) {\n if (a === b) return 0\n if (a.compareDocumentPosition(b) & 2) {\n // b comes before a\n return 1\n }\n return -1\n })\n\n return focusable\n }\n}\n","import { LitElement } from \"lit\"\nimport { customElement } from \"lit/decorators.js\"\n\n@customElement(\"kin-toggle\")\nexport class ToggleComponent extends LitElement {\n active: boolean = false\n toggleTrigger: HTMLElement\n toggleBody: HTMLElement\n\n createRenderRoot() {\n return this\n }\n\n firstUpdated() {\n document.addEventListener(\"click\", (e: Event) => this.handleClick(e))\n document.addEventListener(\"focusout\", (e: Event) => {\n let src = e.composedPath()\n if (!src.find(el => el === this)) {\n this.handleClick(e)\n }\n })\n\n setTimeout(() => {\n this.toggleTrigger = this.querySelector(\"[data-toggle-trigger]\")\n this.toggleBody = this.querySelector(\"[data-toggle-body]\")\n this.toggleTrigger.setAttribute(\"aria-haspopup\", \"true\")\n this.toggleTrigger.setAttribute(\"aria-expanded\", \"false\")\n }, 5)\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n\n document.removeEventListener(\"click\", (e: Event) => this.handleClick(e))\n document.addEventListener(\"focusout\", (e: Event) => {\n let src = e.composedPath()\n if (!src.find(el => el === this)) {\n this.handleClick(e)\n }\n })\n }\n\n handleClick(e: Event) {\n let src = e.composedPath()\n\n if (src.find(el => el === this)) {\n this.toggle()\n } else {\n this.hide()\n }\n }\n\n toggle() {\n if (this.active) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n this.active = true\n this.toggleTrigger.setAttribute(\"aria-expanded\", \"true\")\n this.toggleBody.classList.add(\"is-active\")\n }\n\n hide() {\n this.active = false\n this.toggleTrigger.setAttribute(\"aria-expanded\", \"false\")\n this.toggleBody.classList.remove(\"is-active\")\n }\n}\n","import { LitElement } from \"lit\"\nimport { customElement, query } from \"lit/decorators.js\"\n@customElement(\"kin-password-toggle\")\nexport class PasswordToggleComponent extends LitElement {\n active: boolean = false\n @query(\"[data-pw-toggle-input]\") toggleInput: HTMLElement\n @query(\"[data-pw-toggle-trigger]\") toggleTrigger: HTMLElement\n\n createRenderRoot() {\n return this\n }\n\n async firstUpdated() {\n await new Promise(resolve => setTimeout(resolve, 0))\n this.toggleTrigger.addEventListener(\"click\", (e: Event) => this.handleClick(e))\n }\n\n disconnectedCallback() {\n if (this.toggleTrigger) {\n this.toggleTrigger.removeEventListener(\"click\", (e: Event) => this.handleClick(e))\n }\n super.disconnectedCallback()\n }\n\n handleClick(e: Event) {\n e.preventDefault()\n this.toggle()\n }\n\n toggle() {\n this.active ? this.hidePassword() : this.showPassword()\n }\n\n showPassword() {\n this.active = true\n this.toggleTrigger.classList.add(\"active\")\n this.toggleInput.setAttribute(\"type\", \"text\")\n }\n\n hidePassword() {\n this.active = false\n this.toggleTrigger.classList.remove(\"active\")\n this.toggleInput.setAttribute(\"type\", \"password\")\n }\n}\n","export function checkRelatedRadios(form: HTMLFormElement, element: HTMLInputElement) {\n return Array.from(form.querySelectorAll(`[name=\"${element.name}\"]`)).find((f: HTMLInputElement) => f.checked === true)\n}\n\n// checkCheckboxGroup searches for a containing element with the class '.checkbox--group' and then see's how many checkbox inputs are checked and returns the nodelist\n\nexport function checkCheckboxGroup(form: HTMLFormElement) {\n let checkboxGroup = form.querySelector(\".checkbox--group\")\n let checked = checkboxGroup.querySelectorAll(`input:checked`)\n return checked\n}\n","import { FormField, FormError } from \"./utils\"\nimport { CONSTANTS } from \"./constants\"\nimport { checkRelatedRadios } from \"../utilities/input\"\nimport { checkCheckboxGroup } from \"../utilities/input\"\nimport * as ccValidator from \"card-validator\"\nimport { CardNumberVerification } from \"card-validator/dist/card-number\"\n\nexport function validateInputLength(f: FormField, validationType: string): FormError {\n let field = f.field as HTMLInputElement\n const formError = { type: validationType, message: f.message || \"The value does not match the length required.\" }\n\n return field.value.length < field.minLength ? formError : null\n}\n\nexport function validateInputPattern(f: FormField, validationType: string): FormError {\n let field = f.field as HTMLInputElement\n const formError = { type: validationType, message: f.message || \"The input provided does not match expectations.\" }\n\n return field.validity.patternMismatch ? formError : null\n}\n\nexport function validateEmail(f: FormField, validationType: string): FormError {\n let field = f.field as HTMLInputElement\n const pattern = RegExp(CONSTANTS.emailPattern)\n\n const formError = { type: validationType, message: f.message || \"Please enter a valid e-mail address.\" }\n\n if (field.value !== \"\") {\n // We use more than just field.validity due to our more restrictive email requirements.\n return field.validity.valid && pattern.test(field.value) ? null : formError\n } else {\n return null\n }\n}\n\nexport function validateRequiredField(f: FormField, validationType: string): FormError {\n const formError = { type: validationType, message: f.message || \"This field is required.\" }\n\n if (\n (f.field instanceof HTMLInputElement || f.field instanceof HTMLTextAreaElement) &&\n f.field.dataset.component !== \"multiple-autocomplete\"\n ) {\n return f.field.value.length === 0 ? formError : null\n } else if (f.field instanceof HTMLSelectElement) {\n if (f.field.multiple) {\n return f.field.selectedOptions.length === 0 ? formError : null\n } else {\n return f.field.value.length === 0 ? formError : null\n }\n } else {\n return null\n }\n}\n\nexport function validateRadioButton(f: FormField, validationType: string): FormError {\n const formError = { type: validationType, message: f.message || \"This field is required.\" }\n\n let notChecked = checkRelatedRadios(f.field.form, f.field as HTMLInputElement)\n\n return notChecked ? null : formError\n}\n\nexport function validateCheckboxGroup(f: HTMLFormElement, validationType: string): FormError {\n const formError = { type: validationType, message: f.message || \"At least one checkbox must be selected\" }\n\n return checkCheckboxGroup(f).length > 0 ? null : formError\n}\n\nexport function validateMinMax(f: FormField, validationType: string): FormError {\n let field = f.field as HTMLInputElement\n let min = field.min || null\n let max = field.max || null\n\n if (max !== null && Number.parseFloat(field.value) > Number.parseFloat(max)) {\n return { type: validationType, message: \"The input is higher than the maximum allows.\" }\n } else if (min !== null && Number.parseFloat(field.value) < Number.parseFloat(min)) {\n return { type: validationType, message: \"The input is lower than the minimum allows.\" }\n } else {\n return null\n }\n}\n\nexport function validateNumericMinValue(f: FormField, validationType: string): FormError {\n let minValue = f.field.dataset.validateNumericRangeMin\n let value = f.field.value.replace(/[^0-9.]/g, \"\")\n\n const formError = { type: validationType, message: f.message || \"The input supplied is lower than accepted.\" }\n\n return Number.parseFloat(minValue) > Number.parseFloat(value) ? formError : null\n}\n\nexport function validateNumericMaxValue(f: FormField, validationType: string): FormError {\n let maxValue = f.field.dataset.validateNumericRangeMax\n let value = f.field.value.replace(/[^0-9.]/g, \"\")\n\n let formError = { type: validationType, message: f.message || \"The input supplied is higher than accepted.\" }\n\n return Number.parseFloat(maxValue) < Number.parseFloat(value) ? formError : null\n}\n\nexport function validateTelephoneNumber(f: FormField, validationType: string): FormError {\n const formError = { type: validationType, message: f.message || \"The phone number entered is not valid.\" }\n let phonePattern = RegExp(CONSTANTS.phonePattern)\n\n return phonePattern.test(f.field.value) ? null : formError\n}\n\n// This uses Braintree's Card Validator (https://github.com/braintree/card-validator)\nexport function validateCreditCardField(f: FormField, validationType: string): FormError | String {\n let value = f.field.value\n const formError = { type: validationType, message: f.message || \"This is not a valid credit card.\" }\n\n let creditCard: CardNumberVerification = ccValidator.number(value)\n\n return creditCard.isValid ? null : formError\n}\n\nexport function validateTextAsNumeric(f: FormField, validationType: string): FormError {\n let numericDigits = new RegExp(/^\\d+$/)\n const formError = { type: validationType, message: f.message || \"The value must only contain numeric digits.\" }\n\n return numericDigits.test(f.field.value) ? null : formError\n}\n\nexport function validateMatchingField(f: FormField, matchingField: FormField, validationType: string): FormError {\n let formError = { type: validationType, message: f.message || \"This does not match the associated field's input.\" }\n\n return f.field.value === matchingField.field.value ? null : formError\n}\n","import { FormField, FormError } from \"./utils\"\nimport { accountForUTC, checkDate, padMonth, includesDate } from \"../utilities/date\"\n\nexport function validateDate(f: FormField, validationType: string): FormError {\n let formError = { type: validationType, message: \"This is not a valid date.\" }\n\n if ((f.field as HTMLInputElement).valueAsDate) {\n return checkDate((f.field as HTMLInputElement).valueAsDate) ? null : formError\n } else {\n return checkDate(f.field.value) ? null : formError\n }\n}\n\nexport function validateDateWithinRange(f: FormField, validationType: string) {\n let value = new Date(f.field.value)\n\n let formError = { type: validationType, message: f.message || \"The date provided is not within the range required.\" }\n\n if (value instanceof Date) {\n return f.options.minDate <= value && value <= f.options.maxDate ? null : formError\n } else {\n return formError\n }\n}\n\nexport function validateDateNotDisallowedDate(f: FormField, validationType: string): FormError {\n let value = new Date(f.field.value)\n\n let formError = { type: validationType, message: f.message || \"The date provided is disallowed.\" }\n\n if (value instanceof Date) {\n return !includesDate(f.options.disallowedDatesParsed, value) ? null : formError\n } else {\n return formError\n }\n}\n\nexport function validateMinimumAge(f: FormField, validationType: string): FormError {\n let value = new Date(f.field.value)\n let age = Number.parseInt(f.field.dataset.validateMinAge.valueOf())\n let date = new Date()\n let birthYear = date.getFullYear() - age\n\n let formError = { type: validationType, message: f.message || `Age of applicant must be older than ${age}.` }\n\n date.setFullYear(birthYear)\n\n return value > date ? formError : null\n}\n\nexport function validateMaximumAge(f: FormField, validationType: string): FormError {\n let value = new Date(f.field.value)\n let age = Number.parseInt(f.field.dataset.validateMaxAge.valueOf())\n let date = new Date()\n let birthYear = date.getFullYear() - age\n\n let formError = { type: validationType, message: f.message || `Age of applicant must be younger than ${age}.` }\n\n date.setFullYear(birthYear)\n\n return value < date ? formError : null\n}\n\nexport function validateMinDate(f: FormField, validationType: string): FormError {\n let value = new Date(f.field.value)\n let minDate = f.options?.minDate || new Date()\n\n let formError = { type: validationType, message: f.message || `The date entered is earlier than what is accepted.` }\n\n return accountForUTC(value) < accountForUTC(minDate) ? formError : null\n}\n\nexport function validateMaxDate(f: FormField, validationType: string): FormError {\n let value = new Date(f.field.value)\n let maxDate = f.options?.maxDate || new Date()\n\n let formError = { type: validationType, message: f.message || `The date entered is later than what is accepted.` }\n\n return accountForUTC(value) > accountForUTC(maxDate) ? formError : null\n}\n\nexport function validateMinimumYear(f: FormField, validationType: string): FormError {\n let value = f.field.value\n let minYear = f.field.dataset.validateMinYear\n\n let formError = { type: validationType, message: f.message || `The year supplied is earlier than what is accepted.` }\n\n return value < minYear ? formError : null\n}\n\nexport function validateMaximumYear(f: FormField, validationType: string): FormError {\n let value = f.field.value\n let maxYear = f.field.dataset.validateMaxYear\n\n let formError = { type: validationType, message: f.message || `The year supplied is later than what is accepted.` }\n\n return value > maxYear ? formError : null\n}\n\nexport function validateMinMonthYear(f: FormField, validationType: string): FormError {\n let value = f.field.value.split(\"/\")\n let valueAsDate = accountForUTC(new Date())\n let minDate = f.options.minDate ? f.options.minDate : accountForUTC(new Date())\n let formError = { type: validationType, message: f.message || \"The month and year supplied are not valid.\" }\n\n if (parseInt(value[0]) === 0) {\n return formError\n }\n\n let validInput =\n value[0].length === 2 && parseInt(value[0]) < 13 && value[1].length === 4 && parseInt(value[0]) < minDate.getFullYear() + 30\n\n if (validInput) {\n valueAsDate.setDate(1)\n valueAsDate.setFullYear(parseInt(value[1]))\n valueAsDate.setMonth(parseInt(value[0]) - 1)\n\n if (valueAsDate.getFullYear() > minDate.getFullYear()) {\n return null\n } else if (valueAsDate.getFullYear() === minDate.getFullYear()) {\n if (valueAsDate.getMonth() >= minDate.getMonth()) {\n return null\n } else {\n return formError\n }\n }\n\n return formError\n } else {\n return formError\n }\n}\n\nexport function validateMinMonthYearSet(month: string, year: string, validationType: string, message?: string): FormError {\n const monthPadded = padMonth(month)\n let valueAsDate = accountForUTC(new Date())\n let minDate = accountForUTC(new Date())\n let formError = { type: validationType, message: message || \"The month and year supplied are not valid.\" }\n\n if (parseInt(monthPadded) === 0) {\n return formError\n }\n\n let validInput =\n monthPadded.length === 2 && parseInt(monthPadded) < 13 && year.length === 4 && parseInt(year) < minDate.getFullYear() + 30\n\n if (validInput) {\n valueAsDate.setDate(1)\n valueAsDate.setFullYear(parseInt(year))\n valueAsDate.setMonth(parseInt(monthPadded) - 1)\n\n if (valueAsDate.getFullYear() > minDate.getFullYear()) {\n return null\n } else if (valueAsDate.getFullYear() === minDate.getFullYear()) {\n if (valueAsDate.getMonth() >= minDate.getMonth()) {\n return null\n } else {\n return formError\n }\n }\n\n return formError\n } else {\n return formError\n }\n}\n","import { FormField, FormError } from \"./utils\"\nimport * as ccValidator from \"card-validator\"\nimport { CardNumberVerification } from \"card-validator/dist/card-number\"\n\nexport function detectCreditCardInformation(f: FormField, validationType: string): FormError {\n let value = f.field.value\n\n /* This regex matches the following:\n * - Any number from 13 to 19 digits long\n * - Any string with:\n * - 4 numbers\n * - 1 symbol/space\n * - 4-6 numbers\n * - 1 symbol/space\n * - 4-5 numbers\n * - 1 symbol/space\n * - 4-5 numbers\n * - OR any string with:\n * - 4 numbers\n * - 1 symbol/space\n * - 4-6 numbers\n * - 1 symbol/space\n * - 4-5 numbers\n *\n * All of the above conditions are evaluated on the value of the field by the Credit Card Validator,\n * and if found to be a \"valid\" credit card number, is returned to the Form Validation Component\n * without the number included anymore.\n */\n let matches = value.matchAll(\n /(\\d{13,19}|\\d{4}([^a-zA-Z]|\\s)\\d{4,6}([^a-zA-Z]|\\s)\\d{4,5}([^a-zA-Z]|\\s)\\d{4,5}|\\d{4}([^a-zA-Z]|\\s)\\d{4,6}([^a-zA-Z]|\\s)\\d{4,5})/g\n )\n let validations: CardNumberVerification[] = []\n let results: string[] = []\n\n if (matches) {\n Array.from(matches).forEach(match => {\n let validator = ccValidator.number(match[0])\n if (validator.card !== undefined && validator.isValid) {\n validations.push(validator)\n results.push(match[0])\n }\n })\n }\n\n const formError = {\n type: validationType,\n message:\n \"PII Warning: Credit card number found and removed.
If you feel that this was not PII (such as a number similar to a credit card), please inform #production-support.\"\n }\n\n // If the Credit Card Validator finds a result (or results), remove them from the field value.\n if (results) {\n results.forEach(result => {\n f.field.value = f.field.value.replace(result, \"\")\n })\n }\n\n return results.length > 0 ? formError : null\n}\n","import { LitElement } from \"lit\"\nimport { customElement } from \"lit/decorators.js\"\nimport {\n validateInputLength,\n validateInputPattern,\n validateRequiredField,\n validateEmail,\n validateCreditCardField,\n validateMatchingField,\n validateMinMax,\n validateTelephoneNumber,\n validateNumericMinValue,\n validateNumericMaxValue,\n validateRadioButton,\n validateCheckboxGroup,\n validateTextAsNumeric\n} from \"./validators/input\"\nimport {\n validateDate,\n validateMinimumAge,\n validateMaxDate,\n validateMaximumAge,\n validateDateWithinRange,\n validateDateNotDisallowedDate,\n validateMinDate,\n validateMinimumYear,\n validateMaximumYear,\n validateMinMonthYear,\n validateMinMonthYearSet\n} from \"./validators/date\"\nimport { InputElement, FormField, FormError } from \"./validators/utils\"\nimport { mask } from \"./display/mask\"\nimport { accountForUTC, parseDates } from \"./utilities/date\"\nimport { checkRelatedRadios, checkCheckboxGroup } from \"./utilities/input\"\nimport { detectCreditCardInformation } from \"./validators/pii\"\nimport { AutocompleteComponent } from \"../autocomplete/autocomplete\"\n\n// These are .querySelector() strings that correspond to form fields.\nconst FORM_FIELDS = [\n \"input:not([type=hidden]):not([type=submit]):not(.hidden)\",\n \"select:not(.sr-only):not(.hidden)\",\n \"textarea:not(.sr-only):not(.hidden):not([hidden])\"\n].toString()\n\n/*\n * Kin Form Validation\n *\n * Usage:\n * tag.\n * OR\n * Use validated_form_with or validated_form_for instead of form_with and form_for\n *\n */\n\n@customElement(\"kin-form-validation\")\nexport class FormValidationComponent extends LitElement {\n fields: FormField[] = []\n form: HTMLFormElement\n public submit: HTMLInputElement | HTMLButtonElement\n onChangeEvent: CustomEvent\n validationReadyEvent: CustomEvent\n submitApprovedEvent: CustomEvent\n globalError: HTMLDivElement\n pauseValidation: boolean = false\n\n // we need a reference to the callback so we can remove it with removeEventListener\n private callbacks = {\n dialogVisibility: () => {\n this.findFields()\n }\n }\n\n /*\n * createRenderRoot()\n * LitElement method\n *\n * Specifies a different place to put the element.\n *\n * Using \"return this\" disables Shadow DOM usage, which is good when you do not want to have to pierce through the Shadow DOM.\n *\n */\n createRenderRoot() {\n return this\n }\n\n /*\n * connectedCallback()\n * Web Component Spec / LitElement lifecycle method\n *\n * Runs when the element has been attached to the DOM.\n *\n */\n connectedCallback() {\n super.connectedCallback()\n\n // This setTimeout is necessary for now due to timings of connectedCallback() between different LitElements.\n // TODO: Manage timing.\n setTimeout(() => {\n if (this.closest(\"form\")) {\n this.form = this.closest(\"form\")\n if (this.form.querySelector('[type=\"submit\"]')) {\n this.submit = this.form.querySelector('[type=\"submit\"]')\n } else {\n this.submit = null\n }\n } else {\n // If no form found, do not engage.\n return\n }\n\n if (this.form) {\n this.findFields()\n }\n\n if (this.form.querySelector(\".checkbox--group\") && checkCheckboxGroup(this.form).length === 0) {\n this.submit.disabled = true\n }\n }, 5)\n }\n\n /*\n * disconnectedCallback()\n * Web Component Spec / LitElement lifecycle method\n *\n * Runs right before the element is detached from the DOM.\n *\n */\n disconnectedCallback() {\n super.disconnectedCallback()\n this.removeEventListeners()\n }\n\n /*\n * findFields()\n * This method looks for all applicable form fields within the form (this.form) and sets its Form Validation attributes accordingly.\n *\n * Invoked:\n * - when Form Validation is initialized\n * - when an external script calls triggerRefresh()\n *\n * Requires:\n * - a form to be defined with this.form\n *\n */\n findFields() {\n if (!this.form) {\n return\n }\n\n // TODO: Make this more common.\n if (this.submit === null) {\n if (this.form.querySelector('[type=\"submit\"]')) {\n this.submit = this.form.querySelector('[type=\"submit\"]')\n } else {\n this.submit = null\n }\n }\n\n this.fields = []\n\n this.form.querySelectorAll(FORM_FIELDS).forEach((element: InputElement, i: number) => {\n this.fields.push({ field: element, errors: [], valid: false, options: {} })\n\n element.setCustomValidity(\"\")\n\n // Not assuming prefilled values are correct.\n if (\n ((element.value && element.type !== \"radio\" && !element.dataset.validateCheckbox) ||\n (element.dataset.validateCheckbox && (element as HTMLInputElement).checked)) &&\n (!this.isAutocomplete(element) || (this.isAutocomplete(element) && element.disabled === true))\n ) {\n this.fields[i].valid = true\n this.fields[i].dirty = true\n }\n\n if (element.dataset.skipValidation === \"true\") {\n this.fields[i].valid = true\n this.fields[i].dirty = false\n }\n\n if (element.required && element.value.length === 0 && element.disabled === false) {\n this.fields[i].valid = false\n }\n\n if (element.type === \"radio\") {\n let relatedElements = checkRelatedRadios(this.form, element as HTMLInputElement)\n\n if (element.required && element.type === \"radio\" && (element as HTMLInputElement).checked === false && !relatedElements) {\n this.fields[i].valid = false\n } else {\n this.fields[i].valid = true\n }\n }\n\n if ((!element.required && element.value.length === 0) || element.disabled === true) {\n this.fields[i].valid = true\n }\n })\n\n if (!this.closest(\"details\")) {\n // Remove invisible fields\n this.fields = this.fields.filter(f => f.field.getClientRects().length !== 0)\n }\n\n this.runPreValidation()\n this.initiateComponentEventListeners()\n\n if (this.fields.filter(f => f.dirty).length > 0) {\n this.verifyFieldValidity()\n } else {\n this.verifyValidity()\n }\n\n this.validationReadyEvent = new CustomEvent(\"kin-form-validation:ready\", {\n bubbles: true,\n detail: { validationElement: this }\n })\n this.dispatchEvent(this.validationReadyEvent)\n }\n\n /*\n * initiateComponentEventListeners()\n * In order to interact with our other LitElements, this method creates event listeners for the events our other LitElements send out.\n *\n * More Information:\n * - Search for events in autocomplete.ts, remote-autocomplete.ts, datepicker.ts, or date-input-mask.ts\n *\n * Event Name Paradigm:\n * - :, such as kin-autocomplete:change\n *\n * Invoked:\n * - when Form Validation is initialized (via findFields())\n * - when findFields() is called\n *\n */\n initiateComponentEventListeners() {\n if (this.form) {\n this.form.addEventListener(\"kin-form-validation:triggerRefresh\", () => this.triggerRefresh())\n }\n\n if (this.form && this.fields) {\n let autocompleteFields = this.fields.filter(f => f.field.closest(\"kin-autocomplete, kin-remote-autocomplete\"))\n let datePickerFields = this.fields.filter(f => f.field.closest(\"kin-date-input-mask\"))\n\n autocompleteFields.forEach(field => {\n field.customValidator = true\n if (field.field.disabled) {\n field.valid = true\n }\n this.form.addEventListener(\"kin-autocomplete:change\", (e: CustomEvent) => {\n field.dirty = true\n if (field.field.id.includes(e.detail.id)) {\n this.handleAutocompleteField(field, e)\n }\n })\n })\n\n datePickerFields.forEach(field => {\n document.addEventListener(\"kin-datepicker:change\", (e: CustomEvent) => {\n if (field.field.id.includes(e.detail.id)) {\n field.dirty = true\n this.handleDirtyField(field)\n }\n })\n })\n\n const hasDialogDescendant = this.form.querySelector(\"kin-dialog\") ? true : false\n if (hasDialogDescendant) {\n this.form.addEventListener(\"kin-dialog-show\", this.callbacks.dialogVisibility)\n this.form.addEventListener(\"kin-dialog-hide\", this.callbacks.dialogVisibility)\n }\n }\n\n this.initiateEventListeners()\n }\n\n /*\n * initiateEventListeners()\n * We attach event listeners to each field that has been recognized as an applicable field by findFields()\n *\n * Invoked:\n * - when Form Validation is initialized (via findFields())\n * - when findFields() is called\n *\n */\n initiateEventListeners() {\n if (this.submit) {\n this.submit.addEventListener(\"click\", e => this.handleOnSubmit(e))\n this.form.addEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.key && e.key === \"Enter\") {\n this.handleOnSubmit(e)\n }\n })\n }\n\n this.fields.forEach((f: FormField) => {\n if (!f.customValidator) {\n f.field.addEventListener(\"invalid\", (e: Event) => this.handleInvalid(f), true)\n f.field.addEventListener(\"input\", (e: InputEvent) => this.handleInput(f, true, e))\n f.field.addEventListener(\"change\", e => this.handleDirtyField(f))\n f.field.addEventListener(\n \"focus\",\n (e: FocusEvent) => {\n // if (f.field.dataset.validateCurrency) {\n // ;(f.field as HTMLInputElement).selectionStart = (f.field as HTMLInputElement).selectionEnd\n // }\n f.dirty = true\n },\n true\n )\n\n if (f.field.dataset.validatePiiCompliance) {\n f.field.addEventListener(\"blur\", e => this.handlePII(f))\n } else {\n f.field.addEventListener(\"blur\", e => this.handleDirtyField(f))\n }\n\n if (this.form.querySelector(\".checkbox--group\")) {\n let checkboxGroup = this.form.querySelector(\".checkbox--group\")\n let checkboxes = checkboxGroup.querySelectorAll('input[type=\"checkbox\"]')\n\n checkboxes.forEach((checkbox: HTMLInputElement) => {\n checkbox.addEventListener(\"change\", e => this.handleCheckboxGroup(checkbox))\n })\n }\n }\n })\n }\n\n /*\n * removeComponentEventListeners()\n * To be memory efficient, we must remove event listeners from each item that we've added one to.\n *\n * Invoked:\n * - when form validation is removed from the page (via refresh, page navigation, etc) via disconnectedCallback()\n * - when triggerRefresh() is called\n *\n */\n removeComponentEventListeners() {\n if (this.form) {\n this.form.removeEventListener(\"kin-form-validation:triggerRefresh\", () => this.triggerRefresh())\n this.form.removeEventListener(\"keydown\", (e: KeyboardEvent) => {\n if (e.key && e.key === \"Enter\") {\n this.handleOnSubmit(e)\n }\n })\n }\n\n if (this.form && this.fields) {\n let autocompleteFields = this.fields.filter(f => f.field.closest(\"kin-autocomplete, kin-remote-autocomplete\"))\n let datePickerFields = this.fields.filter(f => f.field.closest(\"kin-date-input-mask\"))\n\n autocompleteFields.forEach(field => {\n this.form.removeEventListener(\"kin-autocomplete:change\", (e: CustomEvent) => {\n field.dirty = true\n if (field.field.id.includes(e.detail.id)) {\n this.handleAutocompleteField(field, e)\n }\n })\n })\n\n datePickerFields.forEach(field => {\n document.removeEventListener(\"kin-datepicker:change\", (e: CustomEvent) => {\n if (field.field.id.includes(e.detail.id)) {\n field.dirty = true\n this.handleDirtyField(field)\n }\n })\n })\n\n const hasDialogDescendant = this.form.querySelector(\"kin-dialog\") ? true : false\n if (hasDialogDescendant) {\n this.form.removeEventListener(\"kin-dialog-show\", this.callbacks.dialogVisibility)\n this.form.removeEventListener(\"kin-dialog-hide\", this.callbacks.dialogVisibility)\n }\n }\n }\n\n /*\n * removeEventListeners()\n * Remove field-specific event listeners to avoid memory leaks.\n *\n * Invoked:\n * - when form validation is removed from the page (via refresh, page navigation, etc) via disconnectedCallback()\n * - when triggerRefresh() is called\n *\n */\n removeEventListeners() {\n this.removeComponentEventListeners()\n if (this.submit) {\n this.submit.removeEventListener(\"click\", e => this.handleOnSubmit(e))\n }\n\n this.fields.forEach((f: FormField) => {\n if (!f.customValidator) {\n f.field.removeEventListener(\"change\", e => this.handleDirtyField(f))\n f.field.removeEventListener(\"invalid\", (e: Event) => this.handleInvalid(f), true)\n f.field.removeEventListener(\"input\", (e: InputEvent) => this.handleInput(f, true, e))\n if (f.field.dataset.validatePiiCompliance) {\n f.field.removeEventListener(\"blur\", e => this.handlePII(f))\n } else {\n f.field.removeEventListener(\"blur\", e => this.handleDirtyField(f))\n }\n f.field.removeEventListener(\n \"focus\",\n (e: FocusEvent) => {\n // if (f.field.dataset.validateCurrency) {\n // ;(f.field as HTMLInputElement).selectionStart = (f.field as HTMLInputElement).selectionEnd\n // }\n f.dirty = true\n },\n true\n )\n }\n })\n }\n\n /*\n * verifyValidity()\n * Check to make sure form is valid and manage submit button state.\n *\n * Invoked:\n * - when initializing Form Validation\n * - when triggerRefresh() is called\n * - when verifyFieldValidity() is called\n * - when a user inputs, changes, or blurs from a field via handleInput(), handleError(), or handleSuccess()\n *\n */\n verifyValidity() {\n if (this.pauseValidation) {\n return\n }\n\n if (this.submit !== null) {\n if (!this.valid) {\n this.submit.disabled = true\n } else {\n this.clearFormErrors()\n this.submit.disabled = false\n }\n }\n\n if (this.valid !== null) {\n this.onChangeEvent = new CustomEvent(\"kin-form-validation:change\", {\n bubbles: true,\n detail: { fields: this.fields, form: { valid: this.valid, element: this.form, validationElement: this } }\n })\n this.dispatchEvent(this.onChangeEvent)\n }\n }\n\n /*\n * runPreValidation()\n * When setting up form validation, there are a few assumptions we can make, such as adding a mask to a telephone field, datepicker, setting maxlengths, etc.\n *\n * Invoked:\n * - when initializing Form Validation\n * - when triggerRefresh() is called\n *\n */\n runPreValidation() {\n // Prep the form for masking, etc.\n this.fields.forEach(f => {\n if (f.field.type === \"tel\") {\n let field = f.field as HTMLInputElement\n field.minLength = 14\n field.maxLength = 14\n field.inputMode = \"tel\"\n f.options.noAlpha = true\n field.placeholder = \"(000) 000-0000\"\n field.value = f.field.value.replace(\"+1 \", \"\")\n field.value = f.field.value.replace(\"+1\", \"\")\n this.handleMasking(f)\n }\n\n if (f.field.dataset.validateMinAge || f.field.dataset.validateMaxAge) {\n f.field.autocomplete = \"bday\" as AutoFill\n }\n\n if (f.field.dataset.validateCreditCard) {\n f.field.autocomplete = \"cc-number\"\n }\n\n let dateQualifiers =\n f.field.type === \"date\" ||\n f.field.dataset.validateDate ||\n f.field.dataset.validateMinAge ||\n f.field.dataset.validateMaxAge ||\n f.field.dataset.validateMaxDate ||\n f.field.dataset.validationRange\n\n if (dateQualifiers) {\n let field = f.field as HTMLInputElement\n field.inputMode = \"decimal\"\n }\n\n if (this.isAutocomplete(f.field)) {\n this.handleAutocompleteField(f)\n }\n\n if (f.field.dataset.validateCurrency) {\n //this.handleCurrency(f)\n }\n })\n }\n\n /*\n * verifyFieldValidity()\n * This function manually checks the validity of each field by running all form validation functions on each field,\n * reporting its status, and handles form status.\n *\n * Invoked:\n * - when initializing Form Validation\n * - when the submit button is clicked\n * - when triggerRefresh() is called\n *\n */\n verifyFieldValidity() {\n if (this.pauseValidation) {\n return\n }\n\n this.fields.forEach(f => {\n if (f.field.dataset.validatePiiCompliance) {\n this.handlePII(f)\n }\n this.handleBlur(f)\n\n this.handleInput(f, false)\n\n // Since we do this in handleDirtyField() but don't want to call handleDirtyField() here, we will do this here for now.\n // TODO: DRY up minimum length errors.\n if (\n (f.field.type === \"text\" || \"tel\") &&\n (f.field as HTMLInputElement).minLength > 0 &&\n (f.field as HTMLInputElement).required &&\n !this.isDatepicker(f.field)\n ) {\n this.handleValidation(f, \"MinimumLengthError\", validateInputLength)\n }\n })\n\n if (this.submit) {\n this.verifyValidity()\n }\n }\n\n /*\n * handleOnSubmit()\n * Function that verifies the form is ready to be submitted when the submit button is clicked.\n *\n * Invoked:\n * - when the submit button is clicked.\n *\n */\n handleOnSubmit(e: Event) {\n if (this.pauseValidation) {\n return\n }\n\n if (e.isTrusted) {\n // Discern between CustomEvent thrown below and normal Submit Event\n // TODO: Propose page level error area to activate upon submit fail.\n this.verifyFieldValidity()\n }\n\n if (!this.valid) {\n e.stopPropagation()\n e.preventDefault()\n\n setTimeout(() => this.displayGlobalError(\"The form is not valid. Please try again.\"), 200)\n }\n }\n\n /*\n * handleInvalid()\n * Handles an invalid field when the event listener \"invalid\" happens.\n *\n * Invoked:\n * - when the \"invalid\" event happens on a field.\n *\n */\n handleInvalid(f: FormField) {\n f.field.setCustomValidity(\"\")\n f.dirty = true\n this.handleInput(f)\n this.handleBlur(f)\n }\n /*\n * handleCheckboxGroup()\n * Handles a group of checkboxes where at least one checkbox must be selected\n *\n * Invoked:\n * - When the \"change\" event happens on a checkbox field inside an checkbox group\n *\n */\n handleCheckboxGroup(f: HTMLInputElement) {\n if (!this.isCheckboxGroup(f)) {\n return\n }\n if (checkCheckboxGroup(f.form).length > 0) {\n this.submit.disabled = false\n } else {\n validateCheckboxGroup(f.form, \"CheckboxRequiredError\")\n this.submit.disabled = true\n }\n }\n /*\n * handleAutocompleteField()\n * Handles an autocomplete field's validity when the kin-autocomplete:change event happens\n *\n * Invoked:\n * - when kin-autocomplete:change event fires.\n *\n */\n handleAutocompleteField(f: FormField, e?: CustomEvent) {\n if (!this.isAutocomplete(f.field)) {\n return\n }\n\n if (e) {\n let eventFieldId = `${e.detail.id}__input`\n\n if (e.detail && eventFieldId === f.field.id && e.detail.consideredValid) {\n this.handleDirtyField(f)\n this.verifyFieldValidity()\n return\n }\n } else {\n let autocomplete = f.field.closest(\"kin-autocomplete, kin-remote-autocomplete\") as AutocompleteComponent\n if (autocomplete.consideredValid) {\n f.valid = true\n f.dirty = false\n this.verifyFieldValidity()\n return\n } else {\n this.handleDirtyField(f)\n }\n }\n }\n\n /*\n * handleCurrency()\n * Masks currency field with $xx,xxx\n *\n * Invoked:\n * - not currently used.\n *\n */\n handleCurrency(f: FormField) {\n let selectionStart = (f.field as HTMLInputElement).selectionStart\n let digits = Number(f.field.dataset.validateCurrencyDigits) || 2\n if (f.field.value.length !== 0 && f.field.value.lastIndexOf(\".\") !== f.field.value.length - 1) {\n f.field.value = Number(f.field.value.replace(/[^0-9.]/g, \"\")).toLocaleString(\"en-US\", {\n style: \"currency\",\n currency: \"USD\",\n minimumFractionDigits: 0,\n maximumFractionDigits: digits\n })\n if (selectionStart !== f.field.value.length - 1) {\n ;(f.field as HTMLInputElement).selectionEnd = selectionStart\n }\n }\n }\n\n /*\n * handleDirtyField()\n * Handles validation of a field when a field is \"blurred\" by the user (i.e. clicked away from, focused away from)\n *\n * Invoked:\n * - when the \"blur\" or \"change\" event happens on a field.\n *\n */\n handleDirtyField(f: FormField, e?: InputEvent | KeyboardEvent) {\n if (this.pauseValidation) {\n return\n }\n\n if (f.externalValidity && f.field.dataset.mask) {\n this.handleMasking(f)\n }\n\n if (f.field.dataset.validatePiiCompliance) {\n this.handlePII(f)\n }\n\n if (f.dirty) {\n let fieldType = f.field.type === \"text\" || \"tel\" ? true : false\n\n // We do this here instead of in handleInput() because if the field isn't filled and has minlength,\n // it will be fine to show only minlength error first.\n if (\n fieldType &&\n f.field.required &&\n (f.field as HTMLInputElement).minLength &&\n f.field.value.length <= (f.field as HTMLInputElement).minLength\n ) {\n this.handleValidation(f, \"MinimumLengthError\", validateInputLength)\n }\n\n if ((f.field as HTMLInputElement) && f.field.type === \"radio\" && f.field.required === true) {\n this.handleValidation(f, \"RadioButtonRequiredError\", validateRadioButton)\n }\n\n this.handleBlur(f)\n this.handleInput(f, false)\n return\n }\n\n if (!f.dirty && f.field.required && f.field.value.length === 0 && this.submit !== null) {\n this.submit.disabled = true\n }\n\n this.handleBlur(f)\n\n f.dirty = true\n this.handleInput(f, false)\n }\n\n /*\n * handleBlur()\n * Specific handlers for only blur events.\n *\n * Invoked:\n * - when the \"blur\" event happens on a field.\n *\n */\n handleBlur(f: FormField) {\n if (f.field.type === \"email\") {\n this.handleValidation(f, \"InvalidEmailError\", validateEmail)\n }\n }\n\n /*\n * handleMasking()\n * Is in charge of handling a field with a mask on it.\n *\n * Invoked:\n * - when a masked field's value changes.\n *\n */\n handleMasking(f: FormField) {\n if ((f.field as HTMLInputElement).selectionStart !== f.field.value.length) {\n mask(f, (f.field as HTMLInputElement).selectionStart, false)\n } else {\n mask(f, null, false)\n }\n }\n\n /*\n * handlePII()\n * Handles issues with PII-specific fields with the `data-validate-pii` attribute.\n *\n * Invoked:\n * - when a field with `data-validate-pii` attribute changes.\n *\n */\n handlePII(f: FormField) {\n let result = detectCreditCardInformation(f, \"PIICreditCardError\")\n result ? this.displayGlobalError(result.message, \"warning\") : null\n }\n\n /*\n * handleInput()\n * Handles a field changed by the user to validate the input.\n *\n * Invoked:\n * - on initialization of Form Validation\n * - in verifyFieldValidity()\n * - in handleDirtyField()\n * - in handleBlur()\n *\n */\n handleInput(f: FormField, clearErrors: boolean = true, e?: InputEvent | KeyboardEvent) {\n if (\n (!f.dirty && !f.field.dataset.validateOnInput) ||\n (f.field.type === \"checkbox\" && !f.field.dataset.validateCheckbox) ||\n f.externalValidity ||\n f.field.dataset.skipValidation === \"true\" ||\n this.pauseValidation\n ) {\n return\n }\n\n this.clearGlobalError()\n if (clearErrors) {\n f.errors = []\n }\n\n if (f.field.dataset.validationMessage) {\n // Set field-wide validation message\n f.message = f.field.dataset.validationMessage\n }\n\n if (f.field.required) {\n this.handleValidation(f, \"EmptyRequiredFieldError\", validateRequiredField)\n }\n\n if (f.field.type === \"checkbox\" && f.field.dataset.validateCheckbox) {\n let validationType = \"RequiredCheckboxError\"\n let formError = { type: validationType, message: \"To continue, you need to agree.\" }\n ;(f.field as HTMLInputElement).checked ? this.handleSuccess(f, validationType) : this.handleError(f, formError)\n }\n\n if (f.field instanceof HTMLInputElement && f.field.value.length > 0) {\n if (f.field.pattern) {\n this.handleValidation(f, \"InputPatternError\", validateInputPattern)\n }\n\n if (f.field.dataset.validateOnInput) {\n if (f.field.dataset.validateOnInput === \"email\") {\n this.handleValidation(f, \"InvalidEmailError\", validateEmail)\n }\n }\n\n if (f.field.max || f.field.min) {\n this.handleValidation(f, \"MinMaxError\", validateMinMax)\n }\n\n if (f.field.type === \"tel\") {\n f.options.mask = \"(000) 000-0000\"\n this.handleMasking(f)\n\n if (f.field.value.length === 14) {\n this.handleValidation(f, \"InvalidTelephoneError\", validateTelephoneNumber)\n }\n }\n }\n\n if (f.field instanceof (HTMLInputElement || HTMLTextAreaElement) && f.field.value.length > 0) {\n if (f.field.dataset.mask && f.field.type !== \"tel\") {\n f.options.mask = f.field.dataset.mask\n\n this.handleMasking(f)\n }\n\n // TODO: Need to format currency similarly to how we format phone number. This currently does not work.\n if (f.field.dataset.validateCurrency) {\n //this.handleCurrency(f)\n }\n\n // Match two fields' inputs together, such as a password / confirm password field.\n if (f.field.dataset.validateCompareField) {\n let validationType = \"FieldMatchError\"\n let matchingField = this.fields.find(field => field.field.id === f.field.dataset.validateCompareField)\n let result = validateMatchingField(f, matchingField, validationType)\n\n result ? this.handleError(f, result) : this.handleSuccess(f, validationType)\n }\n\n // All Date-like fields\n let dateQualifiers =\n f.field.type === \"date\" ||\n f.field.dataset.validateDate ||\n f.field.dataset.validateMinAge ||\n f.field.dataset.validateMaxAge ||\n f.field.dataset.validateMaxDate ||\n f.field.dataset.validationRange ||\n f.field.dataset.validateDateNotDisallowedDate\n\n if (dateQualifiers) {\n f.field.maxLength = 10\n f.field.minLength = 10\n if (new Date(f.field.value) instanceof Date && f.field.value.length === 10) {\n this.handleValidation(f, \"InvalidDateError\", validateDate)\n }\n }\n\n if (f.field.dataset.validateMinAge) {\n if (new Date(f.field.value) instanceof Date && f.field.value.length === 10) {\n this.handleValidation(f, \"MinimumAgeError\", validateMinimumAge)\n }\n }\n\n if (f.field.dataset.validateMaxAge) {\n if (new Date(f.field.value) instanceof Date && f.field.value.length === 10) {\n this.handleValidation(f, \"MaximumAgeError\", validateMaximumAge)\n }\n }\n\n if (f.field.dataset.validateMinDate && !f.field.dataset.validateRange) {\n if (new Date(f.field.value) instanceof Date && f.field.value.length === 10) {\n f.options.minDate = new Date(f.field.dataset.validateMinDate)\n this.handleValidation(f, \"MinDateError\", validateMinDate)\n }\n }\n\n if (f.field.dataset.validateMaxDate && !f.field.dataset.validateRange) {\n if (new Date(f.field.value) instanceof Date && f.field.value.length === 10) {\n f.options.maxDate = new Date(f.field.dataset.validateMaxDate)\n this.handleValidation(f, \"MaxDateError\", validateMaxDate)\n }\n }\n\n if (f.field.dataset.validateMinYear) {\n if (new Date(f.field.value) instanceof Date && f.field.value.length === 4) {\n this.handleValidation(f, \"MinimumYearError\", validateMinimumYear)\n }\n }\n\n if (f.field.dataset.validateMaxYear) {\n if (new Date(f.field.value) instanceof Date && f.field.value.length === 4) {\n this.handleValidation(f, \"MaximumYearError\", validateMaximumYear)\n }\n }\n\n if (f.field.dataset.validateRange && f.field.value.length === 10) {\n // The .replace() methods are for IE 11 compatibility. https://stackoverflow.com/a/26977768\n f.options.minDate = new Date(f.field.dataset.validateMinDate.replace(/[^ -~]/g, \"\"))\n f.options.maxDate = new Date(f.field.dataset.validateMaxDate.replace(/[^ -~]/g, \"\"))\n this.handleValidation(f, \"DateRangeError\", validateDateWithinRange)\n }\n\n if (f.field.dataset.validateNotDisallowedDate && f.field.value.length === 10) {\n let disallowedDatesRaw\n\n try {\n disallowedDatesRaw = JSON.parse(f.field.dataset.validateDisallowedDates)\n } catch (e) {\n return\n }\n\n f.options.disallowedDatesParsed = parseDates(disallowedDatesRaw)\n\n this.handleValidation(f, \"DateDisallowedError\", validateDateNotDisallowedDate)\n }\n\n // More information: https://github.com/braintree/card-validator\n if (f.field.dataset.validateCreditCard) {\n // Properly deal with American Express cards\n if (f.field.value.startsWith(\"34\") || f.field.value.startsWith(\"37\")) {\n f.field.dataset.mask = \"0000 000000 00000\"\n f.field.maxLength = 17\n if (f.field.value.length === 17) {\n this.handleValidation(f, \"CreditCardValidityError\", validateCreditCardField)\n }\n } else {\n f.field.dataset.mask = \"0000 0000 0000 0000\"\n f.field.maxLength = 19\n if (f.field.value.length === 19) {\n this.handleValidation(f, \"CreditCardValidityError\", validateCreditCardField)\n }\n }\n }\n\n // For use in fields that desire MM/YYYY such as credit card validation\n if (f.field.dataset.validateMinMonthYear) {\n f.field.minLength = 7\n f.field.maxLength = 7\n f.options.minDate = accountForUTC(new Date(f.field.dataset.validateMinMonthYear))\n f.options.minDate.setDate(1) // Set to beginning of month\n\n if (f.field.value.length === 7) {\n this.handleValidation(f, \"MinMonthYearError\", validateMinMonthYear)\n } else {\n this.handleValidation(f, \"MinimumLengthError\", validateInputLength)\n }\n }\n\n // When you cannot use a number field (or don't want to because of browser-specific additions),\n // you can use input type=\"text\" and validate as numeric.\n if (f.field.dataset.validateTextAsNumeric) {\n this.handleValidation(f, \"NaNError\", validateTextAsNumeric)\n }\n\n // This is for text fields that hold numeric values, such as currency, etc.\n if (f.field.dataset.validateNumericRangeMin) {\n let validationLength = f.field.dataset.validateNumericRangeMin.length\n\n if (f.field.value.length >= validationLength) {\n this.handleValidation(f, \"NumericValueMinError\", validateNumericMinValue)\n }\n }\n\n // This is for text fields that hold numeric values, such as currency, etc.\n if (f.field.dataset.validateNumericRangeMax) {\n let validationLength = f.field.dataset.validateNumericRangeMax.length\n\n if (f.field.value.length >= validationLength) {\n this.handleValidation(f, \"NumericValueMaxError\", validateNumericMaxValue)\n }\n }\n\n // This is here specifically when data-validate-strict is set to \"true\"\n if ((f.field.type === \"text\" || \"tel\") && (f.field as HTMLInputElement).minLength && f.field.dataset.validateStrict) {\n this.handleValidation(f, \"MinimumLengthError\", validateInputLength)\n }\n }\n\n // Check that at least one field in the named group passes validateRequiredField\n if (f.field.dataset.requiredNonEmptyGroup) {\n const fieldGroupName = f.field.dataset.requiredNonEmptyGroup\n const fieldGroup = this.fields.filter(ff => ff.field.dataset.requiredNonEmptyGroup === fieldGroupName)\n\n const validationType = \"RequiredNonEmptyGroupError\"\n\n // Guilty until proven innocent:\n // Begin with non-null result, reduce over fieldGroup\n let result = {\n type: validationType,\n message: f.field.dataset.requiredNonEmptyGroupMessage || \"At least one of these fields is required.\"\n }\n fieldGroup.forEach(ff => {\n result = validateRequiredField(ff, validationType) && result\n })\n\n if (result) {\n fieldGroup.forEach(ff => this.handleError(ff, result))\n } else {\n fieldGroup.forEach(ff => this.handleSuccess(ff, validationType))\n }\n\n fieldGroup.forEach(ff => this.handleErrorState(ff))\n }\n\n // Used to validate two separate select boxes inputs for month and year.\n if (f.field instanceof HTMLSelectElement && f.field.value.length > 0) {\n if (f.field.dataset.validateMonthYearSet) {\n const identifier = f.field.dataset.validateMonthYearSet\n const matchingPair = this.fields.filter(field => field.field.dataset.validateMonthYearSet === identifier)\n const monthField = matchingPair.find(field => field.field.dataset.validateMonthYearSetType === \"month\")\n const yearField = matchingPair.find(field => field.field.dataset.validateMonthYearSetType === \"year\")\n const message = monthField.field.dataset.validateMonthYearSetMessage || yearField.field.dataset.validateMonthYearSetMessage\n\n if (monthField.dirty && yearField.dirty) {\n const result = validateMinMonthYearSet(monthField.field.value, yearField.field.value, \"MinMonthYearSetError\", message)\n\n if (result) {\n ;[monthField, yearField].forEach(field => {\n this.handleError(field, result)\n })\n } else {\n ;[monthField, yearField].forEach(field => {\n this.handleSuccess(field, \"MinMonthYearSetError\")\n })\n }\n\n ;[monthField, yearField].forEach(field => {\n this.handleErrorState(field)\n })\n }\n }\n }\n }\n\n /*\n * handleValidation()\n * Handles a field changed by the user to validate the input.\n *\n * Invoked:\n * - in any area where we are invoking a validation function\n *\n */\n handleValidation(f: FormField, validationType: string, validationFunction: Function) {\n let result: FormError = validationFunction(f, validationType)\n result ? this.handleError(f, result) : this.handleSuccess(f, validationType)\n this.handleErrorState(f)\n }\n\n /*\n * handleError()\n * Adds an error to the errors array of a field.\n *\n * Invoked:\n * - in any area where we are invoking a validation function and the result is not good.\n *\n */\n handleError(f: FormField, result: FormError) {\n if (!f.errors.find(e => e.type === result.type)) {\n f.valid = false\n f.errors.push(result)\n }\n this.verifyValidity()\n }\n\n /*\n * handleSuccess()\n * Removes the error that was present when the validation condition has been met.\n *\n * Invoked:\n * - in any area where we are invoking a validation function and the result is good.\n *\n */\n handleSuccess(f: FormField, type?: string) {\n f.valid = true\n if (type) {\n f.errors = f.errors.filter(e => e.type !== type)\n }\n this.verifyValidity()\n }\n\n /*\n * public triggerRefresh()\n * Allows an external script to refresh this.fields on the form validation and \"refresh\" the validated fields.\n *\n * Why?\n * If we add, remove or change the state of a field (possibly to disabled or not disabled) then we need to refresh the form validation in order to accurately validate the correct fields.\n *\n */\n public triggerRefresh() {\n this.removeEventListeners()\n this.findFields()\n this.verifyFieldValidity()\n }\n\n /*\n * public triggerFieldRefresh()\n * Allows an external script to refresh a certain field\n *\n * @params id: HTML ID of the field desired to be refreshed.\n *\n * Why?\n * If we add, remove or change the state of a field (possibly to disabled or not disabled) then we need to refresh the form validation in order to accurately validate the correct fields.\n *\n */\n public triggerFieldRefresh(id: string) {\n if (!id) {\n return\n }\n\n let field = this.fields.find(f => f.field.id === id)\n this.handleDirtyField(field)\n }\n\n /*\n * public disableForm()\n * Allows an external script to disable all of the fields controlled by the form validation as well as the submit button\n *\n */\n public disableForm() {\n setTimeout(() => {\n this.fields.forEach(f => {\n if (f.field.disabled === false) {\n f.field.disabled = true\n f.options.disabledByUser = true\n }\n })\n this.submit.disabled = true\n })\n }\n\n /*\n * public enableForm()\n * Allows an external script to disable all of the fields controlled by the form validation as well as the submit button\n *\n */\n public enableForm() {\n setTimeout(() => {\n this.fields.forEach(f => {\n f.options.disabledByUser ? (f.field.disabled = false) : null\n f.options.disabledByUser = null\n })\n this.submit.disabled = false\n })\n }\n\n // This will not work with kin-modal, but will with kin-view-modal due to ShadowRoot traversing\n\n /*\n * public disableSubmit()\n * Allows an external script to disable all of the fields controlled by the form validation as well as the submit button\n *\n * @params message - a message to be shown in a gloabl error box if desired.\n *\n * NOTE:\n * This will not work with kin-modal, but will with kin-view-modal due to ShadowRoot traversing\n *\n */\n public disableSubmit(message?: string) {\n this.submit.disabled = true\n this.pauseValidation = true\n\n if (message) {\n this.displayGlobalError(message)\n super.requestUpdate()\n }\n }\n\n /*\n * public enableSubmit()\n * Allows an external script to enable all of the fields controlled by the form validation and enable validation again.\n * *\n * NOTE:\n * This will not work with kin-modal, but will with kin-view-modal due to ShadowRoot traversing\n *\n */\n public enableSubmit() {\n this.pauseValidation = false\n this.submit.disabled = false\n this.verifyValidity()\n this.form.querySelectorAll(\"[data-form-validation-error]\").forEach(f => f.remove())\n\n super.requestUpdate()\n }\n\n // This maps to this.valid, which is a way to tell if the form is valid or not based upon the validations.\n get valid() {\n return this.fields.find(f => f.valid === false) ? false : true\n }\n\n /*\n * public throwError()\n * Allows an external script to externally validate and throw an error on a field.\n *\n * @params id - HTML ID of the field\n * @params error - in type FormError to display the error\n * @params errorsParent (optional) - a way to specify another HTML Element to display the error in.\n *\n */\n public throwError(id: string, error: FormError, errorsParent?: string) {\n let field = this.fields.find(f => f.field.id === id)\n\n if (field && error) {\n // Clear duplicate errors\n field.errors = field.errors.filter(e => e.type !== error.type)\n field.valid = false\n field.externalValidity = true\n field.errors.push(error)\n this.handleError(field, error)\n this.handleErrorState(field, false, errorsParent)\n }\n }\n\n /*\n * public clearError()\n * Allows an external script to clear an externally thrown error.\n *\n * @params id - HTML ID of the field\n * @params errorsParent (optional) - a way to specify another HTML Element to display the error in.\n *\n */\n public clearError(id: string, errorsParent?: string) {\n let field = this.fields.find(f => f.field.id === id)\n\n if (field) {\n field.valid = true\n field.errors = []\n field.externalValidity = false\n this.handleSuccess(field)\n this.handleErrorState(field, false, errorsParent)\n }\n }\n\n /*\n * displayGlobalError()\n * Allows an external script to clear an externally thrown error.\n *\n * @params message - string containing the message desired.\n * @params type (default = \"error\") - Type of error (either \"warning\" or \"error\")\n *\n * TODO: Make Alert its own LitElement at some point :)\n *\n */\n displayGlobalError(message: string, type: string = \"error\") {\n this.form.querySelectorAll(\"[data-form-validation-error]\").forEach(f => f.remove())\n this.globalError = document.createElement(\"div\")\n this.globalError.setAttribute(\"role\", \"alert\")\n if (type === \"error\") {\n this.globalError.classList.add(\"alert\", \"alert--error\")\n } else if (type === \"warning\") {\n this.globalError.classList.add(\"alert\", \"alert--general\")\n }\n this.globalError.dataset.formValidationError = \"true\"\n let errorMessage = document.createElement(\"span\")\n errorMessage.innerHTML = message\n errorMessage.classList.add(\"alert__content\", \"vr\")\n this.globalError.appendChild(errorMessage)\n\n if (this.fields.length > 0) {\n if (this.fields[0].field.closest(\".k-modal__content__body\")) {\n this.fields[0].field.closest(\".k-modal__content__body\").prepend(this.globalError)\n } else {\n this.form.prepend(this.globalError)\n }\n }\n }\n\n /*\n * clearFormErrors()\n * Clears errors on the form. Helpful if there is a known issue with form validation or you want to reset the form.\n *\n */\n clearFormErrors() {\n this.fields.forEach(f => this.handleErrorState(f, true))\n }\n\n /*\n * clearGlobalError()\n * Clears the global error set by displayGlobalError()\n *\n */\n clearGlobalError() {\n this.form.querySelectorAll(\"[data-form-validation-error]\").forEach(f => f.remove())\n }\n\n /*\n * handleErrorState()\n * Handles the errors on each form field. Either displays the error, or removes it. Adds the errorsParent if necessary.\n *\n * @param f: FormField - the field in question.\n * @param skipVerify - doesn't run verifyValidity() if true\n * @param optionalParent (optional) - parent container in querySelector string form.\n *\n */\n handleErrorState(f: FormField, skipVerify = false, optionalParent?: string) {\n let parent = null\n if (optionalParent) {\n parent = this.form.querySelector(optionalParent)\n } else {\n parent = f.field.parentElement\n }\n\n if (f.errors.length > 0) {\n f.valid = false\n\n if (parent !== null) {\n parent.classList.add(\"is-error\")\n parent.classList.add(\"error-spacing\")\n }\n\n let errorsElement = document.createElement(\"span\")\n errorsElement.classList.add(\"errors\")\n errorsElement.id = f.field.id + \"__errors\"\n errorsElement.setAttribute(\"aria-live\", \"polite\")\n\n if (parent !== null && parent.querySelector(\".errors\")) {\n let errorsEl = parent.querySelector(\".errors\")\n parent.removeChild(errorsEl)\n parent.appendChild(errorsElement)\n } else {\n parent.appendChild(errorsElement)\n }\n\n // Only show the first error message\n let el = document.createElement(\"span\")\n el.classList.add(`errors-1`)\n el.textContent = f.errors[0].message\n\n f.field.setAttribute(\"aria-describedby\", errorsElement.id)\n\n errorsElement.appendChild(el)\n } else {\n f.valid = true\n\n f.field.setAttribute(\"aria-describedby\", \"\")\n\n if (f.field.type === \"radio\") {\n Array.from(this.form.querySelectorAll(`[name=\"${f.field.name}\"]`)).forEach((f: HTMLElement) => {\n let element = this.fields.find((itemizedField: FormField) => itemizedField.field === f)\n\n element.valid = true\n })\n }\n }\n\n if (f.valid && parent !== null) {\n if (parent.querySelector(\".errors\")) {\n let errorsEl = parent.querySelector(\".errors\")\n errorsEl.remove()\n }\n parent.classList.remove(\"is-error\")\n parent.classList.remove(\"error-spacing\")\n }\n\n if (!skipVerify) {\n this.verifyValidity()\n }\n }\n\n /*\n * isAutocomplete()\n * Returns whether the element in question is part of a kin-autocomplete / kin-remote-autocomplete\n *\n */\n isAutocomplete(element: HTMLElement): boolean {\n return element.closest(\"kin-autocomplete\") || element.closest(\"kin-remote-autocomplete\") ? true : false\n }\n\n /*\n * isDatepicker()\n * Returns whether the element in question is part of a kin-date-input-mask (the input associated with a datepicker)\n *\n */\n isDatepicker(element: HTMLElement): boolean {\n return element.closest(\"kin-date-input-mask\") ? true : false\n }\n\n /*\n * isCheckboxGroup()\n * Returns whether the element in question is part of a checkbox group (the input inside the an element with .checkbox--group )\n *\n */\n isCheckboxGroup(element: HTMLElement): boolean {\n return element.closest(\".checkbox--group\") ? true : false\n }\n}\n","import { LitElement } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { refreshVisibleFields } from \"../utils/utils\"\n\nconst FOCUSABLE_ELEMENTS = [\n \"a[href]\",\n \"area[href]\",\n \"input:not([disabled]):not([type='hidden']):not([hidden]):not([aria-hidden]):not(.hidden)\",\n \"select:not([disabled]):not([aria-hidden]):not([hidden]):not(.hidden)\",\n \"textarea:not([disabled]):not([aria-hidden]):not([hidden]):not(.hidden)\",\n \"button:not([disabled]):not([aria-hidden]):not([hidden]):not(.hidden)\",\n \"iframe\",\n \"object\",\n \"embed\",\n \"[contenteditable]\",\n '[tabindex]:not([tabindex^=\"-\"])'\n].toString()\n\nconst WEB_COMPONENTS_TO_SEARCH_FOR = [\"kin-datepicker\", \"kin-date-input-mask\", \"kin-autocomplete\"].toString()\n\nexport type KinModalEvent = CustomEvent<{ id: string }>\n\n/*\n * This is the new modal, without a Shadow DOM\n *\n * Use this with the View Component Shared::UI::ModalComponent\n * Source: app/components/shared/ui/modal_component.rb\n *\n */\n@customElement(\"kin-view-modal\")\nexport class ModalViewComponent extends LitElement {\n @property({ type: Boolean }) locked: boolean = false\n @property() id: string\n @property({ type: Boolean }) active: boolean = false\n returnElement: HTMLElement = document.body\n focusableElements: Element[] = []\n scrollPosition: number\n onOpenEvent: CustomEvent\n onCloseEvent: CustomEvent\n\n createRenderRoot() {\n return this\n }\n\n connectedCallback() {\n super.connectedCallback()\n if (this.active) {\n this.makeActive(true)\n }\n }\n\n private get modalCloseEvent(): KinModalEvent {\n return new CustomEvent(\"kin-modal:close\", {\n bubbles: true,\n detail: { id: this.id }\n })\n }\n\n private get modalOpenEvent(): KinModalEvent {\n return new CustomEvent(\"kin-modal:open\", {\n bubbles: true,\n detail: { id: this.id }\n })\n }\n\n public open(e?: HTMLElement) {\n document.body.classList.add(\"has-open-modal\")\n this.focusableElements = this.getFocusableElements()\n\n this.addEventListeners()\n\n this.makeActive(true)\n this.returnElement = e || document.body\n\n this.focusFirstElement()\n\n setTimeout(() => {\n this.dispatchEvent(this.modalOpenEvent)\n this.refreshFormValidation()\n })\n }\n\n public close() {\n this.makeActive(false)\n\n this.removeEventListeners()\n\n setTimeout(() => {\n this.refreshFormValidation()\n this.dispatchEvent(this.modalCloseEvent)\n })\n\n this.returnElement.focus()\n document.body.classList.remove(\"has-open-modal\")\n }\n\n makeActive(active: boolean) {\n this.active = active\n\n if (active) {\n this.querySelector(\".k-modal\").classList.add(\"is-active\")\n } else {\n this.querySelector(\".k-modal\").classList.remove(\"is-active\")\n }\n }\n\n public addEventListeners() {\n this.addEventListener(\"keydown\", e => this.handleKey(e))\n this.addEventListener(\"kin-modal:overflow\", (e: CustomEvent) => this.allowOverflow(e.detail))\n this.addCloseModalEventListeners()\n }\n\n public addCloseModalEventListeners() {\n if (!this.locked) {\n this.querySelector(\"[data-modal-close]\").addEventListener(\"click\", e => {\n this.dispatchEvent(\n new CustomEvent(\"kin-modal:close-button-click\", {\n bubbles: true,\n detail: { id: this.id }\n })\n )\n this.close()\n })\n }\n }\n\n public removeEventListeners() {\n this.removeEventListener(\"keydown\", e => this.handleKey(e))\n this.removeEventListener(\"kin-modal:overflow\", (e: CustomEvent) => this.allowOverflow(e.detail))\n if (!this.locked) {\n this.querySelector(\"[data-modal-close]\").removeEventListener(\"click\", e => {\n this.close()\n })\n }\n }\n\n allowOverflow(detail: { allow: boolean }) {\n if (detail.allow) {\n this.querySelector(\".k-modal__content__body\").classList.add(\"k-modal__content__body--allow-overflow\")\n } else {\n this.querySelector(\".k-modal__content__body\").classList.remove(\"k-modal__content__body--allow-overflow\")\n }\n }\n\n focusFirstElement() {\n if (!this.locked) {\n setTimeout(() => {\n const close = this.querySelector(\".k-modal__content__header__close button\")\n ;(close as HTMLElement).focus()\n })\n } else {\n setTimeout(() => {\n const focusable = this.querySelector(FOCUSABLE_ELEMENTS)\n ;(focusable as HTMLElement).focus()\n })\n }\n }\n\n // TODO: Abstract this away from ModalComponent\n refreshFormValidation() {\n if (this.querySelector(\"kin-form-validation\")) {\n refreshVisibleFields(this)\n } else if (this.closest(\"form\") && this.closest(\"form\").querySelector(\"kin-form-validation\")) {\n refreshVisibleFields(this.closest(\"form\"))\n }\n }\n\n handleKey(e: KeyboardEvent) {\n if (e.key === \"Tab\") {\n this.handleTab(e)\n }\n if (e.key === \"Escape\" && !this.locked) {\n this.close()\n }\n }\n\n handleTab(e: KeyboardEvent) {\n if (this.focusableElements.length === 0 || this.updated) {\n this.focusableElements = this.getFocusableElements()\n }\n\n const path = e.composedPath()\n\n // Exclude the custom element itself, since we don't need that in a modal implementation.\n const src = path.find(e => this.id && (e as HTMLElement).tagName !== \"KIN-VIEW-MODAL\")\n\n if (src) {\n const index = this.focusableElements.indexOf(src as HTMLElement)\n if (index === this.focusableElements.length - 1 && !e.shiftKey) {\n e.preventDefault()\n ;(this.focusableElements[0] as HTMLElement).focus()\n }\n if (index < this.focusableElements.length - 1 && !e.shiftKey) {\n e.preventDefault()\n ;(this.focusableElements[index + 1] as HTMLElement).focus()\n }\n if (index < this.focusableElements.length - 1 && e.shiftKey && index !== 0) {\n e.preventDefault()\n ;(this.focusableElements[index - 1] as HTMLElement).focus()\n }\n if (index === 0 && e.shiftKey) {\n e.preventDefault()\n ;(this.focusableElements[this.focusableElements.length - 1] as HTMLElement).focus()\n }\n }\n }\n\n getFocusableElements(): Element[] {\n // Due to LitElement's implementation, we have to look both within the custom\n // element AND within the Shadow DOM to get all applicable elements\n let focusable: Element[] = this.locked ? [] : [this.querySelector(\".k-modal__content__header__close button\")]\n focusable = Array.from(this.querySelectorAll(FOCUSABLE_ELEMENTS))\n\n // Account for other possible web components and their respective Shadow DOMs\n let possibleChildren = this.querySelectorAll(WEB_COMPONENTS_TO_SEARCH_FOR)\n\n // NOTE: We don't need to account for those that don't have Shadow DOMs, as they\n // are already picked up by the above methods.\n // TODO: Abstract this somehow to alleviate need for ModalComponent to do this work.\n possibleChildren.forEach(child => {\n if (child.shadowRoot) {\n focusable = focusable.concat(Array.from(child.shadowRoot.querySelectorAll(FOCUSABLE_ELEMENTS)))\n }\n })\n // Remove invisible elements\n focusable = focusable.filter(el => el.getClientRects().length !== 0)\n // We have to filter out the custom element itself since it comes up in the above search.\n if (focusable.indexOf(this)) {\n focusable = focusable.filter(el => el.id !== this.id)\n }\n // Sort the things!\n focusable.sort(function (a, b) {\n if (a === b) return 0\n if (a.compareDocumentPosition(b) & 2) {\n // b comes before a\n return 1\n }\n return -1\n })\n return focusable\n }\n}\n","import { LitElement } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { format } from \"timeago.js\"\n\n/* This web component shows the time it is given in relative time (\"fuzzy time\") as adapted from https://github.com/hustcc/timeago.js\n * Usage:\n *\n * \n *\n * This component uses no styles, but rather will function simply like text, as in it inherits any styles given to it.\n */\n\n@customElement(\"kin-standard-time\")\nexport class StandardTimeComponent extends LitElement {\n @property() relative: boolean = true\n @property() timestamp: string = null\n formattedTimeStamp: string\n interval: any\n\n connectedCallback() {\n if (this.relative) {\n this.createInterval()\n }\n }\n\n updated() {\n clearInterval(this.interval)\n this.createInterval()\n }\n\n createRenderRoot() {\n return this\n }\n\n createInterval() {\n let time = this.getTimeAgo(this.timestamp)\n if (time.includes(\"just now\") || time.includes(\"second\")) {\n this.interval = setInterval(() => {\n this.updateTime()\n }, 1000)\n } else if (time.includes(\"minute\")) {\n this.interval = setInterval(() => {\n this.updateTime()\n }, 30000)\n } else if (time.includes(\"day\") || time.includes(\"week\") || time.includes(\"month\") || time.includes(\"year\")) {\n this.updateTime(false)\n super.requestUpdate()\n return\n }\n\n this.innerText = time\n\n this.title = new Date(this.timestamp.substring(0, this.timestamp.length - 6).replace(/-/g, \"/\")).toLocaleString()\n super.requestUpdate()\n }\n\n updateTime(relative: boolean = true) {\n let time = \"\"\n if (relative) {\n time = this.getTimeAgo(this.timestamp)\n } else {\n time = new Date(this.timestamp.substring(0, this.timestamp.length - 6).replace(/-/g, \"/\")).toLocaleString()\n }\n this.innerText = time\n super.requestUpdate()\n }\n\n get timeStamp() {\n return this.formattedTimeStamp\n }\n\n getTimeAgo(time: string) {\n return format(time)\n }\n}\n","import { LitElement, html, TemplateResult } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { Field, InputElement } from \"../validation/validators/utils\"\nimport { FormValidationComponent } from \"../validation/form-validation\"\nimport { AutocompleteComponent } from \"../autocomplete/autocomplete\"\nimport { until } from \"lit-html/directives/until.js\"\n\n// TODO: Create base class for MagicFormComponent and MagicFieldsetComponent to both inherit from\n// NOTE: This is not used anywhere and might have fallen behind magic-fieldset in terms of its feature set.\n@customElement(\"kin-magic-form\")\nexport class MagicFormComponent extends LitElement {\n @property() jsonUrl: string\n @property() data: string\n @property() action: string\n @property() method: string\n @property() formId: string\n @property() externalSubmit: boolean = false\n fields: Field[] = []\n formValidation: FormValidationComponent\n renderedFields: TemplateResult\n\n createRenderRoot() {\n return this\n }\n\n firstUpdated() {\n this.formValidation = this.querySelector(\"kin-form-validation\")\n\n if (this.externalSubmit) {\n this.formValidation.updateComplete.then(() => {\n setTimeout(() => {\n this.formValidation.submit = document.querySelector(`button[form=\"${this.formId}\"]`)\n this.formValidation.triggerRefresh()\n }, 5)\n })\n }\n }\n\n render() {\n if (this.data) {\n this.fields = JSON.parse(this.data)\n }\n return html`\n
\n \n ${this.fields.length === 0\n ? until(\n this.getThatJson(),\n setTimeout(() => {\n html`\n
\n Unfortunately, there was an error loading the dynamic form. Please mention this to your manager to be placed into\n #production-support.\n
\n `\n })\n )\n : html`\n
\n ${this.fields.map(item => {\n return html` ${this.buildMarkup(item)} `\n })}\n
\n `}\n ${this.externalSubmit\n ? \"\"\n : html`\n
\n \n `}\n
\n `\n }\n\n getThatJson() {\n return fetch(this.jsonUrl).then(res =>\n res.text().then(response => {\n this.fields = JSON.parse(response)\n return html`\n
\n ${this.fields.map(item => {\n return html` ${this.buildMarkup(item)} `\n })}\n
\n `\n })\n )\n }\n\n buildMarkup(item: Field, conditionalPass: boolean = false): TemplateResult {\n if (!item.renderedElement) {\n let el = this.assignFieldSpecificItems(item)\n item.renderedElement = el\n }\n\n if (!item.eligibility || conditionalPass) {\n return html`\n
\n
\n ${!item.selfRendering\n ? html`\n \n `\n : html` ${item.renderedElement} `}\n ${item.conditionals\n ? item.conditionals.map(conditional => {\n if (conditional.visible) {\n return html` ${this.buildMarkup(conditional, true)} `\n }\n })\n : \"\"}\n
\n
\n `\n }\n }\n\n // TODO: Make this common between fieldset and form\n assignFieldSpecificItems(item: Field) {\n let el: InputElement // For now.\n switch (item.element) {\n case \"input\":\n if (item.attributes.type === \"radio\") {\n el = this.createElement(item)\n break\n } else {\n el = this.createElement(item)\n el.addEventListener(\"blur\", () => this.checkConditionals(item))\n el.classList.add(\"input-textbox--input\")\n }\n break\n case \"select\":\n el = this.createElement(item)\n el.addEventListener(\"change\", () => this.checkConditionals(item))\n el.classList.add(\"input-textbox--select\")\n break\n case \"textarea\":\n el = this.createElement(item)\n el.addEventListener(\"blur\", () => this.checkConditionals(item))\n el.classList.add(\"input-textbox--textarea\")\n break\n case \"kin-autocomplete\":\n el = document.createElement(item.element) as AutocompleteComponent as any\n el.setAttribute(\"inputId\", item.attributes.inputId)\n if (item.attributes.required) {\n el.setAttribute(\"isRequired\", item.attributes.required.toString())\n }\n if (item.attributes.disabled) {\n el.setAttribute(\"isDisabled\", item.attributes.disabled.toString())\n }\n if (item.attributes.multiple) {\n el.setAttribute(\"multiple\", item.attributes.multiple.toString())\n }\n el.setAttribute(\"name\", item.attributes.name)\n el.addEventListener(\"change\", () => this.checkConditionals(item))\n default:\n break\n }\n return el\n }\n\n createElement(item: Field): InputElement {\n let el = document.createElement(item.element) as InputElement\n Object.assign(el, item.attributes)\n item.renderedElement = el as InputElement\n\n if (item.options) {\n let firstOption = document.createElement(\"option\")\n firstOption.value = \"\"\n firstOption.text = \"Select One\"\n firstOption.disabled = true\n firstOption.selected = true\n ;(el as HTMLSelectElement).options.add(firstOption)\n item.options.forEach(opt => {\n let optionElement = document.createElement(\"option\")\n Object.assign(optionElement, opt)\n ;(el as HTMLSelectElement).options.add(optionElement)\n })\n }\n\n if (item.attributes.hidden) {\n item.renderedElement.classList.add(\"hidden\")\n item.renderedElement.required = false\n }\n\n this.findAndRelateConditionals(item)\n\n return el\n }\n\n findAndRelateConditionals(item: Field) {\n let fieldsToRelate = this.fields.filter(field => field.eligibility && field.eligibility.id === item.attributes.id)\n if (fieldsToRelate.length > 0) {\n fieldsToRelate.forEach(item => {\n item.isConditional = true\n item.visible = false\n })\n item.conditionals = fieldsToRelate\n if (!item.eligibility) {\n item.visible = true\n }\n }\n }\n\n checkConditionals(item: Field) {\n let conditionalsToHide = this.fields.filter(field => field.eligibility !== undefined && field !== item && !field.isConditional)\n conditionalsToHide.forEach(conditional => (conditional.visible = false))\n\n if (item.conditionals) {\n item.conditionals.forEach(conditional => {\n conditional.visible = false\n })\n\n let conditionalsToChange = item.conditionals.filter(field => field.eligibility.value == item.renderedElement.value)\n\n if (conditionalsToChange.length > 0) {\n conditionalsToChange.forEach(field => (field.visible = !field.visible))\n }\n }\n\n this.formValidation.triggerRefresh()\n super.requestUpdate()\n }\n}\n","import { LitElement, html, TemplateResult } from \"lit\"\nimport { customElement, property, state } from \"lit/decorators.js\"\nimport { Field, InputElement } from \"../validation/validators/utils\"\nimport { FormValidationComponent } from \"../validation/form-validation\"\nimport { AutocompleteComponent } from \"../autocomplete/autocomplete\"\nimport { until } from \"lit-html/directives/until.js\"\nimport { DatePickerComponent } from \"../datepicker/datepicker\"\nimport { DateInputMaskComponent } from \"../datepicker/date-input-mask\"\n\n// TODO: Create base class for MagicFormComponent and MagicFieldsetComponent to both inherit from\n@customElement(\"kin-magic-fieldset\")\nexport class MagicFieldsetComponent extends LitElement {\n @property() jsonUrl: string\n @property() data: string // This can be used from other LitElements, for example.\n @property() legend: string = \"\"\n @property() fieldColumnClass: string\n @property() visibleFieldset: boolean\n @property({ type: Boolean }) disabled = false\n @state() fields: Field[] = []\n @state() originalForm: Node\n formValidation: FormValidationComponent\n renderedFields: TemplateResult\n\n createRenderRoot() {\n return this\n }\n\n firstUpdated() {\n const form = this.closest(\"form\")\n if (form) {\n this.formValidation = this.closest(\"form\").querySelector(\"kin-form-validation\")\n const clone = form.cloneNode(true)\n this.originalForm = clone\n form.addEventListener(\"reset\", () => {\n form.replaceWith(this.originalForm)\n })\n }\n }\n\n updated() {\n requestAnimationFrame(() => this.formValidation.triggerRefresh())\n }\n\n connectedCallback() {\n super.connectedCallback()\n }\n\n render() {\n if (this.data) {\n this.fields = JSON.parse(this.data)\n }\n return html`\n
\n ${this.legend}\n ${this.fields.length === 0\n ? until(this.getThatJson(), html` `)\n : html`\n
\n ${this.fields.map(item => {\n return html` ${this.buildMarkup(item)} `\n })}\n
\n `}\n
\n `\n }\n\n getThatJson() {\n return fetch(this.jsonUrl)\n .then(res => {\n if (res.ok) {\n res.text().then(response => {\n super.requestUpdate()\n try {\n this.fields = JSON.parse(response)\n } catch (_e) {\n this.fields = []\n }\n return html`\n ${this.fields.map(item => {\n return html` ${this.buildMarkup(item)} `\n })}\n `\n })\n }\n })\n .catch(err => {\n return html`\n
\n Unfortunately, there was an error loading the dynamic fieldset. Please mention this to your manager to be placed in\n #production-support.\n
\n Error message: ${err};\n
\n `\n })\n }\n\n buildMarkup(item: Field, conditionalPass: boolean = false): TemplateResult {\n if (!item.renderedElement) {\n let el = this.assignFieldSpecificItems(item)\n item.renderedElement = el\n }\n\n if (!item.eligibility || conditionalPass) {\n return html`\n
\n ${!item.selfRendering\n ? html`\n \n `\n : html` ${item.renderedElement} `}\n ${item.conditionals\n ? item.conditionals.map(conditional => {\n if (conditional.visible) {\n return html` ${this.buildMarkup(conditional, true)} `\n }\n })\n : \"\"}\n
\n `\n }\n\n this.formValidation.triggerRefresh()\n }\n\n assignFieldSpecificItems(item: Field) {\n let el: InputElement // For now.\n switch (item.element) {\n case \"input\":\n if (item.attributes.type === \"radio\") {\n el = this.createElement(item)\n break\n } else {\n el = this.createElement(item)\n el.setAttribute(\"value\", item.attributes.value)\n el.addEventListener(\"blur\", () => this.checkConditionals(item))\n el.classList.add(\"input-textbox--input\")\n }\n break\n case \"select\":\n el = this.createElement(item)\n el.setAttribute(\"value\", item.attributes.value)\n el.addEventListener(\"change\", () => this.checkConditionals(item))\n el.classList.add(\"input-textbox--select\")\n break\n case \"textarea\":\n el = this.createElement(item)\n el.addEventListener(\"blur\", () => this.checkConditionals(item))\n el.classList.add(\"input-textbox--textarea\")\n break\n case \"kin-datepicker\":\n // Set this so that the datepicker has entire control over its display.\n item.selfRendering = true\n\n // Create the Container\n el = document.createElement(\"div\") as any\n el.classList.add(\"datepicker__container\")\n\n // TODO: Make this better :)\n\n // Create Datepicker and Attributes\n let datepicker = document.createElement(item.element) as DatePickerComponent\n datepicker.setAttribute(\"inputId\", item.attributes.inputId)\n datepicker.setAttribute(\"id\", item.attributes.inputId + \"__picker\")\n if (item.attributes.required) {\n datepicker.setAttribute(\"isRequired\", item.attributes.required.toString())\n }\n if (item.attributes.disabled) {\n datepicker.setAttribute(\"isDisabled\", item.attributes.disabled.toString())\n }\n if ((item.attributes as any).start_date) {\n datepicker.setAttribute(\"startDate\", item.attributes.startDate.toString())\n }\n if ((item.attributes as any).end_date) {\n datepicker.setAttribute(\"endDate\", item.attributes.startDate.toString())\n }\n\n // Create Input Mask and Attributes\n let inputMask = document.createElement(\"kin-date-input-mask\") as DateInputMaskComponent\n\n if (item.label) {\n inputMask.setAttribute(\"label\", item.label)\n }\n\n if ((item.attributes as any).value) {\n inputMask.setAttribute(\"value\", item.attributes.value.toString())\n }\n\n inputMask.setAttribute(\"name\", item.attributes.name)\n\n // Create Button and Attributes\n let button = document.createElement(\"button\")\n button.classList.add(\"datepicker__container__trigger\")\n button.addEventListener(\"click\", () => {\n ;(window as any).kin.utils.toggleDatePicker(item.attributes.inputId + \"__picker\")\n })\n button.type = \"button\"\n button.setAttribute(\"aria-controls\", (item.attributes as any).datepicker_id)\n button.setAttribute(\"aria-describedby\", `${item.attributes.id}__mask`)\n\n // Create Calendar Icon\n let img = document.createElement(\"img\")\n let span = document.createElement(\"span\")\n span.innerText = \"Open Date picker\"\n span.classList.add(\"visually--hidden\")\n img.src = \"/assets/icon/calendar.svg\"\n img.style.height = \"20px\"\n button.append(img, span)\n\n // Append all to Container\n el.append(inputMask, button, datepicker)\n this.findAndRelateConditionals(item)\n break\n case \"kin-autocomplete\":\n el = document.createElement(item.element) as AutocompleteComponent as any\n el.setAttribute(\"inputId\", item.attributes.inputId)\n if (item.attributes.required) {\n el.setAttribute(\"isRequired\", item.attributes.required.toString())\n }\n if (item.attributes.disabled) {\n el.setAttribute(\"isDisabled\", item.attributes.disabled.toString())\n }\n if (item.attributes.multiple) {\n el.setAttribute(\"multiple\", item.attributes.multiple.toString())\n }\n if (item.label) {\n el.setAttribute(\"label\", item.label)\n }\n el.setAttribute(\"name\", item.attributes.name.toString())\n\n this.findAndRelateConditionals(item)\n\n el.addEventListener(\"kin-autocomplete:change\", () => this.checkConditionals(item))\n break\n default:\n break\n }\n return el\n }\n\n createElement(item: Field): InputElement {\n let el = document.createElement(item.element) as InputElement\n Object.assign(el, item.attributes)\n Object.assign(el.dataset, item.attributes.data)\n item.renderedElement = el\n\n if (item.options) {\n let firstOption = document.createElement(\"option\")\n firstOption.value = \"\"\n firstOption.text = \"Select One\"\n firstOption.disabled = true\n firstOption.selected = true\n ;(el as HTMLSelectElement).options.add(firstOption)\n item.options.forEach(opt => {\n let optionElement = document.createElement(\"option\")\n Object.assign(optionElement, opt)\n ;(el as HTMLSelectElement).options.add(optionElement)\n })\n }\n\n if (item.attributes.hidden) {\n item.renderedElement.classList.add(\"hidden\")\n item.renderedElement.required = false\n }\n\n this.findAndRelateConditionals(item)\n\n return el\n }\n\n findAndRelateConditionals(item: Field) {\n let fieldsToRelate = this.fields.filter(field => field.eligibility && field.eligibility.id === item.attributes.id)\n if (fieldsToRelate.length > 0) {\n fieldsToRelate.forEach(item => {\n item.isConditional = true\n if (item.eligibility.value === this.findField(item.eligibility.id).renderedElement.value) {\n item.visible = true\n } else {\n item.visible = false\n }\n })\n item.conditionals = fieldsToRelate\n if (!item.eligibility) {\n item.visible = true\n }\n } else {\n item.visible = true\n }\n }\n\n checkConditionals(item: Field) {\n let conditionalsToHide = this.fields.filter(field => field.eligibility !== undefined && field !== item && !field.isConditional)\n conditionalsToHide.forEach(conditional => (conditional.visible = false))\n\n if (item.conditionals) {\n item.conditionals.forEach(conditional => {\n conditional.visible = false\n })\n\n let conditionalsToChange = item.conditionals.filter(field => field.eligibility.value == item.renderedElement.value)\n\n if (conditionalsToChange.length > 0) {\n conditionalsToChange.forEach(field => (field.visible = !field.visible))\n }\n }\n\n this.requestUpdate()\n\n this.updateComplete.then(() => {\n this.formValidation.triggerRefresh()\n })\n }\n\n findField(id: string) {\n return this.fields.find(field => field.attributes.id === id)\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\n\n/* This web component copies the text content of itself onto the clipboard when clicked.\n * Usage:\n *\n * \n *\n * This component uses no styles, but rather will function simply like text, as in it inherits any styles given to it.\n */\n\n@customElement(\"kin-copier\")\nexport class CopierComponent extends LitElement {\n @property() buttonClasses = \"text text--link\"\n @property() buttonText = \"Copy\"\n @property() copy = \"\"\n @property() copyFallback = \"\"\n @property({ type: Boolean }) hideCopyText = false\n @property({ type: Boolean }) copyAsHtml = false\n @property({ type: Boolean }) disabled = false\n\n private timer?: number\n\n createRenderRoot() {\n return this\n }\n\n render() {\n return html`\n ${this.hideCopyText ? \"\" : html`
${this.copy}
`}\n \n `\n }\n\n disconnectedCallback(): void {\n if (this.timer !== undefined) window.clearTimeout(this.timer)\n }\n\n async transferToClipboard() {\n const writeMethod = this.copyAsHtml ? this.writeHtml : this.writeText\n\n try {\n await writeMethod.call(this)\n this.modifyButtonText(\"Copied!\")\n } catch (_e) {\n this.modifyButtonText(\"Error!\")\n }\n }\n\n writeText(): Promise {\n return navigator.clipboard.writeText(this.copy)\n }\n\n writeHtml(): Promise {\n const clipboardItem = new ClipboardItem({\n \"text/html\": new Blob([this.copy], {\n type: \"text/html\"\n }),\n \"text/plain\": new Blob([this.copyFallback || this.copy], {\n type: \"text/plain\"\n })\n })\n return navigator.clipboard.write([clipboardItem])\n }\n\n modifyButtonText(text: string) {\n const originalButtonText = this.buttonText\n this.buttonText = text\n\n this.timer = window.setTimeout(() => {\n this.buttonText = originalButtonText\n }, 1500)\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kin-copier\": CopierComponent\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\n\n// NOTE: This component is dependent on a ViewComponent here: https://github.com/kin/dot-com/blob/master/app/components/shared/ui/accordion_component.html.erb\n\n@customElement(\"kin-accordion-trigger\")\nexport class AccordionTriggerComponent extends LitElement {\n @property({ type: Boolean }) openOnLoad: boolean = false\n @property({ type: Boolean }) disabled: boolean = false\n @property() pillCounterClasses: string\n @property() accordionTitle: string\n @property() counter: string\n @property() accordionId: string\n active: boolean = false\n\n createRenderRoot() {\n return this\n }\n\n firstUpdated() {\n if (this.openOnLoad || this.classList.contains(\"accordion__error\")) {\n this.open()\n }\n }\n\n render() {\n return html`\n \n \n \n \n ${this.accordionTitle} \n ${this.counter.length > 0\n ? html`\n \n ${this.counter}\n \n `\n : null}\n \n \n \n \n ${this.active ? \"Collapse Accordion\" : \"Expand Accordion\"}\n \n \n \n `\n }\n\n handleAccordionState() {\n if (this.active) {\n this.close()\n } else {\n this.open()\n }\n }\n\n public open() {\n this.active = true\n this.classList.add(\"accordion__open\")\n this.body?.classList.remove(\"hidden\")\n this.requestUpdate()\n }\n\n public close() {\n this.active = false\n this.classList.remove(\"accordion__open\")\n this.body?.classList.add(\"hidden\")\n this.requestUpdate()\n }\n\n get body(): HTMLDivElement {\n return this.nextElementSibling as HTMLDivElement\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { AccordionTriggerComponent } from \"./accordion\"\n\n// This component looks for all accordions on a page, and toggles their state.\n\n@customElement(\"kin-accordion-helper\")\nexport class AccordionHelperComponent extends LitElement {\n @property() container: string // Needs to be an ID of an HTML containing element\n state: string = \"Expand\"\n\n createRenderRoot() {\n return this\n }\n\n render() {\n return html` `\n }\n\n connectedCallback() {\n super.connectedCallback()\n }\n\n changeAccordionState() {\n if (this.container) {\n let container = document.querySelector(this.container)\n container.querySelectorAll(\"kin-accordion-trigger\").forEach((accordion: AccordionTriggerComponent) => {\n this.handleAccordion(accordion)\n })\n } else {\n document.querySelectorAll(\"kin-accordion-trigger\").forEach((accordion: AccordionTriggerComponent) => {\n this.handleAccordion(accordion)\n })\n }\n\n this.changeState()\n }\n\n handleAccordion(accordion: AccordionTriggerComponent) {\n if ((accordion.active && this.state === \"Expand\") || (!accordion.active && this.state === \"Collapse\")) {\n return\n }\n\n if (accordion.active && this.state === \"Collapse\") {\n accordion.close()\n }\n\n if (!accordion.active && this.state === \"Expand\") {\n accordion.open()\n }\n }\n\n changeState() {\n if (this.state === \"Expand\") {\n this.state = \"Collapse\"\n } else {\n this.state = \"Expand\"\n }\n\n this.requestUpdate()\n }\n}\n","import { LitElement, html, TemplateResult } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { AutocompleteList, MortgageeResponse } from \"../utils/interfaces\"\nimport { FormValidationComponent } from \"../validation/form-validation\"\nimport debounce from \"lodash.debounce\"\n\n// TODO: Extend both AutocompleteComponent and RemoteAutocompleteComponent off of a BaseAutocompleteComponent\n// NOTICE: This component expects to have a select element input as it's \"inputId\"\n@customElement(\"kin-remote-autocomplete\")\nexport class RemoteAutocompleteComponent extends LitElement {\n // @property() means the value can come from the DOM attribute of the same name on the custom element\n // whereas the rest of the items are properties on the class.\n @property() name: string\n @property() additionalClasses: string\n @property() requestUrl: string\n @property() inputId: string\n @property() label: string\n @property() isRequired: boolean = false\n @property() isDisabled: boolean = false\n @property() multipleLabel: string = \"Selected Items\"\n @property() minimum: number = 3\n @property() minimumMultiple: number = 1\n @property() allowOther: boolean = false\n @property() otherInputId: string\n @property() limit: number\n @property() defaultValue: string\n // Ruby defaults to certain values, although that's not necessarily what's desired. We can declare to ignore that here.\n @property() renderBlank: boolean = null\n loading: boolean = false\n list: AutocompleteList[] = []\n multipleSelectedList: Set = new Set()\n value: string = \"\"\n multiple: boolean = false\n connectionError: string = \"\"\n suggestionListActive: boolean\n listItems: HTMLElement[]\n onChangeEvent: CustomEvent\n\n // We don't need Shadow DOM in this component.\n createRenderRoot() {\n return this\n }\n\n firstUpdated() {\n this.testConnection()\n }\n\n setUpAutocomplete() {\n if (this.associatedSelectElement.multiple) {\n this.multiple = true\n this.minimum = 1\n }\n\n this.addEventListeners()\n\n this.fillInputs()\n\n if (this.multiple) {\n if (this.multipleSelectedList.size >= this.minimumMultiple) {\n this.isRequired = false\n } else {\n this.isRequired = true\n }\n }\n\n super.requestUpdate()\n }\n\n public reinitialize() {\n this.list = []\n if (this.associatedSelectElement) {\n this.associatedSelectElement.value = null\n }\n if (this.multiple) {\n this.multipleSelectedList.clear()\n }\n this.fillInputs()\n super.requestUpdate()\n }\n\n disconnectedCallback() {\n super.disconnectedCallback()\n this.removeEventListeners()\n }\n\n handleConnectionError() {\n if (this.allowOther && !this.otherInputId) {\n this.handleManualEntry()\n } else {\n this.connectionError = \"Connection Error - please call us at (855) 717-0022\"\n this.isDisabled = true\n this.isRequired = false\n this.requestUpdate()\n this.updateComplete.then(() => {\n this.validator.triggerRefresh()\n })\n }\n }\n\n handleSearchError() {\n this.autocompleteLoader.classList.add(\"autocomplete__loading--error\")\n this.autocompleteLoader.title = \"There was an error getting a search result.\"\n this.isLoading(false)\n }\n\n resetSearchError() {\n this.autocompleteLoader.classList.remove(\"autocomplete__loading--error\")\n this.autocompleteLoader.title = null\n }\n\n handleManualEntry() {\n this.removeEventListeners()\n this.list = null\n }\n\n addEventListeners() {\n document.addEventListener(\"click\", e => {\n if (!(e.target as HTMLElement).closest(\"kin-remote-autocomplete\") && this.suggestionListActive) {\n this.deactivateSuggestionBox(false)\n this.fillInputValue()\n }\n })\n this.autocompleteInput.addEventListener(\"input\", (e: InputEvent) => this.handleInput(e))\n this.autocompleteInput.addEventListener(\"keydown\", (e: KeyboardEvent) => this.handleKey(e))\n this.querySelector(\".autocomplete__list\").addEventListener(\"keydown\", (e: KeyboardEvent) => this.handleKey(e))\n\n // We only want to disable fields when they're not already disabled via the ViewComponent\n if (this.isWithinModal && this.getClientRects().length === 0 && !this.isDisabled) {\n document.addEventListener(\"kin-modal:open\", (e: CustomEvent) => this.handleCurrentState(e))\n document.addEventListener(\"kin-modal:close\", (e: CustomEvent) => this.handleCurrentState(e))\n }\n }\n\n removeEventListeners() {\n document.addEventListener(\"click\", e => {\n if (!(e.target as HTMLElement).closest(\"kin-remote-autocomplete\") && this.suggestionListActive) {\n this.deactivateSuggestionBox(false)\n this.fillInputValue()\n }\n })\n this.autocompleteInput.removeEventListener(\"input\", (e: InputEvent) => this.handleInput(e))\n this.autocompleteInput.removeEventListener(\"keydown\", (e: KeyboardEvent) => this.handleKey(e))\n this.querySelector(\".autocomplete__list\").removeEventListener(\"keydown\", (e: KeyboardEvent) => this.handleKey(e))\n\n if (this.isWithinModal && this.getClientRects().length === 0 && !this.isDisabled) {\n document.removeEventListener(\"kin-modal:open\", (e: CustomEvent) => this.handleCurrentState(e))\n document.removeEventListener(\"kin-modal:close\", (e: CustomEvent) => this.handleCurrentState(e))\n }\n }\n\n render() {\n return html`\n \n \n ${this.connectionError ? html`
Connection Error!
` : \"\"}\n
\n ${this.ableToBeCleared\n ? html` `\n : null}\n ${this.label}\n
\n
    \n ${this.list.map(item => {\n if (!item.other && !item.selected) {\n return html`\n
  • \n \n ${this.changeRenderedName(item)}\n \n
  • \n `\n }\n\n if (item.other) {\n return html`\n
  • \n \n + Add ${item.text}\n \n
  • \n `\n }\n })}\n
\n ${this.multiple && this.limit !== undefined\n ? html`\n Please select up to ${this.limit} items (${this.multipleSelectedList.size} selected)\n `\n : \"\"}\n
\n \n ${this.multiple && this.multipleSelectedList.size !== 0\n ? html`\n
\n
\n ${this.multipleLabel}\n
    \n ${Array.from(this.multipleSelectedList).map(item => {\n return html`\n
  • \n \n ${item.text}\n \n
  • \n `\n })}\n
\n
\n
\n `\n : \"\"}\n `\n }\n\n toggleList() {\n if (this.suggestionListActive) {\n this.deactivateSuggestionBox()\n } else {\n this.value = \"\"\n this.activateSuggestionBox()\n }\n super.requestUpdate()\n }\n\n clearValue() {\n this.value = \"\"\n if (this.associatedSelectElement) {\n this.associatedSelectElement.value = \"\"\n } else if (this.otherInputElement) {\n this.otherInputElement.value = \"\"\n }\n if (this.suggestionListActive) {\n this.deactivateSuggestionBox()\n }\n this.fireOnChangeEvent()\n this.requestUpdate()\n }\n\n fillInputs() {\n if (this.multiple) {\n Array.from(this.associatedSelectElement.selectedOptions).forEach(opt => {\n if (opt.value !== \"\") {\n let itemToAdd = this.list.find(item => item.value === opt.value)\n this.multipleSelectedList.add(itemToAdd)\n }\n })\n } else {\n if (this.associatedSelectElement.value && this.associatedSelectElement.value.length > 0 && this.renderBlank === null) {\n let value = this.associatedSelectElement.value\n if (this.associatedSelectElement.querySelector(`option[value=\"${value}\"]`) != null) {\n this.value = (this.associatedSelectElement.querySelector(`option[value=\"${value}\"]`) as HTMLOptionElement).textContent\n }\n } else if (this.defaultValue !== null) {\n this.value = this.defaultValue\n } else {\n this.value = \"\"\n }\n }\n\n super.requestUpdate()\n }\n\n handleClick(e: MouseEvent | KeyboardEvent) {\n let clickedButton = e.target as HTMLElement\n\n if (clickedButton.tagName !== \"button\") {\n clickedButton = clickedButton.closest(\"button\")\n }\n\n let value = clickedButton.getAttribute(\"data-value\")\n if (value !== null) {\n this.setValue(value)\n }\n }\n\n handleCurrentState(e?: CustomEvent) {\n if (!this.isWithinModal) {\n return\n }\n\n if (e.detail.id === this.closest(\"kin-modal, kin-view-modal\").id) {\n this.getClientRects().length === 0 ? this.toggleDisabledState(true) : this.toggleDisabledState(false)\n }\n }\n\n toggleDisabledState(disabled: boolean) {\n this.autocompleteInput.disabled = disabled\n this.fireOnChangeEvent()\n this.requestUpdate()\n }\n\n isValueSelected(name: string): boolean {\n return this.value === name\n }\n\n handleKey(e: KeyboardEvent) {\n e.stopImmediatePropagation()\n if (e.code === \"ArrowDown\") {\n this.navigateDown(e)\n }\n\n if (e.code === \"ArrowUp\") {\n this.navigateUp(e)\n }\n\n if (e.code === \"Enter\" && this.list.length === 1) {\n e.preventDefault()\n if (this.list[0].disabled) {\n return\n }\n\n this.setValue(this.list[0].value)\n this.deactivateSuggestionBox()\n super.requestUpdate()\n } else if (e.code === \"Enter\" && e.srcElement instanceof HTMLButtonElement) {\n e.preventDefault()\n if (!e.srcElement.disabled) {\n this.setValue((e.srcElement as HTMLElement).dataset.value)\n }\n } else if (e.code === \"Enter\") {\n e.preventDefault()\n }\n\n if (e.code === \"Escape\" && this.suggestionListActive) {\n this.deactivateSuggestionBox()\n }\n }\n\n handleInput(e: InputEvent) {\n if ((e.target as HTMLInputElement).value) {\n this.list = []\n this.value = (e.target as HTMLInputElement).value\n\n if (this.value.length > 2) {\n this.isLoading(true)\n this.resetSearchError()\n this.submitSearchQuery()\n }\n } else {\n this.value = \"\"\n this.list = []\n this.resetSearchError()\n this.deactivateSuggestionBox()\n }\n\n super.requestUpdate()\n }\n\n isProperSearchResult(item: AutocompleteList): boolean {\n return item.text.toLowerCase().includes(this.value.toLowerCase())\n }\n\n activateSuggestionBox() {\n this.throwOverflowEvent({ allow: true })\n this.suggestionListActive = true\n //this.autocompleteListElement.scrollTo(0, 0)\n ;(this.querySelector(`#${this.inputId}__input`) as HTMLInputElement).focus()\n super.requestUpdate()\n }\n\n deactivateSuggestionBox(focus: boolean = true) {\n this.throwOverflowEvent({ allow: false })\n this.suggestionListActive = false\n if (focus) {\n ;(this.querySelector(`#${this.inputId}__input`) as HTMLInputElement).focus()\n }\n this.fillInputValue()\n this.loading = false\n super.requestUpdate()\n }\n\n fillInputValue() {\n if (this.value === \"\") {\n this.clearValue()\n } else if (this.associatedSelectElement.value && !this.multiple) {\n let text = this.associatedSelectElement.querySelector(`option[value=\"${this.associatedSelectElement.value}\"]`).textContent\n this.value = text\n } else if (this.otherInputElement.value) {\n this.value = this.otherInputElement.value\n }\n }\n\n throwOverflowEvent(detail: { allow: boolean }) {\n let overflowEvent = new CustomEvent(\"kin-modal:overflow\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: detail\n })\n this.dispatchEvent(overflowEvent)\n }\n\n navigateUp(e: Event) {\n e.preventDefault()\n if (this.suggestionListActive && this.listItems.length > 0) {\n let index = this.findFocusableListItems(e.srcElement as HTMLElement)\n\n if (index < this.listItems.length && index !== 0) {\n this.listItems[index - 1].focus()\n }\n\n if (index === 0) {\n this.listItems[this.listItems.length - 1].focus()\n }\n }\n }\n\n navigateDown(e: Event) {\n e.preventDefault()\n\n if (!this.suggestionListActive) {\n this.activateSuggestionBox()\n }\n\n let index = this.findFocusableListItems(e.srcElement as HTMLElement)\n\n if (index !== -1 && this.listItems.length > 0) {\n if (index < this.listItems.length - 1) {\n this.listItems[index + 1].focus()\n } else {\n this.listItems[0].focus()\n }\n } else {\n this.listItems[0].focus()\n }\n }\n\n findFocusableListItems(src: HTMLElement): number {\n this.listItems = Array.from(this.querySelectorAll(\".autocomplete__list button\"))\n\n return this.listItems.indexOf(src)\n }\n\n changeRenderedName(item: AutocompleteList): TemplateResult {\n if (this.value?.length === 0) {\n return html` ${item.text} `\n }\n\n // TODO: Make this a common util for escaping regex values\n let textToMatch = this.value.replace(/[.*+\\-?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n\n let span = document.createElement(\"span\")\n let regex = new RegExp(\"(\" + textToMatch + \")\", \"gi\")\n let value = item.text.replace(regex, match => `${match}`)\n span.innerHTML = value\n return html` ${span} `\n }\n\n updateMultipleAssociatedField(value?: string) {\n if (value !== undefined) {\n let itemToAdd = this.list.find(item => item.value == value)\n this.multipleSelectedList.add(itemToAdd)\n }\n\n this.associatedSelectElement.querySelectorAll(\"option\").forEach(item => item.remove())\n\n this.multipleSelectedList.forEach(item => {\n if (item !== undefined) {\n this.createOptionToInsert(item)\n }\n })\n\n if (this.limitExceeded) {\n this.deactivateSuggestionBox()\n }\n\n if (this.multipleSelectedList.size >= this.minimumMultiple) {\n this.isRequired = false\n } else {\n this.isRequired = true\n }\n\n this.fireOnChangeEvent(this.associatedSelectElement.selectedOptions)\n\n this.dispatchEvent(this.onChangeEvent)\n\n this.requestUpdate()\n }\n\n deleteFromMultipleList(e: MouseEvent) {\n let value = (e.target as HTMLElement).getAttribute(\"data-value\")\n let itemToDelete = this.list.find(item => item.value == value)\n\n this.multipleSelectedList.delete(itemToDelete)\n this.removeFromSelect(itemToDelete)\n\n this.fireOnChangeEvent(this.associatedSelectElement.selectedOptions)\n\n this.requestUpdate()\n\n this.updateMultipleAssociatedField()\n }\n\n public setValueFromExternalSource(dataValue: string): void {\n if (!dataValue) {\n return\n }\n\n let matchingItem = this.list.find(item => item.value == dataValue)\n\n if (matchingItem) {\n this.setValue(matchingItem.value)\n }\n }\n\n private fireOnChangeEvent(value: any = this.value) {\n this.onChangeEvent = new CustomEvent(\"kin-autocomplete:change\", {\n bubbles: true,\n detail: {\n id: this.inputId,\n name: this.value,\n value: value,\n consideredValid: this.consideredValid\n }\n })\n this.dispatchEvent(this.onChangeEvent)\n }\n\n setValue(dataValue: string): void {\n let itemToSelectValue = this.list.find(item => item.value == dataValue)\n\n if (itemToSelectValue.disabled) {\n return\n }\n\n if (this.allowOther && itemToSelectValue.other) {\n this.otherInputElement.value = itemToSelectValue.text\n this.associatedSelectElement.disabled = true\n this.otherInputElement.disabled = false\n } else if (this.otherInputElement !== null) {\n this.otherInputElement.disabled = true\n this.otherInputElement.value = null\n this.associatedSelectElement.disabled = false\n }\n\n if (this.multiple) {\n if (!this.limitExceeded) {\n this.updateMultipleAssociatedField(String(dataValue))\n this.value = \"\"\n this.deactivateSuggestionBox()\n }\n } else {\n this.value = itemToSelectValue.text\n ;(document.getElementById(this.inputId + \"__input\") as HTMLInputElement).value = itemToSelectValue.text\n this.associatedSelectElement.querySelectorAll(\"option\").forEach(item => item.remove()) // Clear options\n\n this.createOptionToInsert(itemToSelectValue)\n ;(this.associatedSelectElement.querySelector(`option[value=\"${itemToSelectValue.value}\"]`) as HTMLOptionElement).selected = true\n this.associatedSelectElement.value = itemToSelectValue.value\n\n this.deactivateSuggestionBox()\n this.fireOnChangeEvent(itemToSelectValue.value)\n }\n this.requestUpdate()\n }\n\n private createOptionToInsert(option: AutocompleteList) {\n let optionToCreate = document.createElement(\"option\")\n optionToCreate.text = option.text\n optionToCreate.value = option.value\n optionToCreate.selected = true\n this.associatedSelectElement?.appendChild(optionToCreate)\n }\n\n private removeFromSelect(option: AutocompleteList) {\n this.associatedSelectElement.querySelector(`[value=\"${option.value}\"]`).remove()\n }\n\n private isLoading(status: boolean) {\n this.loading = status\n this.requestUpdate()\n }\n\n private submitSearchQuery = debounce(async () => {\n let searchRequest = (await fetch(`/api/v1/auto_complete${this.requestUrl}${this.value}`)).json()\n\n searchRequest.then((res: MortgageeResponse[]) => {\n if ((res as MortgageeResponse[]).length > 0) {\n this.list = (res as MortgageeResponse[]).map(item => {\n let option: AutocompleteList = { value: item.value, text: item.text, disabled: false }\n if (this.multipleSelectedList.has(option)) {\n return\n }\n return option\n })\n this.isLoading(false)\n this.activateSuggestionBox()\n } else {\n this.isLoading(false)\n if (this.allowOther) {\n this.list.push({ value: \"\", text: this.value, disabled: false, other: true })\n } else {\n this.list.push({ value: \"nil\", text: \"No results found.\", disabled: true })\n }\n this.activateSuggestionBox()\n }\n })\n\n searchRequest.catch(() => this.handleSearchError())\n }, 350)\n\n private testConnection = debounce(async () => {\n fetch(`/api/v1/auto_complete${this.requestUrl}`).then(res => {\n if (res.ok) {\n this.setUpAutocomplete()\n } else {\n this.handleConnectionError()\n }\n })\n })\n\n get limitExceeded() {\n return this.multipleSelectedList.size >= this.limit\n }\n\n get consideredValid() {\n if (this.isDisabled) {\n return true\n } else if (this.multiple) {\n return this.multipleSelectedList.size !== 0 && !this.limitExceeded && this.associatedSelectElement.selectedOptions.length > 0\n } else {\n return this.isRequired ? this.associatedSelectElement.value !== null || this.otherInputElement.value === this.value : true\n }\n }\n\n get autocompleteListElement(): HTMLDivElement {\n return this.querySelector(\".autocomplete__list\")\n }\n\n get autocompleteInput(): HTMLInputElement {\n return this.querySelector(`#${this.inputId}__input`)\n }\n\n get autocompleteLoader(): HTMLElement {\n return this.querySelector(\".autocomplete__loading\")\n }\n\n get otherInputElement(): HTMLInputElement {\n return document.querySelector(`input#${this.otherInputId}`) || null\n }\n\n get associatedSelectElement(): HTMLSelectElement {\n return document.querySelector(`select#${this.inputId}`)\n }\n\n get isWithinModal(): HTMLElement | null {\n return this.closest(\"kin-modal\") || this.closest(\"kin-view-modal\")\n }\n\n get validator(): FormValidationComponent {\n return this.autocompleteInput.form.querySelector(\"kin-form-validation\")\n }\n\n get ableToBeCleared(): boolean {\n return !this.loading && this.value.length > 0\n }\n}\n","import { LitElement } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport * as FullStory from \"@fullstory/browser\"\n\nlet kinterested = (window as any).kinterested || {}\n\n// NOTE: Check https://github.com/kin/dot-com/blob/master/app/views/layouts/scripts/_analytics_scripts.erb for notes on how this is implemented.\n\n@customElement(\"kin-analytics-fullstory\")\nexport class FullstoryComponent extends LitElement {\n // TODO: Needs a better way of doing this, perhaps via API?\n @property() orgId: string = \"YVGQ5\"\n @property() userId: string\n @property() crmId: string\n @property() email: string\n @property() name: string = \"\"\n @property() devMode: boolean = false\n\n createRenderRoot() {\n return this\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n FullStory.init({ orgId: this.orgId, devMode: this.devMode })\n\n // Wait til FullStory is ready, then start sending information about session.\n window[\"_fs_ready\"] = () => {\n if (this.email?.length > 0) {\n FullStory.identify(`${this.userId}`, {\n displayName: this.name,\n email: this.email\n })\n }\n\n let url = FullStory.getCurrentSessionURL()\n kinterested.fullStoryUrl = url\n\n if (this.crmId.length > 0) {\n FullStory.setUserVars({ crm_account_id: this.crmId })\n }\n\n if ((window as any).kinterested?.email) {\n this.setFSUserVars()\n } else {\n document.addEventListener(\"kin-analytics-fullstory:ready\", () => this.setFSUserVars())\n }\n }\n }\n\n disconnectedCallback() {\n document.removeEventListener(\"kin-analytics-fullstory:ready\", () => this.setFSUserVars())\n super.disconnectedCallback()\n }\n\n setFSUserVars() {\n let addressString = `${(window as any).kinterested?.address}, ${(window as any).kinterested?.city}, ${\n (window as any).kinterested?.state\n } ${(window as any).kinterested?.zip}`\n\n FullStory.setUserVars({\n address: addressString,\n state: (window as any).kinterested?.state,\n product: (window as any).kinterested?.product,\n property_id: (window as any).kinterested?.product_id\n })\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\n\n/* This web component renders an input that is used to filter a on a column of a table\n * Usage:\n *\n * \n *\n */\n\n@customElement(\"kin-table-filter\")\nexport class TableFilterComponent extends LitElement {\n @property() tableId: string\n @property() columnNumber: number\n @property() label: string\n\n createRenderRoot() {\n return this\n }\n\n render() {\n return html`\n `\n }\n\n firstUpdated() {\n this.addEventListener(\"keyup\", (e: KeyboardEvent) => this.handleKey(e))\n }\n\n handleKey(e: KeyboardEvent) {\n let input = this.querySelector(\"input\")\n let filter = input.value.toUpperCase()\n let table = document.querySelector(this.tableId)\n let cells = table.querySelectorAll(`tr td:nth-child(${this.columnNumber || 1}`)\n\n cells.forEach((td: HTMLTableCellElement) => {\n if (td) {\n let txtValue = td.textContent || td.innerText\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n td.parentElement.style.display = \"\"\n } else {\n td.parentElement.style.display = \"none\"\n }\n }\n })\n }\n}\n","import * as Utils from \"./utils/utils\"\nimport * as Scroll from \"./utils/scroll\"\nimport * as Coverages from \"./utils/coverages\"\nimport * as DriverLicenseValidation from \"./utils/driver-license-validation\"\n;(window as any).kin = {}\n;(window as any).kin.utils = Utils\n;(window as any).kin.scroll = Scroll\n;(window as any).kin.coverages = Coverages\n;(window as any).kin.driverLicenseValidation = DriverLicenseValidation\n\nimport { AutocompleteComponent } from \"./autocomplete/autocomplete\"\nimport { DatePickerComponent } from \"./datepicker/datepicker\"\nimport { DateInputMaskComponent } from \"./datepicker/date-input-mask\"\nimport { FileUploadComponent } from \"./file-upload/file-upload\"\nimport { ModalComponent } from \"./modal/modal\"\nimport { ToggleComponent } from \"./toggle/toggle\"\nimport { PasswordToggleComponent } from \"./password-toggle/password-toggle\"\nimport { FormValidationComponent } from \"./validation/form-validation\"\nimport { ModalViewComponent } from \"./modal/modal-view-component\"\nimport { StandardTimeComponent } from \"./standard-time/standard-time\"\nimport { MagicFormComponent } from \"./magic-form/magic-form\"\nimport { MagicFieldsetComponent } from \"./magic-form/magic-fieldset\"\nimport { CopierComponent } from \"./copier/copier\"\nimport { AccordionTriggerComponent } from \"./accordion/accordion\"\nimport { AccordionHelperComponent } from \"./accordion/accordion-helper\"\nimport { RemoteAutocompleteComponent } from \"./autocomplete/remote-autocomplete\"\nimport { FullstoryComponent } from \"./analytics/fullstory\"\nimport { TableFilterComponent } from \"./table-filter/table-filter\"\n\nconst components: any[] = [\n AccordionTriggerComponent,\n AccordionHelperComponent,\n AutocompleteComponent,\n CopierComponent,\n DatePickerComponent,\n DateInputMaskComponent,\n FileUploadComponent,\n FullstoryComponent,\n MagicFieldsetComponent,\n MagicFormComponent,\n ModalComponent,\n ModalViewComponent,\n RemoteAutocompleteComponent,\n ToggleComponent,\n PasswordToggleComponent,\n FormValidationComponent,\n StandardTimeComponent,\n TableFilterComponent,\n Utils\n]\n\nexport default components\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { ModalViewComponent } from \"../shared/modal/modal-view-component\"\nimport { trackEvent } from \"../../network_requests/funnel_event.js\"\n\n@customElement(\"kin-abandonment-modal\")\nexport class AbandonmentModalComponent extends LitElement {\n @property() headline: string\n @property({ type: Boolean }) alert: boolean = false\n @property() image: string\n activatedOnce: boolean = false\n\n createRenderRoot() {\n return this\n }\n\n firstUpdated() {\n document.querySelector(\".funnel--header\").addEventListener(\"mouseleave\", (e: MouseEvent) => this.activateModal(e))\n }\n\n render() {\n return html`\n \n
\n
\n
\n
\n
\n
\n ${this.image\n ? html` \"\" `\n : html` `}\n
\n
\n
\n \n
\n
\n
\n

${this.headline}

\n
\n \n
\n
\n
\n `\n }\n\n activateModal(e: MouseEvent) {\n let activeModals = this.checkForActiveModals()\n\n if (activeModals.length > 0) {\n return\n }\n\n if (this.activatedOnce === false && e.clientY < 0) {\n setTimeout(() => {\n ;(this.querySelector(\"#modal__abandonment\") as ModalViewComponent).open()\n trackEvent(\"abandonment_modal\")\n }, 500)\n this.activatedOnce = true\n document.body.removeEventListener(\"mouseleave\", (e: MouseEvent) => this.activateModal(e))\n }\n }\n\n checkForActiveModals() {\n return Array.from(document.querySelectorAll(\".k-modal.is-active\"))\n }\n\n closeModal() {\n ;(this.querySelector(\"#modal__abandonment\") as ModalViewComponent).close()\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { request } from \"../../utils/request\"\nimport { formatMoney } from \"../shared/utils/utils\"\nimport debounce from \"lodash.debounce\"\n\ninterface RCEResponse {\n pending_new_replacement_cost: boolean\n replacement_cost: number\n}\n\n@customElement(\"kin-srf-replacement-cost\")\nexport class ReplacementCostComponent extends LitElement {\n @property() policyId: number\n waiting: boolean = true\n replacementCost: number\n\n // Since we're not using slots, we don't need the Shady DOM.\n createRenderRoot() {\n return this\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.checkForReplacementCost()\n }\n\n render() {\n if (this.waiting) {\n return html`\n \n \n Calculating...\n \n `\n } else {\n return html` ${formatMoney(this.replacementCost)} `\n }\n }\n\n private checkForReplacementCost() {\n const response = request(`/kintranet/sales_funnel/property_details/${this.policyId}/rce_value`)\n response.then(json => {\n if (json.pending_new_replacement_cost) {\n this.waiting = true\n setTimeout(() => {\n this.checkForReplacementCost()\n }, 2000)\n return\n }\n\n this.waiting = false\n this.replacementCost = json.replacement_cost\n\n this.requestUpdate()\n })\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { request } from \"../../utils/request\"\nimport debounce from \"lodash.debounce\"\n\ninterface PolicyApplicationResponse {\n pending_application: boolean\n message_prompt: string\n}\n\n@customElement(\"kin-policy-application\")\nexport class PolicyApplicationComponent extends LitElement {\n @property() policyId: number\n waiting: boolean = true\n messagePrompt: string\n limitExceeded: boolean\n limitInterval: any\n onPolicyApplicationSuccess: CustomEvent\n\n // Since we're not using slots, we don't need the Shady DOM.\n createRenderRoot() {\n return this\n }\n\n connectedCallback() {\n super.connectedCallback()\n this.waitForPolicyApplication()\n this.checkForPolicyApplication()\n }\n\n render() {\n if (this.waiting) {\n return html`\n
\n \n

Generating Application...

\n ${this.limitExceeded ? html`

This is taking too long... Try refreshing the page or contacting #production-support

` : \"\"}\n
\n `\n }\n }\n\n waitForPolicyApplication() {\n this.limitInterval = setTimeout(() => {\n this.limitExceeded = true\n this.requestUpdate()\n }, 30000)\n }\n\n private checkForPolicyApplication() {\n const response = request(`/kintranet/policies/${this.policyId}/policy_applications/status`)\n response.then(json => {\n if (json.pending_application) {\n this.waiting = true\n setTimeout(() => {\n this.checkForPolicyApplication()\n }, 1000)\n return\n }\n\n this.waiting = false\n this.limitInterval = null\n this.messagePrompt = json.message_prompt\n\n this.onPolicyApplicationSuccess = new CustomEvent(\"kin-policy-application:generated\", {\n bubbles: true,\n detail: { customMessage: json.message_prompt }\n })\n this.dispatchEvent(this.onPolicyApplicationSuccess)\n this.requestUpdate()\n })\n }\n}\n","import { html, LitElement } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport Flasher from \"../../utils/flasher\"\nimport { datadogLogs } from \"@datadog/browser-logs\"\n\n@customElement(\"mark-duplicate-button\")\nexport class MarkDuplicateButtonComponent extends LitElement {\n @property() opportunityId: string\n @property() lostReason: string\n @property() path: string\n\n createRenderRoot() {\n return this\n }\n\n private refresh() {\n window.location.reload()\n }\n\n private token(): string {\n const tokenTag: HTMLMetaElement = document.querySelector('meta[name=\"csrf-token\"]')\n return tokenTag.content\n }\n\n private logToDatadog(error) {\n datadogLogs.logger.error(`Bad response from server when attempting to mark opportunity ${this.opportunityId} as duplicate.`, {}, error)\n }\n\n private post(event) {\n const options = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": this.token()\n },\n body: JSON.stringify({\n opportunity_id: this.opportunityId,\n lost_reason: this.lostReason,\n quick_mark_duplicate: true\n })\n }\n fetch(this.path, options)\n .then(response => {\n if (!response.ok) {\n Flasher.error(\"Marking opportunity as duplicate failed.\")\n } else {\n this.refresh()\n }\n })\n .catch(error => {\n this.logToDatadog(error)\n })\n }\n\n render() {\n return html`\n \n \n \n \n \n \n \n \n \n \n \n `\n }\n}\n","export default class QuoteNoteService {\n private CSR_QUOTE_BASE_URL = \"/kintranet/csr_quotes\"\n /**\n * Initialize a QuoteService object\n * @param _csrfToken - X-Csrf-Token used in headers\n */\n constructor(private _csrfToken: string) {}\n\n async getNote(csrQuoteId: number, noteId: number) {\n return await this.fetch(`${this.CSR_QUOTE_BASE_URL}/${csrQuoteId}/notes/${noteId}`)\n }\n\n async getNotes(csrQuoteId: number) {\n return await this.fetch(`${this.CSR_QUOTE_BASE_URL}/${csrQuoteId}/notes`)\n }\n\n async createNote(csrQuoteId: number, newNote: string) {\n const options = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": this._csrfToken\n },\n body: JSON.stringify({\n body: newNote,\n hidden: false\n })\n }\n return await this.fetch(`${this.CSR_QUOTE_BASE_URL}/${csrQuoteId}/notes`, options)\n }\n\n async deleteNote(csrQuoteId: number, noteId: number) {\n const options = {\n method: \"DELETE\",\n headers: {\n \"X-Csrf-Token\": this._csrfToken\n }\n }\n return await this.fetch(`${this.CSR_QUOTE_BASE_URL}/${csrQuoteId}/notes/${noteId}`, options, true)\n }\n\n async updateNote(csrQuoteId: number, noteId: number, updatedNote: string) {\n const options = {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": this._csrfToken\n },\n body: JSON.stringify({\n body: updatedNote,\n hidden: false\n })\n }\n return await this.fetch(`${this.CSR_QUOTE_BASE_URL}/${csrQuoteId}/notes/${noteId}`, options)\n }\n\n private async fetch(url: string, options: RequestInit = {}, isDelete: boolean = false) {\n try {\n const response = await fetch(url, options)\n\n if (isDelete && response.status === 200) {\n return response\n }\n\n return await response.json()\n } catch (error) {\n throw new Error(error)\n }\n }\n}\n","export default class QuoteRestoreService {\n private QUOTE_RESTORE_URL = \"/kintranet/quotes/restore\"\n private QUOTE_DIFFERENCES_URL = \"/kintranet/quotes/policy_quote_differences\"\n\n /**\n * Initialize a QuoteService object\n * @param _csrfToken - X-Csrf-Token used in headers\n */\n constructor(private _csrfToken: string) {}\n\n async restoreQuote(csrQuoteId: number) {\n const options = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": this._csrfToken\n },\n body: JSON.stringify({\n csr_quote_id: csrQuoteId\n })\n }\n\n return await this.fetch(`${this.QUOTE_RESTORE_URL}`, options)\n }\n\n async getDifferences(csrQuoteId: number) {\n const options = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": this._csrfToken\n }\n }\n\n return await this.fetch(`${this.QUOTE_DIFFERENCES_URL}/${csrQuoteId}`, options)\n }\n\n private async fetch(url: string, options: RequestInit = {}) {\n try {\n const response = await fetch(url, options)\n\n return await response.json()\n } catch (error) {\n throw new Error(error)\n }\n }\n}\n","/*\n * UtilsService\n * Service for utility functions, created because exporting methods from `utils.ts` has\n * made them horrendously difficult to test.\n */\nexport default class UtilsService {\n static redirectTo(url: string): void {\n window.location.href = url\n }\n}\n","import { QuoteRestoreDifferences } from \"./quote-restore-differences.model\"\n\nexport class QuoteDifferencesUtils {\n static areThereDifferences(differences: QuoteRestoreDifferences) {\n return (\n !!differences &&\n (differences.coverages_and_deductibles?.length > 0 || differences.discounts?.length > 0 || differences.add_ons?.length > 0)\n )\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport type { Quote } from \"./quote.model\"\nimport { QuoteRestoreDifferenceHash, QuoteRestoreDifferences } from \"./quote-restore-differences.model\"\nimport { QuoteDifferencesUtils } from \"./quote-differences-utils\"\n\n@customElement(\"kin-quote-restore-modal\")\nexport class QuoteRestoreModal extends LitElement {\n @property({ type: Boolean, reflect: true }) public open = false\n @property({ type: String }) id = \"\"\n @property({ type: Object }) quoteToRestore: Quote | null = null\n @property({ type: Object }) quoteRestoreDifferences: QuoteRestoreDifferences | null\n\n protected createRenderRoot(): QuoteRestoreModal {\n return this\n }\n\n renderQuoteDifference(hash: QuoteRestoreDifferenceHash) {\n return html`\n \n ${hash.display}\n ${hash.old}\n ${hash.new}\n \n `\n }\n\n renderQuoteDifferences(differences: QuoteRestoreDifferences) {\n const sections = [\n { title: \"Coverages and Deductibles\", items: differences.coverages_and_deductibles },\n { title: \"Discounts\", items: differences.discounts },\n { title: \"Add-Ons\", items: differences.add_ons }\n ]\n\n return sections\n .map(section =>\n section.items.length > 0\n ? html`\n \n ${section.title}\n \n \n \n ${section.items.map(difference => this.renderQuoteDifference(difference))}\n `\n : \"\"\n )\n .reduce((acc, curr) => html`${acc}${curr}`, html``)\n }\n\n render() {\n const anyDifferences = QuoteDifferencesUtils.areThereDifferences(this.quoteRestoreDifferences)\n\n return html`\n \n

\n Are you sure you want to restore the Quote ID ${this.quoteToRestore?.id} at ${this.quoteToRestore?.premium_display}?\n

\n\n
\n

\n The following table outlines the changes you will see across coverages, discounts, and add-ons between\n the latest quote generated and the restored quote.\n

\n
\n \n \n \n \n \n \n \n \n \n ${this.quoteRestoreDifferences ? this.renderQuoteDifferences(this.quoteRestoreDifferences) : \"\"}\n \n
Current ValueRestored Value
\n
\n
\n\n
\n

There are no differences between the current state and the restored quote.

\n
\n\n
\n
\n \n Sales agents are still responsible for verifying property details, effective dates, and insured persons are accurate.\n
\n Upon clicking “Restore Quote”, effective dates, property details, and insured persons will not be restored and may affect\n premiums\n
\n
\n Restore Quote\n Cancel\n
\n
\n
\n \n `\n }\n\n closeRestoreQuoteModal() {\n this.dispatchEvent(new CustomEvent(\"close-restore-quote-modal\"))\n }\n\n handleRestoreQuote() {\n this.dispatchEvent(new CustomEvent(\"handle-restore-quote\"))\n }\n}\n","import { LitElement, html } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport type { Quote } from \"./quote.model\"\nimport { QuoteRestoreDifferenceHash, QuoteRestoreDifferences } from \"./quote-restore-differences.model\"\nimport { QuoteDifferencesUtils } from \"./quote-differences-utils\"\n\n@customElement(\"kin-quote-endorse-modal\")\nexport class QuoteEndorseModal extends LitElement {\n @property({ type: Boolean, reflect: true }) public open = false\n @property({ type: String }) id = \"\"\n @property({ type: Object }) quoteToEndorse: Quote | null = null\n @property({ type: Object }) quoteRestoreDifferences: QuoteRestoreDifferences | null\n\n protected createRenderRoot(): QuoteEndorseModal {\n return this\n }\n\n renderQuoteDifference(hash: QuoteRestoreDifferenceHash) {\n return html`\n \n ${hash.display}\n ${hash.old}\n ${hash.new}\n \n `\n }\n\n renderQuoteDifferences(differences: QuoteRestoreDifferences) {\n const sections = [\n { title: \"Coverages and Deductibles\", items: differences.coverages_and_deductibles },\n { title: \"Discounts\", items: differences.discounts },\n { title: \"Add-Ons\", items: differences.add_ons }\n ]\n\n return sections\n .map(section =>\n section.items.length > 0\n ? html`\n \n ${section.title}\n \n \n \n ${section.items.map(difference => this.renderQuoteDifference(difference))}\n `\n : \"\"\n )\n .reduce((acc, curr) => html`${acc}${curr}`, html``)\n }\n\n render() {\n const anyDifferences = QuoteDifferencesUtils.areThereDifferences(this.quoteRestoreDifferences)\n\n return html`\n \n

\n Are you sure you want to endorse the Quote ID ${this.quoteToEndorse?.id} at ${this.quoteToEndorse?.premium_display}?\n

\n\n
\n

\n The following table outlines the changes you will see across coverages, discounts, and add-ons between\n the latest quote generated and the endorsed quote.\n

\n
\n \n \n \n \n \n \n \n \n \n ${this.quoteRestoreDifferences ? this.renderQuoteDifferences(this.quoteRestoreDifferences) : \"\"}\n \n
Current ValueEndorsed Value
\n
\n
\n\n
\n

There are no differences between the current state and the endorsed quote.

\n
\n\n
\n
\n \n Sales agents are still responsible for verifying property details, effective dates, and insured persons are accurate.\n
\n Upon clicking “Endorse Quote”, effective dates, property details, and insured persons will not be endorsed and may affect\n premiums\n
\n

\n
\n Endorse Quote\n Cancel\n
\n
\n
\n \n `\n }\n\n closeEndorseQuoteModal() {\n this.dispatchEvent(new CustomEvent(\"close-endorse-quote-modal\"))\n }\n\n handleEndorseQuote() {\n this.dispatchEvent(new CustomEvent(\"handle-endorse-quote\"))\n }\n}\n","export default class QuoteEndorseService {\n private RENEWAL_QUOTE_URL = \"/kintranet/policies\"\n\n /**\n * Initialize a QuoteService object\n * @param _csrfToken - X-Csrf-Token used in headers\n */\n constructor(private _csrfToken: string) {}\n\n async endorseQuote(id: number, csrQuoteId: number) {\n const options = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": this._csrfToken\n },\n body: JSON.stringify({\n csr_quote_id: csrQuoteId\n })\n }\n\n return await this.fetch(`${this.RENEWAL_QUOTE_URL}/${id}/renewal_quotes/${csrQuoteId}/endorse_quote`, options)\n }\n\n async getDifferences(policyId: number, csrQuoteId: number) {\n const options = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": this._csrfToken\n }\n }\n\n return await this.fetch(`${this.RENEWAL_QUOTE_URL}/${policyId}/renewal_quotes/${csrQuoteId}/policy_renewal_differences`, options)\n }\n\n private async fetch(url: string, options: RequestInit = {}) {\n try {\n const response = await fetch(url, options)\n\n return await response.json()\n } catch (error) {\n throw new Error(error)\n }\n }\n}\n","import { LitElement, TemplateResult, html } from \"lit\"\nimport { customElement, property, state, query } from \"lit/decorators.js\"\nimport Flasher from \"../../../../assets/javascript/utils/flasher\"\nimport type { Quote } from \"./quote.model\"\nimport QuoteNoteService from \"../../services/quote_note.service\"\nimport QuoteRestoreService from \"../../services/quote_restore.service\"\nimport { QuoteRestoreDifferenceHash, QuoteRestoreDifferences } from \"./quote-restore-differences.model\"\nimport type { KinToastGroup } from \"@kin/web-components/dist/external\"\nimport UtilsService from \"../shared/utils/utils.service\"\nimport \"./quote-restore-modal\"\nimport \"./quote-endorse-modal\"\nimport QuoteEndorseService from \"../../services/quote_endorse.service\"\n\ninterface CopyItem {\n copy: string\n copyFallback: string\n}\n\ninterface QuoteRow extends Quote {\n copyable: boolean\n checked: boolean\n}\n\n@customElement(\"kin-quotes-table\")\nexport class QuotesTableComponent extends LitElement {\n @property({ type: Array })\n quotes: Quote[] = []\n\n @state()\n quoteRows: QuoteRow[] = []\n\n @state()\n copyItems: Map = new Map()\n\n @state()\n allChecked = false\n\n @state()\n isEditNoteDialogOpen = false\n\n @state()\n isRestoreQuoteDialogOpen = false\n\n @state()\n quoteToEdit: Quote | null = null\n\n @state()\n quoteToRestore: Quote | null = null\n\n @state()\n quoteRestoreDifferences: QuoteRestoreDifferences | null = null\n\n @state()\n noteToEdit = \"\"\n\n @query(\"#edit-note-textarea\")\n textarea!: HTMLTextAreaElement\n\n @state()\n restoreQuoteRequestInProgress: boolean = false\n\n @state()\n quoteToEndorse: Quote | null = null\n\n @state()\n endorseQuoteRequestInProgress: boolean = false\n\n @state()\n quoteEndorseDifferences: QuoteRestoreDifferences | null = null\n\n @state()\n isEndorseQuoteDialogOpen = false\n\n get copyValue(): string {\n return [...this.copyItems.values()].map(({ copy }) => `

${copy}

`).join(\"\")\n }\n\n get copyFallbackValue(): string {\n return [...this.copyItems.values()].map(({ copyFallback }) => copyFallback).join(\"\\n\")\n }\n\n get hasCopyableQuotes(): boolean {\n return this.quoteRows.some(quote => quote.copyable)\n }\n\n get quoteVersioningEnabled(): boolean {\n return this.quoteRows.some(quote => quote.quote_versioning_feature_enabled)\n }\n\n get copyQuotesButtonText(): string {\n return `Copy Quote Links (${this.copyItems.size})`\n }\n\n get token(): string {\n const metaEl = document.querySelector('meta[name=\"csrf-token\"]') as HTMLMetaElement\n return metaEl?.content ?? \"\"\n }\n\n private quoteNoteService!: QuoteNoteService\n private quoteRestoreService = new QuoteRestoreService(this.token)\n private quoteEndorseService = new QuoteEndorseService(this.token)\n\n protected createRenderRoot(): QuotesTableComponent {\n return this\n }\n\n get isRenewal(): boolean {\n return this.quoteRows.some(quote => quote.term > 0)\n }\n\n showCorrectActionColumnHeader(): TemplateResult {\n if (this.isRenewal) {\n return html`Endorse Renewal`\n } else {\n if (this.quoteVersioningEnabled) {\n return html` Restore Quote ({ ...quote, copyable: !quote.expired, checked: false }))\n }\n\n restoreQuoteButton(quote: Quote) {\n const quoteId = quote.id\n\n if (this.quoteToRestore?.id === quoteId && this.restoreQuoteRequestInProgress) {\n return html``\n } else {\n return html`\n this.openRestoreQuoteModal(quote)}\n ?disabled=${this.restoreQuoteRequestInProgress}\n >\n Restore\n \n `\n }\n }\n\n endorseQuoteButton(quote: Quote) {\n return html`\n ${this.quoteToEndorse?.id === quote.id && this.endorseQuoteRequestInProgress\n ? html``\n : html`\n this.openEndorseQuoteModal(quote)}\n ?disabled=${this.quoteToEndorse?.id === quote.id && this.endorseQuoteRequestInProgress}\n >\n Endorse\n \n `}\n `\n }\n\n render(): TemplateResult {\n return html`
\n
\n \n
\n \n \n \n \n \n \n ${this.isRenewal ? html`` : \"\"}\n \n \n \n \n \n \n \n \n ${this.showCorrectActionColumnHeader()}\n \n \n \n ${this.quoteRows.map(\n quote => html`\n \n \n \n ${quote.term > 0 ? html` ` : \"\"}\n \n \n \n \n \n \n \n \n \n ${quote.quote_versioning_feature_enabled && quote.restorable\n ? html` `\n : html``}\n \n `\n )}\n \n
\n Quotes\n
\n ${this.hasCopyableQuotes\n ? html` `\n : \"\"}\n IDTermPremiumExpiration DateCreated ByCreated AtPreview Link\n Copy Quote Link\n \n

\n Copy Quote Link can be used to share quote links via email. SMS is not supported at this time (PDF Quotes will need to be\n downloaded via the Preview Link and attached).\n

\n
\n
\n Internal Note\n \n

\n Internal reference only to distinguish between quotes. Customer discussion/information needs to be included as a regular\n PAS note.\n

\n
\n
Edit Note
\n ${quote.copyable\n ? html` `\n : \"\"}\n ${quote.id}${quote.term}${quote.premium_display}${quote.expiration_date_display || \"-\"}${quote.csr_email}${quote.created_at_display}\n View\n \n ${quote.copyable\n ? html` `\n : \"\"}\n ${quote.last_note?.body}\n this.openEditNoteModal(quote)}\n class=\"button button--link button--sm\"\n >\n Edit\n \n 0 ? \"highlighted\" : \"\"}\">\n ${this.isRenewal && quote.term > 0 ? this.endorseQuoteButton(quote) : \"\"}\n ${this.restoreQuoteButton(quote)}
\n
\n \n {\n this.toggleCopyForAllRows(false)\n }}\n class=\"button button--link button--sm\"\n >\n Undo Selection\n \n
\n \n

Edit Internal Note

\n
\n \n
${this.noteToEdit.length} / 100 characters
\n
\n
\n Cancel\n Save\n
\n \n\n \n\n \n
`\n }\n\n handleChange(checked: boolean, id: number, copy: string, copyFallback: string): void {\n if (checked) {\n this.toggleSingleRow(id, true)\n this.addCopyItem(id, {\n copy,\n copyFallback\n })\n return\n }\n\n this.toggleSingleRow(id, false)\n this.removeCopyItem(id)\n }\n\n toggleCopyForAllRows(checked: boolean): void {\n if (checked) {\n this.allChecked = true\n this.toggleAllRows(true)\n this.copyItems.clear()\n this.quoteRows\n .filter(quote => quote.copyable)\n .forEach(({ checked, id, share_html, share_text }) => {\n if (checked) {\n this.copyItems.set(id, { copy: share_html, copyFallback: share_text })\n }\n })\n return\n }\n\n this.allChecked = false\n this.copyItems.clear()\n this.toggleAllRows(false)\n }\n\n addCopyItem(key: number, item: CopyItem): void {\n this.copyItems.set(key, item)\n this.requestUpdate()\n }\n\n removeCopyItem(key: number): void {\n this.copyItems.delete(key)\n this.requestUpdate()\n }\n\n toggleSingleRow(id: number, checked: boolean): void {\n this.quoteRows = this.quoteRows.map(quote => {\n if (quote.id === id) {\n return { ...quote, checked }\n }\n\n return quote\n })\n }\n\n toggleAllRows(checked: boolean): void {\n this.quoteRows = this.quoteRows.map(quote => {\n if (quote.copyable) {\n return { ...quote, checked }\n }\n\n return quote\n })\n }\n\n handleNoteAutoResize(): void {\n // Reset height to auto to recalculate height based on content\n this.textarea.style.height = \"auto\"\n // Set height to the scrollHeight of the content\n this.textarea.style.height = this.textarea.scrollHeight + \"px\"\n }\n\n cancelEditNote(): void {\n this.quoteToEdit = null\n this.noteToEdit = \"\"\n this.isEditNoteDialogOpen = false\n }\n\n handleEditingNote(updatedNote: string): void {\n this.noteToEdit = updatedNote\n this.handleNoteAutoResize()\n }\n\n handleSave(): void {\n if (this.quoteToEdit.last_note) {\n this.editNote()\n } else {\n this.createNote()\n }\n }\n\n openEditNoteModal(quote: Quote): void {\n this.quoteToEdit = quote\n this.noteToEdit = quote.last_note ? this.quoteToEdit.last_note.body : \"\"\n this.isEditNoteDialogOpen = true\n }\n\n async editNote(): Promise {\n try {\n const updatedNote = await this.quoteNoteService.updateNote(this.quoteToEdit.id, this.quoteToEdit.last_note.id, this.noteToEdit)\n if (updatedNote.error) {\n this.handleCreateEditNoteError(updatedNote.message)\n } else {\n this.quoteToEdit.last_note = updatedNote\n this.cancelEditNote()\n this.requestUpdate()\n }\n } catch (e) {\n this.handleCreateEditNoteError(e.message)\n }\n }\n\n async createNote(): Promise {\n try {\n const newNote = await this.quoteNoteService.createNote(this.quoteToEdit.id, this.noteToEdit)\n if (newNote.error) {\n this.handleCreateEditNoteError(newNote.message)\n } else {\n this.quoteToEdit.last_note = newNote\n this.cancelEditNote()\n this.requestUpdate()\n }\n } catch (e) {\n this.handleCreateEditNoteError(e.message)\n }\n }\n\n handleCreateEditNoteError(errorMessage: string): void {\n Flasher.error(`Failed to save note, please try again later. Error: ` + errorMessage)\n }\n\n openRestoreQuoteModal(quote: Quote): void {\n this.quoteToRestore = quote\n\n this.quoteRestoreService\n .getDifferences(this.quoteToRestore.id)\n .then(result => {\n this.quoteRestoreDifferences = result.differences\n this.isRestoreQuoteDialogOpen = true\n })\n .catch(() => {\n this.handleRestoreQuoteToast(\"Failed to retrieve quote details.\", \"error\")\n })\n }\n\n openEndorseQuoteModal(quote: Quote): void {\n this.quoteToEndorse = quote\n\n this.quoteEndorseService\n .getDifferences(this.quoteToEndorse.property_id, this.quoteToEndorse.id)\n .then(result => {\n this.quoteRestoreDifferences = result.differences\n this.isEndorseQuoteDialogOpen = true\n })\n .catch(() => {\n this.handleEndorseQuoteToast(\"Failed to retrieve quote details.\", \"error\")\n })\n }\n closeRestoreQuoteModal(): void {\n this.isRestoreQuoteDialogOpen = false\n this.quoteToRestore = null\n this.quoteRestoreDifferences = null\n }\n\n closeEndorseQuoteModal(): void {\n this.isEndorseQuoteDialogOpen = false\n this.quoteToEndorse = null\n this.quoteRestoreDifferences = null\n }\n\n handleRestoreQuote(): void {\n const quote = this.quoteToRestore\n this.closeRestoreQuoteModal()\n this.restoreQuote(quote)\n }\n\n handleEndorseQuote(): void {\n const quote = this.quoteToEndorse\n this.closeEndorseQuoteModal()\n this.endorseQuote(quote)\n }\n\n handleRestoreQuoteToast(message: string, toastType: \"error\" | \"success\" | \"warning\" | \"info\"): void {\n const container = document.querySelector(\".toast-group-container\")\n const group = container.querySelector(\"kin-toast-group\") as KinToastGroup\n group.addToast(message, toastType)\n }\n\n handleEndorseQuoteToast(message: string, toastType: \"error\" | \"success\" | \"warning\" | \"info\"): void {\n const container = document.querySelector(\".toast-group-container\")\n const group = container.querySelector(\"kin-toast-group\") as KinToastGroup\n group.addToast(message, toastType)\n }\n\n restoreQuote(quote: Quote): void {\n this.restoreQuoteRequestInProgress = true\n this.handleRestoreQuoteToast(\"This quote is being restored. You will be redirected once complete.\", \"info\")\n\n this.quoteRestoreService\n .restoreQuote(quote.id)\n .then(() => {\n this.restoreQuoteRequestInProgress = false\n this.quoteToRestore = null\n UtilsService.redirectTo(`/kintranet/properties/${quote.property_id}`)\n })\n .catch(() => {\n this.restoreQuoteRequestInProgress = false\n this.quoteToRestore = null\n this.handleRestoreQuoteToast(\"Your quote could not be restored. Please try again or contact production support.\", \"error\")\n })\n }\n\n endorseQuote(quote: Quote): void {\n this.endorseQuoteRequestInProgress = true\n this.handleEndorseQuoteToast(\"This quote is being endorsed. You will be redirected once complete.\", \"info\")\n\n this.quoteEndorseService\n .endorseQuote(quote.property_id, quote.id)\n .then(() => {\n this.endorseQuoteRequestInProgress = false\n this.quoteToEndorse = null\n UtilsService.redirectTo(`/kintranet/properties/${quote.property_id}`)\n })\n .catch(() => {\n this.endorseQuoteRequestInProgress = false\n this.quoteToEndorse = null\n this.handleEndorseQuoteToast(\"Your quote could not be endorsed. Please try again or contact production support.\", \"error\")\n })\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kin-quotes-table\": QuotesTableComponent\n }\n}\n","export class LicenseNumbersService {\n static async create(csrId: number, body: { license_number: { state: string; license: string } }): Promise {\n const options = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": LicenseNumbersService.token\n },\n body: JSON.stringify(body)\n }\n\n return fetch(`/kintranet/csrs/${csrId}/license_numbers`, options)\n }\n\n static async update(\n csrId: number,\n licenseNumberId: number,\n body: { license_number: { state: string; license: string } }\n ): Promise {\n const options = {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": LicenseNumbersService.token\n },\n body: JSON.stringify(body)\n }\n return fetch(`/kintranet/csrs/${csrId}/license_numbers/${licenseNumberId}`, options)\n }\n\n static async delete(csrId: number, licenseNumberId: number): Promise {\n const options = {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"X-Csrf-Token\": LicenseNumbersService.token\n }\n }\n return fetch(`/kintranet/csrs/${csrId}/license_numbers/${licenseNumberId}`, options)\n }\n\n private static get token(): string {\n const metaEl = document.querySelector('meta[name=\"csrf-token\"]') as HTMLMetaElement\n return metaEl?.content ?? \"\"\n }\n}\n","import { LitElement, TemplateResult, html } from \"lit\"\nimport { customElement, property, state } from \"lit/decorators.js\"\nimport { classMap } from \"lit/directives/class-map.js\"\nimport { repeat } from \"lit/directives/repeat.js\"\nimport { animate, flyLeft, flyRight } from \"@lit-labs/motion\"\nimport { LicenseNumbersService } from \"../../services/license-numbers.service\"\nimport { LicenseNumber } from \"../../models/license-number.model\"\nimport Flasher from \"../../utils/flasher\"\n\nexport interface StateOption {\n value: string\n label: string\n}\n\nexport type LicenseNumberFormActions = \"create\" | \"update\" | \"delete\"\n\n@customElement(\"kin-license-numbers-form\")\nexport class LicenseNumbersFormComponent extends LitElement {\n public static STATE_MAP: Record = {\n AL: \"Alabama\",\n AK: \"Alaska\",\n AS: \"American Samoa\",\n AZ: \"Arizona\",\n AR: \"Arkansas\",\n CA: \"California\",\n CO: \"Colorado\",\n CT: \"Connecticut\",\n DE: \"Delaware\",\n DC: \"District of Columbia\",\n FL: \"Florida\",\n GA: \"Georgia\",\n GU: \"Guam\",\n HI: \"Hawaii\",\n ID: \"Idaho\",\n IL: \"Illinois\",\n IN: \"Indiana\",\n IA: \"Iowa\",\n KS: \"Kansas\",\n KY: \"Kentucky\",\n LA: \"Louisiana\",\n ME: \"Maine\",\n MD: \"Maryland\",\n MA: \"Massachusetts\",\n MI: \"Michigan\",\n MN: \"Minnesota\",\n MS: \"Mississippi\",\n MO: \"Missouri\",\n MT: \"Montana\",\n NE: \"Nebraska\",\n NV: \"Nevada\",\n NH: \"New Hampshire\",\n NJ: \"New Jersey\",\n NM: \"New Mexico\",\n NY: \"New York\",\n NC: \"North Carolina\",\n ND: \"North Dakota\",\n OH: \"Ohio\",\n OK: \"Oklahoma\",\n OR: \"Oregon\",\n PA: \"Pennsylvania\",\n PR: \"Puerto Rico\",\n RI: \"Rhode Island\",\n SC: \"South Carolina\",\n SD: \"South Dakota\",\n TN: \"Tennessee\",\n TX: \"Texas\",\n UT: \"Utah\",\n VT: \"Vermont\",\n VI: \"Virgin Islands\",\n VA: \"Virginia\",\n WA: \"Washington\",\n WV: \"West Virginia\",\n WI: \"Wisconsin\",\n WY: \"Wyoming\"\n }\n\n @property({ type: Number })\n public csrId = -1\n\n @property({ type: Array })\n public licenseNumbers: LicenseNumber[] = []\n\n @property({ type: Boolean })\n public readWrite = false\n\n @state()\n private selectedLicense: LicenseNumber | null = null\n\n @state()\n private actionInProgress: LicenseNumberFormActions = \"create\"\n\n @state()\n private showDialog = false\n\n @state()\n private stateOptions: StateOption[] = Object.entries(LicenseNumbersFormComponent.STATE_MAP)\n .sort((a, b) => a[1].localeCompare(b[1]))\n .map(([value, label]) => ({ value, label }))\n\n @state()\n private licenseState = this.defaultState.value\n\n @state()\n private licenseNumber = \"\"\n\n private dialogText: Record = {\n create: {\n headerText: \"Add License\",\n buttonText: \"Add\"\n },\n update: {\n headerText: \"Edit License\",\n buttonText: \"Update\"\n },\n delete: {\n headerText: \"Delete License\",\n buttonText: \"Delete\"\n }\n }\n\n public render(): TemplateResult {\n return html`\n
    \n ${repeat(\n this.licenseNumbers,\n licenseNumber => licenseNumber.id,\n licenseNumber => html`\n
    \n ${this.readWrite\n ? html`\n \n this.handleDialogOpen(\"update\", licenseNumber)}> Edit \n this.handleDialogOpen(\"delete\", licenseNumber)}> Delete \n `\n : \"\"}\n
    \n
    \n
    State
    \n
    ${LicenseNumbersFormComponent.STATE_MAP[licenseNumber.state]}
    \n
    \n
    \n
    License Number
    \n
    ${licenseNumber.license}
    \n
    \n
    \n
    \n `\n )}\n
\n ${this.readWrite\n ? html`
\n \n
`\n : \"\"}\n \n

${this.dialogText[this.actionInProgress].headerText}

\n
\n ${this.actionInProgress === \"delete\"\n ? html`

\n Are you sure you want to delete the license number for\n ${LicenseNumbersFormComponent.STATE_MAP[this.selectedLicense?.state]}? This cannot be undone.\n

`\n : html` \n `}\n
\n
\n \n \n ${this.dialogText[this.actionInProgress].buttonText}\n \n
\n
\n `\n }\n\n public createRenderRoot(): this {\n return this\n }\n\n public handleDialogOpen(action: LicenseNumberFormActions, license: LicenseNumber): void {\n this.actionInProgress = action\n this.selectedLicense = license\n this.licenseState = this.selectedLicense?.state || this.defaultState.value\n this.licenseNumber = this.selectedLicense?.license || \"\"\n this.showDialog = true\n }\n\n public handleDialogHide(): void {\n this.actionInProgress = \"create\"\n this.selectedLicense = null\n this.licenseState = this.defaultState.value\n this.licenseNumber = \"\"\n this.showDialog = false\n }\n\n public handleKeypress(e: KeyboardEvent): void {\n if (e.key !== \"Enter\") {\n return\n }\n\n e.preventDefault()\n e.stopPropagation()\n this.handleSubmit()\n }\n\n public handleSubmit(): void {\n if (this.licenseState.trim() === \"\" || this.licenseNumber.trim() === \"\") {\n return\n }\n\n if (this.actionInProgress === \"create\") {\n this.createLicense()\n }\n\n if (this.actionInProgress === \"update\") {\n this.updateLicense()\n }\n\n if (this.actionInProgress === \"delete\") {\n this.deleteLicense()\n }\n }\n\n private async createLicense(): Promise {\n try {\n const response = await LicenseNumbersService.create(this.csrId, {\n license_number: { state: this.licenseState, license: this.licenseNumber }\n })\n\n if (!response.ok) {\n const errorMessage = await this.parseErrorMessage(response)\n throw new Error(errorMessage)\n }\n\n const newLicense = await response.json()\n this.licenseNumbers = [...this.licenseNumbers, newLicense].sort((a, b) =>\n LicenseNumbersFormComponent.STATE_MAP[a.state].localeCompare(LicenseNumbersFormComponent.STATE_MAP[b.state])\n )\n this.showDialog = false\n this.selectedLicense = null\n Flasher.success(`License number for ${LicenseNumbersFormComponent.STATE_MAP[newLicense.state]} was created successfully.`)\n } catch (e: unknown) {\n if (typeof e === \"object\" && \"message\" in e) {\n Flasher.error(e.message)\n }\n }\n }\n\n private async updateLicense(): Promise {\n try {\n const response = await LicenseNumbersService.update(this.csrId, this.selectedLicense.id, {\n license_number: { state: this.licenseState, license: this.licenseNumber }\n })\n\n if (!response.ok) {\n const errorMessage = await this.parseErrorMessage(response)\n throw new Error(errorMessage)\n }\n\n const updatedLicense = await response.json()\n this.licenseNumbers = this.licenseNumbers\n .map(licenseNumber => {\n if (updatedLicense.id === licenseNumber.id) {\n return updatedLicense\n }\n\n return licenseNumber\n })\n .sort((a, b) => LicenseNumbersFormComponent.STATE_MAP[a.state].localeCompare(LicenseNumbersFormComponent.STATE_MAP[b.state]))\n this.showDialog = false\n this.selectedLicense = null\n Flasher.success(`License number for ${LicenseNumbersFormComponent.STATE_MAP[updatedLicense.state]} was updated successfully.`)\n } catch (e: unknown) {\n if (typeof e === \"object\" && \"message\" in e) {\n Flasher.error(e.message)\n }\n }\n }\n\n private async deleteLicense(): Promise {\n try {\n const response = await LicenseNumbersService.delete(this.csrId, this.selectedLicense.id)\n\n if (!response.ok) {\n const errorMessage = await this.parseErrorMessage(response)\n throw new Error(errorMessage)\n }\n\n this.showDialog = false\n Flasher.success(`License number for ${LicenseNumbersFormComponent.STATE_MAP[this.selectedLicense.state]} was deleted successfully.`)\n this.licenseNumbers = this.licenseNumbers.filter(licenseNumber => licenseNumber.id !== this.selectedLicense.id)\n this.selectedLicense = null\n } catch (e: unknown) {\n if (typeof e === \"object\" && \"message\" in e) {\n Flasher.error(e.message)\n }\n }\n }\n\n private async parseErrorMessage(\n response: Response,\n fallbackErrorMessage = \"There was an error processing your request, please try again later.\"\n ): Promise {\n try {\n const json = await response.json()\n return json.errors.join(\", \") ?? fallbackErrorMessage\n } catch (_e: unknown) {\n return fallbackErrorMessage\n }\n }\n\n private get states(): StateOption[] {\n const statesWithLicenses = new Set(this.licenseNumbers.map(licenseNumber => licenseNumber.state))\n\n if (this.actionInProgress === \"create\") {\n return this.stateOptions.filter(state => !statesWithLicenses.has(state.value))\n }\n\n if (this.actionInProgress === \"update\") {\n return this.stateOptions.filter(state => !statesWithLicenses.has(state.value) || state.value === this.selectedLicense?.state)\n }\n\n return this.stateOptions\n }\n\n private get defaultState(): StateOption {\n return this.states[0]\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"kin-license-numbers-form\": LicenseNumbersFormComponent\n }\n}\n","import { html, LitElement } from \"lit\"\nimport { customElement, property } from \"lit/decorators.js\"\nimport { AllCommunityModule, ModuleRegistry, createGrid } from \"ag-grid-community\"\nModuleRegistry.registerModules([AllCommunityModule])\n\n@customElement(\"cancellation-decisions-table\")\nexport class CancellationDecisionsTable extends LitElement {\n static scopedElements = {\n \"ag-grid\": createGrid\n }\n\n @property({ type: Array }) rowData: any[]\n @property({ type: Array }) columnData: any[]\n @property() gridOptions: object\n\n createRenderRoot() {\n return this\n }\n\n render() {\n return html`\n
\n \n
\n `\n }\n\n firstUpdated() {\n this.gridOptions = {\n columnDefs: this.columnData,\n rowData: this.rowData,\n enableCellTextSelection: true,\n ensureDomOrder: true,\n pagination: true,\n paginationPageSize: 50,\n rowClassRules: {\n \"bg-primary-400\": \"data.mismatched_decisions === 'true'\"\n }\n }\n const eGridDiv = document.querySelector(\"ag-grid\") as HTMLElement\n createGrid(eGridDiv, this.gridOptions)\n }\n}\n","import shared from \"./shared/index\"\nimport { AbandonmentModalComponent } from \"./quote/abandonment-modal\"\nimport { ReplacementCostComponent } from \"./sales_funnel/rce\"\nimport { PolicyApplicationComponent } from \"./shared/policy-application\"\nimport { MarkDuplicateButtonComponent } from \"./opportunity/mark-duplicate-button\"\nimport { QuotesTableComponent } from \"./quotes-table/quotes-table\"\nimport { LicenseNumbersFormComponent } from \"./csrs/license-numbers-form\"\nimport { CancellationDecisionsTable } from \"./policy_administration/cancellation-decisions-table\"\n\nconst components: any[] = shared\n\nconst quoteComponents: any[] = [AbandonmentModalComponent, ReplacementCostComponent, PolicyApplicationComponent, QuotesTableComponent]\n\nconst opportunityComponents: any[] = [MarkDuplicateButtonComponent]\n\nconst csrsComponents: any[] = [LicenseNumbersFormComponent]\n\nconst policyAdministrationComponents: any[] = [CancellationDecisionsTable]\n\nexport default [...components, ...quoteComponents, ...opportunityComponents, ...csrsComponents, ...policyAdministrationComponents]\n"],"names":["addScrollReturn","window","document","localStorage","scrollTop","ZERO_VALUE","getDefaultFor","id","options","returnArray","i","returnMap","removeOptions","selectElement","length","copyNoCoverageElement","defaultOptionValues","element","removeNoneIfSelected","isSelectedElements","toRemove","exportObject","isZero","ele","setElementToNoneIfNotSelected","elements","neededElements","parseCoverages","value","maybeValue","setToNone","findIndex","getZeroOrSelectedFrom","lessThanOrEqualTo","larger","smaller","largerSelectedValue","smallerSelectedValue","validSmaller","largerValue","selected","copyOriginalOption","setEqual","from","to","removeNoneOption","zeroIndex","MATCHERS","driverLicenseValidation","licenseNumber","matches","matcher","createTestMatcher","matchRegExps","finalMatchString","regex","getErrorForState","state","o","removeValidations","licenseState","invalid","addValidationMessage","errorMessage","toAdd","htmlDivElement","validateForm","formID","licenseStateSelector","licenseNumberSelector","form","_","AutocompleteComponent","item","clearInput","opt","itemToAdd","clickedButton","disabled","name","focus","text","detail","overflowEvent","index","src","textToMatch","span","match","toSelect","listItem","itemToDelete","dataValue","matchingItem","itemToSelectValue","MONTHS","DAYS_OF_WEEK_ABBREVIATED","DatePickerComponent","day","year","month","fillAssociated","dateOptions","formattedDate","toggleButton","startDate","endDate","active","days","numberOfDays","currentMonth","currentYear","lastDayOfMonth","lastMonth","nextMonth","firstDayOfMonth","beforeDays","endDays","scaffold","temp","decadeStart","decadeEnd","dayOfWeek","forwards","daysInAdjacentMonth","date","day1","day2","selectedDay","selectedYear","selectedMonth","DateInputMaskComponent","defaultLabel","FileUploadComponent","status","label","file","uploaderProgress","files","uploadInput","upload","fileExtension","t","error","blob","ogLabel","FOCUSABLE_ELEMENTS","WEB_COMPONENTS_TO_SEARCH_FOR","ModalComponent","e","focusable","child","el","a","b","ToggleComponent","PasswordToggleComponent","resolve","checkRelatedRadios","f","checkCheckboxGroup","validateInputLength","validationType","field","formError","validateInputPattern","validateEmail","pattern","validateRequiredField","validateRadioButton","validateCheckboxGroup","validateMinMax","min","max","validateNumericMinValue","minValue","validateNumericMaxValue","maxValue","validateTelephoneNumber","validateCreditCardField","validateTextAsNumeric","numericDigits","validateMatchingField","matchingField","validateDate","validateDateWithinRange","validateDateNotDisallowedDate","validateMinimumAge","age","birthYear","validateMaximumAge","validateMinDate","minDate","validateMaxDate","maxDate","validateMinimumYear","minYear","validateMaximumYear","maxYear","validateMinMonthYear","valueAsDate","validateMinMonthYearSet","message","monthPadded","detectCreditCardInformation","validations","results","validator","result","FORM_FIELDS","FormValidationComponent","relatedElements","autocompleteFields","datePickerFields","checkbox","eventFieldId","selectionStart","digits","mask","clearErrors","disallowedDatesRaw","validationLength","fieldGroupName","fieldGroup","ff","identifier","matchingPair","monthField","yearField","validationFunction","type","errorsParent","skipVerify","optionalParent","parent","errorsElement","errorsEl","itemizedField","ModalViewComponent","StandardTimeComponent","time","relative","MagicFormComponent","until","res","response","conditionalPass","conditional","firstOption","optionElement","fieldsToRelate","conditionalsToChange","MagicFieldsetComponent","clone","_e","err","datepicker","inputMask","button","img","CopierComponent","writeMethod","clipboardItem","originalButtonText","AccordionTriggerComponent","AccordionHelperComponent","accordion","RemoteAutocompleteComponent","searchRequest","option","optionToCreate","kinterested","FullstoryComponent","url","addressString","TableFilterComponent","filter","td","AbandonmentModalComponent","ReplacementCostComponent","request","json","PolicyApplicationComponent","MarkDuplicateButtonComponent","event","QuoteNoteService","_csrfToken","csrQuoteId","noteId","newNote","updatedNote","isDelete","QuoteRestoreService","UtilsService","QuoteDifferencesUtils","differences","QuoteRestoreModal","hash","section","difference","acc","curr","anyDifferences","QuoteEndorseModal","QuoteEndorseService","policyId","QuotesTableComponent","copy","copyFallback","quote","metaEl","quoteId","checked","share_html","share_text","key","toastType","LicenseNumbersService","csrId","body","licenseNumberId","LicenseNumbersFormComponent","repeat","action","license","newLicense","updatedLicense","fallbackErrorMessage","statesWithLicenses","CancellationDecisionsTable","eGridDiv","shared","quoteComponents","opportunityComponents","csrsComponents","policyAdministrationComponents"],"sourceRoot":""}