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QA,OAAOC,QAASyK;;;QAGtD,OAAO1K,OAAOC;QACf;;;;;;;QCnBA,IAAI8K,oBAAsBL,oBAAoB","sources":["webpack://semantic-forms/./lib/helpers.js","webpack://semantic-forms/./lib/inputEnhancements.js","webpack://semantic-forms/./lib/keyboardShortcuts.js","webpack://semantic-forms/./semanticForms.js","webpack://semantic-forms/webpack/bootstrap","webpack://semantic-forms/webpack/startup"],"sourcesContent":["/**\n * Uses the navigator to best determine the clients operating system.\n * @returns Operating system string (`mac`, `windows`, `linux`)\n */\nconst getOS = () => {\n  const userAgent = window.navigator.userAgent\n  const platform = window.navigator.platform\n  let os = null\n\n  if (platform.includes('Win')) {\n    os = 'windows'\n  } else if (platform.includes('Mac') || /iPhone|iPad|iPod/.test(userAgent)) {\n    os = 'mac'\n  } else if (platform.includes('Linux') || /Android/.test(userAgent)) {\n    os = 'linux'\n  }\n  return os\n}\n\n/**\n * Places an element immediately after another element\n * @param {Object} newNode element being placed after the reference node\n * @param {*} referenceNode element to be used as reference for new node\n */\nconst insertAfter = (newNode, referenceNode) => {\n  if (referenceNode.nextSibling) referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling)\n  else referenceNode.parentNode.appendChild(newNode)\n}\n\nmodule.exports = { getOS, insertAfter }\n","const { insertAfter } = require('./helpers.js')\n\nconst icons = {\n  passwordShow: '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m1 12s4-8 11-8 11 8 11 8\"/><path d=\"m1 12s4 8 11 8 11-8 11-8\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></g></svg>',\n  passwordHide: '<svg fill=\"none\" height=\"256\" viewBox=\"0 0 24 24\" width=\"256\" xmlns=\"http://www.w3.org/2000/svg\"><g stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"><path d=\"m2 2 20 20\"/><path d=\"m6.71277 6.7226c-3.04798 2.07267-4.71277 5.2774-4.71277 5.2774s3.63636 7 10 7c2.0503 0 3.8174-.7266 5.2711-1.7116m-6.2711-12.23018c.3254-.03809.6588-.05822 1-.05822 6.3636 0 10 7 10 7s-.6918 1.3317-2 2.8335\"/><path d=\"m14 14.2362c-.5308.475-1.2316.7639-2 .7639-1.6569 0-3-1.3431-3-3 0-.8237.33193-1.5698.86932-2.11192\"/></g></svg>',\n  helpIcon: '<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" version=\"1.1\" style=\"overflow:visible;\"><rect width=\"16\" height=\"16\" fill=\"none\"/><path fill=\"currentColor\" d=\"M8,10.5c-0.552,0-1,0.448-1,1c0,0.552,0.448,1,1,1c0.552,0,1-0.448,1-1C9,10.948,8.552,10.5,8,10.5z M8,0 C3.582,0,0,3.582,0,8c0,4.418,3.582,8,8,8s8-3.582,8-8C16,3.582,12.418,0,8,0z M12.243,12.243C11.109,13.376,9.603,14,8,14 s-3.109-0.624-4.243-1.757C2.624,11.109,2,9.603,2,8s0.624-3.109,1.757-4.243C4.891,2.624,6.397,2,8,2s3.109,0.624,4.243,1.757 C13.376,4.891,14,6.397,14,8C14,9.603,13.376,11.109,12.243,12.243z M7.927,3.755c-2.248,0-2.76,1.695-2.802,2.906h1.571 c0.028-0.256,0.101-1.418,1.221-1.418c0.672,0,1.206,0.406,1.206,1.175c0,0.695-0.724,1.155-1.303,1.711 C7.241,8.685,7.168,9.325,7.168,9.824V10c0.146,0,1.615,0,1.615,0V9.824c0-1.256,1.967-1.594,1.967-3.541 C10.75,5.059,9.874,3.755,7.927,3.755z\"/></svg>'\n}\n\nconst lookups = {\n  nodeName: ['TEXTAREA', 'SELECT'],\n  inputType: ['checkbox', 'color', 'date', 'datetime-local', 'email', 'file', 'image', 'month', 'number', 'password', 'radio', 'range', 'search', 'tel', 'text', 'time', 'url', 'week']\n}\n\nlet lastFocusedInput\nlet lastClearFieldPressed\n\nconst enhanceInput = (input, form) => {\n  // ignore input if it has previously been formatted\n  if (input.classList.contains('semanticform') || !input.id) return\n\n  const type = input.getAttribute('type')\n  if (!lookups.nodeName.includes(input.nodeName) && !lookups.inputType.includes(type)) return\n\n  // recursively find <dl> element\n  let dl = input.parentNode\n  while (dl && dl.nodeName !== 'DL') dl = dl.parentNode\n  if (!dl) return\n  if (!dl.classList.contains('floatLabelForm')) dl.classList.add('floatLabelForm')\n\n  const label = input.parentNode.parentNode.id && (type === 'checkbox' || type === 'radio')\n    ? document.querySelector('label[data-for=' + input.parentNode.parentNode.id.replace(/\\./g, '\\\\.') + ']')\n    : document.querySelector('label[for=' + input.id.replace(/\\./g, '\\\\.') + ']')\n\n  if (!label) {\n    console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) without a properly associated label. Make sure there is a label for it and the label has a matching \"for\" attribute.`)\n  }\n\n  input.classList.add('semanticform')\n\n  const isWrapped = input.closest('dd').parentElement.nodeName === 'DIV'\n\n  // #region create labels\n\n  const newLabel = document.createElement('label')\n  newLabel.className = 'floatLabelFormAnimatedLabel'\n\n  if (type === 'checkbox' || type === 'radio') {\n    const div = isWrapped ? input.closest('dd').parentElement : document.createElement('div')\n    const dt = label.closest('dt')\n    const dd = input.closest('dd')\n\n    if (!dt || !dd) {\n      console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that is not inside a <dd> element.`)\n      return\n    }\n\n    if (dd.firstChild.nodeName !== 'LABEL') {\n      if (type === 'checkbox' && input.parentNode.nodeName === 'DD') {\n        newLabel.setAttribute('for', input.id)\n        input.parentNode.classList.add('singleCheckbox')\n        newLabel.className = ''\n        label.setAttribute('hidden', 'hidden')\n        insertAfter(newLabel, input)\n      }\n\n      if (type === 'radio' && input.parentNode.nodeName === 'DD') {\n        newLabel.setAttribute('for', input.id)\n        input.parentNode.classList.add('singleRadio')\n        newLabel.className = ''\n        label.setAttribute('hidden', 'hidden')\n        insertAfter(newLabel, input)\n      }\n\n      newLabel.innerHTML = label.innerHTML\n\n      if (label.hasAttribute('title') && label.getAttribute('data-show-help-icon') !== null && !label.querySelector('span.help')) {\n        const text = label.getAttribute('title')\n        label.innerHTML += ` <span title=\"${text}\" class=\"help\">${icons.helpIcon}</span>`\n        newLabel.innerHTML += ` <span title=\"${text}\" class=\"help\">${icons.helpIcon}</span>`\n      }\n\n      if (dd.querySelector(':required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span.required')) {\n        const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n        label.innerHTML += ` <span title=\"${text}\" class=\"required\">*</span>`\n        newLabel.innerHTML += ` <span title=\"${text}\" class=\"required\">*</span>`\n      }\n\n      if (!dd.querySelector('label')) dd.append(newLabel)\n    }\n\n    // if the user did not wrap the input in a div, do it for them\n    if (!isWrapped) {\n      div.append(dt, dd)\n\n      // determine visibility of newly created <div>\n      if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n    }\n    dl.append(div)\n  } else {\n    newLabel.setAttribute('for', input.id)\n    newLabel.innerHTML = label.innerHTML\n\n    if (input.hasAttribute('title') && label.getAttribute('data-show-help-icon') !== null && !label.querySelector('span.help')) {\n      const text = input.getAttribute('title')\n      newLabel.innerHTML += ` <span title=\"${text}\" class=\"help\">${icons.helpIcon}</span>`\n    }\n\n    if (input.hasAttribute('required') && label.getAttribute('data-no-asterisk') === null && !label.querySelector('span.required')) {\n      const text = label.getAttribute('data-asterisk-text') || 'This field is required.'\n      newLabel.innerHTML += ` <span title=\"${text}\" class=\"required\">*</span>`\n    }\n\n    label.setAttribute('hidden', 'hidden')\n\n    insertAfter(newLabel, input)\n  }\n  // #endregion\n\n  // #region standard inputs\n\n  // check for auto-grow attribute on textareas\n  if (input.getAttribute('data-auto-grow') !== null) {\n    // progressively enhance inputs into textareas\n    if (input.nodeName === 'INPUT' && input.type === 'text') {\n      const newInput = document.createElement('textarea')\n      newInput.id = input.id\n      newInput.class = input.class\n      newInput.innerText = input.value\n      newInput.setAttribute('data-auto-grow', '')\n      input.replaceWith(newInput)\n      input = newInput\n    }\n\n    if (input.nodeName === 'TEXTAREA') {\n      // when pressing enter while this input is focused, we want to submit\n      input.addEventListener('keypress', (e) => {\n        if (e.key !== 'Enter' || (e.key === 'Enter' && e.shiftKey)) return\n        e.preventDefault()\n        form.requestSubmit()\n      })\n    }\n  }\n\n  if (type !== 'checkbox' && type !== 'radio') {\n    if (!input.getAttribute('placeholder')) input.setAttribute('placeholder', ' ')\n\n    const div = isWrapped ? input.closest('dd').parentElement : document.createElement('div')\n    const dt = label.closest('dt')\n    const dd = input.closest('dd')\n\n    if (!dt || !dd) {\n      console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that does not have a corresponding ${!dt ? '<dt>' : '<dd>'} element.`)\n      return\n    }\n\n    // input clear button\n    if (input.nodeName !== 'SELECT' && type !== 'range') {\n      const clearBtn = document.createElement('button')\n      clearBtn.type = 'button'\n      clearBtn.title = input.getAttribute('data-clear-field-text') || 'Clear field'\n      clearBtn.ariaLabel = input.getAttribute('data-clear-field-text') || 'Clear field'\n      clearBtn.tabIndex = -1\n      clearBtn.innerHTML = '<svg viewBox=\"0 0 16 16\" width=\"18\" height=\"18\"><path d=\"M 1 1 L 15 15 M 1 15 L 15 1\" fill=\"none\" stroke-width=\"2\" stroke=\"currentColor\" />'\n      clearBtn.classList.add('clear')\n      clearBtn.id = `semanticFormsClearButton_${input.id}`\n      clearBtn.addEventListener('click', () => {\n        input.previousValue = input.value\n        input.value = ''\n        input.focus()\n        lastClearFieldPressed = input.id\n\n        // used for any other updates required by various inputs\n        input.dispatchEvent(new Event('input', { bubbles: true }))\n      })\n      insertAfter(clearBtn, dd.querySelector('label'))\n    }\n\n    input.addEventListener('focus', event => {\n      if (event.target.nodeName === 'INPUT') lastFocusedInput = event.target\n    })\n\n    // check for colspan- utility class on dd, and move to div\n    if (/colspan-/.test(dd.className)) {\n      const match = dd.className.match(/colspan-([0-9]|full)/)[0]\n      dd.classList.remove(match)\n      div.classList.add(match)\n    }\n\n    // check for max-content attribute\n    // this may be removed once fully supported in Firefox and Safari: https://caniuse.com/wf-field-sizing\n    if (input.getAttribute('data-max-content') !== null) {\n      if (!('fieldSizing' in document.createElement('input').style)) {\n        const adjustWidth = () => {\n          const value = input.value !== '' ? input.value : input.placeholder\n          const width = value.length * 8 + 40\n          input.style.width = width + 'px'\n          input.style.maxWidth = '100%'\n        }\n        adjustWidth()\n        input.addEventListener('input', adjustWidth)\n      }\n    }\n\n    // if the user did not wrap the input in a div, do it for them\n    if (!isWrapped) {\n      div.append(dt, dd)\n\n      // determine visibility of newly created <div>\n      if (dt.style.display === 'none' && dd.style.display === 'none') div.style.display = 'none'\n    }\n\n    dl.append(div)\n  }\n  // #endregion\n\n  // handle file input clear btn, cannot be handled with CSS\n  if (type === 'file') {\n    const clearBtn = input.parentElement.querySelector('.clear')\n    input.addEventListener('input', event => {\n      clearBtn.style.display = event.target.files.length ? 'flex' : 'none'\n    })\n    clearBtn.addEventListener('click', () => {\n      clearBtn.style.display = 'none'\n    })\n  }\n\n  // handle range inputs with a class to display the value\n  // TODO: should this be a data attribute instead?\n  if (type === 'range' && input.classList.contains('displayValue')) {\n    const label = input.parentNode.parentNode.querySelector('dd label')\n    label.innerHTML += `<span class=\"seperator\">: </span><output>${input.value}</output>`\n    input.addEventListener('input', event => {\n      const output = event.target.parentNode.parentNode.querySelector('output')\n      output.innerHTML = event.target.value\n    })\n  }\n\n  // show password button\n  if (type === 'password' && input.getAttribute('data-no-reveal') === null) {\n    const showBtn = document.createElement('button')\n    showBtn.type = 'button'\n    showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n    showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n    showBtn.tabIndex = -1\n    showBtn.innerHTML = icons.passwordShow\n    showBtn.classList.add('show')\n    showBtn.id = `semanticFormsShowButton_${input.id}`\n    const dd = input.closest('dd')\n    if (!dd) {\n      console.error(`semantic-forms: Found an input (${input.id || input.getAttribute('name')}) that is not inside a <dd> element.`)\n      return\n    }\n    showBtn.addEventListener('click', () => {\n      if (input.type === 'password') {\n        showBtn.innerHTML = icons.passwordHide\n        showBtn.title = input.getAttribute('data-hide-password-text') || 'Hide password'\n        showBtn.ariaLabel = input.getAttribute('data-hide-password-text') || 'Hide password'\n        input.type = 'text'\n      } else {\n        showBtn.innerHTML = icons.passwordShow\n        showBtn.title = input.getAttribute('data-show-password-text') || 'Show password'\n        showBtn.ariaLabel = input.getAttribute('data-show-password-text') || 'Show password'\n        input.type = 'password'\n      }\n      input.focus()\n    })\n    insertAfter(showBtn, dd.querySelector('label'))\n  }\n\n  // add listener to shift clear button when scrollbar present\n  if (input.nodeName === 'TEXTAREA') {\n    if (input.getAttribute('data-disable-autosize') === null) {\n      // add auto-sizing\n      input.style.setProperty('resize', 'none')\n      input.style.setProperty('min-height', '0')\n      input.style.setProperty('max-height', 'none')\n      input.style.setProperty('height', 'auto')\n\n      const handleInput = () => {\n        // reset rows attribute to get accurate scrollHeight\n        let maxRows = input.getAttribute('data-max-rows')\n\n        if (maxRows) {\n          if (isNaN(maxRows) || Number(maxRows) <= 0) {\n            console.warn(`An invalid value was passed to the \"data-max-rows\" attribute. This value will be ignored.\\n\\nProvided value: ${input.getAttribute('data-max-rows')}`)\n            maxRows = null\n          }\n        }\n\n        const minRows = input.getAttribute('data-max-rows') && Number(input.getAttribute('data-max-rows')) < 5 ? input.getAttribute('data-max-rows') : '5'\n        input.setAttribute('rows', minRows)\n\n        // get the computed values object reference\n        const style = window.getComputedStyle(input)\n\n        // force content-box for size accurate line-height calculation, remove scrollbars, lock width (subtract inline padding and inline border widths), and remove inline padding and borders to keep width consistent (for text wrapping accuracy)\n        const inlinePadding = parseFloat(style['padding-left']) + parseFloat(style['padding-right'])\n        const inlineBorderWidth = parseFloat(style['border-left-width']) + parseFloat(style['border-right-width'])\n        input.style.setProperty('overflow', 'hidden', 'important')\n        input.style.setProperty('width', (parseFloat(style.width) - inlinePadding - inlineBorderWidth) + 'px')\n        input.style.setProperty('box-sizing', 'content-box')\n        input.style.setProperty('padding-inline', '0')\n        input.style.setProperty('border-width', '0')\n\n        // get the base line height, and top / bottom padding\n        const blockPadding = parseFloat(style['padding-top']) + parseFloat(style['padding-bottom'])\n        const lineHeight = style['line-height'] === 'normal'\n          ? parseFloat(style.height) // if line-height is not explicitly set, use the computed height value (ignore padding due to content-box)\n          : parseFloat(style['line-height']) // otherwise (line-height is explicitly set), use the computed line-height value\n\n        // get the scroll height (rounding to be safe to ensure cross browser consistency)\n        const scrollHeight = Math.round(input.scrollHeight)\n\n        // undo overflow, width, border-width, box-sizing & inline padding overrides\n        input.style.removeProperty('width')\n        input.style.removeProperty('box-sizing')\n        input.style.removeProperty('padding-inline')\n        input.style.removeProperty('border-width')\n        input.style.removeProperty('overflow')\n\n        // subtract blockPadding from scrollHeight and divide that by our lineHeight to get the row count, round to nearest integer as it will always be within ~.1 of the correct whole number\n        const rows = Math.round((scrollHeight - blockPadding) / lineHeight)\n\n        // set the calculated rows attribute (limited by rowLimit)\n        if (maxRows) {\n          input.setAttribute('rows', '' + Math.min(rows, Number(maxRows)))\n        } else {\n          input.setAttribute('rows', '' + rows)\n        }\n      }\n\n      input.addEventListener('input', handleInput)\n\n      // trigger the event to set the initial rows value\n      input.dispatchEvent(new Event('input', { bubbles: true }))\n    }\n\n    // progressively enhance textarea for Firefox and Safari\n    // this may be removed once fully supported in Firefox and Safari: https://caniuse.com/wf-field-sizing\n    if (input.getAttribute('data-auto-grow') !== null) {\n      if (!('fieldSizing' in document.createElement('input').style)) {\n        const adjustHeight = () => {\n          if (input.value.length) {\n            const borderWidth = parseInt(window.getComputedStyle(input).getPropertyValue('border-width'))\n            input.style.height = (input.scrollHeight + (borderWidth * 2)) + 'px'\n          } else {\n            input.style.height = window.getComputedStyle(form).getPropertyValue('--semanticFormsInputHeight')\n          }\n        }\n\n        // set initial height to semantic-forms CSS variable\n        input.style.height = window.getComputedStyle(form).getPropertyValue('--semanticFormsInputHeight')\n        input.addEventListener('input', adjustHeight)\n      }\n    }\n\n    // shifts the clear button to the right if a scrollbar is present\n    const shiftClearBtn = () => {\n      const clearBtn = input.parentElement?.querySelector('button.clear')\n      if (clearBtn) clearBtn.style.marginRight = input.clientHeight < input.scrollHeight ? '15px' : ''\n    }\n    input.addEventListener('input', shiftClearBtn)\n    input.addEventListener('mouseup', shiftClearBtn)\n    shiftClearBtn()\n  }\n}\n\nconst handleUndoRedo = (event) => {\n  // handle undo/redo\n  if ((event.ctrlKey || event.metaKey) && event.key === 'z' && !event.shiftKey) {\n    // undo clearing a field\n    if (lastFocusedInput) {\n      if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n        if (lastFocusedInput.previousValue) {\n          lastFocusedInput.redoValue = lastFocusedInput.value\n          lastFocusedInput.value = lastFocusedInput.previousValue\n        }\n      }\n    }\n  } else {\n    if ((event.ctrlKey && event.key === 'y') || (event.metaKey && event.shiftKey && event.key === 'z')) {\n      // redo clearing a field\n      if (lastFocusedInput) {\n        if (lastFocusedInput?.parentNode?.querySelector('button.clear').id === `semanticFormsClearButton_${lastClearFieldPressed}` || lastFocusedInput?.parentNode?.querySelector('button.clear').name === `semanticFormsClearButton_${lastClearFieldPressed}`) {\n          if (lastFocusedInput.redoValue) {\n            lastFocusedInput.previousValue = lastFocusedInput.value\n            lastFocusedInput.value = lastFocusedInput.redoValue\n          }\n        }\n      }\n    }\n  }\n}\n\nmodule.exports = { enhanceInput, handleUndoRedo }\n","const { getOS, insertAfter } = require('./helpers.js')\n\nconst specialCharMap = {\n  Minus: '-',\n  Equal: '=',\n  BracketLeft: '[',\n  BracketRight: ']',\n  Backslash: '\\\\',\n  Semicolon: ';',\n  Quote: '\\'',\n  Comma: ',',\n  Period: '.',\n  Slash: '/',\n  Backquote: '`'\n}\nconst shiftSpecialCharMap = {\n  1: '!',\n  2: '@',\n  3: '#',\n  4: '$',\n  5: '%',\n  6: '^',\n  7: '&',\n  8: '*',\n  9: '(',\n  0: ')',\n  Minus: '_',\n  Equal: '+',\n  BracketLeft: '{',\n  BracketRight: '}',\n  Backslash: '|',\n  Semicolon: ':',\n  Quote: '\"',\n  Comma: '<',\n  Period: '>',\n  Slash: '?',\n  Backquote: '~'\n}\n\n// handles keyboard shortcut events\nconst shortcutListener = (e, shortcuts) => {\n  // search for matching shortcut from cached shortcut configs\n  const shortcut = shortcuts.find(shortcut => {\n    let matchesKey = false\n    if (e.altKey && !e.shiftKey) {\n      // mac adjusts the key value if altKey is pressed\n      matchesKey = 'Key' + shortcut.key.toUpperCase() === e.code ||\n        'Digit' + shortcut.key.toUpperCase() === e.code ||\n        shortcut.key === e.key ||\n        specialCharMap[e.code] === shortcut.key\n    } else if (e.shiftKey) {\n      // check shift special character map\n      const code = e.code.replace(/Key|Digit/, '')\n      matchesKey = (shiftSpecialCharMap[code] || shiftSpecialCharMap[e.key]) &&\n        (shiftSpecialCharMap[code] === shortcut.key || shiftSpecialCharMap[e.key] === shortcut.key)\n    } else {\n      matchesKey = shortcut.key.toUpperCase() === e.key.toUpperCase()\n    }\n    if (!matchesKey) return false\n\n    let matchesModifier\n    if (shortcut.modifier) {\n      if (shortcut.modifier === shortcut.defaultModifier) matchesModifier = shortcut.os === 'windows' || shortcut.os === 'linux' ? e.ctrlKey : e.metaKey\n      if (shortcut.modifier === 'meta') matchesModifier = e.metaKey\n      if (shortcut.modifier === 'alt') matchesModifier = e.altKey\n      if (shortcut.modifier === 'ctrl') matchesModifier = e.ctrlKey\n    }\n    return matchesModifier\n  })\n\n  if (shortcut) {\n    e.preventDefault()\n    shortcut.input.focus()\n  }\n}\n\nconst createKeyboardShortcut = (input, shortcuts) => {\n  const os = getOS()\n  // this is the custom keyword for meta on linux/mac, ctrl on windows\n  const defaultModifier = 'metactrl'\n\n  // get focus key value\n  let focusKey = input.getAttribute('data-focus-key')\n  if (focusKey.length > 1) {\n    console.error(`Provided focus key \"${focusKey}\" is more than one character. Using first character only.`)\n    focusKey = focusKey.toString()[0]\n  }\n\n  // get focus modifier value\n  let modifierSymbol\n  let modifierKey = defaultModifier\n  const modifierAttr = {\n    default: input.getAttribute('data-focus-modifier') || defaultModifier,\n    linux: input.getAttribute('data-focus-modifier-linux'),\n    mac: input.getAttribute('data-focus-modifier-mac'),\n    windows: input.getAttribute('data-focus-modifier-win')\n  }\n  if (os && modifierAttr[os]) {\n    // a specific modifier key has been set by the user\n    modifierKey = modifierAttr[os]\n  } else {\n    modifierKey = modifierAttr.default\n  }\n\n  // validate passed in modifier\n  const recognizedModifiers = ['ctrl', 'alt', 'opt', 'meta', 'cmd', defaultModifier]\n  if (!recognizedModifiers.includes(modifierKey)) {\n    console.error(`Received an unrecognized modifier, \"${modifierKey},\" defaulting to \"${defaultModifier}.\"`, input)\n    modifierKey = defaultModifier\n  }\n\n  // retrieve modifier symbol\n  if (['alt', 'opt'].includes(modifierKey)) {\n    modifierSymbol = os === 'mac' ? '⌥' : '⎇'\n  } else if (['meta', 'win', 'cmd'].includes(modifierKey) || (modifierKey === defaultModifier && os === 'mac')) {\n    if (os === 'mac') {\n      modifierSymbol = '⌘'\n    } else if (os === 'linux') {\n      modifierSymbol = '◆'\n    } else {\n      modifierSymbol = '⊞'\n    }\n  } else if (modifierKey === 'ctrl' || (modifierKey === defaultModifier && (os === 'windows' || os === 'linux'))) {\n    if (os === 'mac') {\n      modifierSymbol = '⌃'\n    } else {\n      modifierSymbol = 'Ctrl'\n    }\n  }\n\n  // add the shortcut to the cached array, if not a duplicate\n  if (shortcuts.some(shortcut => shortcut.key === focusKey && shortcut.modifier === modifierKey)) {\n    console.error(`Duplicate keyboard shortcut \"${modifierKey} + ${focusKey}\" detected. Only the first input will be focusable using this keyboard shortcut.`, input)\n  }\n\n  // set the shortcut indicator/title\n  if (input.nodeName === 'TEXTAREA' || input.type === 'text' || input.type === 'number') {\n    // create focus indicator for valid inputs\n    const indicator = document.createElement('span')\n    indicator.classList.add('focus-key')\n    indicator.innerHTML = `<kbd>${modifierSymbol} ${focusKey.toUpperCase()}</kbd>`\n\n    const label = input.nextSibling\n    insertAfter(indicator, label)\n  } else {\n    // update the input title\n    if (input.getAttribute('title')) {\n      input.setAttribute('title', input.getAttribute('title') + ` (${modifierSymbol} + ${focusKey})`)\n    } else {\n      input.setAttribute('title', `Focus with ${modifierSymbol} + ${focusKey}`)\n    }\n  }\n\n  return {\n    key: focusKey,\n    modifier: modifierKey,\n    input,\n    os,\n    defaultModifier\n  }\n}\n\nmodule.exports = {\n  shortcutListener,\n  createKeyboardShortcut\n}\n","const { createKeyboardShortcut, shortcutListener } = require('./lib/keyboardShortcuts.js')\nconst { enhanceInput, handleUndoRedo } = require('./lib/inputEnhancements.js')\n\nconst semanticForms = () => {\n  // do some feature detection so none of the JS executes if the browser is too old\n  if (typeof document.getElementsByClassName !== 'function' || typeof document.querySelector !== 'function' || !document.body.classList || !window.MutationObserver) {\n    console.warn('semantic-forms was loaded into an unsupported browser and will not execute.')\n    return\n  }\n\n  // custom keyboard shortcut listener\n  const keyboardShortcuts = []\n  document.addEventListener('keydown', (e) => shortcutListener(e, keyboardShortcuts))\n\n  // progressively enhance form elements that have the semanticForms class\n  const forms = document.querySelectorAll('form.semanticForms:not(.semanticFormsActive), table.semanticForms:not(.semanticFormsActive)')\n\n  for (const form of forms) {\n    form.classList.add('semanticFormsActive')\n    if (form.classList.contains('lowFlow')) continue\n\n    // update each input in the semantic form\n    const inputs = Array.from(form.querySelectorAll('input, textarea, select'))\n    for (const input of inputs) {\n      enhanceInput(input, form)\n\n      // handle keyboard shortcuts\n      if (input.getAttribute('data-focus-key') !== null) {\n        const shortcut = createKeyboardShortcut(input, keyboardShortcuts)\n        keyboardShortcuts.push(shortcut)\n      }\n    }\n  }\n\n  // prevents multiple listeners\n  document.removeEventListener('keydown', handleUndoRedo)\n  document.addEventListener('keydown', handleUndoRedo)\n\n  // monitor changes to the DOM and enhance new semanticForms forms that get added\n  if (!window.semanticFormsObserver) {\n    window.semanticFormsObserver = new window.MutationObserver(mutations => {\n      let stop = false\n      for (const mutation of mutations) {\n        for (const node of mutation.addedNodes) {\n          if (node.nodeName === 'FORM' || node?.querySelector?.('form')) {\n            semanticForms()\n            stop = true\n          }\n        }\n        if (stop) break\n      }\n    })\n    window.semanticFormsObserver.observe(document.body, { attributes: false, childList: true, characterData: false, subtree: true })\n  }\n\n  semanticForms.reinitialize = form => {\n    form.classList.remove('semanticFormsActive')\n    semanticForms()\n  }\n}\n\nmodule.exports = semanticForms\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./semanticForms.js\");\n"],"names":["getOS","userAgent","window","navigator","platform","os","includes","test","insertAfter","newNode","referenceNode","nextSibling","parentNode","insertBefore","appendChild","module","exports","icons","passwordShow","passwordHide","helpIcon","lookups","nodeName","inputType","lastFocusedInput","lastClearFieldPressed","enhanceInput","input","form","classList","contains","id","type","getAttribute","dl","add","label","document","querySelector","replace","console","error","isWrapped","closest","parentElement","newLabel","createElement","className","div","dt","dd","firstChild","setAttribute","innerHTML","hasAttribute","text","append","style","display","newInput","class","innerText","value","replaceWith","addEventListener","e","key","shiftKey","preventDefault","requestSubmit","clearBtn","title","ariaLabel","tabIndex","previousValue","focus","dispatchEvent","Event","bubbles","event","target","match","remove","adjustWidth","placeholder","width","length","maxWidth","files","output","showBtn","setProperty","handleInput","maxRows","isNaN","Number","warn","minRows","getComputedStyle","inlinePadding","parseFloat","inlineBorderWidth","blockPadding","lineHeight","height","scrollHeight","Math","round","removeProperty","rows","min","adjustHeight","borderWidth","parseInt","getPropertyValue","shiftClearBtn","marginRight","clientHeight","handleUndoRedo","ctrlKey","metaKey","name","redoValue","specialCharMap","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash","Backquote","shiftSpecialCharMap","shortcutListener","shortcuts","shortcut","find","matchesKey","altKey","toUpperCase","code","matchesModifier","modifier","defaultModifier","createKeyboardShortcut","focusKey","toString","modifierSymbol","modifierKey","modifierAttr","default","linux","mac","windows","recognizedModifiers","some","indicator","semanticForms","getElementsByClassName","body","MutationObserver","keyboardShortcuts","forms","querySelectorAll","inputs","Array","from","push","removeEventListener","semanticFormsObserver","mutations","stop","mutation","node","addedNodes","observe","attributes","childList","characterData","subtree","reinitialize","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","__webpack_exports__"],"sourceRoot":""}