{"version":3,"file":"survey-BAKsehwP.js","sources":["../../node_modules/dompurify/dist/purify.es.mjs","../../app/javascript/components/surveys/questions/components/shared_styles.ts","../../app/javascript/components/surveys/questions/components/question_label.tsx","../../node_modules/react-id-generator/lib/index.js","../../app/javascript/components/components/base_ui/higher_order_components/questions/shared_components/prompt_with_secondary_text.tsx","../../app/javascript/components/components/base_ui/higher_order_components/questions/use_construct_aria_label.ts","../../app/javascript/components/components/base_ui/higher_order_components/questions/datepicker_question_wrapper.tsx","../../app/javascript/components/surveys/questions/survey_question_date_picker.tsx","../../app/javascript/components/surveys/questions/mentorship_chat_group/student_select.tsx","../../app/javascript/components/surveys/questions/mentorship_chat_group/optional_student_info.tsx","../../app/javascript/components/surveys/questions/components/question_fieldset_legend.tsx","../../app/javascript/components/surveys/questions/question_helpers.tsx","../../app/javascript/components/components/base_ui/higher_order_components/questions/shared_components/shared_form_control_label.tsx","../../app/javascript/components/components/base_ui/higher_order_components/questions/input_question_wrapper.tsx","../../app/javascript/components/components/base_ui/higher_order_components/questions/textarea_question_wrapper.tsx","../../app/javascript/components/components/base_ui/higher_order_components/questions/multiselect_question_wrapper.tsx","../../app/javascript/components/surveys/questions/multi_select.tsx","../../app/javascript/components/surveys/questions/conversation.tsx","../../app/javascript/components/components/data_entry/text_area/index.tsx","../../app/javascript/components/surveys/questions/flags.tsx","../../app/javascript/components/surveys/questions/components/likert.tsx","../../app/javascript/components/surveys/questions/nps.tsx","../../node_modules/baseui/esm/radio/constants.js","../../app/javascript/components/components/base_ui/higher_order_components/questions/select_question_wrapper.tsx","../../app/javascript/components/surveys/questions/select/select_shared_utils.tsx","../../app/javascript/components/surveys/questions/select/deprecated_select.tsx","../../app/javascript/components/surveys/questions/select/survey_question_select.tsx","../../app/javascript/components/components/base_ui/higher_order_components/questions/likert_question_wrapper.tsx","../../app/javascript/components/surveys/questions/likert/use_normalize_survey_question_likert_customizations.ts","../../app/javascript/components/surveys/questions/likert/use_survey_question_likert_validation.ts","../../app/javascript/components/surveys/questions/likert/survey_question_likert.tsx","../../app/javascript/components/surveys/questions/hooks/useRotatingQuestion.ts","../../app/javascript/components/surveys/questions/rotating_likert.tsx","../../app/javascript/components/surveys/questions/rotating_open_response.tsx","../../app/javascript/components/surveys/questions/rotating_career_open_response.tsx","../../app/javascript/components/surveys/questions/survey_question_select_with_select_follow_up.tsx","../../app/javascript/components/surveys/questions/generic/single_select.tsx","../../app/javascript/components/surveys/questions/generic/multi_select.tsx","../../app/javascript/components/surveys/questions/generic/input.tsx","../../app/javascript/components/surveys/questions/generic/generic.tsx","../../app/javascript/components/surveys/questions/counterparts_info.tsx","../../app/javascript/components/surveys/questions/survey_question_number_input.tsx","../../app/javascript/components/surveys/questions/survey_question_open_response.tsx","../../app/javascript/components/surveys/questions/survey_question_text_input.tsx","../../node_modules/downshift/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/downshift/node_modules/react-is/index.js","../../node_modules/compute-scroll-into-view/dist/index.js","../../node_modules/downshift/dist/downshift.esm.js","../../app/javascript/components/components/layout/chip/index.tsx","../../app/javascript/components/components/data_entry/tags/index.tsx","../../app/javascript/components/components/data_entry/input_autocomplete/index.tsx","../../app/javascript/components/surveys/questions/multi_select_dropdown.tsx","../../app/javascript/components/shared/use_device_type.ts","../../app/javascript/components/surveys/survey.tsx"],"sourcesContent":["/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */\n\nconst {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n} = Object;\nlet {\n freeze,\n seal,\n create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n apply,\n construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n}\nif (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySplice = unapply(Array.prototype.splice);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n}\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n}\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n}\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\$\\{[\\w\\W]*/gm); // eslint-disable-line unicorn/better-regex\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ARIA_ATTR: ARIA_ATTR,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT,\n DATA_ATTR: DATA_ATTR,\n DOCTYPE_NAME: DOCTYPE_NAME,\n ERB_EXPR: ERB_EXPR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR\n});\n\n/* eslint-disable @typescript-eslint/indent */\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nconst _createHooksMap = function _createHooksMap() {\n return {\n afterSanitizeAttributes: [],\n afterSanitizeElements: [],\n afterSanitizeShadowDOM: [],\n beforeSanitizeAttributes: [],\n beforeSanitizeElements: [],\n beforeSanitizeShadowDOM: [],\n uponSanitizeAttribute: [],\n uponSanitizeElement: [],\n uponSanitizeShadowNode: []\n };\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n DOMPurify.version = '3.2.4';\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = _createHooksMap();\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n /*\n * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n /* Decide if document with ... should be returned */\n let WHOLE_DOCUMENT = false;\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n /**\n * _parseConfig\n *\n * @param cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;\n HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n /**\n * @param element a DOM element whose namespace is being checked\n * @returns Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via . If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n // The only way to switch from SVG to MathML is via\n // and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n /**\n * _forceRemove\n *\n * @param node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n remove(node);\n }\n };\n /**\n * _removeAttribute\n *\n * @param name an Attribute name\n * @param element a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, element) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: element.getAttributeNode(name),\n from: element\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: element\n });\n }\n element.removeAttribute(name);\n // We void attribute values for unremovable \"is\" attributes\n if (name === 'is') {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(element);\n } catch (_) {}\n } else {\n try {\n element.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n /**\n * _initDocument\n *\n * @param dirty - a string of dirty markup\n * @return a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '' + dirty + '';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param root The root element or node to start traversing on.\n * @return The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n /**\n * _isClobbered\n *\n * @param element element to check for clobbering attacks\n * @return true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(element) {\n return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');\n };\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param value object to check whether it's a DOM node\n * @return true is object is a DOM node\n */\n const _isNode = function _isNode(value) {\n return typeof Node === 'function' && value instanceof Node;\n };\n function _executeHooks(hooks, currentNode, data) {\n arrayForEach(hooks, hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n }\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n * @param currentNode to check for permission to exist\n * @return true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeElement, currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n return false;\n };\n /**\n * _isValidAttribute\n *\n * @param lcTag Lowercase tag name of containing element.\n * @param lcName Lowercase attribute name.\n * @param value Attribute value.\n * @return Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param tagName name of the tag of the node to sanitize\n * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n const {\n attributes\n } = currentNode;\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes || _isClobbered(currentNode)) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n forceKeepAttr: undefined\n };\n let l = attributes.length;\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n };\n /**\n * _sanitizeShadowDOM\n *\n * @param fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n /* Sanitize tags and elements */\n _sanitizeElements(shadowNode);\n /* Check attributes next */\n _sanitizeAttributes(shadowNode);\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(shadowNode.content);\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n };\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '';\n }\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n /* Clean up removed elements */\n DOMPurify.removed = [];\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n _sanitizeElements(currentNode);\n /* Check attributes next */\n _sanitizeAttributes(currentNode);\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n _sanitizeShadowDOM(currentNode.content);\n }\n }\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '\\n' + serializedHTML;\n }\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n arrayPush(hooks[entryPoint], hookFunction);\n };\n DOMPurify.removeHook = function (entryPoint, hookFunction) {\n if (hookFunction !== undefined) {\n const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];\n }\n return arrayPop(hooks[entryPoint]);\n };\n DOMPurify.removeHooks = function (entryPoint) {\n hooks[entryPoint] = [];\n };\n DOMPurify.removeAllHooks = function () {\n hooks = _createHooksMap();\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","import styled from \"styled-components\";\n\nexport const StyledQuestionPrompt = styled.label`\n a {\n text-decoration: underline;\n }\n`;\n\nexport const StyledDescription = styled.span`\n display: block;\n font-weight: 500;\n font-size: 15px;\n margin-top: 17px;\n margin-bottom: 12px;\n color: ${({ theme }) => theme.deprecatedColors.accent.four};\n a {\n text-decoration: underline;\n }\n`;\n\nexport const RequiredMarker = styled.span`\n color: ${({ theme }) => theme.deprecatedColors.error};\n`;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport DOMPurify from \"dompurify\";\nimport { HiddenAccessibleSpan } from \"../../../components/accessibility/hidden_accessible_span\";\nimport { RequiredMarker, StyledQuestionPrompt, StyledDescription } from \"./shared_styles\";\n\nconst StyledLabel = styled.span`\n display: inline-block;\n font-weight: 300;\n font-size: 18px;\n margin-bottom: 12px;\n white-space: pre-wrap;\n`;\n\nexport default function QuestionLabel({\n label,\n description,\n questionIsOptional = false,\n htmlFor,\n hideRequiredMarker = false,\n dataTest,\n ...rest\n}: {\n label: string;\n description?: string;\n questionIsOptional?: boolean;\n className?: string;\n htmlFor?: string;\n hideRequiredMarker?: boolean;\n dataTest?: string;\n}) {\n return (\n \n {/* We're moving away from required indicators as a UX choice, but won't do the refactor en masse. This flag allows us to update some areas incrementally */}\n {!questionIsOptional && !hideRequiredMarker && (\n <>\n * \n Required\n \n )}\n\n \n\n {description && (\n \n )}\n \n );\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar React = require('react');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar React__default = /*#__PURE__*/_interopDefaultLegacy(React);\n\nvar globalPrefix = \"id\";\nvar lastId = 0;\nfunction nextId(localPrefix) {\n lastId++;\n return \"\".concat(localPrefix || globalPrefix).concat(lastId);\n}\nvar resetId = function resetId() {\n lastId = 0;\n};\nvar setPrefix = function setPrefix(newPrefix) {\n globalPrefix = newPrefix;\n};\n\nvar getIds = function getIds(count, prefix) {\n var ids = [];\n\n for (var i = 0; i < count; i++) {\n ids.push(nextId(prefix));\n }\n\n return ids;\n};\n\nfunction usePrevious(value) {\n var ref = React__default['default'].useRef();\n React__default['default'].useEffect(function () {\n ref.current = value;\n });\n return ref.current;\n}\n\nfunction useId() {\n var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;\n var prefix = arguments.length > 1 ? arguments[1] : undefined;\n var idsListRef = React__default['default'].useRef([]);\n var prevCount = usePrevious(count);\n var prevPrefix = usePrevious(prefix);\n\n if (count !== prevCount || prevPrefix !== prefix) {\n idsListRef.current = getIds(count, prefix);\n }\n\n return idsListRef.current;\n}\n\nexports['default'] = nextId;\nexports.resetId = resetId;\nexports.setPrefix = setPrefix;\nexports.useId = useId;\n","import React from \"react\";\nimport { ParagraphMedium } from \"baseui/typography\";\nimport styled from \"styled-components\";\n\nconst StyledSupplementalQuestionPromptDiv = styled.div`\n display: flex;\n white-space: pre-wrap;\n`;\n\nconst StyledParagraphMedium = styled(ParagraphMedium)`\n font-weight: 500;\n padding-right: 3px;\n margin-top: 0;\n margin-bottom: 0;\n max-width: 700px;\n`;\n\nconst StyledText = styled(ParagraphMedium)`\n color: ${({ theme }) => theme.colors.contentTertiary};\n margin-bottom: ${({ theme }) => theme.sizing.scale300};\n margin-top: 0;\n max-width: 700px;\n`;\n\nexport const StyledOptionalText = styled.span`\n font-weight: ${({ theme }) => theme.typography.ParagraphMedium.fontWeight};\n color: ${({ theme }) => theme.colors.contentTertiary};\n margin-bottom: 0;\n display: inline;\n`;\n\ninterface Props {\n supplementalQuestionPrompt: string | React.ReactNode;\n secondaryText?: string;\n optional: boolean;\n dataTest?: string;\n}\n\nconst PromptWithSecondaryText = ({\n supplementalQuestionPrompt,\n secondaryText,\n optional,\n dataTest = \"question-prompt-with-secondary-text\",\n}: Props) => {\n return (\n
\n \n \n {supplementalQuestionPrompt}{\" \"}\n {optional ? (\n \n (Optional)\n \n ) : (\n \"\"\n )}\n \n \n {secondaryText && (\n {secondaryText}\n )}\n
\n );\n};\n\nexport default PromptWithSecondaryText;\n","export function useConstructAriaLabel() {\n const constructAriaLabel = (\n supplementalQuestionPrompt?: string,\n secondaryText?: string,\n label?: string,\n optional = false,\n maxCharacterLimit?: number\n ) => {\n const supplementalQuestionPromptSubstring = supplementalQuestionPrompt\n ? `${supplementalQuestionPrompt} `\n : \"\";\n const secondaryTextSubstring = secondaryText ? `${secondaryText} ` : \"\";\n const labelSubstring = label ? `${label} ` : \"\";\n const optionalSubstring = optional ? `(Optional) ` : \"\";\n const maxCharacterLimitSubString = maxCharacterLimit\n ? `Max ${maxCharacterLimit} characters. `\n : \"\";\n\n return (\n supplementalQuestionPromptSubstring +\n optionalSubstring +\n secondaryTextSubstring +\n labelSubstring +\n maxCharacterLimitSubString\n );\n };\n\n return {\n constructAriaLabel,\n };\n}\n","import React from \"react\";\nimport nextId from \"react-id-generator\";\n\nimport { Overrides } from \"baseui/overrides\";\n\nimport FormControl from \"../../inputs/form_control\";\nimport PromptWithSecondaryText from \"./shared_components/prompt_with_secondary_text\";\nimport { useConstructAriaLabel } from \"./use_construct_aria_label\";\nimport { Datepicker, DatepickerProps } from \"../../date_and_time/datepicker\";\nimport { Theme } from \"../../../../styling/baseui_theme\";\nimport { DatepickerOverrides } from \"baseui/datepicker\";\n\nconst DATEPICKER_NAMESPACE = \"datepicker-input\";\nexport interface DatepickerQuestionWrapperProps extends Omit {\n supplementalQuestionPrompt: string;\n secondaryText?: string;\n label?: string;\n optional: boolean;\n placeholder?: string;\n errorMessage?: string;\n overrides?: Overrides;\n}\n\nconst formControlOverrides = {\n Label: {\n style: ({ $theme }: { $theme: Theme }) => ({\n fontSize: $theme.typography.LabelSmall.fontSize,\n marginBottom: 0,\n }),\n },\n};\n\nconst DatepickerQuestionWrapper = ({\n supplementalQuestionPrompt,\n secondaryText,\n label,\n optional,\n errorMessage,\n placeholder,\n dataTest,\n ...datepickerProps\n}: DatepickerQuestionWrapperProps) => {\n const { constructAriaLabel } = useConstructAriaLabel();\n\n const datepickerId = nextId(DATEPICKER_NAMESPACE);\n\n return (\n
\n {supplementalQuestionPrompt && (\n \n )}\n \n \n \n
\n );\n};\n\nexport default DatepickerQuestionWrapper;\n","import React, { useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport QuestionLabel from \"./components/question_label\";\nimport { QuestionProps } from \"../survey\";\nimport DatePickerComponent from \"../../components/data_entry/date_picker\";\nimport nextId from \"react-id-generator\";\nimport DatepickerQuestionWrapper from \"../../components/base_ui/higher_order_components/questions/datepicker_question_wrapper\";\n\nexport type Answer = string;\nexport interface Customizations {\n prompt: string;\n description?: string;\n optional?: boolean;\n minDateDaysRelativeToToday?: number;\n maxDateDaysRelativeToToday?: number;\n}\n\nconst StyledDatePicker = styled.div`\n text-transform: none;\n display: flex;\n flex-direction: column;\n align-items: center;\n\n .calendar {\n margin-top: ${({ theme }) => theme.sizing.scale300};\n }\n`;\n\nexport default function SurveyQuestionDatePicker({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n}: QuestionProps) {\n const label = customizations.prompt;\n const id = nextId();\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const description = customizations.description;\n\n // set up for limiting datepicker by a range\n let minDate: Date | undefined;\n if (typeof customizations.minDateDaysRelativeToToday === \"number\") {\n minDate = new Date();\n minDate.setDate(minDate.getDate() + customizations.minDateDaysRelativeToToday);\n minDate.setHours(0, 0, 0, 0);\n }\n\n let maxDate: Date | undefined;\n if (typeof customizations.maxDateDaysRelativeToToday === \"number\") {\n maxDate = new Date();\n maxDate.setDate(maxDate.getDate() + customizations.maxDateDaysRelativeToToday);\n maxDate.setHours(0, 0, 0, 0);\n }\n\n const date =\n // if a day is unselected, the answer will be \"\"\n currentAnswer && currentAnswer.length > 0 ? new Date(currentAnswer) : undefined;\n\n const answerIsValidRequired = optional || date !== undefined;\n\n // TODO: remove showSurveyRefresh later when we remove deprecatedDatepicker - avoiding\n // checking the date validation here because the old component does not support it\n const answerIsValidDate =\n !showRefreshedComponents ||\n (date !== undefined &&\n (minDate === undefined || date >= minDate) &&\n (maxDate === undefined || date <= maxDate));\n\n useEffect(() => {\n setAbleToSubmit(answerIsValidRequired && answerIsValidDate);\n }, [answerIsValidRequired, answerIsValidDate, setAbleToSubmit]);\n\n const [datepickerErrorMessage, setDatepickerErrorMessage] = useState(\n undefined,\n );\n useEffect(() => {\n const requiredErrorMessage = \"Please complete the required field.\";\n const dateErrorMessage =\n minDate && maxDate\n ? `Please select a date between ${minDate.toLocaleDateString()} and ${maxDate.toLocaleDateString()}.`\n : minDate\n ? `Please select a date on or after ${minDate.toLocaleDateString()}.`\n : maxDate\n ? `Please select a date on or before ${maxDate.toLocaleDateString()}.`\n : undefined;\n\n if (showValidation) {\n setDatepickerErrorMessage(\n !answerIsValidRequired\n ? requiredErrorMessage\n : !answerIsValidDate\n ? dateErrorMessage\n : undefined,\n );\n }\n }, [showValidation, answerIsValidRequired, answerIsValidDate, minDate, maxDate]);\n\n const deprecatedDatepicker = (\n \n \n \n updateAnswer(selected ? \"\" : day.toString())\n }\n error={datepickerErrorMessage}\n />\n \n );\n\n const datepicker = (\n updateAnswer(newValue.date ? newValue.date.toString() : \"\")}\n />\n );\n\n return showRefreshedComponents ? datepicker : deprecatedDatepicker;\n}\n","import React, { useContext, useEffect } from \"react\";\nimport { gql } from \"@urql/core\";\nimport { SurveyContext, QuestionProps } from \"../../survey\";\nimport Checkbox from \"../../../components/data_entry/checkbox\";\nimport { MentorChatGroupsDocument } from \"../../../generated/graphql\";\nimport QuestionLabel from \"../components/question_label\";\nimport nextId from \"react-id-generator\";\nimport { useQuery } from \"urql\";\nimport { captureError } from \"../../../../utils/capture_error\";\n\ngql`\n query MentorChatGroups($mentorId: ID!) {\n mentor(id: $mentorId) {\n id\n mentorships {\n id\n isMatched\n chatGroup {\n id\n }\n student {\n id\n user {\n id\n firstName\n lastName\n }\n }\n }\n }\n }\n`;\n\nexport default function MentorChatGroupStudentSelect({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n}: QuestionProps) {\n const { participantId, mentorshipChatGroupId } = useContext(SurveyContext);\n\n const [{ fetching, error, data }] = useQuery({\n query: MentorChatGroupsDocument,\n variables: { mentorId: participantId },\n });\n\n // an empty array is still valid here, it just means the user selected \"none\"\n const answerIsValid = typeof currentAnswer !== \"undefined\";\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n if (fetching || data === null) return
Loading...
;\n if (error || !data) {\n const graphQLErrorsForAPM = error?.graphQLErrors?.join(\"; \") ?? \"\";\n captureError(new Error(`Error fetching useMentorChatGroupsQuery: ${graphQLErrorsForAPM}`));\n return null;\n }\n\n const mentorships = data.mentor.mentorships;\n\n if (!mentorshipChatGroupId) {\n throw new Error(\"Can only use as part of a mentorship group survey\");\n }\n\n const matchedMentorshipsInChatGroup = mentorships.filter(\n (mentorship) =>\n mentorship.chatGroup &&\n mentorship.chatGroup.id === mentorshipChatGroupId &&\n mentorship.isMatched,\n );\n\n const label = customizations.prompt;\n const id = \"student-select-\" + nextId();\n\n const selectedStudentIds = currentAnswer ? currentAnswer : [];\n return (\n
\n \n {matchedMentorshipsInChatGroup.map((mentorship) => {\n const student = mentorship.student;\n const user = student.user;\n\n return (\n {\n const index = selectedStudentIds.indexOf(student.id);\n if (index > -1) {\n updateAnswer([\n ...selectedStudentIds.slice(0, index),\n ...selectedStudentIds.slice(index + 1),\n ]);\n } else {\n updateAnswer([...selectedStudentIds, student.id]);\n }\n }}\n />\n );\n })}\n {\n updateAnswer([]);\n }}\n />\n
\n );\n}\n","import React, { useContext, useState, useEffect } from \"react\";\nimport { SurveyContext, QuestionProps } from \"../../survey\";\nimport Checkbox from \"../../../components/data_entry/checkbox\";\nimport Input from \"../../../components/data_entry/input\";\nimport { RadioGroup, RadioButton } from \"../../../components/data_entry/radio\";\nimport { MentorChatGroupsDocument } from \"../../../generated/graphql\";\nimport styled from \"styled-components\";\nimport QuestionLabel from \"../components/question_label\";\nimport nextId from \"react-id-generator\";\nimport { useQuery } from \"urql\";\nimport { captureError } from \"../../../../utils/capture_error\";\n\ntype answer = false | { studentId: string; info: string }[];\n\nconst StyledStudentSelect = styled.div`\n margin-top: 12px;\n`;\n\nexport default function MentorChatGroupOptionalStudentInfo({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n}: QuestionProps) {\n const { participantId, mentorshipChatGroupId } = useContext(SurveyContext);\n\n // this is a temporary data store for input student info. when the user un-checks\n // a student, the info gets removed from currentAnswer. We want to make sure they\n // don't have to re-type everything if they re-check the student again, so we save\n // it here just in case\n const [savedStudentInfo, setSavedStudentInfo] = useState<{\n [studentId: string]: string;\n }>({});\n\n const [{ fetching, error, data }] = useQuery({\n query: MentorChatGroupsDocument,\n variables: { mentorId: participantId },\n });\n\n const answerIsValid = typeof currentAnswer !== \"undefined\";\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n if (fetching || data === null) return
Loading...
;\n if (error || !data) {\n const graphQLErrorsForAPM = error?.graphQLErrors?.join(\"; \") ?? \"\";\n captureError(new Error(`Error fetching useMentorChatGroupsQuery: ${graphQLErrorsForAPM}`));\n return null;\n }\n\n const mentorships = data.mentor.mentorships;\n\n if (!mentorshipChatGroupId) {\n throw new Error(\"Can only use as part of a mentorship group survey\");\n }\n const mentorshipsInChatGroup = mentorships.filter(\n (mentorship) => mentorship.chatGroup && mentorship.chatGroup.id === mentorshipChatGroupId,\n );\n\n const yesNoLabel = customizations.yesNoPrompt;\n const selectLabel = customizations.selectPrompt;\n const id = nextId();\n\n return (\n
\n \n updateAnswer(newValue === \"yes\" ? [] : false)}\n >\n \n \n \n {currentAnswer && (\n \n \n {mentorshipsInChatGroup.map((mentorship) => {\n const student = mentorship.student;\n const user = student.user;\n\n const answerIndex = currentAnswer.findIndex(\n (answer) => answer.studentId === student.id,\n );\n return (\n
\n student.studentId).includes(student.id)}\n htmlFor={id}\n onChange={() => {\n if (answerIndex > -1) {\n updateAnswer([\n ...currentAnswer.slice(0, answerIndex),\n ...currentAnswer.slice(answerIndex + 1),\n ]);\n } else {\n updateAnswer([\n ...currentAnswer,\n {\n studentId: student.id,\n info: savedStudentInfo[student.id] ? savedStudentInfo[student.id] : \"\",\n },\n ]);\n }\n }}\n />\n {answerIndex > -1 && (\n {\n setSavedStudentInfo({\n ...savedStudentInfo,\n [student.id]: newInfo,\n });\n updateAnswer([\n ...currentAnswer.slice(0, answerIndex),\n { ...currentAnswer[answerIndex], info: newInfo },\n ...currentAnswer.slice(answerIndex + 1),\n ]);\n }}\n />\n )}\n
\n );\n })}\n
\n )}\n
\n );\n}\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { HiddenAccessibleSpan } from \"../../../components/accessibility/hidden_accessible_span\";\nimport DOMPurify from \"dompurify\";\nimport { RequiredMarker, StyledQuestionPrompt, StyledDescription } from \"./shared_styles\";\n\nconst StyledLegend = styled.legend`\n display: inline-block;\n font-weight: 300;\n font-size: 18px;\n margin-bottom: 12px;\n white-space: pre-wrap;\n`;\n\nexport const StyledFieldset = styled.fieldset`\n border: none;\n padding: 0;\n`;\n\nexport default function QuestionFieldsetLegend({\n legend,\n description,\n questionIsOptional = false,\n hideRequiredMarker = false,\n dataTest,\n htmlFor,\n ...rest\n}: {\n legend: string;\n description?: string;\n questionIsOptional?: boolean;\n className?: string;\n hideRequiredMarker?: boolean;\n dataTest?: string;\n htmlFor?: string;\n}) {\n return (\n <>\n {/* We're moving away from required indicators as a UX choice, but won't do the refactor en masse. This flag allows us to update some areas incrementally */}\n \n {!questionIsOptional && !hideRequiredMarker && (\n <>\n * \n Required\n \n )}\n \n \n\n {description && (\n \n )}\n \n );\n}\n","// This file is used to help us with Matching Survey migrations into the survey framework.\n// we need backwards compatibility for our existing question templates, but ideally we integrate\n// the two in a better way going forward.\n\ninterface Option {\n text: string;\n image?: string;\n oid: string;\n value?: boolean;\n}\n\ninterface SurveyQuestionSelectOption {\n id: string;\n label: string;\n}\n\ninterface SurveyQuestionSelectOtherOption {\n id: string | undefined;\n label: string | undefined;\n}\n\nfunction getOptionText(option: string | Option | undefined): string | undefined {\n if (option) {\n return typeof option === \"string\" ? option : option.text;\n }\n return undefined;\n}\nfunction getOptionLabel(\n option: string | SurveyQuestionSelectOption | undefined,\n): string | undefined {\n if (option) {\n return typeof option === \"string\" ? option : option.label;\n }\n return undefined;\n}\n\nfunction getOptionOid(option: string | Option | undefined): string | undefined {\n if (option) {\n return typeof option === \"string\" ? option : option.oid;\n }\n return undefined;\n}\n\nfunction getOptionObjectFromText(\n optionText: string,\n optionList: (string | Option)[],\n): string | Option | undefined {\n return optionList.find(\n (option) => (typeof option === \"string\" ? option : option.text) === optionText,\n );\n}\n\nfunction selectedOptionPresent(selectedOption: string | Option | undefined): boolean {\n if (typeof selectedOption === \"string\") {\n return selectedOption.length > 0;\n } else {\n return !!selectedOption?.oid;\n }\n}\n\nexport {\n getOptionText,\n getOptionLabel,\n getOptionObjectFromText,\n getOptionOid,\n selectedOptionPresent,\n};\nexport type { Option, SurveyQuestionSelectOption, SurveyQuestionSelectOtherOption };\n","import styled from \"styled-components\";\nimport React from \"react\";\nimport { StyledOptionalText } from \"./prompt_with_secondary_text\";\nimport { ParagraphMedium } from \"baseui/typography\";\n\nconst QuestionLabel = styled(\"div\")`\n // Respect any line breaks in the label\n white-space: pre-wrap;\n max-width: 700px;\n`;\n\nconst StyledSecondaryText = styled(ParagraphMedium)`\n color: ${({ theme }) => theme.colors.contentTertiary};\n margin-top: ${({ theme }) => theme.sizing.scale100};\n margin-bottom: 0;\n max-width: 700px;\n`;\n\nexport const getFormControlLabel = (\n supplementalQuestionPrompt: string | undefined,\n label: string | undefined,\n optional: boolean,\n secondaryText: string | undefined,\n dataTest: string | undefined,\n) => {\n // Display secondaryText under the main question label when supplementalQuestionPrompt is not present\n const styledSecondaryLabel = !supplementalQuestionPrompt && secondaryText && (\n \n {secondaryText}\n \n );\n\n // We only want to show the optional text in the label if there is no supplemental question prompt and if the question is optional.\n // If there IS a supplemental question prompt AND it's optional, the optional text will be shown in the supplemental question prompt component instead of the traditional label prop.\n return !supplementalQuestionPrompt && optional ? (\n <>\n \n {label} (Optional)\n \n {styledSecondaryLabel}\n \n ) : label ? (\n <>\n {label}\n {styledSecondaryLabel}\n \n ) : null;\n};\n","import React from \"react\";\nimport nextId from \"react-id-generator\";\nimport { mergeOverrides } from \"baseui\";\nimport { Overrides } from \"baseui/overrides\";\nimport { FormControlOverrides } from \"baseui/form-control\";\n\nimport FormControl from \"../../inputs/form_control\";\nimport Input, { InputOverrides, InputProps } from \"../../inputs/input\";\nimport PromptWithSecondaryText from \"./shared_components/prompt_with_secondary_text\";\nimport { useConstructAriaLabel } from \"./use_construct_aria_label\";\nimport { getFormControlLabel } from \"./shared_components/shared_form_control_label\";\nimport { captureError } from \"../../../../../utils/capture_error\";\n\nconst INPUT_AREA_NAMESPACE = \"textarea-input\";\n\nexport interface InputQuestionWrapperProps extends InputProps {\n label?: string;\n secondaryText?: string;\n supplementalQuestionPrompt?: string;\n optional: boolean;\n placeholder?: string;\n errorMessage?: string;\n overrides?: Overrides;\n ariaLabel?: string; // use this if the supplemental question prompt, secondary text, and label cannot be provided, such as in the case of a follow up input to an \"other\" option\n}\n\nconst inputOverrides = (maxCharacterCount?: number): Overrides => ({\n Root: {\n style: ({ $theme }) => ({\n marginTop:\n // If we have a character counter, reduce the top margin.\n maxCharacterCount ? `-${$theme.sizing.scale300}` : `0`,\n maxWidth: \"620px\",\n }),\n },\n});\n\nconst formControlOverrides = (): Overrides => ({\n Label: {\n style: () => ({\n marginBottom: \"0\",\n }),\n },\n});\n\nconst InputQuestionWrapper = ({\n supplementalQuestionPrompt,\n secondaryText,\n label,\n optional,\n placeholder,\n errorMessage,\n overrides,\n ariaLabel,\n dataTest,\n ...inputProps\n}: InputQuestionWrapperProps) => {\n const { constructAriaLabel } = useConstructAriaLabel();\n\n if (overrides) {\n overrides = mergeOverrides(inputOverrides(inputProps.maxCharacterCount), overrides);\n } else {\n overrides = inputOverrides(inputProps.maxCharacterCount);\n }\n\n const inputId = nextId(INPUT_AREA_NAMESPACE);\n\n if (\n !supplementalQuestionPrompt &&\n !secondaryText &&\n !label &&\n !ariaLabel &&\n !inputProps[\"aria-label\"]\n ) {\n captureError(\n \"Error! If input question wrapper does not have supplemental question prompt, secondary text, label, or aria-label, it must have an ariaLabel prop, otherwise the input is inaccessible for assistive technologies.\",\n );\n }\n\n return (\n
\n {supplementalQuestionPrompt && (\n \n )}\n\n \n \n \n
\n );\n};\n\nexport default InputQuestionWrapper;\n","import React from \"react\";\nimport FormControl from \"../../inputs/form_control\";\nimport Textarea, { TextareaOverrides, TextareaProps } from \"../../inputs/textarea\";\nimport PromptWithSecondaryText from \"./shared_components/prompt_with_secondary_text\";\nimport { Overrides } from \"baseui/overrides\";\nimport nextId from \"react-id-generator\";\nimport { useConstructAriaLabel } from \"./use_construct_aria_label\";\nimport { FormControlOverrides } from \"baseui/form-control\";\nimport { getFormControlLabel } from \"./shared_components/shared_form_control_label\";\n\nconst TEXT_AREA_NAMESPACE = \"textarea-input\";\n\nexport interface TextareaWrapperProps extends TextareaProps {\n supplementalQuestionPrompt?: string;\n secondaryText?: string;\n label?: string;\n optional: boolean;\n placeholder?: string;\n errorMessage?: string;\n}\n\nconst textareaOverrides = (\n currentCharacterCount?: number,\n label?: string,\n): Overrides => ({\n Root: {\n style: ({ $theme }) => ({\n marginTop:\n // If we have a character counter OR no label, remove the top margin.\n currentCharacterCount != undefined || !label ? undefined : `-${$theme.sizing.scale500}`,\n maxWidth: \"620px\",\n }),\n },\n});\n\nconst TextareaQuestionWrapper = ({\n supplementalQuestionPrompt,\n secondaryText,\n label,\n optional,\n placeholder,\n errorMessage,\n ...textareaProps\n}: TextareaWrapperProps) => {\n const { constructAriaLabel } = useConstructAriaLabel();\n\n const textAreaId = nextId(TEXT_AREA_NAMESPACE);\n\n const formControlOverrides = (): Overrides => ({\n Label: {\n style: () => ({\n marginBottom: \"0\",\n }),\n },\n });\n\n return (\n
\n {supplementalQuestionPrompt && (\n \n )}\n\n \n \n \n
\n );\n};\n\nexport default TextareaQuestionWrapper;\n","import React, { useEffect, useState } from \"react\";\n\nimport { Overrides } from \"baseui/overrides\";\nimport { FormControlOverrides } from \"baseui/form-control\";\n\nimport FormControl from \"../../inputs/form_control\";\nimport { TextareaOverrides } from \"../../inputs/textarea\";\nimport Checkbox from \"../../inputs/checkbox\";\nimport { InputOverrides } from \"../../inputs/input\";\nimport PromptWithSecondaryText from \"./shared_components/prompt_with_secondary_text\";\nimport { useConstructAriaLabel } from \"./use_construct_aria_label\";\n\nimport Input from \"./input_question_wrapper\";\nimport Textarea from \"./textarea_question_wrapper\";\n\nexport enum MultiSelectFollowUpQuestionType {\n TEXT_INPUT = \"text_input\",\n TEXT_AREA = \"text_area\",\n}\n\nexport enum AnswerCountStrictness {\n MAX_COUNT = \"max_count\",\n MIN_COUNT = \"min_count\",\n EXACT_COUNT = \"exact_count\",\n}\n\nexport interface MultiSelectWrapperProps {\n questionPrompt: string;\n secondaryText?: string;\n optional: boolean;\n showErrors: boolean;\n options: MultiSelectOption[];\n onChange: (newAnswer: MultiSelectOption) => void;\n setAbleToSubmit: (ableToSubmit: boolean) => void;\n requiredAnswerCount?: number;\n answerCountStrictness?: AnswerCountStrictness;\n dataTest?: string;\n}\n\nexport interface MultiSelectOption {\n id: string;\n label: string;\n value: boolean;\n followup?: MultiSelectFollowUp;\n}\n\n// This interface exists largely because existing question types, used by SIFP questions\n// and flags reporting, allowed followup text boxes for some or all checkboxes within a multi-select.\n// The shape of this interface has been designed to also fit the 'other' option\n// that is present in many questions. Doing so also prevents us from having to\n// assume that the final option with oid 'other' always needs to have a text input vs text area.\n// It is up to the caller to decide what to do with the followup values.\n// This component only knows how to capture the followup data and pass it back up,\n// in an effort to keep specific question template type business logic, including\n// knowledge of any json structure, out of the presentation layer.\nexport interface MultiSelectFollowUp {\n type: MultiSelectFollowUpQuestionType;\n optional: boolean;\n value: string | undefined;\n placeholder?: string;\n maxCharacters?: number;\n}\n\nexport const formControlOverrides: Overrides = {\n ControlContainer: {\n style: () => ({\n marginTop: \"0px\",\n marginBottom: \"0px\",\n width: \"fit-content\",\n }),\n },\n};\n\nconst textareaOverrides = (maxCharacters?: number): Overrides => ({\n Root: {\n style: ({ $theme }) => ({\n marginTop:\n // If we have a character counter, reduce the top margin.\n maxCharacters ? `-${$theme.sizing.scale300}` : `${$theme.sizing.scale800}`,\n maxWidth: \"620px\",\n }),\n },\n});\n\nconst inputOverrides = (maxCharacters?: number): Overrides => ({\n Root: {\n style: ({ $theme }) => ({\n marginTop:\n // If we have a character counter, reduce the top margin.\n maxCharacters ? `0` : `${$theme.sizing.scale300}`,\n maxWidth: \"620px\",\n }),\n },\n});\n\nconst getFollowupErrorMessage = (option: MultiSelectOption) => {\n if (!option.followup) {\n return;\n }\n\n const requiredAnswerIsMissing = !option.followup.optional && !option.followup.value;\n const answerExceedsCharacterLimit =\n option.followup.maxCharacters &&\n option.followup.value &&\n option.followup.value.length > option.followup.maxCharacters;\n\n if (requiredAnswerIsMissing) {\n return \"Please complete the required field.\";\n } else if (option.followup.maxCharacters && answerExceedsCharacterLimit) {\n return `Maximum character limit exceeded by ${\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore TS can't see we already guard against undefined in answerExceedsCharacterLimit\n option.followup.value.length - option.followup.maxCharacters\n } characters.`;\n }\n};\n\nconst MultiSelectQuestionWrapper = ({\n questionPrompt,\n secondaryText,\n optional,\n showErrors,\n options,\n onChange,\n setAbleToSubmit,\n requiredAnswerCount,\n answerCountStrictness,\n dataTest,\n}: MultiSelectWrapperProps) => {\n const [errorMessage, setErrorMessage] = useState(undefined);\n const { constructAriaLabel } = useConstructAriaLabel();\n\n useEffect(() => {\n let ableToSubmit = true;\n const selectedOptions = options.filter((option) => option.value);\n\n // Due to how many different ways this component can be flexible,\n // and the fact that we are dealing with not one input (or even a radio group)\n // but potentially three different input types, plus an array of checkboxes,\n // the effort to accomplish this with yup was not in scope for TA-752.\n if (!optional) {\n ableToSubmit = selectedOptions.length > 0;\n\n setErrorMessage(ableToSubmit ? \"\" : \"Please select an option.\");\n\n if (answerCountStrictness === AnswerCountStrictness.EXACT_COUNT && !!requiredAnswerCount) {\n ableToSubmit = selectedOptions.length === requiredAnswerCount;\n\n setErrorMessage(ableToSubmit ? \"\" : `Please select ${requiredAnswerCount} options.`);\n } else if (\n answerCountStrictness === AnswerCountStrictness.MAX_COUNT &&\n !!requiredAnswerCount\n ) {\n ableToSubmit = selectedOptions.length > 0 && selectedOptions.length <= requiredAnswerCount;\n\n setErrorMessage(ableToSubmit ? \"\" : `Please select up to ${requiredAnswerCount} options.`);\n } else if (\n answerCountStrictness === AnswerCountStrictness.MIN_COUNT &&\n !!requiredAnswerCount\n ) {\n ableToSubmit = selectedOptions.length >= requiredAnswerCount;\n\n setErrorMessage(\n ableToSubmit ? \"\" : `Please select at least ${requiredAnswerCount} options.`,\n );\n }\n }\n\n const selectedOptionsWithFollowupErrors = selectedOptions.filter(\n (option) =>\n option.followup?.type && !option.followup?.optional && getFollowupErrorMessage(option),\n );\n\n if (selectedOptionsWithFollowupErrors.length > 0) {\n ableToSubmit = false;\n }\n\n // catch-all\n if (ableToSubmit) {\n setErrorMessage(\"\");\n }\n\n setAbleToSubmit(ableToSubmit);\n // Adding options and setAbleToSubmit as dependencies causes a \"maximum update\n // depth exceeded\" warning for follow-up questions\n // eslint-disable-next-line\n }, [answerCountStrictness, optional, requiredAnswerCount]);\n\n return (\n <>\n \n {options?.map((option, idx) => {\n const optionIsSelected = option.value;\n\n // This is a bit of a hack in order to only show the error message once\n // at the very end of the group of checkboxes\n // but not show an error on the checkbox if the error is on the follow-up element\n const formError = idx === options.length - 1 ? errorMessage : \"no-caption\";\n\n return (\n
\n \n {\n // For the sake of data cleanliness,\n // clear out any free responses if unchecking the parent checkbox\n if (option.followup && !e.currentTarget.checked) {\n onChange({\n ...option,\n value: e.currentTarget.checked,\n followup: { ...option.followup, value: undefined },\n });\n } else {\n onChange({ ...option, value: e.currentTarget.checked });\n }\n }}\n error={showErrors && !!errorMessage}\n >\n {option.label}\n \n \n {optionIsSelected &&\n option.followup?.type === MultiSelectFollowUpQuestionType.TEXT_AREA && (\n {\n // appease typescript\n if (option.followup) {\n onChange({\n ...option,\n followup: { ...option.followup, value: e.target.value },\n });\n }\n }}\n overrides={textareaOverrides(option.followup.maxCharacters)}\n />\n )}\n {optionIsSelected &&\n option.followup?.type === MultiSelectFollowUpQuestionType.TEXT_INPUT && (\n {\n // appease typescript\n if (option.followup) {\n onChange({\n ...option,\n followup: { ...option.followup, value: e.target.value },\n });\n }\n }}\n overrides={inputOverrides(option.followup.maxCharacters)}\n />\n )}\n
\n );\n })}\n \n );\n};\n\nexport default MultiSelectQuestionWrapper;\n","import React, { useEffect } from \"react\";\nimport Checkbox, { CheckBoxDisplay, CheckboxGroup } from \"../../components/data_entry/checkbox\";\nimport Input from \"../../components/data_entry/input\";\nimport QuestionFieldsetLegend, { StyledFieldset } from \"./components/question_fieldset_legend\";\nimport { QuestionProps } from \"../survey\";\nimport { Option, getOptionObjectFromText } from \"./question_helpers\";\nimport nextId from \"react-id-generator\";\nimport MultiSelectQuestionWrapper, {\n MultiSelectOption,\n} from \"../../components/base_ui/higher_order_components/questions/multiselect_question_wrapper\";\nimport { getOptionOid } from \"./question_helpers\";\nimport InputQuestionWrapper from \"../../components/base_ui/higher_order_components/questions/input_question_wrapper\";\n\nexport interface Answer {\n standard: (string | Option | undefined)[];\n writeIn?: string;\n}\n\ninterface OtherOption extends Option {\n optional?: boolean;\n}\n\nexport interface Customizations {\n prompt: string;\n options: (string | Option)[];\n withOtherOption?: OtherOption;\n optional?: boolean;\n description?: string;\n}\n\nexport default function MultiSelect({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n}: QuestionProps) {\n const label = customizations.prompt;\n const id = \"multi-select-\" + nextId();\n const secondaryText = customizations.description ?? \"\";\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const otherOption = customizations.withOtherOption;\n let options = customizations.options;\n\n if (otherOption) {\n options = options.concat(otherOption);\n }\n\n const selectedOptions = currentAnswer ? currentAnswer.standard : [];\n const answerIsValid =\n (optional &&\n (!otherOption ||\n !selectedOptions.includes(getOptionObjectFromText(otherOption.text, options)))) ||\n ((currentAnswer?.standard.length || 0) > 0 &&\n (!(\n otherOption &&\n !otherOption.optional &&\n selectedOptions.includes(getOptionObjectFromText(otherOption.text, options))\n ) ||\n (currentAnswer?.writeIn != null && currentAnswer.writeIn.length > 0)));\n const followUpErrorMessage =\n showValidation && !answerIsValid ? \"Please complete the required field.\" : \"\";\n\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n const deprecatedMultiSelect = (\n
\n \n \n \n {options.map((option) => {\n const label = typeof option === \"string\" ? option : option.text;\n return (\n {\n const index = selectedOptions.indexOf(getOptionObjectFromText(label, options));\n if (index > -1) {\n // The answer is already checked, uncheck it.\n updateAnswer({\n standard: [\n ...selectedOptions.slice(0, index),\n ...selectedOptions.slice(index + 1),\n ],\n writeIn: option === otherOption ? undefined : currentAnswer?.writeIn,\n });\n } else {\n // The answer is not checked yet, check it.\n updateAnswer({\n ...currentAnswer,\n standard: [...selectedOptions, getOptionObjectFromText(label, options)],\n });\n }\n }}\n />\n );\n })}\n \n {otherOption &&\n selectedOptions.includes(getOptionObjectFromText(otherOption.text, options)) && (\n \n updateAnswer({\n standard: selectedOptions,\n writeIn: updatedWriteIn,\n })\n }\n />\n )}\n \n
\n );\n\n const multiSelect = (\n <>\n {\n const optionLabel = typeof option === \"string\" ? option : option.text;\n return {\n id: getOptionOid(option) || \"\",\n label: optionLabel || \"\",\n value: selectedOptions.includes(getOptionObjectFromText(optionLabel, options)),\n };\n })}\n onChange={(newAnswer: MultiSelectOption) => {\n const option = typeof newAnswer === \"string\" ? newAnswer : newAnswer.label;\n const optionObject = getOptionObjectFromText(option, options);\n const index = selectedOptions.indexOf(optionObject);\n\n if (index > -1) {\n // The answer is already checked, uncheck it.\n updateAnswer({\n standard: [...selectedOptions.slice(0, index), ...selectedOptions.slice(index + 1)],\n writeIn: optionObject === otherOption ? undefined : currentAnswer?.writeIn,\n });\n } else {\n // The answer is not checked yet, check it.\n updateAnswer({\n ...currentAnswer,\n standard: [...selectedOptions, optionObject],\n });\n }\n }}\n setAbleToSubmit={setAbleToSubmit}\n dataTest={id}\n />\n {otherOption &&\n selectedOptions.includes(getOptionObjectFromText(otherOption.text, options)) && (\n \n updateAnswer({\n standard: selectedOptions,\n writeIn: updatedWriteIn,\n })\n }\n errorMessage={followUpErrorMessage}\n dataTest={`${id}-follow-up-input`}\n />\n )}\n \n );\n return showRefreshedComponents ? multiSelect : deprecatedMultiSelect;\n}\n","import React, { useContext, Fragment, useEffect } from \"react\";\nimport Checkbox from \"../../components/data_entry/checkbox\";\nimport Input from \"../../components/data_entry/input\";\nimport {\n ModeOfCommunication,\n ConversationTopic,\n ProgramSegmentDocument,\n} from \"../../generated/graphql\";\nimport { gql } from \"@urql/core\";\nimport { SurveyParticipantDataDocument, ConversationTopicsDocument } from \"../../generated/graphql\";\nimport { SurveyContext, QuestionProps } from \"../survey\";\nimport QuestionLabel from \"./components/question_label\";\nimport styled from \"styled-components\";\nimport { useQuery } from \"urql\";\n\nexport interface Answer {\n modesOfCommunication: { standard: ModeOfCommunication[]; writeIn?: string };\n conversationTopics: { standard: ConversationTopic[]; writeIn?: string };\n}\n\nexport interface Customizations {\n modeOfCommunicationPrompt: string;\n topicsPrompt: string;\n description?: string;\n}\n\nconst modeOfCommunicationOptions = [\n {\n label: \"Videochat (Skype, Facetime, etc)\",\n value: ModeOfCommunication.Videochat,\n },\n {\n label: \"Email\",\n value: ModeOfCommunication.Email,\n },\n {\n label: \"Talking on the phone\",\n value: ModeOfCommunication.TalkingOnPhone,\n },\n {\n label: \"Texting\",\n value: ModeOfCommunication.Texting,\n },\n {\n label: \"Social media (Instagram, Facebook, Snapchat, LinkedIn)\",\n value: ModeOfCommunication.SocialMedia,\n },\n {\n label: \"Meeting in person\",\n value: ModeOfCommunication.MeetingInPerson,\n },\n { label: \"Other\", value: ModeOfCommunication.Other },\n];\n\nfunction conversationTopicLabel(topic: ConversationTopic): string {\n switch (topic) {\n case ConversationTopic.GettingToKnowEachOther:\n return \"Getting to know each other\";\n case ConversationTopic.Career:\n return \"Career (jobs, internships, what to do after graduation)\";\n case ConversationTopic.CorporateCareer:\n return \"Career\";\n case ConversationTopic.Activities:\n return \"Activities (sports, clubs, being a leader on campus)\";\n case ConversationTopic.SchoolLife:\n return \"School life (eating, weather, culture)\";\n case ConversationTopic.StayingBalanced:\n return \"Staying balanced (wellness, anxiety, stress, self-care)\";\n case ConversationTopic.Academics:\n return \"Academics (classes, instructors, grades, studying)\";\n case ConversationTopic.FamilyLife:\n return \"Family life\";\n case ConversationTopic.GraduateSchool:\n return \"Graduate school\";\n case ConversationTopic.Resumes:\n return \"Resumes\";\n case ConversationTopic.Interviewing:\n return \"Interviewing\";\n case ConversationTopic.LinkedIn:\n return \"LinkedIn\";\n case ConversationTopic.CareerFairs:\n return \"Career fairs\";\n case ConversationTopic.Networking:\n return \"Networking\";\n case ConversationTopic.ConnectingCourseworkToCareer:\n return \"Connecting coursework to career\";\n case ConversationTopic.ResearchOpportunities:\n return \"Research opportunities\";\n case ConversationTopic.StudentOrCampusLife:\n return \"Student or campus life\";\n case ConversationTopic.ComparingSchools:\n return \"Comparing schools\";\n case ConversationTopic.FinancialAid:\n return \"Financial aid\";\n case ConversationTopic.OnboardingToCompanyOrDepartment:\n return \"Onboarding to Company/Department\";\n case ConversationTopic.ProfessionalDevelopment:\n return \"Professional Development\";\n case ConversationTopic.WorkLifeBalance:\n return \"Work/Life Balance\";\n case ConversationTopic.GettingInvolvedAndCompanyProgramming:\n return \"Getting Involved/Company Programming\";\n case ConversationTopic.CurrentEvents:\n return \"Current Events\";\n case ConversationTopic.OvercomingObstaclesAndNavigatingTheWorkplace:\n return \"Overcoming Obstacles/Navigating the Workplace\";\n case ConversationTopic.ManagingUp:\n return \"Managing Up\";\n case ConversationTopic.BuildingProfessionalBrand:\n return \"Building Professional Brand\";\n case ConversationTopic.BenefitsAndCompensation:\n return \"Benefits & Compensation\";\n case ConversationTopic.PersonnelChallenges:\n return \"Personnel Challenges\";\n case ConversationTopic.Other:\n return \"Other\";\n default:\n throw new Error(`Unrecognized conversation topic ${topic}`);\n }\n}\n\ngql`\n query SurveyParticipantData($participantId: ID!) {\n participant(id: $participantId) {\n id\n program {\n id\n segment\n programSequence {\n id\n school {\n id\n shortName\n }\n }\n }\n }\n }\n`;\n\ngql`\n query ConversationTopics($segment: ProgramSegment!, $programId: ID!, $questionId: ID!) {\n conversationTopics(segment: $segment, programId: $programId, questionId: $questionId)\n }\n`;\n\ngql`\n query ProgramSegment($programId: ID!) {\n program(id: $programId) {\n id\n segment\n programSequence {\n id\n school {\n id\n shortName\n }\n }\n }\n }\n`;\n\nconst ConversationTopicsQuestion = styled.div`\n margin-top: ${({ theme }) => theme.deprecatedSpacing.component.eight};\n`;\n\nexport default function Conversation({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n questionId,\n}: QuestionProps) {\n const { participantId, programId = \"\" } = useContext(SurveyContext);\n\n const [{ fetching, error, data }] = useQuery({\n query: SurveyParticipantDataDocument,\n variables: { participantId },\n pause: !participantId,\n });\n\n const [\n { fetching: fetchingProgramSegment, error: errorProgramSegment, data: programSegmentData },\n ] = useQuery({\n query: ProgramSegmentDocument,\n variables: { programId: programId },\n pause: !programId,\n });\n\n const [{ fetching: fetchingTopics, data: topicsData }] = useQuery({\n query: ConversationTopicsDocument,\n variables: {\n // The conversation topics are based on the program segment, and the program segment could be obtained\n // from either the current participant or the program (from the secret survey preview)\n // When coming from the secret survey preview, the programId will be set and segment retrieved from there\n // instead of from the participant\n\n // checking this in the pause\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n segment: data?.participant.program.segment || programSegmentData?.program.segment,\n programId: programId,\n questionId: questionId ? questionId.toString() : \"\",\n },\n pause: !data?.participant.program.segment && !programSegmentData?.program.segment,\n });\n\n let modeOfCommunicationLabel = \"\";\n let topicsLabel = \"\";\n\n const answeredConversationTopicsQuestion =\n !!currentAnswer &&\n (currentAnswer.conversationTopics.standard.length > 0 ||\n (currentAnswer.conversationTopics.writeIn?.length || 0) > 0);\n\n const answeredModesOfCommunicationQuestion =\n !!currentAnswer &&\n (currentAnswer.modesOfCommunication.standard.length > 0 ||\n (currentAnswer.modesOfCommunication.writeIn?.length || 0) > 0);\n\n const answerIsValid =\n typeof currentAnswer !== \"undefined\" &&\n (!topicsLabel || answeredConversationTopicsQuestion) &&\n (!modeOfCommunicationLabel || answeredModesOfCommunicationQuestion);\n\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n if (fetching || data === null || fetchingProgramSegment || programSegmentData === null)\n return
Loading...
;\n\n if ((error || !data) && (errorProgramSegment || !programSegmentData)) return
Uh oh
;\n\n modeOfCommunicationLabel = customizations.modeOfCommunicationPrompt;\n const description = customizations.description;\n topicsLabel = customizations.topicsPrompt;\n const answer = currentAnswer\n ? currentAnswer\n : { modesOfCommunication: { standard: [] }, conversationTopics: { standard: [] } };\n\n return (\n
\n {modeOfCommunicationLabel && (\n
\n \n {modeOfCommunicationOptions.map((option) => (\n \n {\n const index = answer.modesOfCommunication.standard.indexOf(option.value);\n if (index > -1) {\n updateAnswer({\n conversationTopics: answer.conversationTopics,\n modesOfCommunication: {\n standard: [\n ...answer.modesOfCommunication.standard.slice(0, index),\n ...answer.modesOfCommunication.standard.slice(index + 1),\n ],\n writeIn:\n option.value === ModeOfCommunication.Other\n ? undefined\n : answer.modesOfCommunication.writeIn,\n },\n });\n } else {\n updateAnswer({\n conversationTopics: answer.conversationTopics,\n modesOfCommunication: {\n ...answer.modesOfCommunication,\n standard: [...answer.modesOfCommunication.standard, option.value],\n },\n });\n }\n }}\n />\n {option.value === ModeOfCommunication.Other &&\n answer.modesOfCommunication.standard.includes(option.value) && (\n \n updateAnswer({\n conversationTopics: answer.conversationTopics,\n modesOfCommunication: {\n ...answer.modesOfCommunication,\n writeIn: updatedWriteIn,\n },\n })\n }\n />\n )}\n \n ))}\n
\n )}\n\n {fetchingTopics || topicsData === null ? (\n
Loading...
\n ) : !topicsData ? (\n
Uh oh
\n ) : (\n \n \n {topicsData.conversationTopics.map((topic) => (\n \n {\n const index = answer.conversationTopics.standard.indexOf(topic);\n if (index > -1) {\n updateAnswer({\n modesOfCommunication: answer.modesOfCommunication,\n conversationTopics: {\n standard: [\n ...answer.conversationTopics.standard.slice(0, index),\n ...answer.conversationTopics.standard.slice(index + 1),\n ],\n writeIn:\n topic === ConversationTopic.Other\n ? undefined\n : answer.conversationTopics.writeIn,\n },\n });\n } else {\n updateAnswer({\n modesOfCommunication: answer.modesOfCommunication,\n conversationTopics: {\n ...answer.conversationTopics,\n standard: [...answer.conversationTopics.standard, topic],\n },\n });\n }\n }}\n />\n {topic === ConversationTopic.Other &&\n answer.conversationTopics.standard.includes(topic) && (\n \n updateAnswer({\n modesOfCommunication: answer.modesOfCommunication,\n conversationTopics: {\n ...answer.conversationTopics,\n writeIn: updatedWriteIn,\n },\n })\n }\n />\n )}\n \n ))}\n \n )}\n
\n );\n}\n","import React, { HTMLProps } from \"react\";\nimport styled from \"styled-components\";\n\ninterface Props extends HTMLProps {\n label?: string;\n error?: string;\n questionIsOptional?: boolean;\n}\n\nconst TextArea = styled.span<{ hasError: boolean }>`\n position: relative;\n display: block;\n\n .label {\n display: block;\n text-transform: uppercase;\n color: ${({ theme }) => theme.colors.contentPrimary};\n font-size: ${({ theme }) => theme.font.size.label.one};\n font-family: Arial;\n margin-bottom: ${({ theme }) => theme.deprecatedSpacing.component.three};\n }\n\n .text-area {\n /* this is a hack to avoid chrome's auto-complete styling */\n transition: color 9999s ease-out, background-color 9999s ease-out;\n transition-delay: 9999s;\n\n box-sizing: border-box;\n width: 100%;\n background-color: ${({ theme }) => theme.deprecatedColors.white};\n vertical-align: middle;\n font-size: ${({ theme }) => theme.font.size.body.one};\n font-family: Arial;\n color: ${({ theme }) => theme.deprecatedColors.text.normal};\n border: 1px solid ${({ theme }) => theme.deprecatedColors.gray.six};\n border-radius: ${({ theme }) => theme.deprecatedSpacing.component.two};\n padding: 8px;\n border: 1px solid\n ${({ theme, hasError }) =>\n hasError ? theme.deprecatedColors.error : theme.deprecatedColors.gray.six};\n\n &:focus {\n border-color: ${({ theme }) => theme.deprecatedColors.primary.normal};\n outline-style: none;\n }\n }\n\n .errorText {\n display: block;\n color: ${({ theme, hasError }) =>\n hasError ? theme.deprecatedColors.error : theme.deprecatedColors.gray.six};\n font-size: ${({ theme }) => theme.font.size.body.three};\n line-height: ${({ theme }) => theme.font.size.body.two};\n`;\n\nexport default function TextAreaInput({\n className,\n label,\n error,\n questionIsOptional = true,\n ...inputProps\n}: Props) {\n return (\n \n );\n}\n","import React, { useContext, Fragment, useEffect } from \"react\";\nimport Checkbox from \"../../components/data_entry/checkbox\";\nimport {\n SurveyParticipantDataDocument,\n FlagCategoriesDocument,\n FlagCategory,\n ProgramSegmentDocument,\n} from \"../../generated/graphql\";\nimport { SurveyContext, QuestionProps } from \"../survey\";\nimport TextArea from \"../../components/data_entry/text_area\";\nimport { RadioGroup, RadioButton } from \"../../components/data_entry/radio\";\nimport QuestionLabel from \"./components/question_label\";\nimport styled from \"styled-components\";\nimport { gql } from \"urql\";\nimport { useQuery } from \"urql\";\n\ngql`\n query FlagCategories($filter: FlagCategoryFilter) {\n flagCategories(filter: $filter) {\n id\n name\n identifier\n label\n }\n }\n`;\n\nexport interface Answer {\n selectedFlags: FlagCategory[\"identifier\"][];\n writeIn?: string;\n extraInfo: string;\n shouldSchoolFollowUp: \"YES\" | \"NO\" | \"NOT_SURE\";\n}\n\nexport interface Customizations {\n prompt: string;\n followUpPrompt: string;\n schoolSupportPrompt: string;\n schoolSupportDescription: string;\n hideSchoolSupportQuestion: boolean;\n description?: string;\n}\n\nconst FlagsExtraQuestion = styled.div`\n margin-top: ${({ theme }) => theme.deprecatedSpacing.component.eight};\n`;\n\nexport default function Flags({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n}: QuestionProps) {\n const query = new URLSearchParams(window.location.search);\n const initialCategory = query.get(\"initialCategory\") || \"\";\n\n const { participantId, programId = \"\" } = useContext(SurveyContext);\n\n const [{ fetching, error, data }] = useQuery({\n query: SurveyParticipantDataDocument,\n variables: { participantId },\n pause: !participantId,\n });\n\n const [\n { fetching: fetchingProgramSegment, error: errorProgramSegment, data: programSegmentData },\n ] = useQuery({\n query: ProgramSegmentDocument,\n variables: { programId: programId },\n pause: !programId,\n });\n\n const [{ fetching: categoriesFetching, error: categoriesError, data: categoriesData }] = useQuery(\n {\n query: FlagCategoriesDocument,\n // The flag categories are based on the program, and the program could be obtained\n // from either the current participant or the program id provided from the secret survey preview\n variables: { filter: { programId: data?.participant.program.id || programId || \"\" } },\n pause: !data?.participant.program.id && !programId,\n },\n );\n // @TODO - we could get more nuanced here if we wanted to the follow-up to be required if something is selected\n const answerIsValid = typeof currentAnswer !== \"undefined\";\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n // Pre-populate a flag if we have a query string on the url field.\n useEffect(() => {\n const category = categoriesData?.flagCategories.find(\n (flagCategory) => flagCategory.name === initialCategory,\n );\n if (category) {\n updateAnswer({\n selectedFlags: [category.identifier],\n extraInfo: \"\",\n shouldSchoolFollowUp: \"YES\",\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [initialCategory, categoriesData]);\n\n if (fetching || data === null || fetchingProgramSegment || programSegmentData === null)\n return
Loading...
;\n\n if ((error || !data) && (errorProgramSegment || !programSegmentData)) return
Uh oh
;\n\n const program = data?.participant.program || programSegmentData?.program;\n const label = customizations.prompt;\n const followUpLabel = customizations.followUpPrompt;\n const description = customizations.description;\n const schoolSupportLabel = customizations.schoolSupportPrompt;\n const schoolSupportDescriptionLabel = customizations.schoolSupportDescription;\n const hideSchoolSupportQuestion = customizations.hideSchoolSupportQuestion;\n\n if (categoriesFetching || categoriesData === null) return
Loading...
;\n if (!categoriesData || categoriesError) return
Uh oh
;\n\n const sortedCategories = categoriesData.flagCategories.sort((a, b) =>\n a.label.localeCompare(b.label),\n );\n\n const answer: Answer = currentAnswer\n ? currentAnswer\n : {\n selectedFlags: [],\n extraInfo: \"\",\n shouldSchoolFollowUp: \"YES\",\n };\n return (\n
\n \n {\n updateAnswer({\n selectedFlags: [],\n extraInfo: \"\",\n shouldSchoolFollowUp: \"YES\",\n });\n }}\n />\n {sortedCategories.map((flagCategory) => (\n {\n const index = answer.selectedFlags.indexOf(flagCategory.identifier);\n const updatedOptions =\n index > -1\n ? [\n ...answer.selectedFlags.slice(0, index),\n ...answer.selectedFlags.slice(index + 1),\n ]\n : [...answer.selectedFlags, flagCategory.identifier];\n updateAnswer(\n currentAnswer\n ? {\n ...currentAnswer,\n selectedFlags: updatedOptions,\n }\n : {\n selectedFlags: updatedOptions,\n extraInfo: \"\",\n shouldSchoolFollowUp: \"YES\",\n },\n );\n }}\n />\n ))}\n {answer.selectedFlags.length > 0 && (\n \n \n \n \n updateAnswer(\n currentAnswer\n ? {\n ...currentAnswer,\n extraInfo: updatedResponse,\n }\n : {\n selectedFlags: [],\n extraInfo: updatedResponse,\n shouldSchoolFollowUp: \"YES\",\n },\n )\n }\n value={currentAnswer ? currentAnswer.extraInfo : \"\"}\n />\n \n \n )}\n {answer.selectedFlags.length > 0 && !hideSchoolSupportQuestion && (\n \n \n \n \n updateAnswer(\n currentAnswer\n ? { ...currentAnswer, shouldSchoolFollowUp: newValue }\n : {\n selectedFlags: [],\n extraInfo: \"\",\n shouldSchoolFollowUp: newValue,\n },\n )\n }\n >\n <>\n \n \n \n \n \n \n )}\n
\n );\n}\n","import React, { ReactNode, useContext } from \"react\";\nimport TextArea from \"../../../components/data_entry/text_area\";\nimport QuestionLabel from \"./question_label\";\nimport { RadioGroup, RadioButton, RadioGroupDisplay } from \"../../../components/data_entry/radio\";\nimport styled from \"styled-components\";\nimport MultiSelect from \"../multi_select\";\nimport { Option } from \"../question_helpers\";\nimport { SurveyContext, SurveyDisplay } from \"../../survey\";\n\nconst ScaleLabel = styled.div`\n font-weight: ${({ theme }) => theme.font.weight.normal};\n font-size: ${({ theme }) => theme.font.size.body.one};\n margin-bottom: ${({ theme }) => theme.deprecatedSpacing.component.four};\n color: ${({ theme }) => theme.deprecatedColors.primary.dark};\n`;\n\nexport interface LikertFollowUpMultiSelectAnswer {\n standard: (string | Option | undefined)[];\n writeIn?: string;\n}\n\nexport const times = (\n fn: (num: number, index: number) => T,\n start: number,\n end: number\n): T[] => {\n let num = start;\n let index = 0;\n const list = [];\n while (num <= end) {\n list[index] = fn(num, index);\n index += 1;\n num += 1;\n }\n return list;\n};\n\nconst StyledRadioButton = styled(RadioButton)`\n flex-grow: 1;\n`;\n\nconst LikertExtraQuestion = styled.div`\n margin-top: ${({ theme }) => theme.deprecatedSpacing.component.eight};\n`;\n\nexport type Scale = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;\n\nexport default function Likert({\n prompt,\n value,\n onChangeValue,\n followUpPrompt = \"\",\n followUpResponse = \"\",\n followUpLowScore = false,\n followUpLowPrompt = \"\",\n followUpLowResponse = \"\",\n followUpLowQuestion,\n lowScoreThreshold = 4,\n onChangeLowFollowUp = () => undefined,\n followUpHighScore = false,\n followUpHighPrompt = \"\",\n followUpHighResponse = \"\",\n highScoreThreshold = 5,\n onChangeHighFollowUp = () => undefined,\n optional = false,\n max = 7,\n maxLabel = \"High\",\n min = 1,\n minLabel = \"Low\",\n displayValues,\n description,\n followUpLowDescription,\n}: {\n prompt: string;\n value?: Scale;\n onChangeValue: (newValue: Scale) => void;\n followUpPrompt?: string;\n followUpResponse?: string | LikertFollowUpMultiSelectAnswer;\n followUpLowScore?: boolean;\n followUpLowPrompt?: string;\n followUpLowResponse?: string | LikertFollowUpMultiSelectAnswer;\n // Fixing an accessibility issue in this PR and don't want to scope creep too much trying to figure out what the\n // type is supposed to be to avoid the eslint warning around this 'any'. Sincerest shame, Lindsay\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n followUpLowQuestion?: { type: string; [propName: string]: any };\n lowScoreThreshold?: number;\n followUpHighScore?: boolean;\n followUpHighPrompt?: string;\n followUpHighResponse?: string | LikertFollowUpMultiSelectAnswer;\n highScoreThreshold?: number;\n onChangeLowFollowUp?: (\n updatedFollowUpAnswer: string | LikertFollowUpMultiSelectAnswer | undefined\n ) => void;\n onChangeHighFollowUp?: (\n updatedFollowUpAnswer: string | LikertFollowUpMultiSelectAnswer | undefined\n ) => void;\n max?: Scale;\n maxLabel?: string;\n min?: Scale;\n minLabel?: string;\n optional?: boolean;\n displayValues?: string[] | number[];\n description?: string;\n followUpLowDescription?: string;\n}) {\n // DEPRECATION: avoid using followUpPrompt in favor of followUpLowPrompt\n // avoid using followUpResponse in favor of followUpLowResponse\n // this aliasing is here to support pre-existing likert questions\n followUpLowPrompt = followUpLowPrompt || followUpPrompt;\n followUpLowResponse = followUpLowResponse || followUpResponse;\n const { display } = useContext(SurveyContext);\n\n return (\n
\n \n \n {min}={minLabel} {max}={maxLabel}\n \n \n {times(\n (num, index) => {\n return (\n \n );\n },\n min,\n max\n )}\n \n {followUpLowScore && value && value <= lowScoreThreshold && (\n \n {followUpLowQuestion?.type === \"multi_select\" && (\n {\n onChangeLowFollowUp(newAnswer);\n }}\n setAbleToSubmit={() => {\n /* No-op. We don't currently support required follow ups for this question. */\n }}\n showValidation={false}\n />\n )}\n {!followUpLowQuestion && (\n <>\n \n \n onChangeLowFollowUp(updatedResponse)\n }\n questionIsOptional={true}\n value={typeof followUpLowResponse === \"string\" ? followUpLowResponse : undefined}\n />\n \n )}\n \n )}\n {followUpHighScore && value && value >= highScoreThreshold && (\n
\n \n \n onChangeHighFollowUp(updatedResponse)\n }\n value={typeof followUpHighResponse == \"string\" ? followUpHighResponse : undefined}\n />\n
\n )}\n
\n );\n}\n","import React, { useEffect } from \"react\";\nimport Likert, { LikertFollowUpMultiSelectAnswer, Scale as LikertScale } from \"./components/likert\";\nimport { QuestionProps } from \"../survey\";\n\ninterface Answer {\n value: LikertScale;\n followUpResponse?: string | LikertFollowUpMultiSelectAnswer;\n}\nexport default function Nps({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n}: QuestionProps<\n Answer,\n {\n prompt: string;\n followUpLowScore: boolean;\n followUpPrompt?: string;\n description?: string;\n }\n>) {\n const label = customizations.prompt;\n const description = customizations.description;\n const followUpLowScore = customizations.followUpLowScore;\n const answerIsValid = typeof currentAnswer?.value !== \"undefined\";\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n return (\n
\n {followUpLowScore ? (\n \n updateAnswer(\n currentAnswer ? { ...currentAnswer, value: newValue } : { value: newValue }\n )\n }\n followUpLowScore={true}\n followUpPrompt={customizations.followUpPrompt}\n followUpResponse={\n currentAnswer && currentAnswer.followUpResponse ? currentAnswer.followUpResponse : \"\"\n }\n onChangeLowFollowUp={(newResponse) => {\n if (!currentAnswer)\n throw new Error(\"Attempted to update NPS low score follow up without a score\");\n updateAnswer({ ...currentAnswer, followUpResponse: newResponse });\n }}\n />\n ) : (\n \n updateAnswer(\n currentAnswer ? { ...currentAnswer, value: newValue } : { value: newValue }\n )\n }\n followUpLowScore={false}\n />\n )}\n
\n );\n}\n","/*\nCopyright (c) Uber Technologies, Inc.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree.\n*/\n\n/* eslint-disable import/prefer-default-export */\nexport var STATE_TYPE = {\n change: 'CHANGE'\n};\nexport var ALIGN = {\n vertical: 'vertical',\n horizontal: 'horizontal'\n};\n/* eslint-enable import/prefer-default-export */","import React from \"react\";\nimport FormControl from \"../../inputs/form_control\";\nimport Select, { SelectProps } from \"../../inputs/select\";\nimport PromptWithSecondaryText from \"./shared_components/prompt_with_secondary_text\";\nimport { Overrides } from \"baseui/overrides\";\nimport nextId from \"react-id-generator\";\nimport { Option, SelectOverrides, Value } from \"baseui/select\";\nimport InputQuestionWrapper from \"./input_question_wrapper\";\nimport Radio, { RadioGroup, RadioProps } from \"../../inputs/radio\";\nimport styled from \"styled-components\";\nimport baseuiTheme from \"../../../../styling/baseui_theme\";\nimport { InputOverrides } from \"baseui/input\";\nimport { FormControlOverrides } from \"baseui/form-control\";\nimport { useConstructAriaLabel } from \"./use_construct_aria_label\";\nimport { getFormControlLabel } from \"./shared_components/shared_form_control_label\";\nimport { captureError } from \"../../../../../utils/capture_error\";\n\nconst SELECT_NAMESPACE = \"single-select-input\";\n\n// marginbottom prop is not camel cased to avoid this console warning:\n// Warning: React does not recognize the `marginBottom` prop on a DOM element.\nconst StyledPromptWithSecondaryTextWrapper = styled.div<{ marginbottom?: string }>`\n margin-bottom: ${({ marginbottom }) => marginbottom};\n`;\n\nconst StyledFollowUpWrapper = styled.div<{ marginTop?: string }>`\n margin-top: ${({ marginTop }) => marginTop};\n`;\n\n// Normalize some of the interface between Select and Radio, which have\n// slightly different types in the Base library\nexport interface SelectQuestionWrapperValue {\n id: string;\n label: string;\n}\n// First, create a type from the shared prop names between Select and Radio\ninterface PickRadioSelectCombinedProps\n extends Pick {}\n// Next, omit these shared props so we can normalize their types below\ninterface OmitRadioSelectCombinedProps\n extends Omit {}\n// Finally, normalize these types so that they can be used interchangeably\nexport interface RadioSelectCombinedProps extends OmitRadioSelectCombinedProps {\n options: { label: string; id: string }[];\n value?: SelectQuestionWrapperValue | Option;\n onChange: (value: SelectQuestionWrapperValue | Option) => void;\n}\n\nexport interface SelectQuestionWrapperProps extends RadioSelectCombinedProps {\n supplementalQuestionPrompt?: string;\n secondaryText?: string;\n label?: string;\n optional: boolean;\n placeholder?: string;\n errorMessage?: string;\n showFollowUp?: boolean;\n followUpPrompt?: string;\n followUpIsOptional?: boolean;\n followUpCurrentCharacterCount?: number;\n followUpMaxCharacterCount?: number;\n followUpValue?: string;\n followUpErrorMessage?: string;\n followUpAriaLabel?: string; // Use this intentionally if the supplemental question prompt, secondary text, and label cannot be provided, such as in the case of a follow up input to an \"other\" option\n onChangeFollowUpValue?: (e: React.ChangeEvent) => void;\n // A carry over from the current implementation, which allows the question component to tell the parent\n // component if it has an error or not. This is used to determine if the form can be submitted or not.\n setAbleToSubmit?: (ableToSubmit: boolean) => void;\n dataTest?: string;\n}\n\nconst selectOverrides: Overrides = {\n Root: {\n style: ({ $theme }) => ({\n marginTop: `-${$theme.sizing.scale500}`,\n maxWidth: \"620px\",\n }),\n },\n};\n\nconst radioFormControlOverrides: Overrides = {\n Label: {\n style: () => {\n return {\n marginBottom: 0,\n };\n },\n },\n};\n\nconst inputOverrides = (maxCharacters?: number): Overrides => ({\n Root: {\n style: ({ $theme }) => ({\n marginTop:\n // If we have a character counter, reduce the top margin.\n maxCharacters ? `0` : `${$theme.sizing.scale300}`,\n maxWidth: \"620px\",\n }),\n },\n});\n\nconst RADIO_VARIATION_CUTOFF = 5;\n\nconst SelectQuestionWrapper = ({\n supplementalQuestionPrompt,\n secondaryText, // customizations.description\n label, //customizations.prompt\n value, //currentAnswer\n optional, //customizations.optional\n placeholder,\n errorMessage,\n showFollowUp,\n\n followUpPrompt, // customizations.followUp.prompt\n followUpIsOptional = false, // customizations.followUp?.optional,\n followUpCurrentCharacterCount,\n followUpMaxCharacterCount,\n followUpValue,\n followUpErrorMessage,\n followUpAriaLabel,\n onChangeFollowUpValue,\n setAbleToSubmit,\n dataTest = \"select-question-wrapper\",\n ...selectProps\n}: SelectQuestionWrapperProps) => {\n const { constructAriaLabel } = useConstructAriaLabel();\n\n if (!label && !supplementalQuestionPrompt) {\n captureError(\n \"Cannot render question: SelectQuestionWrapper must have a label or supplementalQuestionPrompt but found neither\",\n );\n return null;\n }\n\n const selectId = nextId(SELECT_NAMESPACE);\n\n const { options } = selectProps;\n\n return (\n
\n {supplementalQuestionPrompt && (\n RADIO_VARIATION_CUTOFF\n ? baseuiTheme.sizing.scale650\n : !label && !!secondaryText && options.length <= RADIO_VARIATION_CUTOFF\n ? `-${baseuiTheme.sizing.scale400}`\n : undefined\n }\n >\n \n \n )}\n {(options?.length as number) > RADIO_VARIATION_CUTOFF && (\n \n selectProps.onChange(params.value[0])}\n overrides={selectOverrides}\n searchable\n clearable\n dataTest={dataTest}\n />\n \n )}\n {(options?.length as number) <= RADIO_VARIATION_CUTOFF && (\n \n \n selectProps.onChange({\n id: e.target.value,\n label: options.find((option) => option.id === e.target.value)?.label ?? \"\",\n })\n }\n value={(value as SelectQuestionWrapperValue)?.id}\n error={!!errorMessage}\n overrides={undefined}\n >\n {options.map((option, idx) => (\n \n {option.label}\n \n ))}\n \n \n )}\n {showFollowUp && (\n RADIO_VARIATION_CUTOFF\n ? baseuiTheme.sizing.scale750\n : undefined\n }\n >\n \n \n )}\n
\n );\n};\n\nexport default SelectQuestionWrapper;\n","import { Option } from \"../question_helpers\";\n\nexport interface Answer {\n selectedOption?: string | Option | undefined;\n writeIn?: string;\n followUpResponse?: string;\n label?: string;\n}\n\nexport interface Customizations {\n prompt: string;\n description?: string;\n options: (string | Option)[];\n followUp?: {\n option: string;\n optional?: boolean;\n prompt: string;\n includeOpenResponse: boolean;\n placeholder?: string;\n };\n optional?: boolean;\n withOtherOption?: Option;\n}\n\nexport function isOptional(customizations: Customizations) {\n return typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n}\n\nexport function getOptionsForSelectComponent(options: (string | Option)[], otherOption?: Option) {\n const optionsForSelectComponent = options\n .filter((option) => option)\n .map((option) => {\n if (typeof option === \"object\") {\n return { id: option.oid, label: option.text };\n } else if (typeof option === \"string\") {\n const snakeCaseOption = option\n .replace(/[^a-zA-Z0-9👍👎\\s]/gu, \"\")\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, \"_\");\n return { id: snakeCaseOption, label: option };\n }\n return { id: option, label: option };\n });\n const optionsIncludeOtherOption = optionsForSelectComponent\n .map((option) => option.id)\n .includes(otherOption?.oid as string);\n\n // If 'Other' option isn't included already, add it to the end of the list\n // Adding this extra bit to check if this option is already present in the array because for some reason\n // it was being added multiple times.\n if (otherOption?.oid && !optionsIncludeOtherOption) {\n optionsForSelectComponent.push({ id: otherOption.oid, label: otherOption.text });\n }\n return optionsForSelectComponent;\n}\n\nexport function getQuestionOptions(options: (string | Option)[], otherOption?: Option) {\n const questionOptions = options.map((option) => option as Option);\n\n const questionOptionsIncludesOtherOption = questionOptions\n .map((option) => option.oid)\n .includes(otherOption?.oid as string);\n\n // If 'Other' option isn't included already, add it to the end of the list\n // Adding this extra bit to check if this option is already present in the array because for some reason\n // it was being added multiple times.\n if (otherOption && !questionOptionsIncludesOtherOption) {\n questionOptions.push(otherOption);\n }\n return questionOptions;\n}\n","import React, { useContext, useEffect } from \"react\";\nimport {\n RadioGroup as DeprecatedRadioGroup,\n RadioButton,\n} from \"../../../components/data_entry/radio\";\nimport Input from \"../../../components/data_entry/input\";\nimport TextArea from \"../../../components/data_entry/text_area\";\nimport QuestionLabel from \"../components/question_label\";\nimport QuestionFieldsetLegend, { StyledFieldset } from \"../components/question_fieldset_legend\";\nimport { SurveyContext, SurveyDisplay } from \"../../survey\";\nimport styled from \"styled-components\";\nimport nextId from \"react-id-generator\";\nimport { getOptionObjectFromText, getOptionText, selectedOptionPresent } from \"../question_helpers\";\nimport { Answer, Customizations, getQuestionOptions, isOptional } from \"./select_shared_utils\";\n\nconst StyledFollowUp = styled.div`\n margin-top: 2em;\n`;\n\nexport default function DeprecatedSelect({\n customizations,\n updateAnswer,\n currentAnswer,\n setAbleToSubmit,\n}: {\n customizations: Customizations;\n updateAnswer: (newAnswer: Answer) => void;\n currentAnswer?: Answer;\n setAbleToSubmit: (ableToSubmit: boolean) => void;\n}) {\n const { display } = useContext(SurveyContext);\n const id = nextId();\n\n const optional = isOptional(customizations);\n const selectedOption = currentAnswer?.selectedOption;\n\n // These options have the structure of { oid: string, text: string }[]\n const questionOptions = getQuestionOptions(\n customizations.options,\n customizations.withOtherOption,\n );\n const withOtherOption = customizations.withOtherOption;\n\n const followUp = customizations.followUp;\n const followUpOptionSelected = followUp && getOptionText(selectedOption) === followUp?.option;\n\n const optionalFollowUp =\n typeof followUp?.optional === \"undefined\" ? true : customizations.optional;\n\n const otherOptionSelected =\n withOtherOption && getOptionText(currentAnswer?.selectedOption) === withOtherOption.text;\n\n const valueProvidedForOtherOption =\n currentAnswer?.writeIn != null && currentAnswer.writeIn.length > 0;\n\n const valueProvidedForFollowUpOption = (currentAnswer?.followUpResponse?.length || 0) > 0;\n\n const followUpIsValid =\n !followUpOptionSelected || optionalFollowUp || valueProvidedForFollowUpOption;\n\n const otherOptionIsValid = !otherOptionSelected || valueProvidedForOtherOption;\n\n const answerIsValid =\n optional || (selectedOptionPresent(selectedOption) && otherOptionIsValid && followUpIsValid);\n\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n return (\n
\n \n \n {(display == SurveyDisplay.banner || display == SurveyDisplay.page) && (\n \n updateAnswer({ selectedOption: getOptionObjectFromText(newValue, questionOptions) })\n }\n role=\"group\"\n aria-labelledby={id}\n >\n {questionOptions.map((option) => {\n const label = getOptionText(option) || \"\";\n return (\n \n );\n })}\n \n )}\n {selectedOption && otherOptionSelected && (\n \n updateAnswer({\n selectedOption: selectedOption,\n writeIn: updatedWriteIn,\n })\n }\n />\n )}\n {followUp && followUpOptionSelected && (\n \n \n {followUp.includeOpenResponse && (\n \n updateAnswer({\n ...currentAnswer,\n selectedOption: selectedOption,\n followUpResponse: updatedResponse,\n })\n }\n value={currentAnswer ? currentAnswer.followUpResponse : \"\"}\n />\n )}\n \n )}\n \n
\n );\n}\n","import React, { useEffect } from \"react\";\nimport { QuestionProps } from \"../../survey\";\nimport SelectQuestionWrapper from \"../../../components/base_ui/higher_order_components/questions/select_question_wrapper\";\nimport DeprecatedSelect from \"./deprecated_select\";\nimport {\n Answer,\n Customizations,\n isOptional,\n getOptionsForSelectComponent,\n getQuestionOptions,\n} from \"./select_shared_utils\";\nimport { getOptionObjectFromText, getOptionOid, getOptionText } from \"../question_helpers\";\n\nconst SELECT_FOLLOW_UP_CHARACTER_LIMIT = 50;\n\nexport default function SurveyQuestionSelect({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n dataTest = \"survey-question-select\",\n}: QuestionProps) {\n const selectedOption = currentAnswer?.selectedOption;\n const optional = isOptional(customizations);\n\n // These options have the structure of { id: string, label: string }[] needed for the SelectQuestionWrapper component\n const selectComponentOptions = getOptionsForSelectComponent(\n customizations.options,\n customizations.withOtherOption,\n );\n\n // These options have the structure of { oid: string, text: string }[] needed to transform the component option selected\n // to a valid question answer.\n const questionOptions = getQuestionOptions(\n customizations.options,\n customizations.withOtherOption,\n );\n\n const followUpOptionSelected =\n customizations.followUp &&\n currentAnswer &&\n getOptionText(selectedOption) === customizations.followUp?.option;\n\n const otherOptionSelected = currentAnswer && getOptionOid(selectedOption) === \"other\";\n\n const showFollowUp = followUpOptionSelected || otherOptionSelected;\n\n const { followUpResponse, writeIn } = currentAnswer || {};\n const followUpCharacterCount = followUpResponse?.length ?? writeIn?.length ?? 0;\n const maximumCharacterLimitExceededBy = followUpCharacterCount - SELECT_FOLLOW_UP_CHARACTER_LIMIT;\n\n // The logic implemented here is mirrored from the deprecated select component\n const followUpIsOptional =\n typeof customizations.followUp?.optional === \"undefined\" ? true : customizations.optional;\n\n const followUpRequiredAndWithinCharacterLimit =\n !followUpIsOptional &&\n showFollowUp &&\n followUpCharacterCount > 0 &&\n maximumCharacterLimitExceededBy <= 0;\n\n const followUpNotRequiredAndWithinCharacterLimit =\n followUpIsOptional && showFollowUp && maximumCharacterLimitExceededBy <= 0;\n\n const noFollowUpIsAsked = !customizations.followUp && !otherOptionSelected;\n\n const followUpIsValid =\n followUpRequiredAndWithinCharacterLimit ||\n followUpNotRequiredAndWithinCharacterLimit ||\n noFollowUpIsAsked ||\n !showFollowUp;\n\n const answerIsValid = optional || !!currentAnswer;\n\n const followUpCurrentCharacterCount = followUpCharacterCount ?? 0;\n\n const followUpCharacterLimitExceeded = !followUpIsValid && maximumCharacterLimitExceededBy > 0;\n\n const requiredErrorMessage = \"Please complete the required field.\";\n const characterLimitErrorMessage = `Maximum character limit exceeded by ${maximumCharacterLimitExceededBy} character${maximumCharacterLimitExceededBy > 1 ? \"s\" : \"\"}.`;\n\n const followUpMissingButRequired =\n !followUpIsValid && showValidation && currentAnswer?.followUpResponse === undefined;\n\n const followUpAriaLabel =\n showFollowUp && !customizations.followUp?.prompt\n ? `Follow-up input field for: ${currentAnswer.label}`\n : otherOptionSelected\n ? `Follow-up input field for: ${customizations.withOtherOption?.text}`\n : undefined;\n\n const ableToSubmit = answerIsValid && followUpIsValid;\n\n useEffect(() => {\n setAbleToSubmit(ableToSubmit as boolean);\n }, [ableToSubmit, setAbleToSubmit]);\n\n const select = (\n \n option.id === getOptionOid(selectedOption) ||\n option.label === getOptionText(selectedOption),\n )}\n onChange={(newAnswer) => {\n updateAnswer({\n selectedOption: newAnswer\n ? getOptionObjectFromText(newAnswer.label as string, questionOptions)\n : undefined,\n });\n }}\n followUpPrompt={otherOptionSelected ? \"\" : customizations.followUp?.prompt}\n followUpIsOptional={followUpIsOptional}\n showFollowUp={showFollowUp}\n followUpMaxCharacterCount={SELECT_FOLLOW_UP_CHARACTER_LIMIT}\n followUpErrorMessage={\n followUpCharacterLimitExceeded\n ? characterLimitErrorMessage\n : followUpMissingButRequired\n ? requiredErrorMessage\n : undefined\n }\n followUpCurrentCharacterCount={followUpCurrentCharacterCount}\n followUpAriaLabel={followUpAriaLabel}\n errorMessage={!answerIsValid && showValidation ? requiredErrorMessage : undefined}\n onChangeFollowUpValue={(e) => {\n updateAnswer({\n ...currentAnswer,\n [followUpOptionSelected ? \"followUpResponse\" : \"writeIn\"]: e.target.value,\n });\n }}\n dataTest={dataTest}\n />\n );\n\n return showRefreshedComponents ? (\n select\n ) : (\n \n );\n}\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport deprecatedTheme from \"../../../../styling/deprecated_theme\";\nimport FormControl from \"../../inputs/form_control\";\nimport Radio, { RadioGroup, RadioGroupProps, ALIGN } from \"../../inputs/radio\";\nimport { Radio as BaseRadio, RadioGroupOverrides } from \"baseui/radio\";\nimport PromptWithSecondaryText from \"./shared_components/prompt_with_secondary_text\";\nimport { Overrides } from \"baseui/overrides\";\nimport nextId from \"react-id-generator\";\nimport TextAreaQuestionWrapper, { TextareaWrapperProps } from \"./textarea_question_wrapper\";\nimport { useConstructAriaLabel } from \"./use_construct_aria_label\";\nimport MultiSelectQuestionWrapper, { MultiSelectOption } from \"./multiselect_question_wrapper\";\n\nconst LIKERT_RADIO_NAMESPACE = \"likert-radio-group\";\n\nexport interface FollowUpLowQuestionProps {\n type: string;\n options: MultiSelectOption[];\n optional: boolean;\n onChange: (newAnswer: MultiSelectOption) => void;\n setAbleToSubmit: (ableToSubmit: boolean) => void;\n showErrors: boolean;\n}\n\nexport interface LikertQuestionWrapperProps extends RadioGroupProps {\n prompt: string;\n description?: string;\n optional?: boolean;\n min?: number;\n minLabel?: string;\n max?: number;\n maxLabel?: string;\n displayValues?: { [key: number]: string | number };\n errorMessage?: string;\n followUpPrompt?: string; // deprecated\n followUpResponse?: string; // deprecated\n followUpLowScore?: boolean;\n lowScoreThreshold?: number;\n followUpLowPrompt?: string;\n followUpLowResponse?: string;\n followUpHighScore?: boolean;\n highScoreThreshold?: number;\n followUpHighPrompt?: string;\n followUpHighResponse?: string;\n followUpCurrentCharacterCount?: TextareaWrapperProps[\"currentCharacterCount\"];\n followUpMaxCharacterCount?: TextareaWrapperProps[\"maxCharacterCount\"];\n onChangeFollowUp?: TextareaWrapperProps[\"onChange\"];\n followUpLowQuestion?: FollowUpLowQuestionProps;\n followUpLowDescription?: string;\n followUpErrorMessage?: string;\n followUpIsOptional?: boolean;\n dataTest?: string;\n}\n\nconst StyledRadioLabel = styled.div`\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 3;\n line-clamp: 3;\n -webkit-box-orient: vertical;\n`;\nconst StyledTextAreaContainer = styled.div`\n max-width: 700px;\n margin-top: ${({ theme }) => theme.sizing.scale800};\n`;\n\nconst likertRadioGroupOverrides: Overrides = {\n RadioGroupRoot: {\n style: ({ $theme }) => ({\n display: \"flex\",\n alignItems: \"flex-start\",\n gap: $theme.sizing.scale800,\n maxWidth: \"800px\",\n }),\n },\n};\n\nconst likertRadioOverrides: Overrides = {\n Root: {\n style: ({ $theme }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n gap: $theme.sizing.scale300,\n marginTop: \"0px\",\n marginRight: \"0px\",\n }),\n },\n Label: {\n style: {\n maxWidth: \"124px\",\n paddingLeft: \"0px\",\n textAlign: \"center\",\n },\n },\n};\n\nconst likertRadioGroupOverridesMobile: Overrides = {};\nconst likertRadioOverridesMobile: Overrides = {};\n\nconst LikertQuestionWrapper = ({\n prompt,\n description,\n optional = false,\n min = 1,\n minLabel = \"Low\",\n max = 7,\n maxLabel = \"High\",\n displayValues,\n errorMessage,\n\n followUpPrompt, // deprecated\n followUpResponse, // deprecated\n\n followUpLowScore = false,\n lowScoreThreshold = 4,\n followUpLowPrompt,\n followUpLowResponse,\n followUpLowQuestion,\n followUpLowDescription,\n\n followUpHighScore = false,\n highScoreThreshold = 5,\n followUpHighPrompt,\n followUpHighResponse,\n\n followUpIsOptional,\n followUpCurrentCharacterCount = 0,\n followUpMaxCharacterCount = 1200,\n onChangeFollowUp,\n followUpErrorMessage,\n dataTest = \"likert-question-wrapper\",\n ...radioGroupProps\n}: LikertQuestionWrapperProps) => {\n const { constructAriaLabel } = useConstructAriaLabel();\n const secondaryText = description\n ? description\n : displayValues\n ? \"\"\n : `${min}=${minLabel} ${max}=${maxLabel}`;\n\n // DEPRECATION: avoid using followUpPrompt in favor of followUpLowPrompt\n // avoid using followUpResponse in favor of followUpLowResponse\n // this aliasing is here to support pre-existing likert questions\n followUpLowPrompt = followUpLowPrompt || followUpPrompt;\n followUpLowResponse = followUpLowResponse || followUpResponse;\n\n const inputId = nextId(LIKERT_RADIO_NAMESPACE);\n const value = radioGroupProps.value ? parseInt(radioGroupProps.value) : undefined;\n\n // create a new list of display values that includes all sequential numbers between the\n // specified min and max, regardless of if a display value is provided for that number\n const radioValues: LikertQuestionWrapperProps[\"displayValues\"] = {};\n for (let i = min; i <= max; i++) {\n radioValues[i] = displayValues && displayValues[i] ? displayValues[i] : \"\";\n }\n\n const followUpLow = value !== undefined && value <= lowScoreThreshold && followUpLowScore;\n const followUpHigh = value !== undefined && value >= highScoreThreshold && followUpHighScore;\n\n const followUpQuestionPrompt = followUpLow\n ? followUpLowPrompt\n : followUpHigh\n ? followUpHighPrompt\n : \"Can you share more?\";\n\n const followUpQuestionResponse = followUpLow\n ? followUpLowResponse\n : followUpHigh\n ? followUpHighResponse\n : \"\"; // setting this to undefined causes weird behavior with inputs that then think they are uncontrolled when they are not\n\n // check size of window to determine if we should show mobile view - the mobile view\n // layout is quite different from the desktop view and we cannot make it work through\n // the use of overrides so assigning this boolean upfront is the best way to go\n const mobileView = window.matchMedia(deprecatedTheme.deprecatedBreakpoints.small).matches;\n\n return (\n
\n \n
\n \n \n {Object.entries(radioValues).map(([k, v]) => (\n \n {mobileView ? (\n {k && v ? `${k}- ${v}` : `${k}`}\n ) : (\n <>\n
{k}
\n {k && (\n \n {v}\n \n )}\n \n )}\n \n ))}\n \n
\n
\n {(followUpLow || followUpHigh) &&\n (followUpLowQuestion?.type === \"multi_select\" ? (\n \n ) : (\n \n \n \n ))}\n
\n );\n};\n\nexport default LikertQuestionWrapper;\n","import { Scale } from \"../components/likert\";\nimport { Customizations, FollowUpLowQuestionOption } from \"./survey_question_likert\";\n\nexport interface LikertCustomizationsNormalized {\n label: string; // customizations.prompt\n description?: string; // customizations.description\n\n followUpLowDescriptionLabel?: string; // customizations.followUpLowDescription\n followUpLowScore?: boolean; // customizations.followUpLowScore\n followUpLowQuestion?: {\n type: string;\n options: FollowUpLowQuestionOption[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [propName: string]: any;\n };\n followUpLowScoreThreshold?: number; // customizations.lowScoreThreshold\n followUpLowPrompt?: string; // customizations.followUpLowPrompt\n\n followUpHighScore?: boolean; // customizations.followUpHighScore\n followUpHighScoreThreshold?: number; // customizations.highScoreThreshold\n followUpHighPrompt?: string; // customizations.followUpHighPrompt\n\n max: Scale; // customizations.max\n maxLabel?: string; // customizations.maxLabel\n min: Scale; // customizations.min\n minLabel?: string; // customizations.minLabel\n\n displayValues?: string[] | number[]; // customizations.displayValues\n\n optional: boolean; // customizations.optional\n followUpLowScoreIsOptional: boolean;\n followUpHighScoreIsOptional: boolean;\n}\n\nexport const useNormalizeSurveyQuestionLikertCustomizations = (\n customizations: Customizations\n): LikertCustomizationsNormalized => {\n customizations.followUpLowScore = customizations.followUpLowScore || customizations.followUpScore;\n customizations.followUpLowPrompt =\n customizations.followUpLowPrompt || customizations.followUpPrompt;\n\n // Deconstruct the customizations object\n const label = customizations.prompt;\n const description = customizations.description;\n\n const followUpLowDescriptionLabel = customizations.followUpLowDescription;\n const followUpLowScore = customizations.followUpLowScore;\n const followUpLowQuestion = customizations.followUpLowQuestion; // a non-open-response follow up (in practice, a multi-select question)\n const followUpLowScoreThreshold = customizations.lowScoreThreshold ?? 4; // mirrors default set in likert_question_wrapper\n const followUpLowPrompt = customizations.followUpLowPrompt;\n // Based on hard-coded values in legacy component app/javascript/components/surveys/questions/components/likert.tsx\n const followUpLowScoreIsOptional = followUpLowQuestion ? !!followUpLowQuestion.optional : true;\n\n const followUpHighScore = customizations.followUpHighScore;\n const followUpHighScoreThreshold = customizations.highScoreThreshold ?? 5; // mirrors default set in likert_question_wrapper\n const followUpHighPrompt = customizations.followUpHighPrompt;\n // Based on hard-coded values in legacy component app/javascript/components/surveys/questions/components/likert.tsx\n const followUpHighScoreIsOptional = false;\n\n const max = customizations.max ?? 7;\n const maxLabel = customizations.maxLabel;\n const min = customizations.min ?? 1;\n const minLabel = customizations.minLabel;\n\n const displayValues = customizations.displayValues;\n\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n\n return {\n label,\n description,\n\n followUpLowDescriptionLabel,\n followUpLowScore,\n followUpLowQuestion,\n followUpLowScoreThreshold,\n followUpLowPrompt,\n\n followUpHighScore,\n followUpHighScoreThreshold,\n followUpHighPrompt,\n\n max,\n maxLabel,\n min,\n minLabel,\n\n displayValues,\n\n optional,\n followUpLowScoreIsOptional,\n followUpHighScoreIsOptional,\n };\n};\n","import { Answer, Customizations } from \"./survey_question_likert\";\nimport { useNormalizeSurveyQuestionLikertCustomizations } from \"./use_normalize_survey_question_likert_customizations\";\n\nexport const LIKERT_FOLLOW_UP_CHARACTER_LIMIT = 1200;\nexport const LIKERT_MULTI_SELECT_OTHER_OPTION_FOLLOW_UP_CHARACTER_LIMIT = 75;\n\nexport const useSurveyQuestionLikertValidation = (\n customizations: Customizations,\n currentAnswer: Answer | undefined,\n followUpState: { triggeredLowScoreFollowUp: boolean; triggeredHighScoreFollowUp: boolean }\n) => {\n const { triggeredLowScoreFollowUp, triggeredHighScoreFollowUp } = followUpState;\n\n const {\n followUpLowScore,\n followUpLowQuestion,\n followUpHighScore,\n optional,\n followUpLowScoreIsOptional,\n followUpHighScoreIsOptional,\n } = useNormalizeSurveyQuestionLikertCustomizations(customizations);\n\n const { value, followUpLowResponse, followUpHighResponse } = currentAnswer || {};\n const followUpLowMultiSelectResponse =\n typeof followUpLowResponse !== \"string\" && followUpLowResponse?.standard !== undefined\n ? followUpLowResponse\n : undefined;\n\n const hasOpenResponseFollowUp =\n (triggeredLowScoreFollowUp || triggeredHighScoreFollowUp) && !followUpLowQuestion;\n const hasMultiSelectFollowUp =\n (triggeredLowScoreFollowUp || triggeredHighScoreFollowUp) && followUpLowQuestion;\n const followUpLowResponseLength =\n hasOpenResponseFollowUp && followUpLowResponse\n ? (followUpLowResponse as string).length\n : undefined;\n const followUpHighResponseLength =\n hasOpenResponseFollowUp && followUpHighResponse\n ? (followUpHighResponse as string).length\n : undefined;\n const followUpLowResponseWriteInLength =\n hasMultiSelectFollowUp && followUpLowMultiSelectResponse?.writeIn\n ? (followUpLowMultiSelectResponse?.writeIn as string).length\n : undefined;\n const followUpCharacterCount =\n followUpLowResponseLength ??\n followUpHighResponseLength ??\n followUpLowResponseWriteInLength ??\n 0;\n const maximumCharacterLimitExceededBy =\n followUpCharacterCount -\n (hasOpenResponseFollowUp\n ? LIKERT_FOLLOW_UP_CHARACTER_LIMIT\n : LIKERT_MULTI_SELECT_OTHER_OPTION_FOLLOW_UP_CHARACTER_LIMIT);\n\n const deprecatedAnswerIsValid = optional ? true : typeof value !== \"undefined\";\n\n const answerIsValid = optional ? true : typeof value !== \"undefined\";\n\n const noFollowUpIsAsked =\n (!followUpLowScore && !followUpHighScore) ||\n (!triggeredLowScoreFollowUp && !triggeredHighScoreFollowUp);\n const followUpLowScoreIsValid =\n (triggeredLowScoreFollowUp &&\n followUpLowScore &&\n followUpLowScoreIsOptional &&\n maximumCharacterLimitExceededBy <= 0) ||\n (triggeredLowScoreFollowUp &&\n followUpLowScore &&\n !followUpLowScoreIsOptional &&\n maximumCharacterLimitExceededBy <= 0 &&\n (followUpLowResponseLength ?? 0) > 0) ||\n !followUpLowScore ||\n triggeredHighScoreFollowUp;\n const followUpHighScoreIsValid =\n (triggeredHighScoreFollowUp &&\n followUpHighScore &&\n followUpHighScoreIsOptional &&\n maximumCharacterLimitExceededBy <= 0) ||\n (triggeredHighScoreFollowUp &&\n followUpHighScore &&\n !followUpHighScoreIsOptional &&\n maximumCharacterLimitExceededBy <= 0 &&\n (followUpHighResponseLength ?? 0) > 0) ||\n !followUpHighScore ||\n triggeredLowScoreFollowUp;\n const followUpIsValid =\n noFollowUpIsAsked || (followUpLowScoreIsValid && followUpHighScoreIsValid);\n\n return {\n deprecatedAnswerIsValid,\n answerIsValid,\n followUpIsValid,\n ableToSubmit: answerIsValid && followUpIsValid,\n maximumCharacterLimitExceededBy,\n followUpCurrentCharacterCount: followUpLowResponseLength ?? followUpHighResponseLength ?? 0,\n maximumCharacterLimitToRespect: hasOpenResponseFollowUp\n ? LIKERT_FOLLOW_UP_CHARACTER_LIMIT\n : hasMultiSelectFollowUp\n ? LIKERT_MULTI_SELECT_OTHER_OPTION_FOLLOW_UP_CHARACTER_LIMIT\n : 0,\n };\n};\n","import React, { useEffect } from \"react\";\nimport Likert, {\n Scale as LikertScale,\n LikertFollowUpMultiSelectAnswer,\n} from \"../components/likert\";\nimport { QuestionProps } from \"../../survey\";\nimport LikertQuestionWrapper, {\n FollowUpLowQuestionProps,\n} from \"../../../components/base_ui/higher_order_components/questions/likert_question_wrapper\";\nimport {\n MultiSelectFollowUpQuestionType,\n MultiSelectOption,\n} from \"../../../components/base_ui/higher_order_components/questions/multiselect_question_wrapper\";\nimport { Option } from \"../question_helpers\";\nimport {\n LikertCustomizationsNormalized,\n useNormalizeSurveyQuestionLikertCustomizations,\n} from \"./use_normalize_survey_question_likert_customizations\";\nimport {\n LIKERT_FOLLOW_UP_CHARACTER_LIMIT,\n LIKERT_MULTI_SELECT_OTHER_OPTION_FOLLOW_UP_CHARACTER_LIMIT,\n useSurveyQuestionLikertValidation,\n} from \"./use_survey_question_likert_validation\";\n\nexport interface Answer {\n value: LikertScale;\n followUpResponse?: string | LikertFollowUpMultiSelectAnswer;\n followUpLowResponse?: string | LikertFollowUpMultiSelectAnswer;\n followUpHighResponse?: string | LikertFollowUpMultiSelectAnswer;\n}\n\nexport interface FollowUpLowQuestionOption {\n oid: string;\n text: string;\n}\n\nexport interface Customizations {\n prompt: string;\n followUpPrompt?: string;\n followUpScore?: boolean;\n followUpLowScore?: boolean;\n followUpLowPrompt?: string;\n followUpLowDescription?: string;\n followUpLowQuestion?: {\n type: string;\n options: FollowUpLowQuestionOption[];\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [propName: string]: any;\n };\n followUpHighScore: boolean;\n followUpHighPrompt?: string;\n max?: LikertScale;\n maxLabel?: string;\n min?: LikertScale;\n minLabel?: string;\n displayValues?: string[] | number[];\n optional?: boolean;\n lowScoreThreshold?: number;\n highScoreThreshold?: number;\n description?: string;\n hideForKeyValuePairsOr?: { [key: string]: boolean };\n}\n\nexport default function SurveyQuestionLikert({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n dataTest = \"survey-question-likert\",\n}: QuestionProps) {\n const { value, followUpLowResponse, followUpHighResponse } = currentAnswer || {};\n const followUpLowMultiSelectResponse =\n typeof followUpLowResponse !== \"string\" && followUpLowResponse?.standard !== undefined\n ? followUpLowResponse\n : undefined;\n\n const {\n label,\n description,\n followUpLowDescriptionLabel,\n followUpLowScore,\n followUpLowQuestion,\n followUpLowScoreThreshold,\n followUpLowPrompt,\n followUpHighScore,\n followUpHighScoreThreshold,\n followUpHighPrompt,\n max,\n maxLabel,\n minLabel,\n min,\n displayValues,\n optional,\n followUpLowScoreIsOptional,\n followUpHighScoreIsOptional,\n }: LikertCustomizationsNormalized =\n useNormalizeSurveyQuestionLikertCustomizations(customizations);\n\n const valueTriggersLowScoreFollowUp = (value?: LikertScale) => {\n return (\n followUpLowScore === true && value !== undefined && +value <= (followUpLowScoreThreshold ?? 0)\n );\n };\n const valueTriggersHighScoreFollowUp = (value?: LikertScale) => {\n return (\n followUpHighScore === true &&\n value !== undefined &&\n +value >= (followUpHighScoreThreshold ?? 0)\n );\n };\n const triggeredLowScoreFollowUp = valueTriggersLowScoreFollowUp(value);\n const triggeredHighScoreFollowUp = valueTriggersHighScoreFollowUp(value);\n\n const {\n deprecatedAnswerIsValid,\n answerIsValid,\n followUpIsValid,\n ableToSubmit,\n maximumCharacterLimitExceededBy,\n followUpCurrentCharacterCount,\n maximumCharacterLimitToRespect,\n } = useSurveyQuestionLikertValidation(customizations, currentAnswer, {\n triggeredLowScoreFollowUp,\n triggeredHighScoreFollowUp,\n });\n\n const followUpIsOptional = triggeredLowScoreFollowUp\n ? followUpLowScoreIsOptional\n : triggeredHighScoreFollowUp\n ? followUpHighScoreIsOptional\n : true;\n\n const requiredErrorMessage = \"Please complete the required field.\";\n const characterLimitErrorMessage =\n maximumCharacterLimitExceededBy === 1\n ? `Maximum character limit exceeded by ${maximumCharacterLimitExceededBy} character.`\n : `Maximum character limit exceeded by ${maximumCharacterLimitExceededBy} characters.`;\n\n useEffect(() => {\n if (showRefreshedComponents) {\n setAbleToSubmit(ableToSubmit);\n } else {\n setAbleToSubmit(deprecatedAnswerIsValid);\n }\n }, [deprecatedAnswerIsValid, ableToSubmit, setAbleToSubmit, showRefreshedComponents]);\n\n // Transform data for the new component\n const displayValuesToFormat = displayValues ? displayValues : [];\n const displayValuesFormattedForLikert = !displayValues\n ? undefined\n : Object.fromEntries(displayValuesToFormat.map((v, index) => [index + min, v]));\n const followUpLowQuestionOptions = followUpLowQuestion\n ? [\n ...(followUpLowQuestion.options as FollowUpLowQuestionOption[]).map(\n (option: FollowUpLowQuestionOption) => ({\n id: option.oid,\n label: option.text,\n value: false,\n }),\n ),\n ...(followUpLowQuestion.withOtherOption\n ? [\n {\n id: followUpLowQuestion.withOtherOption.oid,\n label: followUpLowQuestion.withOtherOption.text,\n value: false,\n followup: {\n optional: true,\n type: MultiSelectFollowUpQuestionType.TEXT_INPUT,\n value: \"\",\n maxCharacters: LIKERT_MULTI_SELECT_OTHER_OPTION_FOLLOW_UP_CHARACTER_LIMIT,\n },\n },\n ]\n : []),\n ]\n : [];\n\n const getValueForMultiSelectOption = (option: (typeof followUpLowQuestionOptions)[0]) =>\n followUpLowMultiSelectResponse?.standard?.find(\n (selectedOption) => (selectedOption as Option)?.oid === option.id,\n )\n ? true\n : false;\n\n // If we're dealing with a multi-select flup, the shape of the followUpLowResponse is not a string, instead:\n // followUpLowResponse: { standard: [{ oid: something, text: \"Something\", optional: boolean }], writeIn: undefined | \"something\" }\n const followUpLowQuestionFormattedForLikert = followUpLowQuestion\n ? {\n onChange: (newResponse: MultiSelectOption) => {\n const newResponseHasWriteIn = newResponse.id === followUpLowQuestion.withOtherOption?.oid;\n const writeIn = newResponseHasWriteIn ? newResponse?.followup?.value : undefined;\n return currentAnswer && value !== undefined\n ? updateAnswer({\n ...currentAnswer,\n followUpLowResponse:\n triggeredLowScoreFollowUp && followUpLowQuestionOptions.length > 0\n ? {\n standard: followUpLowQuestionOptions\n .map((option) =>\n option.id === newResponse.id\n ? { ...option, ...newResponse, oid: option.id, text: option.label }\n : {\n ...option,\n oid: option.id,\n text: option.label,\n value: getValueForMultiSelectOption(option),\n },\n )\n .filter((option) => option.value),\n writeIn,\n }\n : undefined,\n })\n : undefined;\n },\n setAbleToSubmit: () => {\n /* No-op. We don't currently support required follow ups for this question. */\n },\n type: followUpLowQuestion.type,\n showErrors: (!followUpIsValid && showValidation) || maximumCharacterLimitExceededBy > 0,\n optional: followUpLowQuestion.optional,\n options: followUpLowQuestionOptions.map((option) => ({\n ...option,\n value: getValueForMultiSelectOption(option),\n followup:\n option.id === followUpLowQuestion.withOtherOption?.oid\n ? {\n ...(option as MultiSelectOption).followup,\n value: followUpLowMultiSelectResponse?.writeIn,\n }\n : undefined,\n })),\n }\n : undefined;\n\n const deprecatedLikert = (\n
\n {followUpLowScore || followUpHighScore ? (\n {\n let answer = currentAnswer;\n if (\n answer?.followUpHighResponse &&\n typeof customizations.lowScoreThreshold !== \"undefined\" &&\n newValue >= customizations?.lowScoreThreshold\n ) {\n const { followUpHighResponse, ...withoutFollowUpHighResponse } = answer;\n answer = withoutFollowUpHighResponse;\n }\n\n if (\n answer?.followUpLowResponse &&\n typeof customizations.highScoreThreshold !== \"undefined\" &&\n newValue >= customizations?.highScoreThreshold\n ) {\n const { followUpLowResponse, ...withoutFollowUpLowResponse } = answer;\n answer = withoutFollowUpLowResponse;\n }\n updateAnswer({ ...answer, value: newValue });\n }}\n followUpLowScore={followUpLowScore}\n followUpLowPrompt={customizations.followUpLowPrompt}\n followUpLowDescription={followUpLowDescriptionLabel}\n followUpLowResponse={\n currentAnswer && currentAnswer.followUpLowResponse\n ? currentAnswer.followUpLowResponse\n : \"\"\n }\n followUpLowQuestion={customizations.followUpLowQuestion}\n lowScoreThreshold={customizations.lowScoreThreshold}\n onChangeLowFollowUp={(newResponse) => {\n if (!currentAnswer)\n throw new Error(\"Attempted to update NPS low score follow up without a score\");\n updateAnswer({ ...currentAnswer, followUpLowResponse: newResponse });\n }}\n followUpHighScore={followUpHighScore}\n followUpHighPrompt={customizations.followUpHighPrompt}\n followUpHighResponse={\n currentAnswer && currentAnswer.followUpHighResponse\n ? currentAnswer.followUpHighResponse\n : \"\"\n }\n highScoreThreshold={customizations.highScoreThreshold}\n onChangeHighFollowUp={(newResponse) => {\n if (!currentAnswer)\n throw new Error(\"Attempted to update NPS low score follow up without a score\");\n\n updateAnswer({\n ...currentAnswer,\n followUpHighResponse: newResponse,\n });\n }}\n />\n ) : (\n \n updateAnswer(\n currentAnswer ? { ...currentAnswer, value: newValue } : { value: newValue },\n )\n }\n followUpLowScore={false}\n followUpHighScore={false}\n />\n )}\n
\n );\n\n const likert = (\n {\n updateAnswer({\n followUpLowResponse:\n triggeredLowScoreFollowUp &&\n valueTriggersLowScoreFollowUp(+e.target.value as LikertScale)\n ? followUpLowResponse\n : undefined,\n followUpHighResponse:\n triggeredHighScoreFollowUp &&\n valueTriggersHighScoreFollowUp(+e.target.value as LikertScale)\n ? followUpHighResponse\n : undefined,\n value: +e.target.value as LikertScale,\n });\n }}\n followUpMaxCharacterCount={LIKERT_FOLLOW_UP_CHARACTER_LIMIT}\n followUpCurrentCharacterCount={followUpCurrentCharacterCount}\n followUpLowScore={followUpLowScore}\n followUpLowPrompt={followUpLowPrompt}\n followUpLowQuestion={followUpLowQuestionFormattedForLikert as FollowUpLowQuestionProps}\n followUpLowDescription={followUpLowDescriptionLabel}\n followUpLowResponse={followUpLowResponse as string}\n lowScoreThreshold={followUpLowScoreThreshold}\n followUpIsOptional={followUpIsOptional}\n followUpHighScore={followUpHighScore}\n followUpHighPrompt={followUpHighPrompt}\n followUpHighResponse={followUpHighResponse as string}\n highScoreThreshold={followUpHighScoreThreshold}\n // This is the handler for open response follow ups. Multi-select follow ups are handled\n // separately, see above.\n onChangeFollowUp={(e) => {\n if (!currentAnswer || !value)\n throw new Error(\"Attempted to update low/high score follow up without a score\");\n\n updateAnswer({\n ...currentAnswer,\n followUpHighResponse: triggeredHighScoreFollowUp ? e.target.value : undefined,\n followUpLowResponse: triggeredLowScoreFollowUp ? e.target.value : undefined,\n });\n }}\n errorMessage={!answerIsValid && showValidation ? requiredErrorMessage : undefined}\n followUpErrorMessage={\n !followUpIsValid && maximumCharacterLimitExceededBy > 0\n ? characterLimitErrorMessage\n : !followUpIsValid &&\n showValidation &&\n maximumCharacterLimitExceededBy === maximumCharacterLimitToRespect * -1\n ? requiredErrorMessage\n : undefined\n }\n dataTest={dataTest}\n />\n );\n\n return showRefreshedComponents ? likert : deprecatedLikert;\n}\n","import { gql } from \"@urql/core\";\nimport { ParticipantSurveyResponsesDocument } from \"../../../generated/graphql\";\nimport { useContext } from \"react\";\nimport { SurveyContext } from \"../../survey\";\nimport { AppContext } from \"../../../app\";\nimport { useQuery } from \"urql\";\nimport { SurveyAudienceContext } from \"../../survey_page\";\n\ngql`\n query ParticipantSurveyResponses($userId: ID!) {\n user(id: $userId) {\n id\n surveyResponses {\n id\n context {\n participantId\n mentorshipChatGroupId\n mentorshipId\n }\n }\n }\n }\n`;\n\nexport default function useRotatingQuestionIndex({\n numberOfQuestions,\n // This is an ugly work around so useSurveyQuestion can use this hook to determine the correct question index for\n // rotating questions. The error notification component is rendered outside of the SurveyContext provider (because not all instances\n // of surveys need buttons, errors, or are even submittable, such as the case of previews.). So when useSurveyQuestion calls this hook,\n // useRotatingQuestion doesn't know what the context of the survey is (since it is called outside of the context of the survey context provider).\n // We manually pass it in here so we can determine the correct question index and render the right prompt for the error message.\n // TODO: ripe for refactor of some kind\n surveyAudienceContext,\n pause,\n}: {\n numberOfQuestions: number;\n surveyAudienceContext?: SurveyAudienceContext;\n pause?: boolean;\n}): { fetching: boolean; questionIndex?: number } {\n const { userId } = useContext(AppContext);\n const currentSurveyContext = useContext(SurveyContext);\n const surveyId = currentSurveyContext.surveyId;\n const participantId = currentSurveyContext.participantId;\n const [{ fetching, error, data }] = useQuery({\n query: ParticipantSurveyResponsesDocument,\n variables: { userId },\n pause,\n });\n if (fetching || data === null) return { fetching: true, questionIndex: undefined };\n if (pause) {\n return { fetching: false, questionIndex: undefined };\n }\n if (error || !data) {\n throw new Error(\n `Error determining rotating survey question for survey:${surveyId}, participant${participantId}`\n );\n }\n\n const contextToUse = surveyAudienceContext ?? currentSurveyContext;\n\n const responses = data.user.surveyResponses.filter((response) => {\n // we need to make sure the context of this response is applicable. Currently this only includes\n // mentorships and mentorship chat groups. if we end up adding more context types w/ rotating\n // questions, this will need to be updated\n if (contextToUse.mentorshipChatGroupId) {\n if (\n !response.context.mentorshipChatGroupId ||\n // this isn't ideal but graphql ids are strings so we need to make sure whatever we got from rails is a string\n // (since the context object is untyped json)\n `${response.context.mentorshipChatGroupId}` !== contextToUse.mentorshipChatGroupId\n ) {\n return false;\n }\n }\n if (contextToUse.mentorshipId) {\n if (\n !response.context.mentorshipId ||\n // this isn't ideal but graphql ids are strings so we need to make sure whatever we got from rails is a string\n // (since the context object is untyped json)\n `${response.context.mentorshipId}` !== contextToUse.mentorshipId\n ) {\n return false;\n }\n }\n if (contextToUse.participantId) {\n if (\n !response.context.participantId ||\n // this isn't ideal but graphql ids are strings so we need to make sure whatever we got from rails is a string\n // (since the context object is untyped json)\n `${response.context.participantId}` !== contextToUse.participantId\n ) {\n return false;\n }\n }\n return true;\n });\n const numberOfResponses = responses.length;\n const questionIndex = numberOfResponses % numberOfQuestions;\n return { fetching: false, questionIndex };\n}\n","import React, { useEffect } from \"react\";\nimport { QuestionProps } from \"../survey\";\nimport Likert, { LikertFollowUpMultiSelectAnswer, Scale as LikertScale } from \"./components/likert\";\nimport useRotatingQuestionIndex from \"./hooks/useRotatingQuestion\";\nimport { captureError } from \"../../../utils/capture_error\";\n\nexport interface Answer {\n prompt: string;\n value: LikertScale;\n qid: string;\n followUpResponse?: string | LikertFollowUpMultiSelectAnswer;\n followUpQid?: string;\n}\n\nexport interface Customizations {\n rotatingQuestions: {\n prompt: string;\n qid: string;\n followUpLowScore: boolean;\n followUpPrompt?: string;\n followUpQid?: string;\n description?: string;\n }[];\n}\n\nexport default function RotatingLikert({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n}: QuestionProps) {\n const { fetching, questionIndex } = useRotatingQuestionIndex({\n numberOfQuestions: customizations.rotatingQuestions.length,\n });\n const answerIsValid = typeof currentAnswer?.value !== \"undefined\";\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n if (fetching || questionIndex === null) return
Loading...
;\n if (typeof questionIndex === \"undefined\") {\n captureError(new Error(`Question index is undefined for rotating likert`));\n throw new Error(\"The question index is undefined\");\n }\n const likertQuestion = customizations.rotatingQuestions[questionIndex];\n\n return (\n
\n {likertQuestion.followUpLowScore ? (\n \n updateAnswer(\n currentAnswer\n ? { ...currentAnswer, value: newValue }\n : {\n prompt: likertQuestion.prompt,\n qid: likertQuestion.qid,\n followUpQid: likertQuestion.followUpQid,\n value: newValue,\n },\n )\n }\n followUpLowScore={true}\n followUpPrompt={likertQuestion.followUpPrompt}\n followUpResponse={\n currentAnswer && currentAnswer.followUpResponse ? currentAnswer.followUpResponse : \"\"\n }\n onChangeLowFollowUp={(newResponse) => {\n if (!currentAnswer)\n throw new Error(\"Attempted to update NPS low score follow up without a score\");\n updateAnswer({ ...currentAnswer, followUpResponse: newResponse });\n }}\n />\n ) : (\n \n updateAnswer(\n currentAnswer\n ? { ...currentAnswer, value: newValue }\n : { prompt: likertQuestion.prompt, qid: likertQuestion.qid, value: newValue },\n )\n }\n followUpLowScore={false}\n />\n )}\n
\n );\n}\n","import React, { useEffect } from \"react\";\nimport { QuestionProps } from \"../survey\";\nimport TextArea from \"../../components/data_entry/text_area\";\nimport QuestionLabel from \"./components/question_label\";\nimport useRotatingQuestionIndex from \"./hooks/useRotatingQuestion\";\n\nexport interface Answer {\n prompt: string;\n answer: string;\n qid: string;\n}\n\nexport interface Customizations {\n rotatingQuestions: { prompt: string; qid: string }[];\n placeholder?: string;\n optional?: boolean;\n description?: string;\n}\n\nexport default function RotatingOpenResponse({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n}: QuestionProps) {\n const { fetching, questionIndex } = useRotatingQuestionIndex({\n numberOfQuestions: customizations.rotatingQuestions.length,\n });\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const placeholder = customizations.placeholder;\n const description = customizations.description;\n const answerIsValid = optional || (currentAnswer?.answer?.length || 0) > 0;\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n if (fetching || questionIndex === null) return
Loading...
;\n if (typeof questionIndex === \"undefined\") throw new Error(\"Failed to load rotating question\");\n const question = customizations.rotatingQuestions[questionIndex];\n\n return (\n
\n \n \n updateAnswer({\n prompt: question.prompt,\n qid: question.qid,\n answer: updatedResponse,\n })\n }\n value={currentAnswer ? currentAnswer.answer : \"\"}\n />\n
\n );\n}\n","import React, { useContext, Fragment, useEffect } from \"react\";\nimport { SurveyContext, QuestionProps } from \"../survey\";\nimport {\n PostSessionSurveyCareerQuestionDocument,\n PostSessionSurveyCareerQuestionQuery,\n} from \"../../generated/graphql\";\nimport TextArea from \"../../components/data_entry/text_area\";\nimport { gql } from \"@urql/core\";\nimport QuestionLabel from \"./components/question_label\";\nimport useRotatingQuestionIndex from \"./hooks/useRotatingQuestion\";\nimport { useQuery } from \"urql\";\nimport { captureError } from \"../../../utils/capture_error\";\n\nfunction availableMentorQuestions({\n studentFirstName,\n studentGoal,\n getGeneric = false,\n}: {\n studentFirstName: string;\n studentGoal?: string;\n getGeneric?: boolean;\n}) {\n const questions = [\n {\n prompt:\n \"Is there anything else you'd like to share about your mentee? For example, important questions they asked, things they are really excited/confused/nervous about, or advice you have for the school to support them better.\",\n qid: \"rotating_career_mentor_anything_else\",\n },\n {\n prompt: `Please share one way in which you have helped ${\n getGeneric ? \"{studentName}\" : studentFirstName\n } be more successful.`,\n qid: \"rotating_career_mentor_success\",\n },\n {\n prompt: `How has participating in this mentorship program impacted your relationship with your institution?`,\n qid: \"rotating_career_mentor_impact\",\n },\n ];\n // we only want to include the student goal question if the student has one in their profile\n if (studentGoal) {\n questions.splice(2, 0, {\n prompt: `At the beginning of this program, we asked ${\n getGeneric ? \"{studentName}\" : studentFirstName\n } to choose a top goal for the year: secure an internship, learn more about career options, do well in courses, or a write-in answer. They chose: \"${\n getGeneric ? \"{goal}\" : studentGoal\n }\". How have you helped ${\n getGeneric ? \"{studentName}\" : studentFirstName\n } make progress towards this goal, and/or what difficulties have you encountered along the way?`,\n qid: \"rotating_career_mentor_goal\",\n });\n }\n return questions;\n}\n\nfunction availableStudentQuestions({\n mentorFirstName,\n studentGoal,\n getGeneric = false,\n}: {\n mentorFirstName: string;\n studentGoal?: string;\n getGeneric?: boolean;\n}) {\n const questions = [\n {\n prompt:\n \"Is there anything you'd like to share with your school about your mentorship? For example, something you're excited or worried about, or a goal you've set.\",\n qid: \"rotating_career_mentee_anything_else\",\n },\n {\n prompt: `What is one question ${\n getGeneric ? \"{mentorName}\" : mentorFirstName\n } has helped you answer? How did they help you answer it?`,\n qid: \"rotating_career_mentee_success\",\n },\n {\n prompt: `How has participating in this mentorship program impacted your relationship with your institution?`,\n qid: \"rotating_career_mentee_impact\",\n },\n ];\n // we only want to include the student goal question if the student has one in their profile\n if (studentGoal) {\n questions.splice(2, 0, {\n prompt: `At the beginning of this program, we asked you to choose a top goal for the year: secure an internship, learn more about career options, do well in courses, or a write-in answer. You chose: \"${\n getGeneric ? \"{goal}\" : studentGoal\n }\". How has ${\n getGeneric ? \"{mentorName}\" : mentorFirstName\n } helped you make progress towards this goal, and/or what difficulties have you encountered along the way?`,\n qid: \"rotating_career_mentee_goal\",\n });\n }\n return questions;\n}\n\ngql`\n query PostSessionSurveyCareerQuestion($participantId: ID!, $mentorshipId: ID!) {\n participant(id: $participantId) {\n id\n __typename\n program {\n id\n programSequence {\n id\n school {\n id\n name\n }\n }\n }\n }\n mentorship(id: $mentorshipId) {\n id\n student {\n id\n user {\n id\n firstName\n lastName\n }\n programGoal\n }\n mentor {\n id\n user {\n id\n firstName\n lastName\n }\n }\n }\n }\n`;\n\nexport interface Answer {\n prompt: {\n generic: string;\n actual: string;\n qid: string;\n };\n answer: string;\n}\n\nexport interface Customizations {\n optional?: boolean;\n}\n\ninterface Props extends QuestionProps {\n participant: PostSessionSurveyCareerQuestionQuery[\"participant\"];\n mentorship: PostSessionSurveyCareerQuestionQuery[\"mentorship\"];\n}\n\nexport const getRotatingCareerOpenResponseQuestions = (\n participant: PostSessionSurveyCareerQuestionQuery[\"participant\"],\n mentorship: PostSessionSurveyCareerQuestionQuery[\"mentorship\"],\n) =>\n participant.__typename === \"Mentor\"\n ? availableMentorQuestions({\n studentFirstName: mentorship.student.user.firstName,\n studentGoal: mentorship.student.programGoal ? mentorship.student.programGoal : undefined,\n })\n : availableStudentQuestions({\n mentorFirstName: mentorship.mentor.user.firstName,\n studentGoal: mentorship.student.programGoal ? mentorship.student.programGoal : undefined,\n });\n\nfunction RotatingCareerOpenResponseInput({\n currentAnswer,\n updateAnswer,\n participant,\n mentorship,\n setAbleToSubmit,\n customizations,\n}: Props) {\n const rotatingQuestions = getRotatingCareerOpenResponseQuestions(participant, mentorship);\n const genericRotatingQuestions =\n participant.__typename === \"Mentor\"\n ? availableMentorQuestions({\n studentFirstName: mentorship.student.user.firstName,\n studentGoal: mentorship.student.programGoal ? mentorship.student.programGoal : undefined,\n getGeneric: true,\n })\n : availableStudentQuestions({\n mentorFirstName: mentorship.mentor.user.firstName,\n studentGoal: mentorship.student.programGoal ? mentorship.student.programGoal : undefined,\n getGeneric: true,\n });\n const { fetching, questionIndex } = useRotatingQuestionIndex({\n numberOfQuestions: rotatingQuestions.length,\n });\n const optional =\n !customizations || typeof customizations.optional === \"undefined\"\n ? false\n : customizations.optional;\n const answerIsValid = optional || (currentAnswer?.answer?.length || 0) > 0;\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n if (fetching || questionIndex === null) return
Loading...
;\n if (typeof questionIndex === \"undefined\") {\n captureError(new Error(`Question index is undefined`));\n throw new Error(\"Question index is undefined\");\n }\n const question = rotatingQuestions[questionIndex];\n const genericQuestion = genericRotatingQuestions[questionIndex];\n\n return (\n \n \n \n updateAnswer({\n prompt: { generic: genericQuestion.prompt, actual: question.prompt, qid: question.qid },\n answer: updatedResponse,\n })\n }\n value={currentAnswer ? currentAnswer.answer : \"\"}\n />\n \n );\n}\n\nexport default function RotatingCareerOpenResponse(\n props: QuestionProps,\n) {\n const { participantId, mentorshipId } = useContext(SurveyContext);\n if (!mentorshipId) {\n captureError(new Error(`Error: missing mentorshipId for RotatingCareerOpenResponse`));\n throw new Error(\"Missing mentorship id\");\n }\n const [{ fetching, error, data }] = useQuery({\n query: PostSessionSurveyCareerQuestionDocument,\n variables: { participantId, mentorshipId },\n });\n if (fetching || data === null) return
Loading...
;\n if (error || !data) {\n const graphQLErrorsForAPM = error?.graphQLErrors?.join(\"; \") ?? \"\";\n captureError(\n new Error(`Error fetching usePostSessionSurveyCareerQuestionQuery: ${graphQLErrorsForAPM}`),\n );\n return null;\n }\n\n const { participant, mentorship } = data;\n return (\n
\n \n
\n );\n}\n","import React, { useEffect } from \"react\";\nimport { RadioGroup, RadioButton } from \"../../components/data_entry/radio\";\nimport QuestionLabel from \"./components/question_label\";\nimport { QuestionProps } from \"../survey\";\nimport SelectQuestionWrapper from \"../../components/base_ui/higher_order_components/questions/select_question_wrapper\";\n\nexport interface Answer {\n selectedOption: string;\n selectedFollowUpOption?: string;\n}\n\nexport interface Customizations {\n prompt: string;\n options: string[];\n description?: string;\n followUp?: {\n whenOptionSelected: string;\n prompt: string;\n description?: string;\n options: string[];\n qid?: string;\n };\n}\n\nexport default function SurveyQuestionSelectWithSelectFollowUp({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n}: QuestionProps) {\n const label = customizations.prompt;\n const options = customizations.options;\n const followUp = customizations.followUp;\n const description = customizations.description;\n\n const selectedOption = currentAnswer ? currentAnswer.selectedOption : undefined;\n const selectedFollowUpOption = currentAnswer ? currentAnswer.selectedFollowUpOption : undefined;\n\n const optionIsValid = (currentAnswer?.selectedOption?.length || 0) > 0;\n const followUpOptionIsTriggered = followUp && selectedOption === followUp.whenOptionSelected;\n const followUpOptionIsValid = (currentAnswer?.selectedFollowUpOption?.length || 0) > 0;\n const answerIsValid = optionIsValid && (followUpOptionIsTriggered ? followUpOptionIsValid : true);\n\n useEffect(() => {\n setAbleToSubmit(!!answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n const requiredErrorMessage = \"Please complete the required field.\";\n\n const deprecatedSelectWithSelectFollowUp = (\n
\n \n updateAnswer({ selectedOption: newValue })}\n >\n {options.map((option) => (\n \n ))}\n \n {followUp && selectedOption === followUp.whenOptionSelected && (\n
\n \n \n updateAnswer({\n selectedOption: selectedOption,\n selectedFollowUpOption: followUpValue,\n })\n }\n >\n {followUp.options.map((option) => (\n \n ))}\n \n
\n )}\n
\n );\n\n const selectWithSelectFollowUp = (\n <>\n ({ id: option, label: option }))}\n value={{ id: selectedOption, label: selectedOption }}\n onChange={(newAnswer) => updateAnswer({ selectedOption: newAnswer.id as string })}\n // SelectQuestionWrapper only handles follow-ups of type Input\n // And SelectWithSelectFollowUp is only used in a single place\n // So this implementation is doing the bare minimum to refresh the UI\n // Without making the follow-up component logic more flexible\n showFollowUp={false}\n errorMessage={!optionIsValid && showValidation ? requiredErrorMessage : undefined}\n dataTest=\"select-with-select-follow-up\"\n />\n {followUpOptionIsTriggered && (\n ({ id: option, label: option }))}\n value={{ id: selectedFollowUpOption, label: selectedFollowUpOption }}\n onChange={(followUpValue) =>\n updateAnswer({\n selectedOption: selectedOption,\n selectedFollowUpOption: followUpValue.id as string,\n })\n }\n errorMessage={!followUpOptionIsValid && showValidation ? requiredErrorMessage : undefined}\n data-test=\"follow-up-select-option\"\n />\n )}\n \n );\n\n return showRefreshedComponents ? selectWithSelectFollowUp : deprecatedSelectWithSelectFollowUp;\n}\n","import React, { useEffect } from \"react\";\nimport { QuestionProps } from \"../../survey\";\nimport { RadioButton, RadioGroup } from \"../../../components/data_entry/radio\";\nimport { Answer } from \"./generic\";\nimport styled from \"styled-components\";\nimport QuestionFieldsetLegend, { StyledFieldset } from \"../components/question_fieldset_legend\";\nimport SelectQuestionWrapper from \"../../../components/base_ui/higher_order_components/questions/select_question_wrapper\";\n\nconst StyledDeprecatedSingleSelect = styled.div`\n margin-top: 2em;\n`;\n\nconst StyledSingleSelect = styled.div`\n margin-top: ${({ theme }) => theme.sizing.scale600};\n`;\n\nexport interface SingleSelectCustomization {\n qid: string;\n text: string;\n description?: string;\n optional?: boolean;\n qInfo: {\n type: string;\n options: {\n text: string;\n oid: string;\n }[];\n };\n}\n\nexport default function SingleSelect({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n}: QuestionProps) {\n const label = customizations.text;\n const description = customizations.description;\n\n const options = customizations.qInfo.options;\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const qid = customizations.qid;\n\n const answerIsValid =\n optional ||\n (currentAnswer && currentAnswer[qid] ? (currentAnswer[qid].length || 0) > 0 : false);\n\n // Adding setAbleToSubmit as dependency might break survey behavior (e.g. questions that have follow-ups such as the desired_mentoring_frequency question)\n // If you're making edits to this please check that this works with follow-up questions\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n // eslint-disable-next-line\n }, [answerIsValid, currentAnswer]);\n\n const selectedOption = currentAnswer ? currentAnswer[qid] : undefined;\n\n const transformedOptions = options.map((option) => ({\n id: option.oid,\n label: option.text,\n }));\n\n const deprecatedSingleSelect = (\n \n \n \n {\n updateAnswer({ [qid]: newValue });\n }}\n >\n {options.map((option) => (\n \n ))}\n \n \n \n );\n\n const singleSelect = (\n \n option.id === selectedOption)}\n onChange={(newValue) => {\n updateAnswer({ [qid]: newValue.id });\n }}\n options={transformedOptions}\n errorMessage={\n showValidation && !answerIsValid ? \"Please complete the required field.\" : undefined\n }\n setAbleToSubmit={setAbleToSubmit}\n />\n \n );\n\n return showRefreshedComponents ? singleSelect : deprecatedSingleSelect;\n}\n","import React, { useEffect } from \"react\";\nimport { QuestionProps } from \"../../survey\";\nimport { Answer } from \"./generic\";\nimport Checkbox from \"../../../components/data_entry/checkbox\";\nimport styled from \"styled-components\";\nimport QuestionFieldsetLegend, { StyledFieldset } from \"../components/question_fieldset_legend\";\nimport MultiSelectQuestionWrapper, {\n MultiSelectOption,\n} from \"../../../components/base_ui/higher_order_components/questions/multiselect_question_wrapper\";\nimport { getOptionText, getOptionOid } from \"../question_helpers\";\n\nconst StyledMultiSelect = styled.div`\n margin-top: 2em;\n`;\n\nconst StyledMultiSelectContainer = styled.div`\n margin-top: ${({ theme }) => theme.sizing.scale600};\n`;\n\nexport interface MultiSelectCustomization {\n qid: string;\n text: string;\n description?: string;\n optional?: boolean;\n qInfo: {\n type: string;\n options: {\n text: string;\n oid: string;\n }[];\n };\n}\n\nexport default function MultiSelect({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n}: QuestionProps) {\n const label = customizations.text;\n const secondaryText = customizations.description ?? \"\";\n const options = customizations.qInfo.options;\n const qid = customizations.qid;\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const answerIsValid =\n optional ||\n (currentAnswer && currentAnswer[qid] ? (currentAnswer[qid].length || 0) > 0 : false);\n const selectedOptions = currentAnswer && currentAnswer[qid] ? currentAnswer[qid] : [];\n\n // Adding setAbleToSubmit as dependency might break survey behavior (e.g. questions that have follow-ups such as the desired_mentoring_frequency question)\n // If you're making edits to this please check that this works with follow-up questions\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n // eslint-disable-next-line\n }, [answerIsValid, currentAnswer, selectedOptions]);\n\n const deprecatedMultiSelect = (\n \n \n \n {options.map((option) => (\n {\n const index = selectedOptions.indexOf(option.oid);\n if (index > -1) {\n // The answer is already checked, uncheck it.\n updateAnswer({\n [qid]: [...selectedOptions.slice(0, index), ...selectedOptions.slice(index + 1)],\n });\n } else {\n // The answer is not checked yet, check it.\n updateAnswer({ [qid]: [...selectedOptions, option.oid] });\n }\n }}\n />\n ))}\n \n \n );\n\n const multiSelect = (\n \n ({\n id: getOptionOid(option) || \"\",\n label: getOptionText(option) || \"\",\n value: selectedOptions.includes(option.oid),\n }))}\n onChange={(newAnswer: MultiSelectOption) => {\n const index = selectedOptions.indexOf(newAnswer.id);\n if (index > -1) {\n // The answer is already checked, uncheck it.\n updateAnswer({\n [qid]: [...selectedOptions.slice(0, index), ...selectedOptions.slice(index + 1)],\n });\n } else {\n // The answer is not checked yet, check it.\n updateAnswer({ [qid]: [...selectedOptions, newAnswer.id] });\n }\n }}\n setAbleToSubmit={setAbleToSubmit}\n dataTest=\"generic-multi-select\"\n />\n \n );\n\n return showRefreshedComponents ? multiSelect : deprecatedMultiSelect;\n}\n","import React, { useEffect } from \"react\";\nimport { QuestionProps } from \"../../survey\";\nimport QuestionLabel from \"../components/question_label\";\nimport { Answer } from \"./generic\";\nimport styled from \"styled-components\";\nimport TextArea from \"../../../components/data_entry/text_area\";\nimport InputQuestionWrapper from \"../../../components/base_ui/higher_order_components/questions/input_question_wrapper\";\n\nconst StyledDeprecatedInput = styled.div`\n margin-top: 2em;\n`;\n\nconst StyledInput = styled.div`\n margin-top: ${({ theme }) => theme.sizing.scale600};\n`;\n\nexport interface InputCustomization {\n qid: string;\n text: string;\n description?: string;\n optional?: boolean;\n qInfo: {\n type: string;\n placeholder?: string;\n };\n}\n\nexport default function Input({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n}: QuestionProps) {\n const label = customizations.text;\n const description = customizations.description ?? \"\";\n\n const qid = customizations.qid;\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const answerIsValid =\n optional ||\n (currentAnswer && currentAnswer[qid] ? (currentAnswer[qid].length || 0) > 0 : false);\n\n // Adding setAbleToSubmit as dependency might break survey behavior\n // If you're making edits to this please check that this works with follow-up questions if applicable\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n // eslint-disable-next-line\n }, [answerIsValid, currentAnswer]);\n\n const deprecatedInput = (\n \n \n \n updateAnswer({ [qid]: updatedResponse })\n }\n value={currentAnswer ? currentAnswer[qid] : \"\"}\n />\n \n );\n\n const input = (\n \n \n updateAnswer({ [qid]: updatedResponse })\n }\n errorMessage={\n showValidation && !answerIsValid ? \"Please complete the required field.\" : undefined\n }\n />\n \n );\n return showRefreshedComponents ? input : deprecatedInput;\n}\n","import React, { Fragment } from \"react\";\nimport { QuestionProps } from \"../../survey\";\nimport _ from \"lodash\";\nimport SingleSelect from \"./single_select\";\nimport MultiSelect from \"./multi_select\";\nimport Input from \"./input\";\n\n// Answer can take on any shape.\nexport interface Answer {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n [propName: string]: any;\n}\n\nexport interface FollowUp {\n whenOidSelectedOr?: string[];\n qid: string;\n text: string;\n description?: string;\n optional?: boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n qInfo: any;\n}\n\nexport default function Generic({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n}: QuestionProps<\n Answer,\n {\n qid: string;\n text: string;\n description?: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n qInfo: any;\n followUps?: FollowUp[];\n }\n>) {\n const qid = customizations.qid;\n const followUps = customizations.followUps || [];\n\n // With the new answer, remove any stale follow up answers.\n const updateAndScrubAnswer = (answer: Answer) => {\n // Quickly get what we would be showing\n const tempNewFollowUps = filterFollowUpConditions(qid, answer, followUps);\n\n // Queue up all irrelevant follow ups to remove\n const followUpsToRemove = followUps.filter((followUp) => {\n return !tempNewFollowUps.map((f) => f.qid).includes(followUp.qid);\n });\n\n // Remove the irrelevant follow ups\n const newAnswers = _.omit(\n currentAnswer,\n followUpsToRemove.map((followUp) => followUp.qid),\n );\n updateAnswer({ ...newAnswers, ...answer });\n };\n\n const followUpsToDisplay = filterFollowUpConditions(qid, currentAnswer, followUps);\n const QuestionComponent = componentForQuestionType(customizations.qInfo.type);\n\n return (\n \n \n\n {/* TODO: There is a bug here where only the last of the follow-ups will dictate setAbleToSubmit, not addressing this yet since we might overhaul this component */}\n {followUpsToDisplay.map((followUp) => (\n \n ))}\n \n );\n}\n\nfunction componentForQuestionType(type: string) {\n switch (type) {\n case \"single_select\":\n return SingleSelect;\n case \"multi_select\":\n return MultiSelect;\n case \"short_text\": // can't be renamed without changing database values\n return Input;\n }\n // Not implemented yet\n throw `Unsupported generic question type: ${type}.`;\n}\n\nfunction filterFollowUpConditions(\n qid: string,\n currentAnswer?: Answer,\n followUps?: FollowUp[],\n): FollowUp[] {\n if (!currentAnswer) {\n return [];\n }\n if (followUps) {\n return followUps.filter((followUp) => {\n const answerArray = Array.isArray(currentAnswer[qid])\n ? currentAnswer[qid]\n : Array(currentAnswer[qid]);\n if (\n followUp.whenOidSelectedOr &&\n _.intersection(followUp.whenOidSelectedOr, answerArray).length > 0\n ) {\n return true;\n }\n });\n }\n return [];\n}\n","import React, { useContext, useEffect } from \"react\";\nimport { gql } from \"@urql/core\";\nimport { SurveyContext, QuestionProps } from \"../survey\";\nimport { CounterpartsQuestionDocument } from \"../../generated/graphql\";\nimport QuestionLabel from \"./components/question_label\";\nimport Input from \"../../components/data_entry/input\";\nimport styled from \"styled-components\";\nimport { useQuery } from \"urql\";\nimport { captureError } from \"../../../utils/capture_error\";\n\ngql`\n query CounterpartsQuestion($participantId: ID!) {\n participant(id: $participantId) {\n id\n __typename\n mentorships(status: MATCHED) {\n id\n student {\n __typename\n id\n user {\n id\n firstName\n lastName\n }\n }\n mentor {\n __typename\n id\n user {\n id\n firstName\n lastName\n }\n }\n }\n }\n }\n`;\n\ninterface Answer {\n [mentorshipId: string]: string;\n}\n\ninterface Customizations {\n prompt: string;\n inputType: \"text\" | \"number\";\n description?: string;\n optional?: boolean;\n placeholder?: string;\n}\n\nconst Question = styled.div`\n .counterpart {\n margin-top: ${({ theme }) => theme.deprecatedSpacing.component.three};\n }\n`;\n\nexport default function CounterpartsInfo({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n}: QuestionProps) {\n const { participantId } = useContext(SurveyContext);\n\n const [{ fetching, error, data }] = useQuery({\n query: CounterpartsQuestionDocument,\n variables: { participantId },\n });\n\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const description = customizations.description;\n const placeholder = customizations.placeholder;\n const filledOut =\n !!data &&\n !!currentAnswer &&\n data.participant.mentorships.every((mentorship) =>\n Object.keys(currentAnswer).includes(mentorship.id),\n );\n let answerIsValid = optional ? true : typeof currentAnswer !== \"undefined\" && filledOut;\n answerIsValid =\n // if the input is a number, make sure none of the answers are less than 0\n customizations.inputType === \"number\" &&\n currentAnswer &&\n Object.keys(currentAnswer).some((key) => parseInt(currentAnswer[key], 10) < 0)\n ? false\n : answerIsValid;\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n if (fetching || data === null) return
Loading...
;\n if (error || !data) {\n const graphQLErrorsForAPM = error?.graphQLErrors?.join(\"; \") ?? \"\";\n captureError(new Error(`Error fetching useCounterpartsQuestionQuery: ${graphQLErrorsForAPM}`));\n return null;\n }\n\n const mentorships = data.participant.mentorships;\n const userIsMentor = data.participant.__typename === \"Mentor\";\n\n const label = customizations.prompt;\n\n return (\n \n \n {mentorships.map((mentorship) => {\n const counterpart = userIsMentor ? mentorship.student : mentorship.mentor;\n\n return (\n {\n if (value.length < 1) {\n const updatedAnswer: Answer = { ...currentAnswer };\n delete updatedAnswer[mentorship.id];\n updateAnswer(updatedAnswer);\n } else {\n updateAnswer({ ...currentAnswer, [mentorship.id]: value });\n }\n }}\n />\n );\n })}\n \n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport TextArea from \"../../components/data_entry/text_area\";\nimport QuestionLabel from \"./components/question_label\";\nimport { QuestionProps } from \"../survey\";\nimport { RadioButton, RadioGroup } from \"../../components/data_entry/radio\";\nimport { Option, getOptionObjectFromText, getOptionText, getOptionOid } from \"./question_helpers\";\nimport styled from \"styled-components\";\nimport nextId from \"react-id-generator\";\nimport InputQuestionWrapper from \"../../components/base_ui/higher_order_components/questions/input_question_wrapper\";\nimport SelectQuestionWrapper from \"../../components/base_ui/higher_order_components/questions/select_question_wrapper\";\n\nexport interface Customizations {\n prompt: string;\n optional?: boolean;\n description?: string;\n placeholder?: string;\n maxValue?: number;\n followUp?: {\n qid: string;\n whenGreaterThan: number;\n prompt: string;\n description?: string;\n options: (string | Option)[];\n };\n}\n\nexport interface Answer {\n value: string;\n selectedFollowUpOption?: string | Option;\n}\n\nconst StyledFollowUp = styled.div`\n margin-top: 2em;\n`;\n\nconst NumberErrorLabel = styled.div`\n color: red;\n margin-top: 1em;\n`;\n\nexport default function SurveyQuestionNumberInput({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n}: QuestionProps) {\n const [showNumberError, setShowNumberError] = useState(false);\n const [numericInputErrorMessage, setNumericInputErrorMessage] = useState(\n undefined,\n );\n const [followUpQuestionErrorMessage, setfollowUpQuestionErrorMessage] = useState<\n string | undefined\n >(undefined);\n const [touched, setTouched] = useState(false);\n const [showMaxCharactersError, setShowMaxCharactersError] = useState(false);\n const label = customizations.prompt;\n const id = \"number-input-\" + nextId();\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const description = customizations.description;\n const placeholder = customizations.placeholder;\n const currentAnswerValue = currentAnswer ? currentAnswer.value : undefined;\n const selectedFollowUpOption = currentAnswer ? currentAnswer.selectedFollowUpOption : undefined;\n const followUp = customizations.followUp;\n const maxValue = customizations.maxValue;\n\n const isFollowUpQuestionAnswerValid = (): boolean => {\n return (\n !followUp ||\n // This is a bit complicated - If it has a follow up, we should make sure it either is showing and answered, or not showing at all.\n (!!followUp &&\n ((shouldShowFollowUp(currentAnswerValue) && !!selectedFollowUpOption) ||\n !shouldShowFollowUp(currentAnswerValue)))\n );\n };\n const answerIsValid =\n optional ||\n (typeof currentAnswerValue !== \"undefined\" &&\n currentAnswerValue !== \"\" &&\n isFollowUpQuestionAnswerValid());\n\n const numericInputAnswerIsValid = optional || currentAnswerValue;\n const followUpQuestionAnswerIsValid = isFollowUpQuestionAnswerValid();\n\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n useEffect(() => {\n setNumericInputErrorMessage(\n !numericInputAnswerIsValid ? \"Please complete the required field.\" : undefined,\n );\n }, [numericInputAnswerIsValid]);\n\n useEffect(() => {\n setfollowUpQuestionErrorMessage(\n !followUpQuestionAnswerIsValid ? \"Please complete the required field.\" : undefined,\n );\n }, [followUpQuestionAnswerIsValid]);\n\n function shouldShowFollowUp(currentAnswerValue: string | undefined): boolean {\n return (\n !!followUp &&\n !!currentAnswerValue &&\n Number.isInteger(parseInt(currentAnswerValue)) &&\n Number(currentAnswerValue) > followUp.whenGreaterThan\n );\n }\n\n const deprecatedNumberInput = (\n
\n \n {\n const numberFormat = /^\\d*\\.?\\d*$/;\n const numberIsProperFormat = numberFormat.test(updatedResponse.trim());\n const numberIsWithinValidRange = maxValue ? parseInt(updatedResponse) <= maxValue : true;\n if (numberIsProperFormat && numberIsWithinValidRange) {\n updateAnswer({ value: updatedResponse });\n setShowNumberError(false);\n setShowMaxCharactersError(false);\n } else if (!numberIsProperFormat) {\n setShowNumberError(true);\n updateAnswer({ value: \"\" });\n } else if (!numberIsWithinValidRange) {\n setShowMaxCharactersError(true);\n updateAnswer({ value: \"\" });\n }\n }}\n value={currentAnswerValue ? currentAnswerValue : \"\"}\n />\n {showNumberError && Numbers only please.}\n {showMaxCharactersError && (\n Please enter a number from 0 - {maxValue}.\n )}\n {followUp && currentAnswerValue && shouldShowFollowUp(currentAnswerValue) && (\n \n \n \n updateAnswer({\n value: currentAnswerValue,\n selectedFollowUpOption: getOptionObjectFromText(followUpValue, followUp.options),\n })\n }\n >\n {followUp.options.map((option) => {\n const optionText = getOptionText(option);\n return (\n \n );\n })}\n \n \n )}\n
\n );\n const numberInput = (\n <>\n {\n if (!maxValue || (maxValue && maxValue < 100 && updatedResponse.length <= 2)) {\n updateAnswer({ value: updatedResponse });\n }\n }}\n onBlur={() => {\n setTouched(true);\n }}\n errorMessage={touched || showValidation ? numericInputErrorMessage : undefined}\n >\n {followUp && currentAnswerValue && shouldShowFollowUp(currentAnswerValue) && (\n ({\n id: getOptionOid(option) || \"\",\n label: getOptionText(option) || \"\",\n }))}\n onChange={(followUpValue) => {\n updateAnswer({\n value: currentAnswerValue,\n selectedFollowUpOption: getOptionObjectFromText(\n followUpValue.label as string,\n followUp.options,\n ),\n });\n }}\n optional={false}\n label={followUp.prompt}\n value={{\n id: selectedFollowUpOption ? getOptionOid(selectedFollowUpOption) : \"\",\n label: getOptionText(selectedFollowUpOption) || \"\",\n }}\n errorMessage={showValidation ? followUpQuestionErrorMessage : undefined}\n >\n )}\n \n );\n\n return showRefreshedComponents ? numberInput : deprecatedNumberInput;\n}\n","import React, { useEffect, useState } from \"react\";\nimport TextArea from \"../../components/data_entry/text_area\";\nimport QuestionLabel from \"./components/question_label\";\nimport { QuestionProps } from \"../survey\";\nimport nextId from \"react-id-generator\";\nimport TextareaQuestionWrapper from \"../../components/base_ui/higher_order_components/questions/textarea_question_wrapper\";\n\nexport interface Customizations {\n prompt: string;\n description?: string;\n placeholder?: string;\n optional?: boolean;\n}\n\nexport type Answer = string;\n\nexport default function SurveyQuestionOpenResponse({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n hackToHideFeedback = false,\n}: QuestionProps) {\n const [errorMessage, setErrorMessage] = useState(undefined);\n const [touched, setTouched] = useState(false);\n\n const label = customizations.prompt;\n const id = \"open-response-\" + nextId();\n const description = customizations.description;\n const placeholder = customizations.placeholder;\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const answerIsValid = optional || (typeof currentAnswer !== \"undefined\" && currentAnswer !== \"\");\n\n useEffect(() => {\n setErrorMessage(!answerIsValid ? \"Please complete the required field.\" : undefined);\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n const deprecatedOpenResponse = (\n
\n \n {hackToHideFeedback ? (\n <>\n ) : (\n \n updateAnswer(updatedResponse)\n }\n value={currentAnswer ? currentAnswer : \"\"}\n error={\n !answerIsValid && showValidation ? \"Please complete the required field.\" : undefined\n }\n />\n )}\n
\n );\n\n const openResponse = (\n {\n updateAnswer(updatedResponse);\n }}\n onBlur={() => {\n setTouched(true);\n }}\n errorMessage={touched || showValidation ? errorMessage : undefined}\n />\n );\n\n return showRefreshedComponents ? openResponse : deprecatedOpenResponse;\n}\n","import React, { useEffect, useState } from \"react\";\nimport { QuestionProps } from \"../survey\";\nimport nextId from \"react-id-generator\";\nimport InputQuestionWrapper from \"../../components/base_ui/higher_order_components/questions/input_question_wrapper\";\n\nexport interface Customizations {\n prompt: string;\n description?: string;\n placeholder?: string;\n optional?: boolean;\n}\n\nexport type Answer = string;\n\nexport default function SurveyQuestionTextInput({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n}: QuestionProps) {\n const [errorMessage, setErrorMessage] = useState(undefined);\n const [touched, setTouched] = useState(false);\n\n // Hardcoded to for now, ideally this would be passed in from the backend.\n const maxCharacterCount = 100;\n\n const label = customizations.prompt;\n const id = \"open-response-\" + nextId();\n const description = customizations.description;\n const placeholder = customizations.placeholder;\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n\n const hasNoOptionalityError =\n optional || (typeof currentAnswer !== \"undefined\" && currentAnswer !== \"\");\n const hasNoLengthError = (currentAnswer?.length || 0) <= maxCharacterCount;\n\n useEffect(() => {\n if (!hasNoOptionalityError) {\n setErrorMessage(\"Please complete the required field.\");\n setAbleToSubmit(false);\n } else if (!hasNoLengthError) {\n setErrorMessage(\"Please shorten your response.\");\n setAbleToSubmit(false);\n } else {\n setErrorMessage(undefined);\n setAbleToSubmit(true);\n }\n }, [hasNoOptionalityError, hasNoLengthError, setAbleToSubmit]);\n\n return (\n {\n updateAnswer(updatedResponse);\n }}\n onBlur={() => {\n setTouched(true);\n }}\n errorMessage={touched || showValidation ? errorMessage : undefined}\n />\n );\n}\n","/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","const t=t=>\"object\"==typeof t&&null!=t&&1===t.nodeType,e=(t,e)=>(!e||\"hidden\"!==t)&&(\"visible\"!==t&&\"clip\"!==t),n=(t,n)=>{if(t.clientHeight{const e=(t=>{if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}})(t);return!!e&&(e.clientHeightre||r>t&&i=e&&s>=n?r-t-o:i>e&&sn?i-e+l:0,l=t=>{const e=t.parentElement;return null==e?t.getRootNode().host||null:e},r=(e,r)=>{var i,s,d,h;if(\"undefined\"==typeof document)return[];const{scrollMode:c,block:f,inline:u,boundary:a,skipOverflowHiddenElements:g}=r,p=\"function\"==typeof a?a:t=>t!==a;if(!t(e))throw new TypeError(\"Invalid target\");const m=document.scrollingElement||document.documentElement,w=[];let W=e;for(;t(W)&&p(W);){if(W=l(W),W===m){w.push(W);break}null!=W&&W===document.body&&n(W)&&!n(document.documentElement)||null!=W&&n(W,g)&&w.push(W)}const b=null!=(s=null==(i=window.visualViewport)?void 0:i.width)?s:innerWidth,H=null!=(h=null==(d=window.visualViewport)?void 0:d.height)?h:innerHeight,{scrollX:y,scrollY:M}=window,{height:v,width:E,top:x,right:C,bottom:I,left:R}=e.getBoundingClientRect(),{top:T,right:B,bottom:F,left:V}=(t=>{const e=window.getComputedStyle(t);return{top:parseFloat(e.scrollMarginTop)||0,right:parseFloat(e.scrollMarginRight)||0,bottom:parseFloat(e.scrollMarginBottom)||0,left:parseFloat(e.scrollMarginLeft)||0}})(e);let k=\"start\"===f||\"nearest\"===f?x-T:\"end\"===f?I+F:x+v/2-T+F,D=\"center\"===u?R+E/2-V+B:\"end\"===u?C+B:R-V;const L=[];for(let t=0;t=0&&R>=0&&I<=H&&C<=b&&x>=r&&I<=s&&R>=d&&C<=i)return L;const h=getComputedStyle(e),a=parseInt(h.borderLeftWidth,10),g=parseInt(h.borderTopWidth,10),p=parseInt(h.borderRightWidth,10),W=parseInt(h.borderBottomWidth,10);let T=0,B=0;const F=\"offsetWidth\"in e?e.offsetWidth-e.clientWidth-a-p:0,V=\"offsetHeight\"in e?e.offsetHeight-e.clientHeight-g-W:0,S=\"offsetWidth\"in e?0===e.offsetWidth?0:l/e.offsetWidth:0,X=\"offsetHeight\"in e?0===e.offsetHeight?0:n/e.offsetHeight:0;if(m===e)T=\"start\"===f?k:\"end\"===f?k-H:\"nearest\"===f?o(M,M+H,H,g,W,M+k,M+k+v,v):k-H/2,B=\"start\"===u?D:\"center\"===u?D-b/2:\"end\"===u?D-b:o(y,y+b,b,a,p,y+D,y+D+E,E),T=Math.max(0,T+M),B=Math.max(0,B+y);else{T=\"start\"===f?k-r-g:\"end\"===f?k-s+W+V:\"nearest\"===f?o(r,s,n,g,W+V,k,k+v,v):k-(r+n/2)+V/2,B=\"start\"===u?D-d-a:\"center\"===u?D-(d+l/2)+F/2:\"end\"===u?D-i+p+F:o(d,i,l,a,p+F,D,D+E,E);const{scrollLeft:t,scrollTop:h}=e;T=0===X?0:Math.max(0,Math.min(h+T/X,e.scrollHeight-n/X+V)),B=0===S?0:Math.max(0,Math.min(t+B/S,e.scrollWidth-l/S+F)),k+=h-T,D+=t-B}L.push({el:e,top:T,left:B})}return L};export{r as compute};//# sourceMappingURL=index.js.map\n","import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport PropTypes from 'prop-types';\nimport React, { cloneElement, Component, useRef, useEffect, useLayoutEffect, useCallback, useReducer, useMemo } from 'react';\nimport { isForwardRef } from 'react-is';\nimport { compute } from 'compute-scroll-into-view';\nimport { __assign } from 'tslib';\n\nvar idCounter = 0;\n\n/**\n * Accepts a parameter and returns it if it's a function\n * or a noop function if it's not. This allows us to\n * accept a callback, but not worry about it if it's not\n * passed.\n * @param {Function} cb the callback\n * @return {Function} a function\n */\nfunction cbToCb(cb) {\n return typeof cb === 'function' ? cb : noop;\n}\nfunction noop() {}\n\n/**\n * Scroll node into view if necessary\n * @param {HTMLElement} node the element that should scroll into view\n * @param {HTMLElement} menuNode the menu element of the component\n */\nfunction scrollIntoView(node, menuNode) {\n if (!node) {\n return;\n }\n var actions = compute(node, {\n boundary: menuNode,\n block: 'nearest',\n scrollMode: 'if-needed'\n });\n actions.forEach(function (_ref) {\n var el = _ref.el,\n top = _ref.top,\n left = _ref.left;\n el.scrollTop = top;\n el.scrollLeft = left;\n });\n}\n\n/**\n * @param {HTMLElement} parent the parent node\n * @param {HTMLElement} child the child node\n * @param {Window} environment The window context where downshift renders.\n * @return {Boolean} whether the parent is the child or the child is in the parent\n */\nfunction isOrContainsNode(parent, child, environment) {\n var result = parent === child || child instanceof environment.Node && parent.contains && parent.contains(child);\n return result;\n}\n\n/**\n * Simple debounce implementation. Will call the given\n * function once after the time given has passed since\n * it was last called.\n * @param {Function} fn the function to call after the time\n * @param {Number} time the time to wait\n * @return {Function} the debounced function\n */\nfunction debounce(fn, time) {\n var timeoutId;\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n }\n function wrapper() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n cancel();\n timeoutId = setTimeout(function () {\n timeoutId = null;\n fn.apply(void 0, args);\n }, time);\n }\n wrapper.cancel = cancel;\n return wrapper;\n}\n\n/**\n * This is intended to be used to compose event handlers.\n * They are executed in order until one of them sets\n * `event.preventDownshiftDefault = true`.\n * @param {...Function} fns the event handler functions\n * @return {Function} the event handler to add to an element\n */\nfunction callAllEventHandlers() {\n for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n fns[_key2] = arguments[_key2];\n }\n return function (event) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return fns.some(function (fn) {\n if (fn) {\n fn.apply(void 0, [event].concat(args));\n }\n return event.preventDownshiftDefault || event.hasOwnProperty('nativeEvent') && event.nativeEvent.preventDownshiftDefault;\n });\n };\n}\nfunction handleRefs() {\n for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n refs[_key4] = arguments[_key4];\n }\n return function (node) {\n refs.forEach(function (ref) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n });\n };\n}\n\n/**\n * This generates a unique ID for an instance of Downshift\n * @return {String} the unique ID\n */\nfunction generateId() {\n return String(idCounter++);\n}\n\n/**\n * Resets idCounter to 0. Used for SSR.\n */\nfunction resetIdCounter() {\n // istanbul ignore next\n if ('useId' in React) {\n console.warn(\"It is not necessary to call resetIdCounter when using React 18+\");\n return;\n }\n idCounter = 0;\n}\n\n/**\n * Default implementation for status message. Only added when menu is open.\n * Will specify if there are results in the list, and if so, how many,\n * and what keys are relevant.\n *\n * @param {Object} param the downshift state and other relevant properties\n * @return {String} the a11y status message\n */\nfunction getA11yStatusMessage(_ref2) {\n var isOpen = _ref2.isOpen,\n resultCount = _ref2.resultCount,\n previousResultCount = _ref2.previousResultCount;\n if (!isOpen) {\n return '';\n }\n if (!resultCount) {\n return 'No results are available.';\n }\n if (resultCount !== previousResultCount) {\n return resultCount + \" result\" + (resultCount === 1 ? ' is' : 's are') + \" available, use up and down arrow keys to navigate. Press Enter key to select.\";\n }\n return '';\n}\n\n/**\n * Takes an argument and if it's an array, returns the first item in the array\n * otherwise returns the argument\n * @param {*} arg the maybe-array\n * @param {*} defaultValue the value if arg is falsey not defined\n * @return {*} the arg or it's first item\n */\nfunction unwrapArray(arg, defaultValue) {\n arg = Array.isArray(arg) ? /* istanbul ignore next (preact) */arg[0] : arg;\n if (!arg && defaultValue) {\n return defaultValue;\n } else {\n return arg;\n }\n}\n\n/**\n * @param {Object} element (P)react element\n * @return {Boolean} whether it's a DOM element\n */\nfunction isDOMElement(element) {\n\n // then we assume this is react\n return typeof element.type === 'string';\n}\n\n/**\n * @param {Object} element (P)react element\n * @return {Object} the props\n */\nfunction getElementProps(element) {\n return element.props;\n}\n\n/**\n * Throws a helpful error message for required properties. Useful\n * to be used as a default in destructuring or object params.\n * @param {String} fnName the function name\n * @param {String} propName the prop name\n */\nfunction requiredProp(fnName, propName) {\n // eslint-disable-next-line no-console\n console.error(\"The property \\\"\" + propName + \"\\\" is required in \\\"\" + fnName + \"\\\"\");\n}\nvar stateKeys = ['highlightedIndex', 'inputValue', 'isOpen', 'selectedItem', 'type'];\n/**\n * @param {Object} state the state object\n * @return {Object} state that is relevant to downshift\n */\nfunction pickState(state) {\n if (state === void 0) {\n state = {};\n }\n var result = {};\n stateKeys.forEach(function (k) {\n if (state.hasOwnProperty(k)) {\n result[k] = state[k];\n }\n });\n return result;\n}\n\n/**\n * This will perform a shallow merge of the given state object\n * with the state coming from props\n * (for the controlled component scenario)\n * This is used in state updater functions so they're referencing\n * the right state regardless of where it comes from.\n *\n * @param {Object} state The state of the component/hook.\n * @param {Object} props The props that may contain controlled values.\n * @returns {Object} The merged controlled state.\n */\nfunction getState(state, props) {\n if (!state || !props) {\n return state;\n }\n return Object.keys(state).reduce(function (prevState, key) {\n prevState[key] = isControlledProp(props, key) ? props[key] : state[key];\n return prevState;\n }, {});\n}\n\n/**\n * This determines whether a prop is a \"controlled prop\" meaning it is\n * state which is controlled by the outside of this component rather\n * than within this component.\n *\n * @param {Object} props The props that may contain controlled values.\n * @param {String} key the key to check\n * @return {Boolean} whether it is a controlled controlled prop\n */\nfunction isControlledProp(props, key) {\n return props[key] !== undefined;\n}\n\n/**\n * Normalizes the 'key' property of a KeyboardEvent in IE/Edge\n * @param {Object} event a keyboardEvent object\n * @return {String} keyboard key\n */\nfunction normalizeArrowKey(event) {\n var key = event.key,\n keyCode = event.keyCode;\n /* istanbul ignore next (ie) */\n if (keyCode >= 37 && keyCode <= 40 && key.indexOf('Arrow') !== 0) {\n return \"Arrow\" + key;\n }\n return key;\n}\n\n/**\n * Simple check if the value passed is object literal\n * @param {*} obj any things\n * @return {Boolean} whether it's object literal\n */\nfunction isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n\n/**\n * Returns the next non-disabled highlightedIndex value.\n *\n * @param {number} start The current highlightedIndex.\n * @param {number} offset The offset from the current highlightedIndex to start searching.\n * @param {unknown[]} items The items array.\n * @param {(item: unknown, index: number) => boolean} isItemDisabled Function that tells if an item is disabled or not.\n * @param {boolean?} circular If the search reaches the end, if it can search again starting from the other end.\n * @returns {number} The next highlightedIndex.\n */\nfunction getHighlightedIndex(start, offset, items, isItemDisabled, circular) {\n if (circular === void 0) {\n circular = false;\n }\n var count = items.length;\n if (count === 0) {\n return -1;\n }\n var itemsLastIndex = count - 1;\n if (typeof start !== 'number' || start < 0 || start > itemsLastIndex) {\n start = offset > 0 ? -1 : itemsLastIndex + 1;\n }\n var current = start + offset;\n if (current < 0) {\n current = circular ? itemsLastIndex : 0;\n } else if (current > itemsLastIndex) {\n current = circular ? 0 : itemsLastIndex;\n }\n var highlightedIndex = getNonDisabledIndex(current, offset < 0, items, isItemDisabled, circular);\n if (highlightedIndex === -1) {\n return start >= count ? -1 : start;\n }\n return highlightedIndex;\n}\n\n/**\n * Returns the next non-disabled highlightedIndex value.\n *\n * @param {number} start The current highlightedIndex.\n * @param {boolean} backwards If true, it will search backwards from the start.\n * @param {unknown[]} items The items array.\n * @param {(item: unknown, index: number) => boolean} isItemDisabled Function that tells if an item is disabled or not.\n * @param {boolean} circular If the search reaches the end, if it can search again starting from the other end.\n * @returns {number} The next non-disabled index.\n */\nfunction getNonDisabledIndex(start, backwards, items, isItemDisabled, circular) {\n if (circular === void 0) {\n circular = false;\n }\n var count = items.length;\n if (backwards) {\n for (var index = start; index >= 0; index--) {\n if (!isItemDisabled(items[index], index)) {\n return index;\n }\n }\n } else {\n for (var _index = start; _index < count; _index++) {\n if (!isItemDisabled(items[_index], _index)) {\n return _index;\n }\n }\n }\n if (circular) {\n return getNonDisabledIndex(backwards ? count - 1 : 0, backwards, items, isItemDisabled);\n }\n return -1;\n}\n\n/**\n * Checks if event target is within the downshift elements.\n *\n * @param {EventTarget} target Target to check.\n * @param {HTMLElement[]} downshiftElements The elements that form downshift (list, toggle button etc).\n * @param {Window} environment The window context where downshift renders.\n * @param {boolean} checkActiveElement Whether to also check activeElement.\n *\n * @returns {boolean} Whether or not the target is within downshift elements.\n */\nfunction targetWithinDownshift(target, downshiftElements, environment, checkActiveElement) {\n if (checkActiveElement === void 0) {\n checkActiveElement = true;\n }\n return environment && downshiftElements.some(function (contextNode) {\n return contextNode && (isOrContainsNode(contextNode, target, environment) || checkActiveElement && isOrContainsNode(contextNode, environment.document.activeElement, environment));\n });\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nvar validateControlledUnchanged = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validateControlledUnchanged = function validateControlledUnchanged(state, prevProps, nextProps) {\n var warningDescription = \"This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props\";\n Object.keys(state).forEach(function (propKey) {\n if (prevProps[propKey] !== undefined && nextProps[propKey] === undefined) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: A component has changed the controlled prop \\\"\" + propKey + \"\\\" to be uncontrolled. \" + warningDescription);\n } else if (prevProps[propKey] === undefined && nextProps[propKey] !== undefined) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: A component has changed the uncontrolled prop \\\"\" + propKey + \"\\\" to be controlled. \" + warningDescription);\n }\n });\n };\n}\n\nvar cleanupStatus = debounce(function (documentProp) {\n getStatusDiv(documentProp).textContent = '';\n}, 500);\n\n/**\n * Get the status node or create it if it does not already exist.\n * @param {Object} documentProp document passed by the user.\n * @return {HTMLElement} the status node.\n */\nfunction getStatusDiv(documentProp) {\n var statusDiv = documentProp.getElementById('a11y-status-message');\n if (statusDiv) {\n return statusDiv;\n }\n statusDiv = documentProp.createElement('div');\n statusDiv.setAttribute('id', 'a11y-status-message');\n statusDiv.setAttribute('role', 'status');\n statusDiv.setAttribute('aria-live', 'polite');\n statusDiv.setAttribute('aria-relevant', 'additions text');\n Object.assign(statusDiv.style, {\n border: '0',\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px'\n });\n documentProp.body.appendChild(statusDiv);\n return statusDiv;\n}\n\n/**\n * @param {String} status the status message\n * @param {Object} documentProp document passed by the user.\n */\nfunction setStatus(status, documentProp) {\n if (!status || !documentProp) {\n return;\n }\n var div = getStatusDiv(documentProp);\n div.textContent = status;\n cleanupStatus(documentProp);\n}\n\n/**\n * Removes the status element from the DOM\n * @param {Document} documentProp \n */\nfunction cleanupStatusDiv(documentProp) {\n var statusDiv = documentProp == null ? void 0 : documentProp.getElementById('a11y-status-message');\n if (statusDiv) {\n statusDiv.remove();\n }\n}\n\nvar unknown = process.env.NODE_ENV !== \"production\" ? '__autocomplete_unknown__' : 0;\nvar mouseUp = process.env.NODE_ENV !== \"production\" ? '__autocomplete_mouseup__' : 1;\nvar itemMouseEnter = process.env.NODE_ENV !== \"production\" ? '__autocomplete_item_mouseenter__' : 2;\nvar keyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_arrow_up__' : 3;\nvar keyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_arrow_down__' : 4;\nvar keyDownEscape = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_escape__' : 5;\nvar keyDownEnter = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_enter__' : 6;\nvar keyDownHome = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_home__' : 7;\nvar keyDownEnd = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_end__' : 8;\nvar clickItem = process.env.NODE_ENV !== \"production\" ? '__autocomplete_click_item__' : 9;\nvar blurInput = process.env.NODE_ENV !== \"production\" ? '__autocomplete_blur_input__' : 10;\nvar changeInput = process.env.NODE_ENV !== \"production\" ? '__autocomplete_change_input__' : 11;\nvar keyDownSpaceButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_space_button__' : 12;\nvar clickButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_click_button__' : 13;\nvar blurButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_blur_button__' : 14;\nvar controlledPropUpdatedSelectedItem = process.env.NODE_ENV !== \"production\" ? '__autocomplete_controlled_prop_updated_selected_item__' : 15;\nvar touchEnd = process.env.NODE_ENV !== \"production\" ? '__autocomplete_touchend__' : 16;\n\nvar stateChangeTypes$3 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n blurButton: blurButton,\n blurInput: blurInput,\n changeInput: changeInput,\n clickButton: clickButton,\n clickItem: clickItem,\n controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,\n itemMouseEnter: itemMouseEnter,\n keyDownArrowDown: keyDownArrowDown,\n keyDownArrowUp: keyDownArrowUp,\n keyDownEnd: keyDownEnd,\n keyDownEnter: keyDownEnter,\n keyDownEscape: keyDownEscape,\n keyDownHome: keyDownHome,\n keyDownSpaceButton: keyDownSpaceButton,\n mouseUp: mouseUp,\n touchEnd: touchEnd,\n unknown: unknown\n});\n\nvar _excluded$3 = [\"refKey\", \"ref\"],\n _excluded2$3 = [\"onClick\", \"onPress\", \"onKeyDown\", \"onKeyUp\", \"onBlur\"],\n _excluded3$2 = [\"onKeyDown\", \"onBlur\", \"onChange\", \"onInput\", \"onChangeText\"],\n _excluded4$2 = [\"refKey\", \"ref\"],\n _excluded5 = [\"onMouseMove\", \"onMouseDown\", \"onClick\", \"onPress\", \"index\", \"item\"];\nvar Downshift = /*#__PURE__*/function () {\n var Downshift = /*#__PURE__*/function (_Component) {\n function Downshift(_props) {\n var _this;\n _this = _Component.call(this, _props) || this;\n // fancy destructuring + defaults + aliases\n // this basically says each value of state should either be set to\n // the initial value or the default value if the initial value is not provided\n _this.id = _this.props.id || \"downshift-\" + generateId();\n _this.menuId = _this.props.menuId || _this.id + \"-menu\";\n _this.labelId = _this.props.labelId || _this.id + \"-label\";\n _this.inputId = _this.props.inputId || _this.id + \"-input\";\n _this.getItemId = _this.props.getItemId || function (index) {\n return _this.id + \"-item-\" + index;\n };\n _this.items = [];\n // itemCount can be changed asynchronously\n // from within downshift (so it can't come from a prop)\n // this is why we store it as an instance and use\n // getItemCount rather than just use items.length\n // (to support windowing + async)\n _this.itemCount = null;\n _this.previousResultCount = 0;\n _this.timeoutIds = [];\n /**\n * @param {Function} fn the function to call after the time\n * @param {Number} time the time to wait\n */\n _this.internalSetTimeout = function (fn, time) {\n var id = setTimeout(function () {\n _this.timeoutIds = _this.timeoutIds.filter(function (i) {\n return i !== id;\n });\n fn();\n }, time);\n _this.timeoutIds.push(id);\n };\n _this.setItemCount = function (count) {\n _this.itemCount = count;\n };\n _this.unsetItemCount = function () {\n _this.itemCount = null;\n };\n _this.isItemDisabled = function (_item, index) {\n var currentElementNode = _this.getItemNodeFromIndex(index);\n return currentElementNode && currentElementNode.hasAttribute('disabled');\n };\n _this.setHighlightedIndex = function (highlightedIndex, otherStateToSet) {\n if (highlightedIndex === void 0) {\n highlightedIndex = _this.props.defaultHighlightedIndex;\n }\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n otherStateToSet = pickState(otherStateToSet);\n _this.internalSetState(_extends({\n highlightedIndex: highlightedIndex\n }, otherStateToSet));\n };\n _this.clearSelection = function (cb) {\n _this.internalSetState({\n selectedItem: null,\n inputValue: '',\n highlightedIndex: _this.props.defaultHighlightedIndex,\n isOpen: _this.props.defaultIsOpen\n }, cb);\n };\n _this.selectItem = function (item, otherStateToSet, cb) {\n otherStateToSet = pickState(otherStateToSet);\n _this.internalSetState(_extends({\n isOpen: _this.props.defaultIsOpen,\n highlightedIndex: _this.props.defaultHighlightedIndex,\n selectedItem: item,\n inputValue: _this.props.itemToString(item)\n }, otherStateToSet), cb);\n };\n _this.selectItemAtIndex = function (itemIndex, otherStateToSet, cb) {\n var item = _this.items[itemIndex];\n if (item == null) {\n return;\n }\n _this.selectItem(item, otherStateToSet, cb);\n };\n _this.selectHighlightedItem = function (otherStateToSet, cb) {\n return _this.selectItemAtIndex(_this.getState().highlightedIndex, otherStateToSet, cb);\n };\n // any piece of our state can live in two places:\n // 1. Uncontrolled: it's internal (this.state)\n // We will call this.setState to update that state\n // 2. Controlled: it's external (this.props)\n // We will call this.props.onStateChange to update that state\n //\n // In addition, we'll call this.props.onChange if the\n // selectedItem is changed.\n _this.internalSetState = function (stateToSet, cb) {\n var isItemSelected, onChangeArg;\n var onStateChangeArg = {};\n var isStateToSetFunction = typeof stateToSet === 'function';\n\n // we want to call `onInputValueChange` before the `setState` call\n // so someone controlling the `inputValue` state gets notified of\n // the input change as soon as possible. This avoids issues with\n // preserving the cursor position.\n // See https://github.com/downshift-js/downshift/issues/217 for more info.\n if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) {\n _this.props.onInputValueChange(stateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), stateToSet));\n }\n return _this.setState(function (state) {\n var _newStateToSet;\n state = _this.getState(state);\n var newStateToSet = isStateToSetFunction ? stateToSet(state) : stateToSet;\n\n // Your own function that could modify the state that will be set.\n newStateToSet = _this.props.stateReducer(state, newStateToSet);\n\n // checks if an item is selected, regardless of if it's different from\n // what was selected before\n // used to determine if onSelect and onChange callbacks should be called\n isItemSelected = newStateToSet.hasOwnProperty('selectedItem');\n // this keeps track of the object we want to call with setState\n var nextState = {};\n // we need to call on change if the outside world is controlling any of our state\n // and we're trying to update that state. OR if the selection has changed and we're\n // trying to update the selection\n if (isItemSelected && newStateToSet.selectedItem !== state.selectedItem) {\n onChangeArg = newStateToSet.selectedItem;\n }\n (_newStateToSet = newStateToSet).type || (_newStateToSet.type = unknown);\n Object.keys(newStateToSet).forEach(function (key) {\n // onStateChangeArg should only have the state that is\n // actually changing\n if (state[key] !== newStateToSet[key]) {\n onStateChangeArg[key] = newStateToSet[key];\n }\n // the type is useful for the onStateChangeArg\n // but we don't actually want to set it in internal state.\n // this is an undocumented feature for now... Not all internalSetState\n // calls support it and I'm not certain we want them to yet.\n // But it enables users controlling the isOpen state to know when\n // the isOpen state changes due to mouseup events which is quite handy.\n if (key === 'type') {\n return;\n }\n newStateToSet[key];\n // if it's coming from props, then we don't care to set it internally\n if (!isControlledProp(_this.props, key)) {\n nextState[key] = newStateToSet[key];\n }\n });\n\n // if stateToSet is a function, then we weren't able to call onInputValueChange\n // earlier, so we'll call it now that we know what the inputValue state will be.\n if (isStateToSetFunction && newStateToSet.hasOwnProperty('inputValue')) {\n _this.props.onInputValueChange(newStateToSet.inputValue, _extends({}, _this.getStateAndHelpers(), newStateToSet));\n }\n return nextState;\n }, function () {\n // call the provided callback if it's a function\n cbToCb(cb)();\n\n // only call the onStateChange and onChange callbacks if\n // we have relevant information to pass them.\n var hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1;\n if (hasMoreStateThanType) {\n _this.props.onStateChange(onStateChangeArg, _this.getStateAndHelpers());\n }\n if (isItemSelected) {\n _this.props.onSelect(stateToSet.selectedItem, _this.getStateAndHelpers());\n }\n if (onChangeArg !== undefined) {\n _this.props.onChange(onChangeArg, _this.getStateAndHelpers());\n }\n // this is currently undocumented and therefore subject to change\n // We'll try to not break it, but just be warned.\n _this.props.onUserAction(onStateChangeArg, _this.getStateAndHelpers());\n });\n };\n //////////////////////////// ROOT\n _this.rootRef = function (node) {\n return _this._rootNode = node;\n };\n _this.getRootProps = function (_temp, _temp2) {\n var _extends2;\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$refKey = _ref.refKey,\n refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,\n ref = _ref.ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n _ref2$suppressRefErro = _ref2.suppressRefError,\n suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;\n // this is used in the render to know whether the user has called getRootProps.\n // It uses that to know whether to apply the props automatically\n _this.getRootProps.called = true;\n _this.getRootProps.refKey = refKey;\n _this.getRootProps.suppressRefError = suppressRefError;\n var _this$getState = _this.getState(),\n isOpen = _this$getState.isOpen;\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, _this.rootRef), _extends2.role = 'combobox', _extends2['aria-expanded'] = isOpen, _extends2['aria-haspopup'] = 'listbox', _extends2['aria-owns'] = isOpen ? _this.menuId : undefined, _extends2['aria-labelledby'] = _this.labelId, _extends2), rest);\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ROOT\n _this.keyDownHandlers = {\n ArrowDown: function ArrowDown(event) {\n var _this2 = this;\n event.preventDefault();\n if (this.getState().isOpen) {\n var amount = event.shiftKey ? 5 : 1;\n this.moveHighlightedIndex(amount, {\n type: keyDownArrowDown\n });\n } else {\n this.internalSetState({\n isOpen: true,\n type: keyDownArrowDown\n }, function () {\n var itemCount = _this2.getItemCount();\n if (itemCount > 0) {\n var _this2$getState = _this2.getState(),\n highlightedIndex = _this2$getState.highlightedIndex;\n var nextHighlightedIndex = getHighlightedIndex(highlightedIndex, 1, {\n length: itemCount\n }, _this2.isItemDisabled, true);\n _this2.setHighlightedIndex(nextHighlightedIndex, {\n type: keyDownArrowDown\n });\n }\n });\n }\n },\n ArrowUp: function ArrowUp(event) {\n var _this3 = this;\n event.preventDefault();\n if (this.getState().isOpen) {\n var amount = event.shiftKey ? -5 : -1;\n this.moveHighlightedIndex(amount, {\n type: keyDownArrowUp\n });\n } else {\n this.internalSetState({\n isOpen: true,\n type: keyDownArrowUp\n }, function () {\n var itemCount = _this3.getItemCount();\n if (itemCount > 0) {\n var _this3$getState = _this3.getState(),\n highlightedIndex = _this3$getState.highlightedIndex;\n var nextHighlightedIndex = getHighlightedIndex(highlightedIndex, -1, {\n length: itemCount\n }, _this3.isItemDisabled, true);\n _this3.setHighlightedIndex(nextHighlightedIndex, {\n type: keyDownArrowUp\n });\n }\n });\n }\n },\n Enter: function Enter(event) {\n if (event.which === 229) {\n return;\n }\n var _this$getState2 = this.getState(),\n isOpen = _this$getState2.isOpen,\n highlightedIndex = _this$getState2.highlightedIndex;\n if (isOpen && highlightedIndex != null) {\n event.preventDefault();\n var item = this.items[highlightedIndex];\n var itemNode = this.getItemNodeFromIndex(highlightedIndex);\n if (item == null || itemNode && itemNode.hasAttribute('disabled')) {\n return;\n }\n this.selectHighlightedItem({\n type: keyDownEnter\n });\n }\n },\n Escape: function Escape(event) {\n event.preventDefault();\n this.reset(_extends({\n type: keyDownEscape\n }, !this.state.isOpen && {\n selectedItem: null,\n inputValue: ''\n }));\n }\n };\n //////////////////////////// BUTTON\n _this.buttonKeyDownHandlers = _extends({}, _this.keyDownHandlers, {\n ' ': function _(event) {\n event.preventDefault();\n this.toggleMenu({\n type: keyDownSpaceButton\n });\n }\n });\n _this.inputKeyDownHandlers = _extends({}, _this.keyDownHandlers, {\n Home: function Home(event) {\n var _this$getState3 = this.getState(),\n isOpen = _this$getState3.isOpen;\n if (!isOpen) {\n return;\n }\n event.preventDefault();\n var itemCount = this.getItemCount();\n if (itemCount <= 0 || !isOpen) {\n return;\n }\n\n // get next non-disabled starting downwards from 0 if that's disabled.\n var newHighlightedIndex = getNonDisabledIndex(0, false, {\n length: itemCount\n }, this.isItemDisabled);\n this.setHighlightedIndex(newHighlightedIndex, {\n type: keyDownHome\n });\n },\n End: function End(event) {\n var _this$getState4 = this.getState(),\n isOpen = _this$getState4.isOpen;\n if (!isOpen) {\n return;\n }\n event.preventDefault();\n var itemCount = this.getItemCount();\n if (itemCount <= 0 || !isOpen) {\n return;\n }\n\n // get next non-disabled starting upwards from last index if that's disabled.\n var newHighlightedIndex = getNonDisabledIndex(itemCount - 1, true, {\n length: itemCount\n }, this.isItemDisabled);\n this.setHighlightedIndex(newHighlightedIndex, {\n type: keyDownEnd\n });\n }\n });\n _this.getToggleButtonProps = function (_temp3) {\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n onClick = _ref3.onClick;\n _ref3.onPress;\n var onKeyDown = _ref3.onKeyDown,\n onKeyUp = _ref3.onKeyUp,\n onBlur = _ref3.onBlur,\n rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$3);\n var _this$getState5 = _this.getState(),\n isOpen = _this$getState5.isOpen;\n var enabledEventHandlers = {\n onClick: callAllEventHandlers(onClick, _this.buttonHandleClick),\n onKeyDown: callAllEventHandlers(onKeyDown, _this.buttonHandleKeyDown),\n onKeyUp: callAllEventHandlers(onKeyUp, _this.buttonHandleKeyUp),\n onBlur: callAllEventHandlers(onBlur, _this.buttonHandleBlur)\n };\n var eventHandlers = rest.disabled ? {} : enabledEventHandlers;\n return _extends({\n type: 'button',\n role: 'button',\n 'aria-label': isOpen ? 'close menu' : 'open menu',\n 'aria-haspopup': true,\n 'data-toggle': true\n }, eventHandlers, rest);\n };\n _this.buttonHandleKeyUp = function (event) {\n // Prevent click event from emitting in Firefox\n event.preventDefault();\n };\n _this.buttonHandleKeyDown = function (event) {\n var key = normalizeArrowKey(event);\n if (_this.buttonKeyDownHandlers[key]) {\n _this.buttonKeyDownHandlers[key].call(_this, event);\n }\n };\n _this.buttonHandleClick = function (event) {\n event.preventDefault();\n // handle odd case for Safari and Firefox which\n // don't give the button the focus properly.\n /* istanbul ignore if (can't reasonably test this) */\n if (_this.props.environment) {\n var _this$props$environme = _this.props.environment.document,\n body = _this$props$environme.body,\n activeElement = _this$props$environme.activeElement;\n if (body && body === activeElement) {\n event.target.focus();\n }\n }\n // to simplify testing components that use downshift, we'll not wrap this in a setTimeout\n // if the NODE_ENV is test. With the proper build system, this should be dead code eliminated\n // when building for production and should therefore have no impact on production code.\n if (process.env.NODE_ENV === 'test') {\n _this.toggleMenu({\n type: clickButton\n });\n } else {\n // Ensure that toggle of menu occurs after the potential blur event in iOS\n _this.internalSetTimeout(function () {\n return _this.toggleMenu({\n type: clickButton\n });\n });\n }\n };\n _this.buttonHandleBlur = function (event) {\n var blurTarget = event.target; // Save blur target for comparison with activeElement later\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not body element\n _this.internalSetTimeout(function () {\n if (_this.isMouseDown || !_this.props.environment) {\n return;\n }\n var activeElement = _this.props.environment.document.activeElement;\n if ((activeElement == null || activeElement.id !== _this.inputId) && activeElement !== blurTarget // Do nothing if we refocus the same element again (to solve issue in Safari on iOS)\n ) {\n _this.reset({\n type: blurButton\n });\n }\n });\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ BUTTON\n /////////////////////////////// LABEL\n _this.getLabelProps = function (props) {\n return _extends({\n htmlFor: _this.inputId,\n id: _this.labelId\n }, props);\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ LABEL\n /////////////////////////////// INPUT\n _this.getInputProps = function (_temp4) {\n var _ref4 = _temp4 === void 0 ? {} : _temp4,\n onKeyDown = _ref4.onKeyDown,\n onBlur = _ref4.onBlur,\n onChange = _ref4.onChange,\n onInput = _ref4.onInput;\n _ref4.onChangeText;\n var rest = _objectWithoutPropertiesLoose(_ref4, _excluded3$2);\n var onChangeKey;\n var eventHandlers = {};\n\n /* istanbul ignore next (preact) */\n {\n onChangeKey = 'onChange';\n }\n var _this$getState6 = _this.getState(),\n inputValue = _this$getState6.inputValue,\n isOpen = _this$getState6.isOpen,\n highlightedIndex = _this$getState6.highlightedIndex;\n if (!rest.disabled) {\n var _eventHandlers;\n eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, _this.inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, _this.inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, _this.inputHandleBlur), _eventHandlers);\n }\n return _extends({\n 'aria-autocomplete': 'list',\n 'aria-activedescendant': isOpen && typeof highlightedIndex === 'number' && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : undefined,\n 'aria-controls': isOpen ? _this.menuId : undefined,\n 'aria-labelledby': rest && rest['aria-label'] ? undefined : _this.labelId,\n // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion\n // revert back since autocomplete=\"nope\" is ignored on latest Chrome and Opera\n autoComplete: 'off',\n value: inputValue,\n id: _this.inputId\n }, eventHandlers, rest);\n };\n _this.inputHandleKeyDown = function (event) {\n var key = normalizeArrowKey(event);\n if (key && _this.inputKeyDownHandlers[key]) {\n _this.inputKeyDownHandlers[key].call(_this, event);\n }\n };\n _this.inputHandleChange = function (event) {\n _this.internalSetState({\n type: changeInput,\n isOpen: true,\n inputValue: event.target.value,\n highlightedIndex: _this.props.defaultHighlightedIndex\n });\n };\n _this.inputHandleBlur = function () {\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not the body element\n _this.internalSetTimeout(function () {\n var _activeElement$datase;\n if (_this.isMouseDown || !_this.props.environment) {\n return;\n }\n var activeElement = _this.props.environment.document.activeElement;\n var downshiftButtonIsActive = (activeElement == null || (_activeElement$datase = activeElement.dataset) == null ? void 0 : _activeElement$datase.toggle) && _this._rootNode && _this._rootNode.contains(activeElement);\n if (!downshiftButtonIsActive) {\n _this.reset({\n type: blurInput\n });\n }\n });\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ INPUT\n /////////////////////////////// MENU\n _this.menuRef = function (node) {\n _this._menuNode = node;\n };\n _this.getMenuProps = function (_temp5, _temp6) {\n var _extends3;\n var _ref5 = _temp5 === void 0 ? {} : _temp5,\n _ref5$refKey = _ref5.refKey,\n refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,\n ref = _ref5.ref,\n props = _objectWithoutPropertiesLoose(_ref5, _excluded4$2);\n var _ref6 = _temp6 === void 0 ? {} : _temp6,\n _ref6$suppressRefErro = _ref6.suppressRefError,\n suppressRefError = _ref6$suppressRefErro === void 0 ? false : _ref6$suppressRefErro;\n _this.getMenuProps.called = true;\n _this.getMenuProps.refKey = refKey;\n _this.getMenuProps.suppressRefError = suppressRefError;\n return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, _this.menuRef), _extends3.role = 'listbox', _extends3['aria-labelledby'] = props && props['aria-label'] ? undefined : _this.labelId, _extends3.id = _this.menuId, _extends3), props);\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ MENU\n /////////////////////////////// ITEM\n _this.getItemProps = function (_temp7) {\n var _enabledEventHandlers;\n var _ref7 = _temp7 === void 0 ? {} : _temp7,\n onMouseMove = _ref7.onMouseMove,\n onMouseDown = _ref7.onMouseDown,\n onClick = _ref7.onClick;\n _ref7.onPress;\n var index = _ref7.index,\n _ref7$item = _ref7.item,\n item = _ref7$item === void 0 ? process.env.NODE_ENV === 'production' ? /* istanbul ignore next */undefined : requiredProp('getItemProps', 'item') : _ref7$item,\n rest = _objectWithoutPropertiesLoose(_ref7, _excluded5);\n if (index === undefined) {\n _this.items.push(item);\n index = _this.items.indexOf(item);\n } else {\n _this.items[index] = item;\n }\n var onSelectKey = 'onClick';\n var customClickHandler = onClick;\n var enabledEventHandlers = (_enabledEventHandlers = {\n // onMouseMove is used over onMouseEnter here. onMouseMove\n // is only triggered on actual mouse movement while onMouseEnter\n // can fire on DOM changes, interrupting keyboard navigation\n onMouseMove: callAllEventHandlers(onMouseMove, function () {\n if (index === _this.getState().highlightedIndex) {\n return;\n }\n _this.setHighlightedIndex(index, {\n type: itemMouseEnter\n });\n\n // We never want to manually scroll when changing state based\n // on `onMouseMove` because we will be moving the element out\n // from under the user which is currently scrolling/moving the\n // cursor\n _this.avoidScrolling = true;\n _this.internalSetTimeout(function () {\n return _this.avoidScrolling = false;\n }, 250);\n }),\n onMouseDown: callAllEventHandlers(onMouseDown, function (event) {\n // This prevents the activeElement from being changed\n // to the item so it can remain with the current activeElement\n // which is a more common use case.\n event.preventDefault();\n })\n }, _enabledEventHandlers[onSelectKey] = callAllEventHandlers(customClickHandler, function () {\n _this.selectItemAtIndex(index, {\n type: clickItem\n });\n }), _enabledEventHandlers);\n\n // Passing down the onMouseDown handler to prevent redirect\n // of the activeElement if clicking on disabled items\n var eventHandlers = rest.disabled ? {\n onMouseDown: enabledEventHandlers.onMouseDown\n } : enabledEventHandlers;\n return _extends({\n id: _this.getItemId(index),\n role: 'option',\n 'aria-selected': _this.getState().highlightedIndex === index\n }, eventHandlers, rest);\n };\n //\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ITEM\n _this.clearItems = function () {\n _this.items = [];\n };\n _this.reset = function (otherStateToSet, cb) {\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n otherStateToSet = pickState(otherStateToSet);\n _this.internalSetState(function (_ref8) {\n var selectedItem = _ref8.selectedItem;\n return _extends({\n isOpen: _this.props.defaultIsOpen,\n highlightedIndex: _this.props.defaultHighlightedIndex,\n inputValue: _this.props.itemToString(selectedItem)\n }, otherStateToSet);\n }, cb);\n };\n _this.toggleMenu = function (otherStateToSet, cb) {\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n otherStateToSet = pickState(otherStateToSet);\n _this.internalSetState(function (_ref9) {\n var isOpen = _ref9.isOpen;\n return _extends({\n isOpen: !isOpen\n }, isOpen && {\n highlightedIndex: _this.props.defaultHighlightedIndex\n }, otherStateToSet);\n }, function () {\n var _this$getState7 = _this.getState(),\n isOpen = _this$getState7.isOpen,\n highlightedIndex = _this$getState7.highlightedIndex;\n if (isOpen) {\n if (_this.getItemCount() > 0 && typeof highlightedIndex === 'number') {\n _this.setHighlightedIndex(highlightedIndex, otherStateToSet);\n }\n }\n cbToCb(cb)();\n });\n };\n _this.openMenu = function (cb) {\n _this.internalSetState({\n isOpen: true\n }, cb);\n };\n _this.closeMenu = function (cb) {\n _this.internalSetState({\n isOpen: false\n }, cb);\n };\n _this.updateStatus = debounce(function () {\n var _this$props;\n if (!((_this$props = _this.props) != null && (_this$props = _this$props.environment) != null && _this$props.document)) {\n return;\n }\n var state = _this.getState();\n var item = _this.items[state.highlightedIndex];\n var resultCount = _this.getItemCount();\n var status = _this.props.getA11yStatusMessage(_extends({\n itemToString: _this.props.itemToString,\n previousResultCount: _this.previousResultCount,\n resultCount: resultCount,\n highlightedItem: item\n }, state));\n _this.previousResultCount = resultCount;\n setStatus(status, _this.props.environment.document);\n }, 200);\n var _this$props2 = _this.props,\n defaultHighlightedIndex = _this$props2.defaultHighlightedIndex,\n _this$props2$initialH = _this$props2.initialHighlightedIndex,\n _highlightedIndex = _this$props2$initialH === void 0 ? defaultHighlightedIndex : _this$props2$initialH,\n defaultIsOpen = _this$props2.defaultIsOpen,\n _this$props2$initialI = _this$props2.initialIsOpen,\n _isOpen = _this$props2$initialI === void 0 ? defaultIsOpen : _this$props2$initialI,\n _this$props2$initialI2 = _this$props2.initialInputValue,\n _inputValue = _this$props2$initialI2 === void 0 ? '' : _this$props2$initialI2,\n _this$props2$initialS = _this$props2.initialSelectedItem,\n _selectedItem = _this$props2$initialS === void 0 ? null : _this$props2$initialS;\n var _state = _this.getState({\n highlightedIndex: _highlightedIndex,\n isOpen: _isOpen,\n inputValue: _inputValue,\n selectedItem: _selectedItem\n });\n if (_state.selectedItem != null && _this.props.initialInputValue === undefined) {\n _state.inputValue = _this.props.itemToString(_state.selectedItem);\n }\n _this.state = _state;\n return _this;\n }\n _inheritsLoose(Downshift, _Component);\n var _proto = Downshift.prototype;\n /**\n * Clear all running timeouts\n */\n _proto.internalClearTimeouts = function internalClearTimeouts() {\n this.timeoutIds.forEach(function (id) {\n clearTimeout(id);\n });\n this.timeoutIds = [];\n }\n\n /**\n * Gets the state based on internal state or props\n * If a state value is passed via props, then that\n * is the value given, otherwise it's retrieved from\n * stateToMerge\n *\n * @param {Object} stateToMerge defaults to this.state\n * @return {Object} the state\n */;\n _proto.getState = function getState$1(stateToMerge) {\n if (stateToMerge === void 0) {\n stateToMerge = this.state;\n }\n return getState(stateToMerge, this.props);\n };\n _proto.getItemCount = function getItemCount() {\n // things read better this way. They're in priority order:\n // 1. `this.itemCount`\n // 2. `this.props.itemCount`\n // 3. `this.items.length`\n var itemCount = this.items.length;\n if (this.itemCount != null) {\n itemCount = this.itemCount;\n } else if (this.props.itemCount !== undefined) {\n itemCount = this.props.itemCount;\n }\n return itemCount;\n };\n _proto.getItemNodeFromIndex = function getItemNodeFromIndex(index) {\n return this.props.environment ? this.props.environment.document.getElementById(this.getItemId(index)) : null;\n };\n _proto.scrollHighlightedItemIntoView = function scrollHighlightedItemIntoView() {\n /* istanbul ignore else (react-native) */\n {\n var node = this.getItemNodeFromIndex(this.getState().highlightedIndex);\n this.props.scrollIntoView(node, this._menuNode);\n }\n };\n _proto.moveHighlightedIndex = function moveHighlightedIndex(amount, otherStateToSet) {\n var itemCount = this.getItemCount();\n var _this$getState8 = this.getState(),\n highlightedIndex = _this$getState8.highlightedIndex;\n if (itemCount > 0) {\n var nextHighlightedIndex = getHighlightedIndex(highlightedIndex, amount, {\n length: itemCount\n }, this.isItemDisabled, true);\n this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet);\n }\n };\n _proto.getStateAndHelpers = function getStateAndHelpers() {\n var _this$getState9 = this.getState(),\n highlightedIndex = _this$getState9.highlightedIndex,\n inputValue = _this$getState9.inputValue,\n selectedItem = _this$getState9.selectedItem,\n isOpen = _this$getState9.isOpen;\n var itemToString = this.props.itemToString;\n var id = this.id;\n var getRootProps = this.getRootProps,\n getToggleButtonProps = this.getToggleButtonProps,\n getLabelProps = this.getLabelProps,\n getMenuProps = this.getMenuProps,\n getInputProps = this.getInputProps,\n getItemProps = this.getItemProps,\n openMenu = this.openMenu,\n closeMenu = this.closeMenu,\n toggleMenu = this.toggleMenu,\n selectItem = this.selectItem,\n selectItemAtIndex = this.selectItemAtIndex,\n selectHighlightedItem = this.selectHighlightedItem,\n setHighlightedIndex = this.setHighlightedIndex,\n clearSelection = this.clearSelection,\n clearItems = this.clearItems,\n reset = this.reset,\n setItemCount = this.setItemCount,\n unsetItemCount = this.unsetItemCount,\n setState = this.internalSetState;\n return {\n // prop getters\n getRootProps: getRootProps,\n getToggleButtonProps: getToggleButtonProps,\n getLabelProps: getLabelProps,\n getMenuProps: getMenuProps,\n getInputProps: getInputProps,\n getItemProps: getItemProps,\n // actions\n reset: reset,\n openMenu: openMenu,\n closeMenu: closeMenu,\n toggleMenu: toggleMenu,\n selectItem: selectItem,\n selectItemAtIndex: selectItemAtIndex,\n selectHighlightedItem: selectHighlightedItem,\n setHighlightedIndex: setHighlightedIndex,\n clearSelection: clearSelection,\n clearItems: clearItems,\n setItemCount: setItemCount,\n unsetItemCount: unsetItemCount,\n setState: setState,\n // props\n itemToString: itemToString,\n // derived\n id: id,\n // state\n highlightedIndex: highlightedIndex,\n inputValue: inputValue,\n isOpen: isOpen,\n selectedItem: selectedItem\n };\n };\n _proto.componentDidMount = function componentDidMount() {\n var _this4 = this;\n /* istanbul ignore if (react-native) */\n if (process.env.NODE_ENV !== 'production' && true && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);\n }\n\n /* istanbul ignore if (react-native or SSR) */\n if (!this.props.environment) {\n this.cleanup = function () {\n _this4.internalClearTimeouts();\n };\n } else {\n // this.isMouseDown helps us track whether the mouse is currently held down.\n // This is useful when the user clicks on an item in the list, but holds the mouse\n // down long enough for the list to disappear (because the blur event fires on the input)\n // this.isMouseDown is used in the blur handler on the input to determine whether the blur event should\n // trigger hiding the menu.\n var onMouseDown = function onMouseDown() {\n _this4.isMouseDown = true;\n };\n var onMouseUp = function onMouseUp(event) {\n _this4.isMouseDown = false;\n // if the target element or the activeElement is within a downshift node\n // then we don't want to reset downshift\n var contextWithinDownshift = targetWithinDownshift(event.target, [_this4._rootNode, _this4._menuNode], _this4.props.environment);\n if (!contextWithinDownshift && _this4.getState().isOpen) {\n _this4.reset({\n type: mouseUp\n }, function () {\n return _this4.props.onOuterClick(_this4.getStateAndHelpers());\n });\n }\n };\n // Touching an element in iOS gives focus and hover states, but touching out of\n // the element will remove hover, and persist the focus state, resulting in the\n // blur event not being triggered.\n // this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.\n // If the user taps outside of Downshift, the component should be reset,\n // but not if the user is swiping\n var onTouchStart = function onTouchStart() {\n _this4.isTouchMove = false;\n };\n var onTouchMove = function onTouchMove() {\n _this4.isTouchMove = true;\n };\n var onTouchEnd = function onTouchEnd(event) {\n var contextWithinDownshift = targetWithinDownshift(event.target, [_this4._rootNode, _this4._menuNode], _this4.props.environment, false);\n if (!_this4.isTouchMove && !contextWithinDownshift && _this4.getState().isOpen) {\n _this4.reset({\n type: touchEnd\n }, function () {\n return _this4.props.onOuterClick(_this4.getStateAndHelpers());\n });\n }\n };\n var environment = this.props.environment;\n environment.addEventListener('mousedown', onMouseDown);\n environment.addEventListener('mouseup', onMouseUp);\n environment.addEventListener('touchstart', onTouchStart);\n environment.addEventListener('touchmove', onTouchMove);\n environment.addEventListener('touchend', onTouchEnd);\n this.cleanup = function () {\n _this4.internalClearTimeouts();\n _this4.updateStatus.cancel();\n environment.removeEventListener('mousedown', onMouseDown);\n environment.removeEventListener('mouseup', onMouseUp);\n environment.removeEventListener('touchstart', onTouchStart);\n environment.removeEventListener('touchmove', onTouchMove);\n environment.removeEventListener('touchend', onTouchEnd);\n };\n }\n };\n _proto.shouldScroll = function shouldScroll(prevState, prevProps) {\n var _ref10 = this.props.highlightedIndex === undefined ? this.getState() : this.props,\n currentHighlightedIndex = _ref10.highlightedIndex;\n var _ref11 = prevProps.highlightedIndex === undefined ? prevState : prevProps,\n prevHighlightedIndex = _ref11.highlightedIndex;\n var scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;\n var scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;\n return scrollWhenOpen || scrollWhenNavigating;\n };\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== 'production') {\n validateControlledUnchanged(this.state, prevProps, this.props);\n /* istanbul ignore if (react-native) */\n if (this.getMenuProps.called && !this.getMenuProps.suppressRefError) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);\n }\n }\n if (isControlledProp(this.props, 'selectedItem') && this.props.selectedItemChanged(prevProps.selectedItem, this.props.selectedItem)) {\n this.internalSetState({\n type: controlledPropUpdatedSelectedItem,\n inputValue: this.props.itemToString(this.props.selectedItem)\n });\n }\n if (!this.avoidScrolling && this.shouldScroll(prevState, prevProps)) {\n this.scrollHighlightedItemIntoView();\n }\n\n /* istanbul ignore else (react-native) */\n {\n this.updateStatus();\n }\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cleanup(); // avoids memory leak\n };\n _proto.render = function render() {\n var children = unwrapArray(this.props.children, noop);\n // because the items are rerendered every time we call the children\n // we clear this out each render and it will be populated again as\n // getItemProps is called.\n this.clearItems();\n // we reset this so we know whether the user calls getRootProps during\n // this render. If they do then we don't need to do anything,\n // if they don't then we need to clone the element they return and\n // apply the props for them.\n this.getRootProps.called = false;\n this.getRootProps.refKey = undefined;\n this.getRootProps.suppressRefError = undefined;\n // we do something similar for getMenuProps\n this.getMenuProps.called = false;\n this.getMenuProps.refKey = undefined;\n this.getMenuProps.suppressRefError = undefined;\n // we do something similar for getLabelProps\n this.getLabelProps.called = false;\n // and something similar for getInputProps\n this.getInputProps.called = false;\n var element = unwrapArray(children(this.getStateAndHelpers()));\n if (!element) {\n return null;\n }\n if (this.getRootProps.called || this.props.suppressRefError) {\n if (process.env.NODE_ENV !== 'production' && !this.getRootProps.suppressRefError && !this.props.suppressRefError) {\n validateGetRootPropsCalledCorrectly(element, this.getRootProps);\n }\n return element;\n } else if (isDOMElement(element)) {\n // they didn't apply the root props, but we can clone\n // this and apply the props ourselves\n return /*#__PURE__*/cloneElement(element, this.getRootProps(getElementProps(element)));\n }\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== 'production') {\n // they didn't apply the root props, but they need to\n // otherwise we can't query around the autocomplete\n\n throw new Error('downshift: If you return a non-DOM element, you must apply the getRootProps function');\n }\n\n /* istanbul ignore next */\n return undefined;\n };\n return Downshift;\n }(Component);\n Downshift.defaultProps = {\n defaultHighlightedIndex: null,\n defaultIsOpen: false,\n getA11yStatusMessage: getA11yStatusMessage,\n itemToString: function itemToString(i) {\n if (i == null) {\n return '';\n }\n if (process.env.NODE_ENV !== 'production' && isPlainObject(i) && !i.hasOwnProperty('toString')) {\n // eslint-disable-next-line no-console\n console.warn('downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.', 'The object that was passed:', i);\n }\n return String(i);\n },\n onStateChange: noop,\n onInputValueChange: noop,\n onUserAction: noop,\n onChange: noop,\n onSelect: noop,\n onOuterClick: noop,\n selectedItemChanged: function selectedItemChanged(prevItem, item) {\n return prevItem !== item;\n },\n environment: /* istanbul ignore next (ssr) */\n typeof window === 'undefined' || false ? undefined : window,\n stateReducer: function stateReducer(state, stateToSet) {\n return stateToSet;\n },\n suppressRefError: false,\n scrollIntoView: scrollIntoView\n };\n Downshift.stateChangeTypes = stateChangeTypes$3;\n return Downshift;\n}();\nprocess.env.NODE_ENV !== \"production\" ? Downshift.propTypes = {\n children: PropTypes.func,\n defaultHighlightedIndex: PropTypes.number,\n defaultIsOpen: PropTypes.bool,\n initialHighlightedIndex: PropTypes.number,\n initialSelectedItem: PropTypes.any,\n initialInputValue: PropTypes.string,\n initialIsOpen: PropTypes.bool,\n getA11yStatusMessage: PropTypes.func,\n itemToString: PropTypes.func,\n onChange: PropTypes.func,\n onSelect: PropTypes.func,\n onStateChange: PropTypes.func,\n onInputValueChange: PropTypes.func,\n onUserAction: PropTypes.func,\n onOuterClick: PropTypes.func,\n selectedItemChanged: PropTypes.func,\n stateReducer: PropTypes.func,\n itemCount: PropTypes.number,\n id: PropTypes.string,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func.isRequired,\n removeEventListener: PropTypes.func.isRequired,\n document: PropTypes.shape({\n createElement: PropTypes.func.isRequired,\n getElementById: PropTypes.func.isRequired,\n activeElement: PropTypes.any.isRequired,\n body: PropTypes.any.isRequired\n }).isRequired,\n Node: PropTypes.func.isRequired\n }),\n suppressRefError: PropTypes.bool,\n scrollIntoView: PropTypes.func,\n // things we keep in state for uncontrolled components\n // but can accept as props for controlled components\n /* eslint-disable react/no-unused-prop-types */\n selectedItem: PropTypes.any,\n isOpen: PropTypes.bool,\n inputValue: PropTypes.string,\n highlightedIndex: PropTypes.number,\n labelId: PropTypes.string,\n inputId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func\n /* eslint-enable react/no-unused-prop-types */\n} : void 0;\nfunction validateGetMenuPropsCalledCorrectly(node, _ref12) {\n var refKey = _ref12.refKey;\n if (!node) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: The ref prop \\\"\" + refKey + \"\\\" from getMenuProps was not applied correctly on your menu element.\");\n }\n}\nfunction validateGetRootPropsCalledCorrectly(element, _ref13) {\n var refKey = _ref13.refKey;\n var refKeySpecified = refKey !== 'ref';\n var isComposite = !isDOMElement(element);\n if (isComposite && !refKeySpecified && !isForwardRef(element)) {\n // eslint-disable-next-line no-console\n console.error('downshift: You returned a non-DOM element. You must specify a refKey in getRootProps');\n } else if (!isComposite && refKeySpecified) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \\\"\" + refKey + \"\\\"\");\n }\n if (!isForwardRef(element) && !getElementProps(element)[refKey]) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: You must apply the ref prop \\\"\" + refKey + \"\\\" from getRootProps onto your root element.\");\n }\n}\n\nvar dropdownDefaultStateValues = {\n highlightedIndex: -1,\n isOpen: false,\n selectedItem: null,\n inputValue: ''\n};\nfunction callOnChangeProps(action, state, newState) {\n var props = action.props,\n type = action.type;\n var changes = {};\n Object.keys(state).forEach(function (key) {\n invokeOnChangeHandler(key, action, state, newState);\n if (newState[key] !== state[key]) {\n changes[key] = newState[key];\n }\n });\n if (props.onStateChange && Object.keys(changes).length) {\n props.onStateChange(_extends({\n type: type\n }, changes));\n }\n}\nfunction invokeOnChangeHandler(key, action, state, newState) {\n var props = action.props,\n type = action.type;\n var handler = \"on\" + capitalizeString(key) + \"Change\";\n if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) {\n props[handler](_extends({\n type: type\n }, newState));\n }\n}\n\n/**\n * Default state reducer that returns the changes.\n *\n * @param {Object} s state.\n * @param {Object} a action with changes.\n * @returns {Object} changes.\n */\nfunction stateReducer(s, a) {\n return a.changes;\n}\n\n/**\n * Debounced call for updating the a11y message.\n */\nvar updateA11yStatus = debounce(function (status, document) {\n setStatus(status, document);\n}, 200);\n\n// istanbul ignore next\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;\n\n// istanbul ignore next\nvar useElementIds = 'useId' in React // Avoid conditional useId call\n? function useElementIds(_ref) {\n var id = _ref.id,\n labelId = _ref.labelId,\n menuId = _ref.menuId,\n getItemId = _ref.getItemId,\n toggleButtonId = _ref.toggleButtonId,\n inputId = _ref.inputId;\n // Avoid conditional useId call\n var reactId = \"downshift-\" + React.useId();\n if (!id) {\n id = reactId;\n }\n var elementIdsRef = useRef({\n labelId: labelId || id + \"-label\",\n menuId: menuId || id + \"-menu\",\n getItemId: getItemId || function (index) {\n return id + \"-item-\" + index;\n },\n toggleButtonId: toggleButtonId || id + \"-toggle-button\",\n inputId: inputId || id + \"-input\"\n });\n return elementIdsRef.current;\n} : function useElementIds(_ref2) {\n var _ref2$id = _ref2.id,\n id = _ref2$id === void 0 ? \"downshift-\" + generateId() : _ref2$id,\n labelId = _ref2.labelId,\n menuId = _ref2.menuId,\n getItemId = _ref2.getItemId,\n toggleButtonId = _ref2.toggleButtonId,\n inputId = _ref2.inputId;\n var elementIdsRef = useRef({\n labelId: labelId || id + \"-label\",\n menuId: menuId || id + \"-menu\",\n getItemId: getItemId || function (index) {\n return id + \"-item-\" + index;\n },\n toggleButtonId: toggleButtonId || id + \"-toggle-button\",\n inputId: inputId || id + \"-input\"\n });\n return elementIdsRef.current;\n};\nfunction getItemAndIndex(itemProp, indexProp, items, errorMessage) {\n var item, index;\n if (itemProp === undefined) {\n if (indexProp === undefined) {\n throw new Error(errorMessage);\n }\n item = items[indexProp];\n index = indexProp;\n } else {\n index = indexProp === undefined ? items.indexOf(itemProp) : indexProp;\n item = itemProp;\n }\n return [item, index];\n}\nfunction isAcceptedCharacterKey(key) {\n return /^\\S{1}$/.test(key);\n}\nfunction capitalizeString(string) {\n return \"\" + string.slice(0, 1).toUpperCase() + string.slice(1);\n}\nfunction useLatestRef(val) {\n var ref = useRef(val);\n // technically this is not \"concurrent mode safe\" because we're manipulating\n // the value during render (so it's not idempotent). However, the places this\n // hook is used is to support memoizing callbacks which will be called\n // *during* render, so we need the latest values *during* render.\n // If not for this, then we'd probably want to use useLayoutEffect instead.\n ref.current = val;\n return ref;\n}\n\n/**\n * Computes the controlled state using a the previous state, props,\n * two reducers, one from downshift and an optional one from the user.\n * Also calls the onChange handlers for state values that have changed.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} props The hook props, also passed to createInitialState.\n * @param {Function} createInitialState Function that returns the initial state.\n * @param {Function} isStateEqual Function that checks if a previous state is equal to the next.\n * @returns {Array} An array with the state and an action dispatcher.\n */\nfunction useEnhancedReducer(reducer, props, createInitialState, isStateEqual) {\n var prevStateRef = useRef();\n var actionRef = useRef();\n var enhancedReducer = useCallback(function (state, action) {\n actionRef.current = action;\n state = getState(state, action.props);\n var changes = reducer(state, action);\n var newState = action.props.stateReducer(state, _extends({}, action, {\n changes: changes\n }));\n return newState;\n }, [reducer]);\n var _useReducer = useReducer(enhancedReducer, props, createInitialState),\n state = _useReducer[0],\n dispatch = _useReducer[1];\n var propsRef = useLatestRef(props);\n var dispatchWithProps = useCallback(function (action) {\n return dispatch(_extends({\n props: propsRef.current\n }, action));\n }, [propsRef]);\n var action = actionRef.current;\n useEffect(function () {\n var prevState = getState(prevStateRef.current, action == null ? void 0 : action.props);\n var shouldCallOnChangeProps = action && prevStateRef.current && !isStateEqual(prevState, state);\n if (shouldCallOnChangeProps) {\n callOnChangeProps(action, prevState, state);\n }\n prevStateRef.current = state;\n }, [state, action, isStateEqual]);\n return [state, dispatchWithProps];\n}\n\n/**\n * Wraps the useEnhancedReducer and applies the controlled prop values before\n * returning the new state.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} props The hook props, also passed to createInitialState.\n * @param {Function} createInitialState Function that returns the initial state.\n * @param {Function} isStateEqual Function that checks if a previous state is equal to the next.\n * @returns {Array} An array with the state and an action dispatcher.\n */\nfunction useControlledReducer$1(reducer, props, createInitialState, isStateEqual) {\n var _useEnhancedReducer = useEnhancedReducer(reducer, props, createInitialState, isStateEqual),\n state = _useEnhancedReducer[0],\n dispatch = _useEnhancedReducer[1];\n return [getState(state, props), dispatch];\n}\nvar defaultProps$3 = {\n itemToString: function itemToString(item) {\n return item ? String(item) : '';\n },\n itemToKey: function itemToKey(item) {\n return item;\n },\n stateReducer: stateReducer,\n scrollIntoView: scrollIntoView,\n environment: /* istanbul ignore next (ssr) */\n typeof window === 'undefined' || false ? undefined : window\n};\nfunction getDefaultValue$1(props, propKey, defaultStateValues) {\n if (defaultStateValues === void 0) {\n defaultStateValues = dropdownDefaultStateValues;\n }\n var defaultValue = props[\"default\" + capitalizeString(propKey)];\n if (defaultValue !== undefined) {\n return defaultValue;\n }\n return defaultStateValues[propKey];\n}\nfunction getInitialValue$1(props, propKey, defaultStateValues) {\n if (defaultStateValues === void 0) {\n defaultStateValues = dropdownDefaultStateValues;\n }\n var value = props[propKey];\n if (value !== undefined) {\n return value;\n }\n var initialValue = props[\"initial\" + capitalizeString(propKey)];\n if (initialValue !== undefined) {\n return initialValue;\n }\n return getDefaultValue$1(props, propKey, defaultStateValues);\n}\nfunction getInitialState$2(props) {\n var selectedItem = getInitialValue$1(props, 'selectedItem');\n var isOpen = getInitialValue$1(props, 'isOpen');\n var highlightedIndex = getInitialHighlightedIndex(props);\n var inputValue = getInitialValue$1(props, 'inputValue');\n return {\n highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.findIndex(function (item) {\n return props.itemToKey(item) === props.itemToKey(selectedItem);\n }) : highlightedIndex,\n isOpen: isOpen,\n selectedItem: selectedItem,\n inputValue: inputValue\n };\n}\nfunction getHighlightedIndexOnOpen(props, state, offset) {\n var items = props.items,\n initialHighlightedIndex = props.initialHighlightedIndex,\n defaultHighlightedIndex = props.defaultHighlightedIndex,\n isItemDisabled = props.isItemDisabled,\n itemToKey = props.itemToKey;\n var selectedItem = state.selectedItem,\n highlightedIndex = state.highlightedIndex;\n if (items.length === 0) {\n return -1;\n }\n\n // initialHighlightedIndex will give value to highlightedIndex on initial state only.\n if (initialHighlightedIndex !== undefined && highlightedIndex === initialHighlightedIndex && !isItemDisabled(items[initialHighlightedIndex], initialHighlightedIndex)) {\n return initialHighlightedIndex;\n }\n if (defaultHighlightedIndex !== undefined && !isItemDisabled(items[defaultHighlightedIndex], defaultHighlightedIndex)) {\n return defaultHighlightedIndex;\n }\n if (selectedItem) {\n return items.findIndex(function (item) {\n return itemToKey(selectedItem) === itemToKey(item);\n });\n }\n if (offset < 0 && !isItemDisabled(items[items.length - 1], items.length - 1)) {\n return items.length - 1;\n }\n if (offset > 0 && !isItemDisabled(items[0], 0)) {\n return 0;\n }\n return -1;\n}\n/**\n * Tracks mouse and touch events, such as mouseDown, touchMove and touchEnd.\n *\n * @param {Window} environment The environment to add the event listeners to, for instance window.\n * @param {() => void} handleBlur The function that is called if mouseDown or touchEnd occured outside the downshiftElements.\n * @param {Array<{current: HTMLElement}>} downshiftElementsRefs The refs for the elements that should not trigger a blur action from mouseDown or touchEnd.\n * @returns {{isMouseDown: boolean, isTouchMove: boolean, isTouchEnd: boolean}} The mouse and touch events information, if any of are happening.\n */\nfunction useMouseAndTouchTracker(environment, handleBlur, downshiftElementsRefs) {\n var mouseAndTouchTrackersRef = useRef({\n isMouseDown: false,\n isTouchMove: false,\n isTouchEnd: false\n });\n useEffect(function () {\n if (!environment) {\n return noop;\n }\n var downshiftElements = downshiftElementsRefs.map(function (ref) {\n return ref.current;\n });\n function onMouseDown() {\n mouseAndTouchTrackersRef.current.isTouchEnd = false; // reset this one.\n mouseAndTouchTrackersRef.current.isMouseDown = true;\n }\n function onMouseUp(event) {\n mouseAndTouchTrackersRef.current.isMouseDown = false;\n if (!targetWithinDownshift(event.target, downshiftElements, environment)) {\n handleBlur();\n }\n }\n function onTouchStart() {\n mouseAndTouchTrackersRef.current.isTouchEnd = false;\n mouseAndTouchTrackersRef.current.isTouchMove = false;\n }\n function onTouchMove() {\n mouseAndTouchTrackersRef.current.isTouchMove = true;\n }\n function onTouchEnd(event) {\n mouseAndTouchTrackersRef.current.isTouchEnd = true;\n if (!mouseAndTouchTrackersRef.current.isTouchMove && !targetWithinDownshift(event.target, downshiftElements, environment, false)) {\n handleBlur();\n }\n }\n environment.addEventListener('mousedown', onMouseDown);\n environment.addEventListener('mouseup', onMouseUp);\n environment.addEventListener('touchstart', onTouchStart);\n environment.addEventListener('touchmove', onTouchMove);\n environment.addEventListener('touchend', onTouchEnd);\n return function cleanup() {\n environment.removeEventListener('mousedown', onMouseDown);\n environment.removeEventListener('mouseup', onMouseUp);\n environment.removeEventListener('touchstart', onTouchStart);\n environment.removeEventListener('touchmove', onTouchMove);\n environment.removeEventListener('touchend', onTouchEnd);\n };\n }, [downshiftElementsRefs, environment, handleBlur]);\n return mouseAndTouchTrackersRef.current;\n}\n\n/* istanbul ignore next */\n// eslint-disable-next-line import/no-mutable-exports\nvar useGetterPropsCalledChecker = function useGetterPropsCalledChecker() {\n return noop;\n};\n/**\n * Custom hook that checks if getter props are called correctly.\n *\n * @param {...any} propKeys Getter prop names to be handled.\n * @returns {Function} Setter function called inside getter props to set call information.\n */\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n useGetterPropsCalledChecker = function useGetterPropsCalledChecker() {\n for (var _len = arguments.length, propKeys = new Array(_len), _key = 0; _key < _len; _key++) {\n propKeys[_key] = arguments[_key];\n }\n var getterPropsCalledRef = useRef(propKeys.reduce(function (acc, propKey) {\n acc[propKey] = {};\n return acc;\n }, {}));\n useEffect(function () {\n Object.keys(getterPropsCalledRef.current).forEach(function (propKey) {\n var propCallInfo = getterPropsCalledRef.current[propKey];\n if (!Object.keys(propCallInfo).length) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: You forgot to call the \" + propKey + \" getter function on your component / element.\");\n return;\n }\n var suppressRefError = propCallInfo.suppressRefError,\n refKey = propCallInfo.refKey,\n elementRef = propCallInfo.elementRef;\n if (suppressRefError) {\n return;\n }\n if (!(elementRef != null && elementRef.current)) {\n // eslint-disable-next-line no-console\n console.error(\"downshift: The ref prop \\\"\" + refKey + \"\\\" from \" + propKey + \" was not applied correctly on your element.\");\n }\n });\n }, []);\n var setGetterPropCallInfo = useCallback(function (propKey, suppressRefError, refKey, elementRef) {\n getterPropsCalledRef.current[propKey] = {\n suppressRefError: suppressRefError,\n refKey: refKey,\n elementRef: elementRef\n };\n }, []);\n return setGetterPropCallInfo;\n };\n}\n\n/**\n * Adds an a11y aria live status message if getA11yStatusMessage is passed.\n * @param {(options: Object) => string} getA11yStatusMessage The function that builds the status message.\n * @param {Object} options The options to be passed to getA11yStatusMessage if called.\n * @param {Array} dependencyArray The dependency array that triggers the status message setter via useEffect.\n * @param {{document: Document}} environment The environment object containing the document.\n */\nfunction useA11yMessageStatus(getA11yStatusMessage, options, dependencyArray, environment) {\n if (environment === void 0) {\n environment = {};\n }\n var document = environment.document;\n var isInitialMount = useIsInitialMount();\n\n // Adds an a11y aria live status message if getA11yStatusMessage is passed.\n useEffect(function () {\n if (!getA11yStatusMessage || isInitialMount || false || !document) {\n return;\n }\n var status = getA11yStatusMessage(options);\n updateA11yStatus(status, document);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencyArray);\n\n // Cleanup the status message container.\n useEffect(function () {\n return function () {\n updateA11yStatus.cancel();\n cleanupStatusDiv(document);\n };\n }, [document]);\n}\nfunction useScrollIntoView(_ref3) {\n var highlightedIndex = _ref3.highlightedIndex,\n isOpen = _ref3.isOpen,\n itemRefs = _ref3.itemRefs,\n getItemNodeFromIndex = _ref3.getItemNodeFromIndex,\n menuElement = _ref3.menuElement,\n scrollIntoViewProp = _ref3.scrollIntoView;\n // used not to scroll on highlight by mouse.\n var shouldScrollRef = useRef(true);\n // Scroll on highlighted item if change comes from keyboard.\n useIsomorphicLayoutEffect(function () {\n if (highlightedIndex < 0 || !isOpen || !Object.keys(itemRefs.current).length) {\n return;\n }\n if (shouldScrollRef.current === false) {\n shouldScrollRef.current = true;\n } else {\n scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex), menuElement);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [highlightedIndex]);\n return shouldScrollRef;\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nvar useControlPropsValidator = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n useControlPropsValidator = function useControlPropsValidator(_ref4) {\n var props = _ref4.props,\n state = _ref4.state;\n // used for checking when props are moving from controlled to uncontrolled.\n var prevPropsRef = useRef(props);\n var isInitialMount = useIsInitialMount();\n useEffect(function () {\n if (isInitialMount) {\n return;\n }\n validateControlledUnchanged(state, prevPropsRef.current, props);\n prevPropsRef.current = props;\n }, [state, props, isInitialMount]);\n };\n}\n\n/**\n * Handles selection on Enter / Alt + ArrowUp. Closes the menu and resets the highlighted index, unless there is a highlighted.\n * In that case, selects the item and resets to defaults for open state and highlighted idex.\n * @param {Object} props The useCombobox props.\n * @param {number} highlightedIndex The index from the state.\n * @param {boolean} inputValue Also return the input value for state.\n * @returns The changes for the state.\n */\nfunction getChangesOnSelection(props, highlightedIndex, inputValue) {\n var _props$items;\n if (inputValue === void 0) {\n inputValue = true;\n }\n var shouldSelect = ((_props$items = props.items) == null ? void 0 : _props$items.length) && highlightedIndex >= 0;\n return _extends({\n isOpen: false,\n highlightedIndex: -1\n }, shouldSelect && _extends({\n selectedItem: props.items[highlightedIndex],\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex')\n }, inputValue && {\n inputValue: props.itemToString(props.items[highlightedIndex])\n }));\n}\n\n/**\n * Check if a state is equal for dropdowns, by comparing isOpen, inputValue, highlightedIndex and selected item.\n * Used by useSelect and useCombobox.\n *\n * @param {Object} prevState\n * @param {Object} newState\n * @returns {boolean} Wheather the states are deeply equal.\n */\nfunction isDropdownsStateEqual(prevState, newState) {\n return prevState.isOpen === newState.isOpen && prevState.inputValue === newState.inputValue && prevState.highlightedIndex === newState.highlightedIndex && prevState.selectedItem === newState.selectedItem;\n}\n\n/**\n * Tracks if it's the first render.\n */\nfunction useIsInitialMount() {\n var isInitialMountRef = React.useRef(true);\n React.useEffect(function () {\n isInitialMountRef.current = false;\n return function () {\n isInitialMountRef.current = true;\n };\n }, []);\n return isInitialMountRef.current;\n}\n\n/**\n * Returns the new highlightedIndex based on the defaultHighlightedIndex prop, if it's not disabled.\n *\n * @param {Object} props Props from useCombobox or useSelect.\n * @returns {number} The highlighted index.\n */\nfunction getDefaultHighlightedIndex(props) {\n var highlightedIndex = getDefaultValue$1(props, 'highlightedIndex');\n if (highlightedIndex > -1 && props.isItemDisabled(props.items[highlightedIndex], highlightedIndex)) {\n return -1;\n }\n return highlightedIndex;\n}\n\n/**\n * Returns the new highlightedIndex based on the initialHighlightedIndex prop, if not disabled.\n *\n * @param {Object} props Props from useCombobox or useSelect.\n * @returns {number} The highlighted index.\n */\nfunction getInitialHighlightedIndex(props) {\n var highlightedIndex = getInitialValue$1(props, 'highlightedIndex');\n if (highlightedIndex > -1 && props.isItemDisabled(props.items[highlightedIndex], highlightedIndex)) {\n return -1;\n }\n return highlightedIndex;\n}\n\n// Shared between all exports.\nvar commonPropTypes = {\n environment: PropTypes.shape({\n addEventListener: PropTypes.func.isRequired,\n removeEventListener: PropTypes.func.isRequired,\n document: PropTypes.shape({\n createElement: PropTypes.func.isRequired,\n getElementById: PropTypes.func.isRequired,\n activeElement: PropTypes.any.isRequired,\n body: PropTypes.any.isRequired\n }).isRequired,\n Node: PropTypes.func.isRequired\n }),\n itemToString: PropTypes.func,\n itemToKey: PropTypes.func,\n stateReducer: PropTypes.func\n};\n\n// Shared between useSelect, useCombobox, Downshift.\nvar commonDropdownPropTypes = _extends({}, commonPropTypes, {\n getA11yStatusMessage: PropTypes.func,\n highlightedIndex: PropTypes.number,\n defaultHighlightedIndex: PropTypes.number,\n initialHighlightedIndex: PropTypes.number,\n isOpen: PropTypes.bool,\n defaultIsOpen: PropTypes.bool,\n initialIsOpen: PropTypes.bool,\n selectedItem: PropTypes.any,\n initialSelectedItem: PropTypes.any,\n defaultSelectedItem: PropTypes.any,\n id: PropTypes.string,\n labelId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func,\n toggleButtonId: PropTypes.string,\n onSelectedItemChange: PropTypes.func,\n onHighlightedIndexChange: PropTypes.func,\n onStateChange: PropTypes.func,\n onIsOpenChange: PropTypes.func,\n scrollIntoView: PropTypes.func\n});\n\nfunction downshiftCommonReducer(state, action, stateChangeTypes) {\n var type = action.type,\n props = action.props;\n var changes;\n switch (type) {\n case stateChangeTypes.ItemMouseMove:\n changes = {\n highlightedIndex: action.disabled ? -1 : action.index\n };\n break;\n case stateChangeTypes.MenuMouseLeave:\n changes = {\n highlightedIndex: -1\n };\n break;\n case stateChangeTypes.ToggleButtonClick:\n case stateChangeTypes.FunctionToggleMenu:\n changes = {\n isOpen: !state.isOpen,\n highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n case stateChangeTypes.FunctionOpenMenu:\n changes = {\n isOpen: true,\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n case stateChangeTypes.FunctionCloseMenu:\n changes = {\n isOpen: false\n };\n break;\n case stateChangeTypes.FunctionSetHighlightedIndex:\n changes = {\n highlightedIndex: props.isItemDisabled(props.items[action.highlightedIndex], action.highlightedIndex) ? -1 : action.highlightedIndex\n };\n break;\n case stateChangeTypes.FunctionSetInputValue:\n changes = {\n inputValue: action.inputValue\n };\n break;\n case stateChangeTypes.FunctionReset:\n changes = {\n highlightedIndex: getDefaultHighlightedIndex(props),\n isOpen: getDefaultValue$1(props, 'isOpen'),\n selectedItem: getDefaultValue$1(props, 'selectedItem'),\n inputValue: getDefaultValue$1(props, 'inputValue')\n };\n break;\n default:\n throw new Error('Reducer called without proper action type.');\n }\n return _extends({}, state, changes);\n}\n/* eslint-enable complexity */\n\nfunction getItemIndexByCharacterKey(_a) {\n var keysSoFar = _a.keysSoFar, highlightedIndex = _a.highlightedIndex, items = _a.items, itemToString = _a.itemToString, isItemDisabled = _a.isItemDisabled;\n var lowerCasedKeysSoFar = keysSoFar.toLowerCase();\n for (var index = 0; index < items.length; index++) {\n // if we already have a search query in progress, we also consider the current highlighted item.\n var offsetIndex = (index + highlightedIndex + (keysSoFar.length < 2 ? 1 : 0)) % items.length;\n var item = items[offsetIndex];\n if (item !== undefined &&\n itemToString(item).toLowerCase().startsWith(lowerCasedKeysSoFar) &&\n !isItemDisabled(item, offsetIndex)) {\n return offsetIndex;\n }\n }\n return highlightedIndex;\n}\nvar propTypes$2 = __assign(__assign({}, commonDropdownPropTypes), { items: PropTypes.array.isRequired, isItemDisabled: PropTypes.func });\nvar defaultProps$2 = __assign(__assign({}, defaultProps$3), { isItemDisabled: function () {\n return false;\n } });\n// eslint-disable-next-line import/no-mutable-exports\nvar validatePropTypes$2 = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes$2 = function (options, caller) {\n PropTypes.checkPropTypes(propTypes$2, options, 'prop', caller.name);\n };\n}\n\nvar ToggleButtonClick$1 = process.env.NODE_ENV !== \"production\" ? '__togglebutton_click__' : 0;\nvar ToggleButtonKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_arrow_down__' : 1;\nvar ToggleButtonKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_arrow_up__' : 2;\nvar ToggleButtonKeyDownCharacter = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_character__' : 3;\nvar ToggleButtonKeyDownEscape = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_escape__' : 4;\nvar ToggleButtonKeyDownHome = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_home__' : 5;\nvar ToggleButtonKeyDownEnd = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_end__' : 6;\nvar ToggleButtonKeyDownEnter = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_enter__' : 7;\nvar ToggleButtonKeyDownSpaceButton = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_space_button__' : 8;\nvar ToggleButtonKeyDownPageUp = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_page_up__' : 9;\nvar ToggleButtonKeyDownPageDown = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_page_down__' : 10;\nvar ToggleButtonBlur = process.env.NODE_ENV !== \"production\" ? '__togglebutton_blur__' : 11;\nvar MenuMouseLeave$1 = process.env.NODE_ENV !== \"production\" ? '__menu_mouse_leave__' : 12;\nvar ItemMouseMove$1 = process.env.NODE_ENV !== \"production\" ? '__item_mouse_move__' : 13;\nvar ItemClick$1 = process.env.NODE_ENV !== \"production\" ? '__item_click__' : 14;\nvar FunctionToggleMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_toggle_menu__' : 15;\nvar FunctionOpenMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_open_menu__' : 16;\nvar FunctionCloseMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_close_menu__' : 17;\nvar FunctionSetHighlightedIndex$1 = process.env.NODE_ENV !== \"production\" ? '__function_set_highlighted_index__' : 18;\nvar FunctionSelectItem$1 = process.env.NODE_ENV !== \"production\" ? '__function_select_item__' : 19;\nvar FunctionSetInputValue$1 = process.env.NODE_ENV !== \"production\" ? '__function_set_input_value__' : 20;\nvar FunctionReset$2 = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 21;\n\nvar stateChangeTypes$2 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n FunctionCloseMenu: FunctionCloseMenu$1,\n FunctionOpenMenu: FunctionOpenMenu$1,\n FunctionReset: FunctionReset$2,\n FunctionSelectItem: FunctionSelectItem$1,\n FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,\n FunctionSetInputValue: FunctionSetInputValue$1,\n FunctionToggleMenu: FunctionToggleMenu$1,\n ItemClick: ItemClick$1,\n ItemMouseMove: ItemMouseMove$1,\n MenuMouseLeave: MenuMouseLeave$1,\n ToggleButtonBlur: ToggleButtonBlur,\n ToggleButtonClick: ToggleButtonClick$1,\n ToggleButtonKeyDownArrowDown: ToggleButtonKeyDownArrowDown,\n ToggleButtonKeyDownArrowUp: ToggleButtonKeyDownArrowUp,\n ToggleButtonKeyDownCharacter: ToggleButtonKeyDownCharacter,\n ToggleButtonKeyDownEnd: ToggleButtonKeyDownEnd,\n ToggleButtonKeyDownEnter: ToggleButtonKeyDownEnter,\n ToggleButtonKeyDownEscape: ToggleButtonKeyDownEscape,\n ToggleButtonKeyDownHome: ToggleButtonKeyDownHome,\n ToggleButtonKeyDownPageDown: ToggleButtonKeyDownPageDown,\n ToggleButtonKeyDownPageUp: ToggleButtonKeyDownPageUp,\n ToggleButtonKeyDownSpaceButton: ToggleButtonKeyDownSpaceButton\n});\n\n/* eslint-disable complexity */\nfunction downshiftSelectReducer(state, action) {\n var _props$items;\n var type = action.type,\n props = action.props,\n altKey = action.altKey;\n var changes;\n switch (type) {\n case ItemClick$1:\n changes = {\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultHighlightedIndex(props),\n selectedItem: props.items[action.index]\n };\n break;\n case ToggleButtonKeyDownCharacter:\n {\n var lowercasedKey = action.key;\n var inputValue = \"\" + state.inputValue + lowercasedKey;\n var prevHighlightedIndex = !state.isOpen && state.selectedItem ? props.items.findIndex(function (item) {\n return props.itemToKey(item) === props.itemToKey(state.selectedItem);\n }) : state.highlightedIndex;\n var highlightedIndex = getItemIndexByCharacterKey({\n keysSoFar: inputValue,\n highlightedIndex: prevHighlightedIndex,\n items: props.items,\n itemToString: props.itemToString,\n isItemDisabled: props.isItemDisabled\n });\n changes = {\n inputValue: inputValue,\n highlightedIndex: highlightedIndex,\n isOpen: true\n };\n }\n break;\n case ToggleButtonKeyDownArrowDown:\n {\n var _highlightedIndex = state.isOpen ? getHighlightedIndex(state.highlightedIndex, 1, props.items, props.isItemDisabled) : altKey && state.selectedItem == null ? -1 : getHighlightedIndexOnOpen(props, state, 1);\n changes = {\n highlightedIndex: _highlightedIndex,\n isOpen: true\n };\n }\n break;\n case ToggleButtonKeyDownArrowUp:\n if (state.isOpen && altKey) {\n changes = getChangesOnSelection(props, state.highlightedIndex, false);\n } else {\n var _highlightedIndex2 = state.isOpen ? getHighlightedIndex(state.highlightedIndex, -1, props.items, props.isItemDisabled) : getHighlightedIndexOnOpen(props, state, -1);\n changes = {\n highlightedIndex: _highlightedIndex2,\n isOpen: true\n };\n }\n break;\n // only triggered when menu is open.\n case ToggleButtonKeyDownEnter:\n case ToggleButtonKeyDownSpaceButton:\n changes = getChangesOnSelection(props, state.highlightedIndex, false);\n break;\n case ToggleButtonKeyDownHome:\n changes = {\n highlightedIndex: getNonDisabledIndex(0, false, props.items, props.isItemDisabled),\n isOpen: true\n };\n break;\n case ToggleButtonKeyDownEnd:\n changes = {\n highlightedIndex: getNonDisabledIndex(props.items.length - 1, true, props.items, props.isItemDisabled),\n isOpen: true\n };\n break;\n case ToggleButtonKeyDownPageUp:\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, -10, props.items, props.isItemDisabled)\n };\n break;\n case ToggleButtonKeyDownPageDown:\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, 10, props.items, props.isItemDisabled)\n };\n break;\n case ToggleButtonKeyDownEscape:\n changes = {\n isOpen: false,\n highlightedIndex: -1\n };\n break;\n case ToggleButtonBlur:\n changes = _extends({\n isOpen: false,\n highlightedIndex: -1\n }, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && {\n selectedItem: props.items[state.highlightedIndex]\n });\n break;\n case FunctionSelectItem$1:\n changes = {\n selectedItem: action.selectedItem\n };\n break;\n default:\n return downshiftCommonReducer(state, action, stateChangeTypes$2);\n }\n return _extends({}, state, changes);\n}\n/* eslint-enable complexity */\n\nvar _excluded$2 = [\"onClick\"],\n _excluded2$2 = [\"onMouseLeave\", \"refKey\", \"ref\"],\n _excluded3$1 = [\"onBlur\", \"onClick\", \"onPress\", \"onKeyDown\", \"refKey\", \"ref\"],\n _excluded4$1 = [\"item\", \"index\", \"onMouseMove\", \"onClick\", \"onMouseDown\", \"onPress\", \"refKey\", \"disabled\", \"ref\"];\nuseSelect.stateChangeTypes = stateChangeTypes$2;\nfunction useSelect(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n validatePropTypes$2(userProps, useSelect);\n // Props defaults and destructuring.\n var props = _extends({}, defaultProps$2, userProps);\n var scrollIntoView = props.scrollIntoView,\n environment = props.environment,\n getA11yStatusMessage = props.getA11yStatusMessage;\n // Initial state depending on controlled props.\n var _useControlledReducer = useControlledReducer$1(downshiftSelectReducer, props, getInitialState$2, isDropdownsStateEqual),\n state = _useControlledReducer[0],\n dispatch = _useControlledReducer[1];\n var isOpen = state.isOpen,\n highlightedIndex = state.highlightedIndex,\n selectedItem = state.selectedItem,\n inputValue = state.inputValue;\n // Element efs.\n var toggleButtonRef = useRef(null);\n var menuRef = useRef(null);\n var itemRefs = useRef({});\n\n // used to keep the inputValue clearTimeout object between renders.\n var clearTimeoutRef = useRef(null);\n // prevent id re-generation between renders.\n var elementIds = useElementIds(props);\n // utility callback to get item element.\n var latest = useLatestRef({\n state: state,\n props: props\n });\n\n // Some utils.\n var getItemNodeFromIndex = useCallback(function (index) {\n return itemRefs.current[elementIds.getItemId(index)];\n }, [elementIds]);\n\n // Effects.\n // Adds an a11y aria live status message if getA11yStatusMessage is passed.\n useA11yMessageStatus(getA11yStatusMessage, state, [isOpen, highlightedIndex, selectedItem, inputValue], environment);\n // Scroll on highlighted item if change comes from keyboard.\n var shouldScrollRef = useScrollIntoView({\n menuElement: menuRef.current,\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n itemRefs: itemRefs,\n scrollIntoView: scrollIntoView,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n // Sets cleanup for the keysSoFar callback, debounded after 500ms.\n useEffect(function () {\n // init the clean function here as we need access to dispatch.\n clearTimeoutRef.current = debounce(function (outerDispatch) {\n outerDispatch({\n type: FunctionSetInputValue$1,\n inputValue: ''\n });\n }, 500);\n\n // Cancel any pending debounced calls on mount\n return function () {\n clearTimeoutRef.current.cancel();\n };\n }, []);\n // Invokes the keysSoFar callback set up above.\n useEffect(function () {\n if (!inputValue) {\n return;\n }\n clearTimeoutRef.current(dispatch);\n }, [dispatch, inputValue]);\n useControlPropsValidator({\n props: props,\n state: state\n });\n // Focus the toggle button on first render if required.\n useEffect(function () {\n var focusOnOpen = getInitialValue$1(props, 'isOpen');\n if (focusOnOpen && toggleButtonRef.current) {\n toggleButtonRef.current.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n var mouseAndTouchTrackers = useMouseAndTouchTracker(environment, useCallback(function handleBlur() {\n if (latest.current.state.isOpen) {\n dispatch({\n type: ToggleButtonBlur\n });\n }\n }, [dispatch, latest]), useMemo(function () {\n return [menuRef, toggleButtonRef];\n }, [menuRef.current, toggleButtonRef.current]));\n var setGetterPropCallInfo = useGetterPropsCalledChecker('getMenuProps', 'getToggleButtonProps');\n // Reset itemRefs on close.\n useEffect(function () {\n if (!isOpen) {\n itemRefs.current = {};\n }\n }, [isOpen]);\n\n // Event handler functions.\n var toggleButtonKeyDownHandlers = useMemo(function () {\n return {\n ArrowDown: function ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownArrowDown,\n altKey: event.altKey\n });\n },\n ArrowUp: function ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownArrowUp,\n altKey: event.altKey\n });\n },\n Home: function Home(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownHome\n });\n },\n End: function End(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownEnd\n });\n },\n Escape: function Escape() {\n if (latest.current.state.isOpen) {\n dispatch({\n type: ToggleButtonKeyDownEscape\n });\n }\n },\n Enter: function Enter(event) {\n event.preventDefault();\n dispatch({\n type: latest.current.state.isOpen ? ToggleButtonKeyDownEnter : ToggleButtonClick$1\n });\n },\n PageUp: function PageUp(event) {\n if (latest.current.state.isOpen) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownPageUp\n });\n }\n },\n PageDown: function PageDown(event) {\n if (latest.current.state.isOpen) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownPageDown\n });\n }\n },\n ' ': function _(event) {\n event.preventDefault();\n var currentState = latest.current.state;\n if (!currentState.isOpen) {\n dispatch({\n type: ToggleButtonClick$1\n });\n return;\n }\n if (currentState.inputValue) {\n dispatch({\n type: ToggleButtonKeyDownCharacter,\n key: ' '\n });\n } else {\n dispatch({\n type: ToggleButtonKeyDownSpaceButton\n });\n }\n }\n };\n }, [dispatch, latest]);\n\n // Action functions.\n var toggleMenu = useCallback(function () {\n dispatch({\n type: FunctionToggleMenu$1\n });\n }, [dispatch]);\n var closeMenu = useCallback(function () {\n dispatch({\n type: FunctionCloseMenu$1\n });\n }, [dispatch]);\n var openMenu = useCallback(function () {\n dispatch({\n type: FunctionOpenMenu$1\n });\n }, [dispatch]);\n var setHighlightedIndex = useCallback(function (newHighlightedIndex) {\n dispatch({\n type: FunctionSetHighlightedIndex$1,\n highlightedIndex: newHighlightedIndex\n });\n }, [dispatch]);\n var selectItem = useCallback(function (newSelectedItem) {\n dispatch({\n type: FunctionSelectItem$1,\n selectedItem: newSelectedItem\n });\n }, [dispatch]);\n var reset = useCallback(function () {\n dispatch({\n type: FunctionReset$2\n });\n }, [dispatch]);\n var setInputValue = useCallback(function (newInputValue) {\n dispatch({\n type: FunctionSetInputValue$1,\n inputValue: newInputValue\n });\n }, [dispatch]);\n // Getter functions.\n var getLabelProps = useCallback(function (_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n onClick = _ref.onClick,\n labelProps = _objectWithoutPropertiesLoose(_ref, _excluded$2);\n var labelHandleClick = function labelHandleClick() {\n var _toggleButtonRef$curr;\n (_toggleButtonRef$curr = toggleButtonRef.current) == null || _toggleButtonRef$curr.focus();\n };\n return _extends({\n id: elementIds.labelId,\n htmlFor: elementIds.toggleButtonId,\n onClick: callAllEventHandlers(onClick, labelHandleClick)\n }, labelProps);\n }, [elementIds]);\n var getMenuProps = useCallback(function (_temp2, _temp3) {\n var _extends2;\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n onMouseLeave = _ref2.onMouseLeave,\n _ref2$refKey = _ref2.refKey,\n refKey = _ref2$refKey === void 0 ? 'ref' : _ref2$refKey,\n ref = _ref2.ref,\n rest = _objectWithoutPropertiesLoose(_ref2, _excluded2$2);\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n _ref3$suppressRefErro = _ref3.suppressRefError,\n suppressRefError = _ref3$suppressRefErro === void 0 ? false : _ref3$suppressRefErro;\n var menuHandleMouseLeave = function menuHandleMouseLeave() {\n dispatch({\n type: MenuMouseLeave$1\n });\n };\n setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {\n menuRef.current = menuNode;\n }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = rest && rest['aria-label'] ? undefined : \"\" + elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, menuHandleMouseLeave), _extends2), rest);\n }, [dispatch, setGetterPropCallInfo, elementIds]);\n var getToggleButtonProps = useCallback(function (_temp4, _temp5) {\n var _extends3;\n var _ref4 = _temp4 === void 0 ? {} : _temp4,\n onBlur = _ref4.onBlur,\n onClick = _ref4.onClick;\n _ref4.onPress;\n var onKeyDown = _ref4.onKeyDown,\n _ref4$refKey = _ref4.refKey,\n refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey,\n ref = _ref4.ref,\n rest = _objectWithoutPropertiesLoose(_ref4, _excluded3$1);\n var _ref5 = _temp5 === void 0 ? {} : _temp5,\n _ref5$suppressRefErro = _ref5.suppressRefError,\n suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;\n var latestState = latest.current.state;\n var toggleButtonHandleClick = function toggleButtonHandleClick() {\n dispatch({\n type: ToggleButtonClick$1\n });\n };\n var toggleButtonHandleBlur = function toggleButtonHandleBlur() {\n if (latestState.isOpen && !mouseAndTouchTrackers.isMouseDown) {\n dispatch({\n type: ToggleButtonBlur\n });\n }\n };\n var toggleButtonHandleKeyDown = function toggleButtonHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n if (key && toggleButtonKeyDownHandlers[key]) {\n toggleButtonKeyDownHandlers[key](event);\n } else if (isAcceptedCharacterKey(key)) {\n dispatch({\n type: ToggleButtonKeyDownCharacter,\n key: key\n });\n }\n };\n var toggleProps = _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (toggleButtonNode) {\n toggleButtonRef.current = toggleButtonNode;\n }), _extends3['aria-activedescendant'] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : '', _extends3['aria-controls'] = elementIds.menuId, _extends3['aria-expanded'] = latest.current.state.isOpen, _extends3['aria-haspopup'] = 'listbox', _extends3['aria-labelledby'] = rest && rest['aria-label'] ? undefined : \"\" + elementIds.labelId, _extends3.id = elementIds.toggleButtonId, _extends3.role = 'combobox', _extends3.tabIndex = 0, _extends3.onBlur = callAllEventHandlers(onBlur, toggleButtonHandleBlur), _extends3), rest);\n if (!rest.disabled) {\n /* istanbul ignore if (react-native) */\n {\n toggleProps.onClick = callAllEventHandlers(onClick, toggleButtonHandleClick);\n toggleProps.onKeyDown = callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown);\n }\n }\n setGetterPropCallInfo('getToggleButtonProps', suppressRefError, refKey, toggleButtonRef);\n return toggleProps;\n }, [dispatch, elementIds, latest, mouseAndTouchTrackers, setGetterPropCallInfo, toggleButtonKeyDownHandlers]);\n var getItemProps = useCallback(function (_temp6) {\n var _extends4;\n var _ref6 = _temp6 === void 0 ? {} : _temp6,\n itemProp = _ref6.item,\n indexProp = _ref6.index,\n onMouseMove = _ref6.onMouseMove,\n onClick = _ref6.onClick,\n onMouseDown = _ref6.onMouseDown;\n _ref6.onPress;\n var _ref6$refKey = _ref6.refKey,\n refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,\n disabledProp = _ref6.disabled,\n ref = _ref6.ref,\n rest = _objectWithoutPropertiesLoose(_ref6, _excluded4$1);\n if (disabledProp !== undefined) {\n console.warn('Passing \"disabled\" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');\n }\n var _latest$current = latest.current,\n latestState = _latest$current.state,\n latestProps = _latest$current.props;\n var _getItemAndIndex = getItemAndIndex(itemProp, indexProp, latestProps.items, 'Pass either item or index to getItemProps!'),\n item = _getItemAndIndex[0],\n index = _getItemAndIndex[1];\n var disabled = latestProps.isItemDisabled(item, index);\n var itemHandleMouseMove = function itemHandleMouseMove() {\n if (mouseAndTouchTrackers.isTouchEnd || index === latestState.highlightedIndex) {\n return;\n }\n shouldScrollRef.current = false;\n dispatch({\n type: ItemMouseMove$1,\n index: index,\n disabled: disabled\n });\n };\n var itemHandleClick = function itemHandleClick() {\n dispatch({\n type: ItemClick$1,\n index: index\n });\n };\n var itemHandleMouseDown = function itemHandleMouseDown(e) {\n return e.preventDefault();\n }; // keep focus on the toggle after item click select.\n\n var itemProps = _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (itemNode) {\n if (itemNode) {\n itemRefs.current[elementIds.getItemId(index)] = itemNode;\n }\n }), _extends4['aria-disabled'] = disabled, _extends4['aria-selected'] = item === latestState.selectedItem, _extends4.id = elementIds.getItemId(index), _extends4.role = 'option', _extends4), rest);\n if (!disabled) {\n /* istanbul ignore next (react-native) */\n {\n itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);\n }\n }\n itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);\n itemProps.onMouseDown = callAllEventHandlers(onMouseDown, itemHandleMouseDown);\n return itemProps;\n }, [latest, elementIds, mouseAndTouchTrackers, shouldScrollRef, dispatch]);\n return {\n // prop getters.\n getToggleButtonProps: getToggleButtonProps,\n getLabelProps: getLabelProps,\n getMenuProps: getMenuProps,\n getItemProps: getItemProps,\n // actions.\n toggleMenu: toggleMenu,\n openMenu: openMenu,\n closeMenu: closeMenu,\n setHighlightedIndex: setHighlightedIndex,\n selectItem: selectItem,\n reset: reset,\n setInputValue: setInputValue,\n // state.\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n selectedItem: selectedItem,\n inputValue: inputValue\n };\n}\n\nvar InputKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__input_keydown_arrow_down__' : 0;\nvar InputKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__input_keydown_arrow_up__' : 1;\nvar InputKeyDownEscape = process.env.NODE_ENV !== \"production\" ? '__input_keydown_escape__' : 2;\nvar InputKeyDownHome = process.env.NODE_ENV !== \"production\" ? '__input_keydown_home__' : 3;\nvar InputKeyDownEnd = process.env.NODE_ENV !== \"production\" ? '__input_keydown_end__' : 4;\nvar InputKeyDownPageUp = process.env.NODE_ENV !== \"production\" ? '__input_keydown_page_up__' : 5;\nvar InputKeyDownPageDown = process.env.NODE_ENV !== \"production\" ? '__input_keydown_page_down__' : 6;\nvar InputKeyDownEnter = process.env.NODE_ENV !== \"production\" ? '__input_keydown_enter__' : 7;\nvar InputChange = process.env.NODE_ENV !== \"production\" ? '__input_change__' : 8;\nvar InputBlur = process.env.NODE_ENV !== \"production\" ? '__input_blur__' : 9;\nvar InputClick = process.env.NODE_ENV !== \"production\" ? '__input_click__' : 10;\nvar MenuMouseLeave = process.env.NODE_ENV !== \"production\" ? '__menu_mouse_leave__' : 11;\nvar ItemMouseMove = process.env.NODE_ENV !== \"production\" ? '__item_mouse_move__' : 12;\nvar ItemClick = process.env.NODE_ENV !== \"production\" ? '__item_click__' : 13;\nvar ToggleButtonClick = process.env.NODE_ENV !== \"production\" ? '__togglebutton_click__' : 14;\nvar FunctionToggleMenu = process.env.NODE_ENV !== \"production\" ? '__function_toggle_menu__' : 15;\nvar FunctionOpenMenu = process.env.NODE_ENV !== \"production\" ? '__function_open_menu__' : 16;\nvar FunctionCloseMenu = process.env.NODE_ENV !== \"production\" ? '__function_close_menu__' : 17;\nvar FunctionSetHighlightedIndex = process.env.NODE_ENV !== \"production\" ? '__function_set_highlighted_index__' : 18;\nvar FunctionSelectItem = process.env.NODE_ENV !== \"production\" ? '__function_select_item__' : 19;\nvar FunctionSetInputValue = process.env.NODE_ENV !== \"production\" ? '__function_set_input_value__' : 20;\nvar FunctionReset$1 = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 21;\nvar ControlledPropUpdatedSelectedItem = process.env.NODE_ENV !== \"production\" ? '__controlled_prop_updated_selected_item__' : 22;\n\nvar stateChangeTypes$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem,\n FunctionCloseMenu: FunctionCloseMenu,\n FunctionOpenMenu: FunctionOpenMenu,\n FunctionReset: FunctionReset$1,\n FunctionSelectItem: FunctionSelectItem,\n FunctionSetHighlightedIndex: FunctionSetHighlightedIndex,\n FunctionSetInputValue: FunctionSetInputValue,\n FunctionToggleMenu: FunctionToggleMenu,\n InputBlur: InputBlur,\n InputChange: InputChange,\n InputClick: InputClick,\n InputKeyDownArrowDown: InputKeyDownArrowDown,\n InputKeyDownArrowUp: InputKeyDownArrowUp,\n InputKeyDownEnd: InputKeyDownEnd,\n InputKeyDownEnter: InputKeyDownEnter,\n InputKeyDownEscape: InputKeyDownEscape,\n InputKeyDownHome: InputKeyDownHome,\n InputKeyDownPageDown: InputKeyDownPageDown,\n InputKeyDownPageUp: InputKeyDownPageUp,\n ItemClick: ItemClick,\n ItemMouseMove: ItemMouseMove,\n MenuMouseLeave: MenuMouseLeave,\n ToggleButtonClick: ToggleButtonClick\n});\n\nfunction getInitialState$1(props) {\n var initialState = getInitialState$2(props);\n var selectedItem = initialState.selectedItem;\n var inputValue = initialState.inputValue;\n if (inputValue === '' && selectedItem && props.defaultInputValue === undefined && props.initialInputValue === undefined && props.inputValue === undefined) {\n inputValue = props.itemToString(selectedItem);\n }\n return _extends({}, initialState, {\n inputValue: inputValue\n });\n}\nvar propTypes$1 = _extends({}, commonDropdownPropTypes, {\n items: PropTypes.array.isRequired,\n isItemDisabled: PropTypes.func,\n inputValue: PropTypes.string,\n defaultInputValue: PropTypes.string,\n initialInputValue: PropTypes.string,\n inputId: PropTypes.string,\n onInputValueChange: PropTypes.func\n});\n\n/**\n * The useCombobox version of useControlledReducer, which also\n * checks if the controlled prop selectedItem changed between\n * renders. If so, it will also update inputValue with its\n * string equivalent. It uses the common useEnhancedReducer to\n * compute the rest of the state.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} props The hook props, also passed to createInitialState.\n * @param {Function} createInitialState Function that returns the initial state.\n * @param {Function} isStateEqual Function that checks if a previous state is equal to the next.\n * @returns {Array} An array with the state and an action dispatcher.\n */\nfunction useControlledReducer(reducer, props, createInitialState, isStateEqual) {\n var previousSelectedItemRef = useRef();\n var _useEnhancedReducer = useEnhancedReducer(reducer, props, createInitialState, isStateEqual),\n state = _useEnhancedReducer[0],\n dispatch = _useEnhancedReducer[1];\n var isInitialMount = useIsInitialMount();\n useEffect(function () {\n if (!isControlledProp(props, 'selectedItem')) {\n return;\n }\n if (!isInitialMount // on first mount we already have the proper inputValue for a initial selected item.\n ) {\n var shouldCallDispatch = props.itemToKey(props.selectedItem) !== props.itemToKey(previousSelectedItemRef.current);\n if (shouldCallDispatch) {\n dispatch({\n type: ControlledPropUpdatedSelectedItem,\n inputValue: props.itemToString(props.selectedItem)\n });\n }\n }\n previousSelectedItemRef.current = state.selectedItem === previousSelectedItemRef.current ? props.selectedItem : state.selectedItem;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.selectedItem, props.selectedItem]);\n return [getState(state, props), dispatch];\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nvar validatePropTypes$1 = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes$1 = function validatePropTypes(options, caller) {\n PropTypes.checkPropTypes(propTypes$1, options, 'prop', caller.name);\n };\n}\nvar defaultProps$1 = _extends({}, defaultProps$3, {\n isItemDisabled: function isItemDisabled() {\n return false;\n }\n});\n\n/* eslint-disable complexity */\nfunction downshiftUseComboboxReducer(state, action) {\n var _props$items;\n var type = action.type,\n props = action.props,\n altKey = action.altKey;\n var changes;\n switch (type) {\n case ItemClick:\n changes = {\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultHighlightedIndex(props),\n selectedItem: props.items[action.index],\n inputValue: props.itemToString(props.items[action.index])\n };\n break;\n case InputKeyDownArrowDown:\n if (state.isOpen) {\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, 1, props.items, props.isItemDisabled, true)\n };\n } else {\n changes = {\n highlightedIndex: altKey && state.selectedItem == null ? -1 : getHighlightedIndexOnOpen(props, state, 1),\n isOpen: props.items.length >= 0\n };\n }\n break;\n case InputKeyDownArrowUp:\n if (state.isOpen) {\n if (altKey) {\n changes = getChangesOnSelection(props, state.highlightedIndex);\n } else {\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, -1, props.items, props.isItemDisabled, true)\n };\n }\n } else {\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, -1),\n isOpen: props.items.length >= 0\n };\n }\n break;\n case InputKeyDownEnter:\n changes = getChangesOnSelection(props, state.highlightedIndex);\n break;\n case InputKeyDownEscape:\n changes = _extends({\n isOpen: false,\n highlightedIndex: -1\n }, !state.isOpen && {\n selectedItem: null,\n inputValue: ''\n });\n break;\n case InputKeyDownPageUp:\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, -10, props.items, props.isItemDisabled, true)\n };\n break;\n case InputKeyDownPageDown:\n changes = {\n highlightedIndex: getHighlightedIndex(state.highlightedIndex, 10, props.items, props.isItemDisabled, true)\n };\n break;\n case InputKeyDownHome:\n changes = {\n highlightedIndex: getNonDisabledIndex(0, false, props.items, props.isItemDisabled)\n };\n break;\n case InputKeyDownEnd:\n changes = {\n highlightedIndex: getNonDisabledIndex(props.items.length - 1, true, props.items, props.isItemDisabled)\n };\n break;\n case InputBlur:\n changes = _extends({\n isOpen: false,\n highlightedIndex: -1\n }, state.highlightedIndex >= 0 && ((_props$items = props.items) == null ? void 0 : _props$items.length) && action.selectItem && {\n selectedItem: props.items[state.highlightedIndex],\n inputValue: props.itemToString(props.items[state.highlightedIndex])\n });\n break;\n case InputChange:\n changes = {\n isOpen: true,\n highlightedIndex: getDefaultHighlightedIndex(props),\n inputValue: action.inputValue\n };\n break;\n case InputClick:\n changes = {\n isOpen: !state.isOpen,\n highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n case FunctionSelectItem:\n changes = {\n selectedItem: action.selectedItem,\n inputValue: props.itemToString(action.selectedItem)\n };\n break;\n case ControlledPropUpdatedSelectedItem:\n changes = {\n inputValue: action.inputValue\n };\n break;\n default:\n return downshiftCommonReducer(state, action, stateChangeTypes$1);\n }\n return _extends({}, state, changes);\n}\n/* eslint-enable complexity */\n\nvar _excluded$1 = [\"onMouseLeave\", \"refKey\", \"ref\"],\n _excluded2$1 = [\"item\", \"index\", \"refKey\", \"ref\", \"onMouseMove\", \"onMouseDown\", \"onClick\", \"onPress\", \"disabled\"],\n _excluded3 = [\"onClick\", \"onPress\", \"refKey\", \"ref\"],\n _excluded4 = [\"onKeyDown\", \"onChange\", \"onInput\", \"onBlur\", \"onChangeText\", \"onClick\", \"refKey\", \"ref\"];\nuseCombobox.stateChangeTypes = stateChangeTypes$1;\nfunction useCombobox(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n validatePropTypes$1(userProps, useCombobox);\n // Props defaults and destructuring.\n var props = _extends({}, defaultProps$1, userProps);\n var items = props.items,\n scrollIntoView = props.scrollIntoView,\n environment = props.environment,\n getA11yStatusMessage = props.getA11yStatusMessage;\n // Initial state depending on controlled props.\n var _useControlledReducer = useControlledReducer(downshiftUseComboboxReducer, props, getInitialState$1, isDropdownsStateEqual),\n state = _useControlledReducer[0],\n dispatch = _useControlledReducer[1];\n var isOpen = state.isOpen,\n highlightedIndex = state.highlightedIndex,\n selectedItem = state.selectedItem,\n inputValue = state.inputValue;\n\n // Element refs.\n var menuRef = useRef(null);\n var itemRefs = useRef({});\n var inputRef = useRef(null);\n var toggleButtonRef = useRef(null);\n var isInitialMount = useIsInitialMount();\n\n // prevent id re-generation between renders.\n var elementIds = useElementIds(props);\n // used to keep track of how many items we had on previous cycle.\n var previousResultCountRef = useRef();\n // utility callback to get item element.\n var latest = useLatestRef({\n state: state,\n props: props\n });\n var getItemNodeFromIndex = useCallback(function (index) {\n return itemRefs.current[elementIds.getItemId(index)];\n }, [elementIds]);\n\n // Effects.\n // Adds an a11y aria live status message if getA11yStatusMessage is passed.\n useA11yMessageStatus(getA11yStatusMessage, state, [isOpen, highlightedIndex, selectedItem, inputValue], environment);\n // Scroll on highlighted item if change comes from keyboard.\n var shouldScrollRef = useScrollIntoView({\n menuElement: menuRef.current,\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n itemRefs: itemRefs,\n scrollIntoView: scrollIntoView,\n getItemNodeFromIndex: getItemNodeFromIndex\n });\n useControlPropsValidator({\n props: props,\n state: state\n });\n // Focus the input on first render if required.\n useEffect(function () {\n var focusOnOpen = getInitialValue$1(props, 'isOpen');\n if (focusOnOpen && inputRef.current) {\n inputRef.current.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n useEffect(function () {\n if (!isInitialMount) {\n previousResultCountRef.current = items.length;\n }\n });\n var mouseAndTouchTrackers = useMouseAndTouchTracker(environment, useCallback(function handleBlur() {\n if (latest.current.state.isOpen) {\n dispatch({\n type: InputBlur,\n selectItem: false\n });\n }\n }, [dispatch, latest]), useMemo(function () {\n return [menuRef, toggleButtonRef, inputRef];\n }, [menuRef.current, toggleButtonRef.current, inputRef.current]));\n var setGetterPropCallInfo = useGetterPropsCalledChecker('getInputProps', 'getMenuProps');\n // Reset itemRefs on close.\n useEffect(function () {\n if (!isOpen) {\n itemRefs.current = {};\n }\n }, [isOpen]);\n // Reset itemRefs on close.\n useEffect(function () {\n var _inputRef$current;\n if (!isOpen || !(environment != null && environment.document) || !(inputRef != null && (_inputRef$current = inputRef.current) != null && _inputRef$current.focus)) {\n return;\n }\n if (environment.document.activeElement !== inputRef.current) {\n inputRef.current.focus();\n }\n }, [isOpen, environment]);\n\n /* Event handler functions */\n var inputKeyDownHandlers = useMemo(function () {\n return {\n ArrowDown: function ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownArrowDown,\n altKey: event.altKey\n });\n },\n ArrowUp: function ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownArrowUp,\n altKey: event.altKey\n });\n },\n Home: function Home(event) {\n if (!latest.current.state.isOpen) {\n return;\n }\n event.preventDefault();\n dispatch({\n type: InputKeyDownHome\n });\n },\n End: function End(event) {\n if (!latest.current.state.isOpen) {\n return;\n }\n event.preventDefault();\n dispatch({\n type: InputKeyDownEnd\n });\n },\n Escape: function Escape(event) {\n var latestState = latest.current.state;\n if (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownEscape\n });\n }\n },\n Enter: function Enter(event) {\n var latestState = latest.current.state;\n // if closed or no highlighted index, do nothing.\n if (!latestState.isOpen || event.which === 229 // if IME composing, wait for next Enter keydown event.\n ) {\n return;\n }\n event.preventDefault();\n dispatch({\n type: InputKeyDownEnter\n });\n },\n PageUp: function PageUp(event) {\n if (latest.current.state.isOpen) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownPageUp\n });\n }\n },\n PageDown: function PageDown(event) {\n if (latest.current.state.isOpen) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownPageDown\n });\n }\n }\n };\n }, [dispatch, latest]);\n\n // Getter props.\n var getLabelProps = useCallback(function (labelProps) {\n return _extends({\n id: elementIds.labelId,\n htmlFor: elementIds.inputId\n }, labelProps);\n }, [elementIds]);\n var getMenuProps = useCallback(function (_temp, _temp2) {\n var _extends2;\n var _ref = _temp === void 0 ? {} : _temp,\n onMouseLeave = _ref.onMouseLeave,\n _ref$refKey = _ref.refKey,\n refKey = _ref$refKey === void 0 ? 'ref' : _ref$refKey,\n ref = _ref.ref,\n rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);\n var _ref2 = _temp2 === void 0 ? {} : _temp2,\n _ref2$suppressRefErro = _ref2.suppressRefError,\n suppressRefError = _ref2$suppressRefErro === void 0 ? false : _ref2$suppressRefErro;\n setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (menuNode) {\n menuRef.current = menuNode;\n }), _extends2.id = elementIds.menuId, _extends2.role = 'listbox', _extends2['aria-labelledby'] = rest && rest['aria-label'] ? undefined : \"\" + elementIds.labelId, _extends2.onMouseLeave = callAllEventHandlers(onMouseLeave, function () {\n dispatch({\n type: MenuMouseLeave\n });\n }), _extends2), rest);\n }, [dispatch, setGetterPropCallInfo, elementIds]);\n var getItemProps = useCallback(function (_temp3) {\n var _extends3, _ref4;\n var _ref3 = _temp3 === void 0 ? {} : _temp3,\n itemProp = _ref3.item,\n indexProp = _ref3.index,\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n ref = _ref3.ref,\n onMouseMove = _ref3.onMouseMove,\n onMouseDown = _ref3.onMouseDown,\n onClick = _ref3.onClick;\n _ref3.onPress;\n var disabledProp = _ref3.disabled,\n rest = _objectWithoutPropertiesLoose(_ref3, _excluded2$1);\n if (disabledProp !== undefined) {\n console.warn('Passing \"disabled\" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');\n }\n var _latest$current = latest.current,\n latestProps = _latest$current.props,\n latestState = _latest$current.state;\n var _getItemAndIndex = getItemAndIndex(itemProp, indexProp, latestProps.items, 'Pass either item or index to getItemProps!'),\n item = _getItemAndIndex[0],\n index = _getItemAndIndex[1];\n var disabled = latestProps.isItemDisabled(item, index);\n var onSelectKey = 'onClick';\n var customClickHandler = onClick;\n var itemHandleMouseMove = function itemHandleMouseMove() {\n if (mouseAndTouchTrackers.isTouchEnd || index === latestState.highlightedIndex) {\n return;\n }\n shouldScrollRef.current = false;\n dispatch({\n type: ItemMouseMove,\n index: index,\n disabled: disabled\n });\n };\n var itemHandleClick = function itemHandleClick() {\n dispatch({\n type: ItemClick,\n index: index\n });\n };\n var itemHandleMouseDown = function itemHandleMouseDown(e) {\n return e.preventDefault();\n }; // keep focus on the input after item click select.\n\n return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (itemNode) {\n if (itemNode) {\n itemRefs.current[elementIds.getItemId(index)] = itemNode;\n }\n }), _extends3['aria-disabled'] = disabled, _extends3['aria-selected'] = index === latestState.highlightedIndex, _extends3.id = elementIds.getItemId(index), _extends3.role = 'option', _extends3), !disabled && (_ref4 = {}, _ref4[onSelectKey] = callAllEventHandlers(customClickHandler, itemHandleClick), _ref4), {\n onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),\n onMouseDown: callAllEventHandlers(onMouseDown, itemHandleMouseDown)\n }, rest);\n }, [dispatch, elementIds, latest, mouseAndTouchTrackers, shouldScrollRef]);\n var getToggleButtonProps = useCallback(function (_temp4) {\n var _extends4;\n var _ref5 = _temp4 === void 0 ? {} : _temp4,\n onClick = _ref5.onClick;\n _ref5.onPress;\n var _ref5$refKey = _ref5.refKey,\n refKey = _ref5$refKey === void 0 ? 'ref' : _ref5$refKey,\n ref = _ref5.ref,\n rest = _objectWithoutPropertiesLoose(_ref5, _excluded3);\n var latestState = latest.current.state;\n var toggleButtonHandleClick = function toggleButtonHandleClick() {\n dispatch({\n type: ToggleButtonClick\n });\n };\n return _extends((_extends4 = {}, _extends4[refKey] = handleRefs(ref, function (toggleButtonNode) {\n toggleButtonRef.current = toggleButtonNode;\n }), _extends4['aria-controls'] = elementIds.menuId, _extends4['aria-expanded'] = latestState.isOpen, _extends4.id = elementIds.toggleButtonId, _extends4.tabIndex = -1, _extends4), !rest.disabled && _extends({}, {\n onClick: callAllEventHandlers(onClick, toggleButtonHandleClick)\n }), rest);\n }, [dispatch, latest, elementIds]);\n var getInputProps = useCallback(function (_temp5, _temp6) {\n var _extends5;\n var _ref6 = _temp5 === void 0 ? {} : _temp5,\n onKeyDown = _ref6.onKeyDown,\n onChange = _ref6.onChange,\n onInput = _ref6.onInput,\n onBlur = _ref6.onBlur;\n _ref6.onChangeText;\n var onClick = _ref6.onClick,\n _ref6$refKey = _ref6.refKey,\n refKey = _ref6$refKey === void 0 ? 'ref' : _ref6$refKey,\n ref = _ref6.ref,\n rest = _objectWithoutPropertiesLoose(_ref6, _excluded4);\n var _ref7 = _temp6 === void 0 ? {} : _temp6,\n _ref7$suppressRefErro = _ref7.suppressRefError,\n suppressRefError = _ref7$suppressRefErro === void 0 ? false : _ref7$suppressRefErro;\n setGetterPropCallInfo('getInputProps', suppressRefError, refKey, inputRef);\n var latestState = latest.current.state;\n var inputHandleKeyDown = function inputHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n if (key && inputKeyDownHandlers[key]) {\n inputKeyDownHandlers[key](event);\n }\n };\n var inputHandleChange = function inputHandleChange(event) {\n dispatch({\n type: InputChange,\n inputValue: event.target.value\n });\n };\n var inputHandleBlur = function inputHandleBlur(event) {\n /* istanbul ignore else */\n if (environment != null && environment.document && latestState.isOpen && !mouseAndTouchTrackers.isMouseDown) {\n var isBlurByTabChange = event.relatedTarget === null && environment.document.activeElement !== environment.document.body;\n dispatch({\n type: InputBlur,\n selectItem: !isBlurByTabChange\n });\n }\n };\n var inputHandleClick = function inputHandleClick() {\n dispatch({\n type: InputClick\n });\n };\n\n /* istanbul ignore next (preact) */\n var onChangeKey = 'onChange';\n var eventHandlers = {};\n if (!rest.disabled) {\n var _eventHandlers;\n eventHandlers = (_eventHandlers = {}, _eventHandlers[onChangeKey] = callAllEventHandlers(onChange, onInput, inputHandleChange), _eventHandlers.onKeyDown = callAllEventHandlers(onKeyDown, inputHandleKeyDown), _eventHandlers.onBlur = callAllEventHandlers(onBlur, inputHandleBlur), _eventHandlers.onClick = callAllEventHandlers(onClick, inputHandleClick), _eventHandlers);\n }\n return _extends((_extends5 = {}, _extends5[refKey] = handleRefs(ref, function (inputNode) {\n inputRef.current = inputNode;\n }), _extends5['aria-activedescendant'] = latestState.isOpen && latestState.highlightedIndex > -1 ? elementIds.getItemId(latestState.highlightedIndex) : '', _extends5['aria-autocomplete'] = 'list', _extends5['aria-controls'] = elementIds.menuId, _extends5['aria-expanded'] = latestState.isOpen, _extends5['aria-labelledby'] = rest && rest['aria-label'] ? undefined : elementIds.labelId, _extends5.autoComplete = 'off', _extends5.id = elementIds.inputId, _extends5.role = 'combobox', _extends5.value = latestState.inputValue, _extends5), eventHandlers, rest);\n }, [dispatch, elementIds, environment, inputKeyDownHandlers, latest, mouseAndTouchTrackers, setGetterPropCallInfo]);\n\n // returns\n var toggleMenu = useCallback(function () {\n dispatch({\n type: FunctionToggleMenu\n });\n }, [dispatch]);\n var closeMenu = useCallback(function () {\n dispatch({\n type: FunctionCloseMenu\n });\n }, [dispatch]);\n var openMenu = useCallback(function () {\n dispatch({\n type: FunctionOpenMenu\n });\n }, [dispatch]);\n var setHighlightedIndex = useCallback(function (newHighlightedIndex) {\n dispatch({\n type: FunctionSetHighlightedIndex,\n highlightedIndex: newHighlightedIndex\n });\n }, [dispatch]);\n var selectItem = useCallback(function (newSelectedItem) {\n dispatch({\n type: FunctionSelectItem,\n selectedItem: newSelectedItem\n });\n }, [dispatch]);\n var setInputValue = useCallback(function (newInputValue) {\n dispatch({\n type: FunctionSetInputValue,\n inputValue: newInputValue\n });\n }, [dispatch]);\n var reset = useCallback(function () {\n dispatch({\n type: FunctionReset$1\n });\n }, [dispatch]);\n return {\n // prop getters.\n getItemProps: getItemProps,\n getLabelProps: getLabelProps,\n getMenuProps: getMenuProps,\n getInputProps: getInputProps,\n getToggleButtonProps: getToggleButtonProps,\n // actions.\n toggleMenu: toggleMenu,\n openMenu: openMenu,\n closeMenu: closeMenu,\n setHighlightedIndex: setHighlightedIndex,\n setInputValue: setInputValue,\n selectItem: selectItem,\n reset: reset,\n // state.\n highlightedIndex: highlightedIndex,\n isOpen: isOpen,\n selectedItem: selectedItem,\n inputValue: inputValue\n };\n}\n\nvar defaultStateValues = {\n activeIndex: -1,\n selectedItems: []\n};\n\n/**\n * Returns the initial value for a state key in the following order:\n * 1. controlled prop, 2. initial prop, 3. default prop, 4. default\n * value from Downshift.\n *\n * @param {Object} props Props passed to the hook.\n * @param {string} propKey Props key to generate the value for.\n * @returns {any} The initial value for that prop.\n */\nfunction getInitialValue(props, propKey) {\n return getInitialValue$1(props, propKey, defaultStateValues);\n}\n\n/**\n * Returns the default value for a state key in the following order:\n * 1. controlled prop, 2. default prop, 3. default value from Downshift.\n *\n * @param {Object} props Props passed to the hook.\n * @param {string} propKey Props key to generate the value for.\n * @returns {any} The initial value for that prop.\n */\nfunction getDefaultValue(props, propKey) {\n return getDefaultValue$1(props, propKey, defaultStateValues);\n}\n\n/**\n * Gets the initial state based on the provided props. It uses initial, default\n * and controlled props related to state in order to compute the initial value.\n *\n * @param {Object} props Props passed to the hook.\n * @returns {Object} The initial state.\n */\nfunction getInitialState(props) {\n var activeIndex = getInitialValue(props, 'activeIndex');\n var selectedItems = getInitialValue(props, 'selectedItems');\n return {\n activeIndex: activeIndex,\n selectedItems: selectedItems\n };\n}\n\n/**\n * Returns true if dropdown keydown operation is permitted. Should not be\n * allowed on keydown with modifier keys (ctrl, alt, shift, meta), on\n * input element with text content that is either highlighted or selection\n * cursor is not at the starting position.\n *\n * @param {KeyboardEvent} event The event from keydown.\n * @returns {boolean} Whether the operation is allowed.\n */\nfunction isKeyDownOperationPermitted(event) {\n if (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {\n return false;\n }\n var element = event.target;\n if (element instanceof HTMLInputElement &&\n // if element is a text input\n element.value !== '' && (\n // and we have text in it\n // and cursor is either not at the start or is currently highlighting text.\n element.selectionStart !== 0 || element.selectionEnd !== 0)) {\n return false;\n }\n return true;\n}\n\n/**\n * Check if a state is equal for taglist, by comparing active index and selected items.\n * Used by useSelect and useCombobox.\n *\n * @param {Object} prevState\n * @param {Object} newState\n * @returns {boolean} Wheather the states are deeply equal.\n */\nfunction isStateEqual(prevState, newState) {\n return prevState.selectedItems === newState.selectedItems && prevState.activeIndex === newState.activeIndex;\n}\nvar propTypes = {\n stateReducer: commonPropTypes.stateReducer,\n itemToKey: commonPropTypes.itemToKey,\n environment: commonPropTypes.environment,\n selectedItems: PropTypes.array,\n initialSelectedItems: PropTypes.array,\n defaultSelectedItems: PropTypes.array,\n getA11yStatusMessage: PropTypes.func,\n activeIndex: PropTypes.number,\n initialActiveIndex: PropTypes.number,\n defaultActiveIndex: PropTypes.number,\n onActiveIndexChange: PropTypes.func,\n onSelectedItemsChange: PropTypes.func,\n keyNavigationNext: PropTypes.string,\n keyNavigationPrevious: PropTypes.string\n};\nvar defaultProps = {\n itemToKey: defaultProps$3.itemToKey,\n stateReducer: defaultProps$3.stateReducer,\n environment: defaultProps$3.environment,\n keyNavigationNext: 'ArrowRight',\n keyNavigationPrevious: 'ArrowLeft'\n};\n\n// eslint-disable-next-line import/no-mutable-exports\nvar validatePropTypes = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes = function validatePropTypes(options, caller) {\n PropTypes.checkPropTypes(propTypes, options, 'prop', caller.name);\n };\n}\n\nvar SelectedItemClick = process.env.NODE_ENV !== \"production\" ? '__selected_item_click__' : 0;\nvar SelectedItemKeyDownDelete = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_delete__' : 1;\nvar SelectedItemKeyDownBackspace = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_backspace__' : 2;\nvar SelectedItemKeyDownNavigationNext = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_navigation_next__' : 3;\nvar SelectedItemKeyDownNavigationPrevious = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_navigation_previous__' : 4;\nvar DropdownKeyDownNavigationPrevious = process.env.NODE_ENV !== \"production\" ? '__dropdown_keydown_navigation_previous__' : 5;\nvar DropdownKeyDownBackspace = process.env.NODE_ENV !== \"production\" ? '__dropdown_keydown_backspace__' : 6;\nvar DropdownClick = process.env.NODE_ENV !== \"production\" ? '__dropdown_click__' : 7;\nvar FunctionAddSelectedItem = process.env.NODE_ENV !== \"production\" ? '__function_add_selected_item__' : 8;\nvar FunctionRemoveSelectedItem = process.env.NODE_ENV !== \"production\" ? '__function_remove_selected_item__' : 9;\nvar FunctionSetSelectedItems = process.env.NODE_ENV !== \"production\" ? '__function_set_selected_items__' : 10;\nvar FunctionSetActiveIndex = process.env.NODE_ENV !== \"production\" ? '__function_set_active_index__' : 11;\nvar FunctionReset = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 12;\n\nvar stateChangeTypes = /*#__PURE__*/Object.freeze({\n __proto__: null,\n DropdownClick: DropdownClick,\n DropdownKeyDownBackspace: DropdownKeyDownBackspace,\n DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious,\n FunctionAddSelectedItem: FunctionAddSelectedItem,\n FunctionRemoveSelectedItem: FunctionRemoveSelectedItem,\n FunctionReset: FunctionReset,\n FunctionSetActiveIndex: FunctionSetActiveIndex,\n FunctionSetSelectedItems: FunctionSetSelectedItems,\n SelectedItemClick: SelectedItemClick,\n SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace,\n SelectedItemKeyDownDelete: SelectedItemKeyDownDelete,\n SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext,\n SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious\n});\n\n/* eslint-disable complexity */\nfunction downshiftMultipleSelectionReducer(state, action) {\n var type = action.type,\n index = action.index,\n props = action.props,\n selectedItem = action.selectedItem;\n var activeIndex = state.activeIndex,\n selectedItems = state.selectedItems;\n var changes;\n switch (type) {\n case SelectedItemClick:\n changes = {\n activeIndex: index\n };\n break;\n case SelectedItemKeyDownNavigationPrevious:\n changes = {\n activeIndex: activeIndex - 1 < 0 ? 0 : activeIndex - 1\n };\n break;\n case SelectedItemKeyDownNavigationNext:\n changes = {\n activeIndex: activeIndex + 1 >= selectedItems.length ? -1 : activeIndex + 1\n };\n break;\n case SelectedItemKeyDownBackspace:\n case SelectedItemKeyDownDelete:\n {\n if (activeIndex < 0) {\n break;\n }\n var newActiveIndex = activeIndex;\n if (selectedItems.length === 1) {\n newActiveIndex = -1;\n } else if (activeIndex === selectedItems.length - 1) {\n newActiveIndex = selectedItems.length - 2;\n }\n changes = _extends({\n selectedItems: [].concat(selectedItems.slice(0, activeIndex), selectedItems.slice(activeIndex + 1))\n }, {\n activeIndex: newActiveIndex\n });\n break;\n }\n case DropdownKeyDownNavigationPrevious:\n changes = {\n activeIndex: selectedItems.length - 1\n };\n break;\n case DropdownKeyDownBackspace:\n changes = {\n selectedItems: selectedItems.slice(0, selectedItems.length - 1)\n };\n break;\n case FunctionAddSelectedItem:\n changes = {\n selectedItems: [].concat(selectedItems, [selectedItem])\n };\n break;\n case DropdownClick:\n changes = {\n activeIndex: -1\n };\n break;\n case FunctionRemoveSelectedItem:\n {\n var _newActiveIndex = activeIndex;\n var selectedItemIndex = selectedItems.findIndex(function (item) {\n return props.itemToKey(item) === props.itemToKey(selectedItem);\n });\n if (selectedItemIndex < 0) {\n break;\n }\n if (selectedItems.length === 1) {\n _newActiveIndex = -1;\n } else if (selectedItemIndex === selectedItems.length - 1) {\n _newActiveIndex = selectedItems.length - 2;\n }\n changes = {\n selectedItems: [].concat(selectedItems.slice(0, selectedItemIndex), selectedItems.slice(selectedItemIndex + 1)),\n activeIndex: _newActiveIndex\n };\n break;\n }\n case FunctionSetSelectedItems:\n {\n var newSelectedItems = action.selectedItems;\n changes = {\n selectedItems: newSelectedItems\n };\n break;\n }\n case FunctionSetActiveIndex:\n {\n var _newActiveIndex2 = action.activeIndex;\n changes = {\n activeIndex: _newActiveIndex2\n };\n break;\n }\n case FunctionReset:\n changes = {\n activeIndex: getDefaultValue(props, 'activeIndex'),\n selectedItems: getDefaultValue(props, 'selectedItems')\n };\n break;\n default:\n throw new Error('Reducer called without proper action type.');\n }\n return _extends({}, state, changes);\n}\n\nvar _excluded = [\"refKey\", \"ref\", \"onClick\", \"onKeyDown\", \"selectedItem\", \"index\"],\n _excluded2 = [\"refKey\", \"ref\", \"onKeyDown\", \"onClick\", \"preventKeyAction\"];\nuseMultipleSelection.stateChangeTypes = stateChangeTypes;\nfunction useMultipleSelection(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n validatePropTypes(userProps, useMultipleSelection);\n // Props defaults and destructuring.\n var props = _extends({}, defaultProps, userProps);\n var getA11yStatusMessage = props.getA11yStatusMessage,\n environment = props.environment,\n keyNavigationNext = props.keyNavigationNext,\n keyNavigationPrevious = props.keyNavigationPrevious;\n\n // Reducer init.\n var _useControlledReducer = useControlledReducer$1(downshiftMultipleSelectionReducer, props, getInitialState, isStateEqual),\n state = _useControlledReducer[0],\n dispatch = _useControlledReducer[1];\n var activeIndex = state.activeIndex,\n selectedItems = state.selectedItems;\n\n // Refs.\n var isInitialMount = useIsInitialMount();\n var dropdownRef = useRef(null);\n var selectedItemRefs = useRef();\n selectedItemRefs.current = [];\n var latest = useLatestRef({\n state: state,\n props: props\n });\n\n // Effects.\n // Adds an a11y aria live status message if getA11yStatusMessage is passed.\n useA11yMessageStatus(getA11yStatusMessage, state, [activeIndex, selectedItems], environment);\n // Sets focus on active item.\n useEffect(function () {\n if (isInitialMount) {\n return;\n }\n if (activeIndex === -1 && dropdownRef.current) {\n dropdownRef.current.focus();\n } else if (selectedItemRefs.current[activeIndex]) {\n selectedItemRefs.current[activeIndex].focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [activeIndex]);\n useControlPropsValidator({\n props: props,\n state: state\n });\n var setGetterPropCallInfo = useGetterPropsCalledChecker('getDropdownProps');\n\n // Event handler functions.\n var selectedItemKeyDownHandlers = useMemo(function () {\n var _ref;\n return _ref = {}, _ref[keyNavigationPrevious] = function () {\n dispatch({\n type: SelectedItemKeyDownNavigationPrevious\n });\n }, _ref[keyNavigationNext] = function () {\n dispatch({\n type: SelectedItemKeyDownNavigationNext\n });\n }, _ref.Delete = function Delete() {\n dispatch({\n type: SelectedItemKeyDownDelete\n });\n }, _ref.Backspace = function Backspace() {\n dispatch({\n type: SelectedItemKeyDownBackspace\n });\n }, _ref;\n }, [dispatch, keyNavigationNext, keyNavigationPrevious]);\n var dropdownKeyDownHandlers = useMemo(function () {\n var _ref2;\n return _ref2 = {}, _ref2[keyNavigationPrevious] = function (event) {\n if (isKeyDownOperationPermitted(event)) {\n dispatch({\n type: DropdownKeyDownNavigationPrevious\n });\n }\n }, _ref2.Backspace = function Backspace(event) {\n if (isKeyDownOperationPermitted(event)) {\n dispatch({\n type: DropdownKeyDownBackspace\n });\n }\n }, _ref2;\n }, [dispatch, keyNavigationPrevious]);\n\n // Getter props.\n var getSelectedItemProps = useCallback(function (_temp) {\n var _extends2;\n var _ref3 = _temp === void 0 ? {} : _temp,\n _ref3$refKey = _ref3.refKey,\n refKey = _ref3$refKey === void 0 ? 'ref' : _ref3$refKey,\n ref = _ref3.ref,\n onClick = _ref3.onClick,\n onKeyDown = _ref3.onKeyDown,\n selectedItemProp = _ref3.selectedItem,\n indexProp = _ref3.index,\n rest = _objectWithoutPropertiesLoose(_ref3, _excluded);\n var latestState = latest.current.state;\n var _getItemAndIndex = getItemAndIndex(selectedItemProp, indexProp, latestState.selectedItems, 'Pass either item or index to getSelectedItemProps!'),\n index = _getItemAndIndex[1];\n var isFocusable = index > -1 && index === latestState.activeIndex;\n var selectedItemHandleClick = function selectedItemHandleClick() {\n dispatch({\n type: SelectedItemClick,\n index: index\n });\n };\n var selectedItemHandleKeyDown = function selectedItemHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n if (key && selectedItemKeyDownHandlers[key]) {\n selectedItemKeyDownHandlers[key](event);\n }\n };\n return _extends((_extends2 = {}, _extends2[refKey] = handleRefs(ref, function (selectedItemNode) {\n if (selectedItemNode) {\n selectedItemRefs.current.push(selectedItemNode);\n }\n }), _extends2.tabIndex = isFocusable ? 0 : -1, _extends2.onClick = callAllEventHandlers(onClick, selectedItemHandleClick), _extends2.onKeyDown = callAllEventHandlers(onKeyDown, selectedItemHandleKeyDown), _extends2), rest);\n }, [dispatch, latest, selectedItemKeyDownHandlers]);\n var getDropdownProps = useCallback(function (_temp2, _temp3) {\n var _extends3;\n var _ref4 = _temp2 === void 0 ? {} : _temp2,\n _ref4$refKey = _ref4.refKey,\n refKey = _ref4$refKey === void 0 ? 'ref' : _ref4$refKey,\n ref = _ref4.ref,\n onKeyDown = _ref4.onKeyDown,\n onClick = _ref4.onClick,\n _ref4$preventKeyActio = _ref4.preventKeyAction,\n preventKeyAction = _ref4$preventKeyActio === void 0 ? false : _ref4$preventKeyActio,\n rest = _objectWithoutPropertiesLoose(_ref4, _excluded2);\n var _ref5 = _temp3 === void 0 ? {} : _temp3,\n _ref5$suppressRefErro = _ref5.suppressRefError,\n suppressRefError = _ref5$suppressRefErro === void 0 ? false : _ref5$suppressRefErro;\n setGetterPropCallInfo('getDropdownProps', suppressRefError, refKey, dropdownRef);\n var dropdownHandleKeyDown = function dropdownHandleKeyDown(event) {\n var key = normalizeArrowKey(event);\n if (key && dropdownKeyDownHandlers[key]) {\n dropdownKeyDownHandlers[key](event);\n }\n };\n var dropdownHandleClick = function dropdownHandleClick() {\n dispatch({\n type: DropdownClick\n });\n };\n return _extends((_extends3 = {}, _extends3[refKey] = handleRefs(ref, function (dropdownNode) {\n if (dropdownNode) {\n dropdownRef.current = dropdownNode;\n }\n }), _extends3), !preventKeyAction && {\n onKeyDown: callAllEventHandlers(onKeyDown, dropdownHandleKeyDown),\n onClick: callAllEventHandlers(onClick, dropdownHandleClick)\n }, rest);\n }, [dispatch, dropdownKeyDownHandlers, setGetterPropCallInfo]);\n\n // returns\n var addSelectedItem = useCallback(function (selectedItem) {\n dispatch({\n type: FunctionAddSelectedItem,\n selectedItem: selectedItem\n });\n }, [dispatch]);\n var removeSelectedItem = useCallback(function (selectedItem) {\n dispatch({\n type: FunctionRemoveSelectedItem,\n selectedItem: selectedItem\n });\n }, [dispatch]);\n var setSelectedItems = useCallback(function (newSelectedItems) {\n dispatch({\n type: FunctionSetSelectedItems,\n selectedItems: newSelectedItems\n });\n }, [dispatch]);\n var setActiveIndex = useCallback(function (newActiveIndex) {\n dispatch({\n type: FunctionSetActiveIndex,\n activeIndex: newActiveIndex\n });\n }, [dispatch]);\n var reset = useCallback(function () {\n dispatch({\n type: FunctionReset\n });\n }, [dispatch]);\n return {\n getSelectedItemProps: getSelectedItemProps,\n getDropdownProps: getDropdownProps,\n addSelectedItem: addSelectedItem,\n removeSelectedItem: removeSelectedItem,\n setSelectedItems: setSelectedItems,\n setActiveIndex: setActiveIndex,\n reset: reset,\n selectedItems: selectedItems,\n activeIndex: activeIndex\n };\n}\n\nexport { Downshift as default, resetIdCounter, useCombobox, useMultipleSelection, useSelect };\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\n\nexport const ChipGroup = styled.div`\n display: flex;\n flex-wrap: wrap;\n & > span {\n margin: ${({ theme }) => theme.deprecatedSpacing.component.one};\n }\n`;\n\nconst StyledChip = styled.span<{ color?: ChipColors }>`\n display: inline-block;\n border-radius: ${({ theme }) => theme.deprecatedBorder.radius.normal};\n padding: ${({ theme }) => theme.deprecatedSpacing.component.four};\n\n background-color: ${({ theme, color }) => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n //@ts-ignore\n return color ? theme.deprecatedColors.accent[color] : theme.deprecatedColors.accent.five;\n }};\n color: ${({ theme }) => theme.deprecatedColors.white};\n\n .delete-icon {\n &:hover {\n cursor: pointer;\n }\n }\n`;\n\nexport enum ChipColors {\n one = \"one\",\n two = \"two\",\n three = \"three\",\n four = \"four\",\n five = \"five\",\n six = \"six\",\n seven = \"seven\",\n eight = \"eight\",\n nine = \"nine\",\n}\n\ninterface ChipProps {\n label: string;\n onDelete?: (value: string) => void;\n color?: ChipColors;\n}\n\nexport default function Chip({ label, onDelete, color = ChipColors.six }: ChipProps) {\n return (\n \n {label}{\" \"}\n {onDelete && (\n onDelete(label)}\n className=\"delete-icon\"\n />\n )}\n \n );\n}\n","import React, { ReactElement, useEffect, useState } from \"react\";\nimport styled from \"styled-components\";\nimport { useCombobox } from \"downshift\";\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\n\nimport Input from \"../input\";\nimport Chip, { ChipColors } from \"../../layout/chip\";\nimport { ToggleTipProps } from \"../../layout/toggle_tip\";\n\nconst TagsInputWrapper = styled.span`\n display: inline-block;\n width: 100%;\n margin-bottom: 12px;\n .wrapper {\n width: 100%;\n position: relative;\n }\n\n .text-input {\n margin-bottom: ${({ theme }) => theme.deprecatedSpacing.component.five};\n }\n`;\n\nconst StyledTagsContainer = styled.div<{ hasError: boolean }>`\n width: 100%;\n min-height: ${({ theme }) => theme.deprecatedSpacing.component.nine};\n background-color: ${({ theme }) => theme.deprecatedColors.white};\n vertical-align: middle;\n border: 1px solid\n ${({ theme, hasError }) =>\n hasError ? theme.deprecatedColors.error : theme.deprecatedColors.gray.eight};\n border-radius: ${({ theme }) => theme.deprecatedSpacing.component.two};\n box-sizing: border-box;\n padding: ${({ theme }) => theme.deprecatedSpacing.component.five}\n ${({ theme }) => theme.deprecatedSpacing.component.four}\n ${({ theme }) => theme.deprecatedSpacing.component.three};\n display: flex;\n flex-wrap: wrap;\n\n & > * {\n margin: 0 ${({ theme }) => theme.deprecatedSpacing.component.two}\n ${({ theme }) => theme.deprecatedSpacing.component.three};\n }\n`;\n\nconst StyledOptions = styled.ul<{ isOpen: boolean }>`\n overflow: hidden;\n background-color: ${({ theme }) => theme.deprecatedColors.primary.extraLight};\n border-radius: ${({ theme }) => theme.deprecatedBorder.radius.large};\n box-shadow: ${({ theme }) => theme.deprecatedElevation.two};\n padding: ${({ theme, isOpen }) => (isOpen ? theme.deprecatedSpacing.component.five : 0)};\n position: absolute;\n left: 0;\n right: 0;\n top: 90%;\n list-style-type: none;\n max-height: 130px;\n overflow-y: scroll;\n z-index: 1;\n`;\n\nconst StyledOption = styled.li<{ isHighlighted: boolean; isDisabled?: boolean }>`\n border-radius: ${({ theme }) => theme.deprecatedBorder.radius.normal};\n padding: ${({ theme }) => theme.deprecatedSpacing.component.four};\n background-color: ${({ theme, isHighlighted }) =>\n isHighlighted ? theme.deprecatedColors.accent.six : \"transparent\"};\n color: ${({ theme, isHighlighted, isDisabled }) =>\n isDisabled\n ? theme.deprecatedColors.gray.seven\n : isHighlighted\n ? theme.deprecatedColors.white\n : theme.deprecatedColors.text.normal};\n cursor: ${({ isHighlighted, isDisabled }) =>\n isDisabled ? \"not-allowed\" : isHighlighted ? \"pointer\" : \"normal\"};\n`;\n\n//The label is optional when passed down as a prop\nexport interface TagItemType {\n value: string;\n label?: string;\n}\n\n//The label is required for the items used to generate the dropdown options\ninterface DropdownItemType {\n value: string;\n label: string;\n}\n\nexport interface TagsProps {\n label?: string;\n helperText?: string;\n className?: string;\n error?: string;\n toggleTip?: ReactElement;\n adornmentIcon?: IconProp;\n availableTags: TagItemType[];\n createTagLabel?: string;\n id?: string;\n placeholder?: string;\n value?: string[];\n disableTagCreation?: boolean;\n description?: string;\n questionIsOptional?: boolean;\n onTagSelect: (value: string) => void;\n onTagCreate?: (value: string) => void;\n onTagDelete: (value: string) => void;\n disabled?: boolean;\n tagLabelPlural?: string;\n}\n\nexport default React.memo(function Tags({\n value = [],\n onTagSelect,\n onTagCreate,\n label,\n helperText,\n className,\n error,\n toggleTip,\n adornmentIcon,\n placeholder,\n id,\n createTagLabel = \"Create:\",\n availableTags,\n disableTagCreation,\n description,\n questionIsOptional = false,\n onTagDelete,\n disabled = false,\n tagLabelPlural = \"\",\n}: TagsProps) {\n //represents the entire list of tags available for the component\n const [formattedTags, setFormattedTags] = useState([]);\n\n //represents the list of tags displayed in the dropdown which are filtered when the user types\n const [inputItems, setInputItems] = useState([]);\n const {\n isOpen,\n getMenuProps,\n getInputProps,\n highlightedIndex,\n getItemProps,\n setInputValue,\n openMenu,\n closeMenu,\n } = useCombobox({\n items: inputItems,\n itemToString: (item) => (item ? item.label : \"\"),\n onSelectedItemChange: ({ selectedItem }) => {\n setInputValue(\"\");\n\n //Checks if the selectedItemValue is not in the list of selected values\n if (\n selectedItem &&\n !valueIsSelected(selectedItem.value) &&\n !isCustomValue(selectedItem.value)\n ) {\n onTagSelect(selectedItem.value);\n }\n\n //Keeps track of the custom values entered by the user\n if (\n (disableTagCreation === false || disableTagCreation === undefined) &&\n selectedItem &&\n isCustomValue(selectedItem.value) &&\n !valueIsSelected(selectedItem.value) &&\n onTagCreate\n ) {\n onTagCreate(selectedItem.value);\n }\n closeMenu();\n },\n onInputValueChange: ({ inputValue }) => {\n //Filters the options that are displayed in the dropdown menu\n const itemsToSet = formattedTags.filter((option) => {\n return option.label.toLowerCase().includes(inputValue?.toLowerCase() ?? \"\");\n });\n\n const customInputItem =\n inputValue &&\n isCustomValue(inputValue) &&\n (disableTagCreation === false || disableTagCreation === undefined) //If value typed by the user is not in the list of options, it displays a new dropdown item to \"create\" the tag\n ? [{ label: `${createTagLabel} \"${inputValue}\"`, value: inputValue }]\n : [];\n\n setInputItems([...itemsToSet, ...customInputItem]);\n },\n });\n\n useEffect(() => {\n const getFormattedTags = () =>\n availableTags.map((availableTag) => ({\n label: availableTag?.label ?? availableTag.value,\n value: availableTag.value,\n }));\n\n setFormattedTags(getFormattedTags());\n setInputItems(getFormattedTags());\n }, [availableTags]);\n\n const availableTagsValues = () => availableTags.map((availableTag) => availableTag.value);\n\n const valueIsSelected = (valueToFind: string) => value?.some((item) => item === valueToFind);\n\n const handleTagDelete = (deletedItem: string) => {\n if (onTagDelete) {\n onTagDelete(deletedItem);\n }\n };\n\n const isCustomValue = (value: string) => {\n //This is used to check if the value selected was entered by the user and is not included in the list of predefined options\n return !availableTagsValues().includes(value);\n };\n\n return (\n \n
\n \n \n {isOpen &&\n inputItems.map((item, index) => (\n \n {item.label}\n \n ))}\n \n
\n\n \n {value.map((selectedValue) => {\n const optionData = formattedTags.find(\n (option) => option.value === selectedValue,\n ) as DropdownItemType;\n return (\n handleTagDelete(selectedValue) : undefined}\n color={isCustomValue(selectedValue) ? ChipColors.two : ChipColors.six}\n />\n );\n })}\n {!value.length &&

{`You haven't selected any ${tagLabelPlural}`}

}\n
\n
\n );\n});\n","import React, { ReactElement, useEffect, useState, FocusEvent } from \"react\";\n\nimport styled from \"styled-components\";\nimport { useCombobox } from \"downshift\";\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\n\nimport Input from \"../input\";\nimport { ToggleTipProps } from \"../../layout/toggle_tip\";\nimport usePrevious from \"../../../shared/use_previous\";\n\nconst InputAutocompleteWrapper = styled.span`\n display: inline-block;\n width: 100%;\n .wrapper {\n width: 100%;\n position: relative;\n }\n\n .text-input {\n margin-bottom: ${({ theme }) => theme.deprecatedSpacing.component.five};\n }\n`;\n\nconst StyledOptions = styled.ul<{ isOpen: boolean; maxHeight?: number }>`\n overflow: ${({ maxHeight }) => (maxHeight ? \"scroll\" : \"hidden\")};\n max-height: ${({ maxHeight }) => (maxHeight ? maxHeight : \"\")};\n background-color: ${({ theme }) => theme.deprecatedColors.primary.extraLight};\n border-radius: ${({ theme }) => theme.deprecatedBorder.radius.large};\n box-shadow: ${({ theme }) => theme.deprecatedElevation.two};\n padding: ${({ theme, isOpen }) => (isOpen ? theme.deprecatedSpacing.component.five : 0)};\n position: absolute;\n left: 0;\n right: 0;\n top: 90%;\n list-style-type: none;\n z-index: 1;\n`;\n\nconst StyledOption = styled.li<{ isHighlighted: boolean; isDisabled?: boolean }>`\n border-radius: ${({ theme }) => theme.deprecatedBorder.radius.normal};\n padding: ${({ theme }) => theme.deprecatedSpacing.component.four};\n background-color: ${({ theme, isHighlighted }) =>\n isHighlighted ? theme.deprecatedColors.primary.normal : \"transparent\"};\n color: ${({ theme, isHighlighted, isDisabled }) =>\n isDisabled\n ? theme.deprecatedColors.gray.seven\n : isHighlighted\n ? theme.deprecatedColors.white\n : theme.deprecatedColors.text.normal};\n cursor: ${({ isHighlighted, isDisabled }) =>\n isDisabled ? \"not-allowed\" : isHighlighted ? \"pointer\" : \"normal\"};\n`;\n\n//The label is optional when passed down as a prop\nexport interface AutocompleteItemType {\n value: string;\n label?: string;\n icon?: React.ReactNode;\n}\n\n//The label is required for the items used to generate the dropdown options\nexport interface DropdownItemType {\n value: string;\n label: string;\n icon?: React.ReactNode;\n}\n\nexport interface InputAutocompleteProps {\n label?: string;\n helperText?: string;\n className?: string;\n error?: string;\n description?: string;\n toggleTip?: ReactElement;\n adornmentIcon?: IconProp;\n availableOptions: AutocompleteItemType[];\n id?: string;\n placeholder?: string;\n value?: string;\n onSelect: (value: string) => void;\n onChange?: (value: string | undefined) => void;\n defaultIsOpen?: boolean;\n clearOnSelect?: boolean;\n optional?: boolean;\n maxHeight?: number;\n onMenuScrollToBottom?: () => void;\n onBlur?: (e: FocusEvent) => void;\n}\n\nexport default function InputAutocomplete({\n onSelect,\n label,\n helperText,\n className,\n error,\n toggleTip,\n adornmentIcon,\n description,\n placeholder,\n value,\n id,\n availableOptions,\n onChange,\n defaultIsOpen = false,\n clearOnSelect = true,\n optional = false,\n maxHeight = undefined,\n onMenuScrollToBottom = undefined,\n onBlur,\n}: InputAutocompleteProps) {\n const formattedOptions: DropdownItemType[] = availableOptions.map((availableOption) => ({\n label: availableOption?.label ?? availableOption.value,\n value: availableOption.value,\n icon: availableOption?.icon ?? undefined,\n }));\n const [inputItems, setInputItems] = useState(formattedOptions);\n const {\n isOpen,\n getMenuProps,\n getInputProps,\n getLabelProps,\n highlightedIndex,\n getItemProps,\n setInputValue,\n openMenu,\n closeMenu,\n } = useCombobox({\n items: inputItems,\n itemToString: (item) => (item ? item.label : \"\"),\n onSelectedItemChange: ({ selectedItem }) => {\n if (clearOnSelect) setInputValue(\"\");\n\n if (selectedItem && onSelect) {\n onSelect(selectedItem.value);\n }\n\n closeMenu();\n },\n onInputValueChange: ({ inputValue }) => {\n //Filters the options that are displayed in the dropdown menu\n if (onChange) onChange(inputValue);\n const itemsToSet = formattedOptions.filter((option) => {\n return option.label.toLowerCase().includes(inputValue?.toLowerCase() ?? \"\");\n });\n setInputItems([...itemsToSet]);\n },\n defaultIsOpen,\n });\n\n const prevOptions = usePrevious(availableOptions);\n useEffect(() => {\n // if the options passed in via props change, reset the dropdown\n // A simple !== will give us false positives\n if (!optionsMatch(prevOptions, availableOptions)) {\n setInputItems(formattedOptions);\n }\n }, [prevOptions, formattedOptions, availableOptions]);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const handleOptionsScroll = (event: { currentTarget: any }) => {\n const node = event.currentTarget;\n const isAtBottom = node?.scrollHeight - node?.scrollTop === node?.clientHeight;\n\n if (isAtBottom && !!onMenuScrollToBottom) {\n onMenuScrollToBottom();\n }\n };\n\n useEffect(() => {\n if (!value) {\n // if the value is invalidated by the parent, clear the input\n setInputValue(\"\");\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [value]);\n\n return (\n \n
\n \n\n \n {isOpen &&\n inputItems.map((item, index) => (\n \n {item?.icon || null}\n {item.label}\n \n ))}\n \n
\n
\n );\n}\n\nfunction optionsMatch(\n previous: AutocompleteItemType[] | undefined,\n current: AutocompleteItemType[],\n): boolean {\n if (!previous || previous.length !== current.length) return false;\n return previous.every((option, index) => {\n const currentOption = current[index];\n return option.value === currentOption.value && option.label === currentOption.label;\n });\n}\n","import React, { useEffect } from \"react\";\nimport Tags from \"../../components/data_entry/tags\";\nimport { QuestionProps } from \"../survey\";\nimport styled from \"styled-components\";\nimport QuestionLabel from \"./components/question_label\";\nimport TextArea from \"../../components/data_entry/text_area\";\nimport { Option, getOptionObjectFromText, getOptionOid, getOptionText } from \"./question_helpers\";\nimport InputAutocomplete from \"../../components/data_entry/input_autocomplete\";\nimport SelectQuestionWrapper from \"../../components/base_ui/higher_order_components/questions/select_question_wrapper\";\n\nexport interface Answer {\n writeIn?: string;\n followUpResponse?: string;\n selectedOptions: (string | Option | undefined)[];\n}\n\nexport interface Customizations {\n prompt: string;\n options: (string | Option)[];\n followUp?: {\n option: string;\n prompt: string;\n includeOpenResponse: boolean;\n placeholder?: string;\n };\n numberToChoose?: number;\n disableTagCreation?: boolean;\n description?: string;\n placeholder?: string;\n optional?: boolean;\n}\n\nconst Question = styled.div`\n .counterpart {\n margin-top: ${({ theme }) => theme.deprecatedSpacing.component.three};\n }\n .label {\n .label-text {\n text-transform: none;\n display: inline-block;\n font-weight: ${({ theme }) => theme.font.weight.light};\n font-size: 18px;\n white-space: pre-wrap;\n color: ${({ theme }) => theme.deprecatedColors.gray.four};\n }\n }\n`;\n\nconst StyledFollowUp = styled.div`\n padding-top: 2em;\n`;\n\nconst StyledDropdown = styled(InputAutocomplete)`\n .label {\n display: initial;\n }\n\n .inputWrapper {\n margin-top: 24px;\n }\n\n .text-input .input-description {\n display: block;\n font-weight: 500;\n font-size: 15px;\n margin-top: 17px;\n margin-bottom: 0;\n color: ${({ theme }) => theme.deprecatedColors.accent.four};\n }\n\n .input-options {\n max-height: 200px;\n overflow: scroll;\n }\n`;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function wrapDropdownStyles(Component: any) {\n return styled(Component)``;\n}\nconst StyledDropdownTags = wrapDropdownStyles(Tags);\n\nexport default function DropdownComponent({\n customizations,\n currentAnswer,\n updateAnswer,\n setAbleToSubmit,\n showValidation,\n showRefreshedComponents = true,\n}: QuestionProps) {\n const label = customizations.prompt;\n const optional = typeof customizations.optional === \"undefined\" ? false : customizations.optional;\n const disableTagCreation = customizations.disableTagCreation;\n const secondaryText = customizations.description;\n const placeholder = customizations.placeholder;\n const followUp = customizations.followUp;\n const numberToChoose = customizations.numberToChoose;\n const options = customizations.options;\n const answerIsValid = optional || (currentAnswer?.selectedOptions.length || 0) > 0;\n const selectedOptions = currentAnswer?.selectedOptions || [];\n\n useEffect(() => {\n setAbleToSubmit(answerIsValid);\n }, [answerIsValid, setAbleToSubmit]);\n\n const tagItemList = options.map((option) => {\n return { value: getOptionText(option) ?? \"\", label: getOptionText(option) };\n });\n\n const deprecatedDropdownComponent = (\n \n {(!numberToChoose || numberToChoose > 1) && (\n getOptionText(option))}\n onTagDelete={(deletedTag: string) => {\n updateAnswer({\n selectedOptions: selectedOptions.filter(\n (option) => getOptionText(option) !== deletedTag,\n ),\n });\n }}\n onTagSelect={(selectedTagString: string) => {\n updateAnswer({\n selectedOptions: [\n ...selectedOptions,\n getOptionObjectFromText(selectedTagString, customizations.options),\n ],\n });\n }}\n />\n )}\n {numberToChoose === 1 && (\n {\n updateAnswer({\n selectedOptions: [getOptionObjectFromText(selectedTag, customizations.options)],\n });\n }}\n onChange={(selectedTag) => {\n if (!selectedTag) return updateAnswer({ selectedOptions: [] });\n\n const option = getOptionObjectFromText(selectedTag.trim(), customizations.options);\n const answers = option ? [option] : [];\n updateAnswer({ selectedOptions: answers });\n }}\n />\n )}\n {followUp &&\n selectedOptions.map((option) => getOptionText(option)).includes(followUp.option) && (\n \n \n {followUp.includeOpenResponse && (\n \n updateAnswer({\n ...currentAnswer,\n selectedOptions: selectedOptions,\n followUpResponse: updatedResponse,\n })\n }\n value={currentAnswer ? currentAnswer.followUpResponse : \"\"}\n />\n )}\n \n )}\n \n );\n const requiredErrorMessage = \"Please complete the required field.\";\n const multiselectComponent = (\n <>\n 0\n ? {\n id: getOptionOid(selectedOptions[0]) || \"\",\n label: getOptionText(selectedOptions[0]),\n }\n : undefined\n }\n options={options.map((option) => {\n const optionLabel = getOptionText(option);\n return {\n id: getOptionOid(option) || \"\",\n label: getOptionText(option) || \"\",\n value: selectedOptions.includes(getOptionObjectFromText(optionLabel || \"\", options)),\n };\n })}\n onChange={(newAnswer) => {\n updateAnswer({\n selectedOptions: newAnswer\n ? [getOptionObjectFromText(newAnswer.label as string, customizations.options)]\n : [],\n });\n }}\n setAbleToSubmit={setAbleToSubmit}\n errorMessage={!answerIsValid && showValidation ? requiredErrorMessage : undefined}\n followUpPrompt={followUp?.prompt}\n followUpIsOptional={true}\n showFollowUp={followUp && getOptionText(selectedOptions[0]) === followUp?.option}\n dataTest=\"survey-question-multi-select\"\n >\n \n );\n\n return showRefreshedComponents ? multiselectComponent : deprecatedDropdownComponent;\n}\n","import { useState, useEffect } from \"react\";\nimport { useStyletron } from \"baseui\";\n\ninterface DeviceTypes {\n isMobile: boolean;\n isTablet: boolean;\n isDesktop: boolean;\n}\n\nconst useDeviceType = (): DeviceTypes => {\n const [, theme] = useStyletron();\n const [deviceTypes, setDeviceTypes] = useState(getDeviceTypes(theme.breakpoints));\n\n useEffect(() => {\n const handleResize = () => {\n setDeviceTypes(getDeviceTypes(theme.breakpoints));\n };\n\n // Add event listener for window resize\n window.addEventListener(\"resize\", handleResize);\n\n // Remove event listener on component unmount\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n }, [theme.breakpoints]);\n\n return deviceTypes;\n};\n\nconst getDeviceTypes = (breakpoints: { medium: number; large: number }): DeviceTypes => {\n const windowWidth = window.innerWidth;\n\n return {\n isMobile: windowWidth < breakpoints.medium,\n isTablet: windowWidth >= breakpoints.medium && windowWidth < breakpoints.large,\n isDesktop: windowWidth >= breakpoints.large,\n };\n};\n\nexport default useDeviceType;\n","import React, { useState, createContext, useEffect, Dispatch, SetStateAction } from \"react\";\nimport SurveyQuestionDatePicker from \"./questions/survey_question_date_picker\";\nimport MentorshipChatGroupStudentSelect from \"./questions/mentorship_chat_group/student_select\";\nimport MentorshipChatGroupOptionalStudentInfo from \"./questions/mentorship_chat_group/optional_student_info\";\nimport MultiSelect from \"./questions/multi_select\";\nimport { gql } from \"@urql/core\";\nimport {\n SurveyDocument,\n SaveSurveyResponseDocument,\n SurveyQuery,\n Survey as SurveyType, // not great, but there's a conflicting declaration of the Survey class in this file\n SurveyType as SurveyTypeType, // not great, but there's a conflicting declaration of the Survey class in this file\n SurveyAnswerInput,\n SurveyQuestionTemplateId,\n SurveyQuestion,\n SaveSurveyResponseMutationVariables,\n} from \"../generated/graphql\";\nimport Conversation from \"./questions/conversation\";\nimport Flags from \"./questions/flags\";\nimport Nps from \"./questions/nps\";\nimport SurveyQuestionSelect from \"./questions/select/survey_question_select\";\nimport SurveyQuestionLikert from \"./questions/likert/survey_question_likert\";\nimport RotatingLikert from \"./questions/rotating_likert\";\nimport RotatingOpenResponse from \"./questions/rotating_open_response\";\nimport RotatingCareerOpenResponse from \"./questions/rotating_career_open_response\";\nimport SurveyQuestionSelectWithSelectFollowUp from \"./questions/survey_question_select_with_select_follow_up\";\nimport Generic from \"./questions/generic/generic\";\nimport styled from \"styled-components\";\nimport CounterpartsInfo from \"./questions/counterparts_info\";\nimport SurveyQuestionNumberInput from \"./questions/survey_question_number_input\";\nimport { useQuery, useMutation } from \"urql\";\nimport SurveyQuestionOpenResponse from \"./questions/survey_question_open_response\";\nimport SurveyQuestionTextInput from \"./questions/survey_question_text_input\";\nimport DropdownComponent from \"./questions/multi_select_dropdown\";\nimport useDeviceType from \"../shared/use_device_type\";\nimport { captureError } from \"../../utils/capture_error\";\n\nexport interface QuestionProps {\n customizations: Customizations;\n currentAnswer?: Answer;\n updateAnswer: (newAnswer: Answer) => void;\n setAbleToSubmit: (ableToSubmit: boolean) => void;\n questionId?: string | number;\n maxValue?: number;\n showValidation: boolean;\n showRefreshedComponents?: boolean;\n hackToHideFeedback?: boolean;\n dataTest?: string;\n}\n\nfunction Question({\n answer,\n templateId,\n customizations,\n updateAnswer,\n setAbleToSubmit,\n qid,\n questionId,\n showValidation,\n showRefreshedComponents,\n}: {\n answer?: SurveyAnswerInput[\"answerJson\"];\n templateId: SurveyQuestionTemplateId;\n customizations: SurveyQuestion[\"customizations\"];\n updateAnswer: (newAnswer: SurveyAnswerInput[\"answerJson\"]) => void;\n setAbleToSubmit: (ableToSubmit: boolean) => void;\n qid?: string | null;\n questionId: number | string;\n showValidation: boolean;\n showRefreshedComponents: boolean;\n}) {\n switch (templateId) {\n case SurveyQuestionTemplateId.DatePicker:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n showRefreshedComponents={showRefreshedComponents}\n />\n );\n case SurveyQuestionTemplateId.OpenResponse:\n if (qid === \"signature\" && showRefreshedComponents) {\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n }\n\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n showRefreshedComponents={showRefreshedComponents}\n // This hack is in place because the open-response question on the Post-Session Survey\n // leads to some answers from participants where participants/partners expect quick action.\n // However, there is no good process for reviewing PSS responses in a timely manner.\n // It takes PS a lot of manual time to review these responses via exports.\n // Removing a question from the PSS \"the right way\" is high-effort due to current survey design.\n // Additionally, the initial ask was to include a text-only (no-input) question\n // to redirect participants to our normal helpdesk flow.\n // This hack is acceptable from a product perspective so that we don't have the liability of\n // having to do something with feedback that we cannot quickly and efficiently address.\n // Ideally the entire PSS is replaced by a different solution, since there are multiple\n // issues with the PSS as a whole.\n hackToHideFeedback={[29, 35, 40, 46, 82, 382, 387, 6179, 6187].includes(\n parseInt(questionId.toString()),\n )}\n />\n );\n case SurveyQuestionTemplateId.MentorshipChatGroupStudentSelect:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n case SurveyQuestionTemplateId.MentorshipChatGroupOptionalStudentInfo:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n // Note that even though this question template is called \"MultiSelect\", currently we don't have any survey\n // question that requires selecting multiple options. There is a property called `numberToChoose` in the customizations json\n // that indicates how many options can be selected, but it is always set to 1 (in other words, it's a single-select question).\n // Probably would be a good idea to refactor/rename this to avoid confusion.\n case SurveyQuestionTemplateId.MultiSelect:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n showRefreshedComponents={showRefreshedComponents}\n />\n );\n case SurveyQuestionTemplateId.Conversation:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n case SurveyQuestionTemplateId.Flags:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n case SurveyQuestionTemplateId.Nps:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n case SurveyQuestionTemplateId.Likert:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n showRefreshedComponents={showRefreshedComponents}\n />\n );\n case SurveyQuestionTemplateId.Select:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n showRefreshedComponents={showRefreshedComponents}\n />\n );\n case SurveyQuestionTemplateId.RotatingLikert:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n case SurveyQuestionTemplateId.RotatingOpenResponse:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n case SurveyQuestionTemplateId.RotatingCareerOpenResponse:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n case SurveyQuestionTemplateId.SelectWithSelectFollowUp:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n showRefreshedComponents={showRefreshedComponents}\n />\n );\n case SurveyQuestionTemplateId.CounterpartsInfo:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n />\n );\n case SurveyQuestionTemplateId.MultiSelectDropdown:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n showRefreshedComponents={showRefreshedComponents}\n />\n );\n case SurveyQuestionTemplateId.Generic:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n showRefreshedComponents={showRefreshedComponents}\n />\n );\n case SurveyQuestionTemplateId.NumberInput:\n return (\n updateAnswer(newAnswer)}\n setAbleToSubmit={setAbleToSubmit}\n questionId={questionId}\n showValidation={showValidation}\n showRefreshedComponents={showRefreshedComponents}\n />\n );\n default:\n throw new Error(`Couldn't find survey question template ${templateId}`);\n }\n}\n\nexport enum SurveyDisplay {\n page,\n banner,\n}\n\nexport const SurveyContext = createContext<{\n surveyId: string;\n mentorshipChatGroupId?: string;\n mentorshipId?: string;\n participantId: string;\n display: SurveyDisplay;\n programId?: string;\n}>({ participantId: \"\", surveyId: \"\", display: SurveyDisplay.page, programId: \"\" });\n\ngql`\n query Survey(\n $id: ID!\n $participantId: ID\n $surveyCustomRenderOverride: SurveyCustomRenderOverride\n $questionFilter: SurveyQuestionFilter\n ) {\n survey(id: $id) {\n id\n name\n description(\n participantId: $participantId\n surveyCustomRenderOverride: $surveyCustomRenderOverride\n )\n surveyType\n questions(filter: $questionFilter, surveyCustomRenderOverride: $surveyCustomRenderOverride) {\n id\n qid\n index\n template {\n id\n templateId\n }\n customizations\n createdInAdminTool\n }\n }\n }\n`;\n\n// in addition to the survey response, we also need to query for everything that might have changed because of\n// a side effect to update the cache. for now this just includes conversation logs and # of survey responses\ngql`\n mutation SaveSurveyResponse($inputResponse: SurveyResponseInput!) {\n saveSurveyResponse(response: $inputResponse) {\n errors\n response {\n id\n context {\n participantId\n mentorshipId\n mentorshipChatGroupId\n }\n }\n user {\n id\n participants {\n id\n mentorships {\n id\n studentIsDisengaged\n mentorIsDisengaged\n mentorConversationLogs {\n id\n }\n studentConversationLogs {\n id\n }\n }\n surveyResponses {\n id\n survey {\n id\n }\n }\n }\n # To properly update the urql cache, we need to re-fetch all surveyResponses for this participant.\n # We can't just fetch by id, the cache will not update.\n surveyResponses {\n id\n survey {\n id\n }\n }\n }\n }\n }\n`;\n\nconst StyledSurvey = styled.div`\n width: 100%;\n\n .showRefreshedComponents {\n margin: 0;\n }\n\n .question {\n display: flex;\n flex-direction: column;\n padding: ${({ theme }) => theme.sizing.scale300};\n }\n\n .mobile {\n padding: ${({ theme }) => theme.sizing.scale300};\n }\n`;\n\nconst Description = styled.p`\n font-size: ${({ theme }) => theme.font.size.header.four};\n`;\n\ninterface CustomRenderOverride {\n userId: string;\n programId: string;\n}\n\nexport interface SurveyState {\n survey: SurveyType;\n answers: { [questionId: string]: SurveyAnswerInput[\"answerJson\"] };\n savingResponse: boolean;\n ableToSubmit: boolean;\n fetching: boolean;\n setAnswers: (args: { [questionId: string]: SurveyAnswerInput[\"answerJson\"] }) => void;\n setSavingResponse: (args: boolean) => void;\n saveSurveyResponse: (args: SaveSurveyResponseMutationVariables) => void;\n setIdsOfQuestionsAbleToSubmit: Dispatch>;\n questionsWithErrors: SurveyType[\"questions\"];\n showValidation: boolean;\n setShowValidation: (showValidation: boolean) => void;\n}\n\nexport function useSurveyState({\n id,\n userId,\n onSubmit,\n participantId = \"\",\n surveyCustomRenderOverride,\n}: {\n id: string;\n userId: string;\n onSubmit: () => void;\n participantId?: string;\n surveyCustomRenderOverride?: CustomRenderOverride;\n}): SurveyState {\n const [answers, setAnswers] = useState<{\n [questionId: string]: SurveyAnswerInput[\"answerJson\"];\n }>({});\n const [idsOfQuestionsAbleToSubmit, setIdsOfQuestionsAbleToSubmit] = useState([]);\n const [savingResponse, setSavingResponse] = useState(false);\n const [saveResponseResult, saveSurveyResponse] = useMutation(SaveSurveyResponseDocument);\n const [showValidation, setShowValidation] = useState(false);\n\n const [{ fetching, error, data }] = useQuery({\n query: SurveyDocument,\n variables: {\n id: id,\n participantId: participantId, // needed to transform variables in Description field\n surveyCustomRenderOverride: surveyCustomRenderOverride,\n questionFilter: {\n userId: userId,\n participantId: participantId,\n },\n },\n pause: !id,\n });\n\n useEffect(() => {\n if (saveResponseResult.data?.saveSurveyResponse) {\n const response = saveResponseResult.data.saveSurveyResponse;\n if (response.errors?.length) {\n throw new Error(`Could not save survey: ${response.errors.join(\", \")}`);\n } else {\n onSubmit();\n }\n }\n }, [onSubmit, saveResponseResult.data?.saveSurveyResponse]);\n\n if (fetching || data === null || !id) {\n return {\n fetching: true,\n survey: {} as SurveyType,\n ableToSubmit: false,\n answers,\n setAnswers,\n saveSurveyResponse,\n setSavingResponse,\n savingResponse,\n setIdsOfQuestionsAbleToSubmit,\n questionsWithErrors: [],\n showValidation,\n setShowValidation,\n };\n }\n\n if (error || !data || saveResponseResult.error) {\n if (error || !data) {\n const graphQLErrorsForAPM = error?.graphQLErrors?.join(\"; \") ?? \"\";\n captureError(new Error(`Error fetching useSurveyQuery: ${graphQLErrorsForAPM}`));\n }\n\n throw new Error(\"Uh oh\");\n }\n\n const survey = data.survey;\n const questionsWithErrors = survey.questions.filter(\n (question: SurveyQuery[\"survey\"][\"questions\"][0]) =>\n !idsOfQuestionsAbleToSubmit.includes(question.id),\n );\n\n const ableToSubmit = survey.questions.reduce(\n (ableToSubmit: boolean, question: SurveyQuery[\"survey\"][\"questions\"][0]) =>\n idsOfQuestionsAbleToSubmit.includes(question.id) ? ableToSubmit : false,\n true,\n );\n\n return {\n fetching,\n survey,\n answers,\n setAnswers,\n saveSurveyResponse,\n setSavingResponse,\n savingResponse,\n setIdsOfQuestionsAbleToSubmit,\n ableToSubmit,\n questionsWithErrors,\n showValidation,\n setShowValidation,\n };\n}\n\nexport default function Survey({\n survey,\n context,\n className,\n savingResponse,\n answers,\n setAnswers,\n setIdsOfQuestionsAbleToSubmit,\n display = SurveyDisplay.page,\n showValidation = false,\n}: {\n survey: SurveyType;\n // @TODO: might need to come back and re-think this a bit. What other contexts could a survey be used for?\n context?: {\n mentorshipChatGroupId?: string;\n mentorshipId?: string;\n participantId?: string;\n programId?: string;\n };\n className?: string;\n savingResponse: boolean;\n answers: { [questionId: string]: SurveyAnswerInput[\"answerJson\"] };\n setAnswers: (args: { [questionId: string]: SurveyAnswerInput[\"answerJson\"] }) => void;\n setIdsOfQuestionsAbleToSubmit: Dispatch>;\n display?: SurveyDisplay;\n showValidation?: boolean;\n}) {\n const { isMobile } = useDeviceType();\n const QUICK_CONVERSATION_LOGGING_SURVEY_ID = \"28\";\n\n // TA-879: due to time and resource constraints, these surveys will not have a refreshed UI\n const showRefreshedComponents =\n survey.surveyType !== SurveyTypeType.PostSession &&\n survey.id !== QUICK_CONVERSATION_LOGGING_SURVEY_ID;\n\n return (\n \n {survey.description && (\n \n )}\n {/* Hide this notice on survey banners, which are limited to one question. */}\n {!showRefreshedComponents && display !== SurveyDisplay.banner && (\n

NOTE: Fields marked with an asterisk (*) are required.

\n )}\n {!savingResponse ? (\n \n {survey.questions\n .sort((question1, question2) => (question1.index < question2.index ? -1 : 1))\n .map((question) => {\n return (\n \n \n setAnswers({ ...answers, [question.id]: answer })\n }\n setAbleToSubmit={(ableToSubmit: boolean) => {\n // we use an updater function here since we're relying on previous state, and\n // there could be multiple questions updating at the same time\n // https://reactjs.org/docs/hooks-reference.html#functional-updates\n setIdsOfQuestionsAbleToSubmit((currentIds) => {\n if (ableToSubmit) {\n if (!currentIds.includes(question.id)) {\n return [...currentIds, question.id];\n }\n } else {\n if (currentIds.includes(question.id)) {\n return currentIds.filter((questionId) => questionId !== question.id);\n }\n }\n return currentIds;\n });\n }}\n />\n \n );\n })}\n \n ) : (\n \"Saving...\"\n )}\n \n );\n}\n"],"names":["entries","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","freeze","seal","create","apply","construct","x","fun","thisValue","args","Func","arrayForEach","unapply","arrayLastIndexOf","arrayPop","arrayPush","arraySplice","stringToLowerCase","stringToString","stringMatch","stringReplace","stringIndexOf","stringTrim","objectHasOwnProperty","regExpTest","typeErrorCreate","unconstruct","func","thisArg","_len","_key","_len2","_key2","addToSet","set","array","transformCaseFunc","l","element","lcElement","cleanArray","index","clone","object","newObject","property","value","lookupGetter","prop","desc","fallbackValue","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","text","html","svg","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","EXPRESSIONS","NODE_TYPE","getGlobal","_createTrustedTypesPolicy","trustedTypes","purifyHostElement","suffix","ATTR_NAME","policyName","scriptUrl","_createHooksMap","createDOMPurify","window","DOMPurify","root","document","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","HTMLFormElement","DOMParser","ElementPrototype","cloneNode","remove","getNextSibling","getChildNodes","getParentNode","template","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","SANITIZE_NAMED_PROPS_PREFIX","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","DEFAULT_PARSER_MEDIA_TYPE","CONFIG","formElement","isRegexOrFunction","testValue","_parseConfig","cfg","ALL_SVG_TAGS","ALL_MATHML_TAGS","_checkValidNamespace","parent","tagName","parentTagName","_forceRemove","node","_removeAttribute","name","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","body","_createNodeIterator","_isClobbered","_isNode","_executeHooks","currentNode","data","hook","_sanitizeElements","content","_isBasicCustomElement","parentNode","childNodes","childCount","i","childClone","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","attributes","hookEvent","attr","namespaceURI","attrValue","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","importedNode","returnNode","nodeIterator","serializedHTML","tag","entryPoint","hookFunction","purify","StyledQuestionPrompt","styled","StyledDescription","theme","RequiredMarker","StyledLabel","QuestionLabel","label","description","questionIsOptional","htmlFor","hideRequiredMarker","dataTest","rest","jsxs","Fragment","jsx","HiddenAccessibleSpan","exports","React","require$$0","_interopDefaultLegacy","e","React__default","globalPrefix","lastId","nextId","localPrefix","resetId","setPrefix","newPrefix","getIds","count","prefix","ids","usePrevious","ref","useId","idsListRef","prevCount","prevPrefix","StyledSupplementalQuestionPromptDiv","StyledParagraphMedium","ParagraphMedium","StyledText","StyledOptionalText","PromptWithSecondaryText","supplementalQuestionPrompt","secondaryText","optional","useConstructAriaLabel","maxCharacterLimit","supplementalQuestionPromptSubstring","secondaryTextSubstring","labelSubstring","optionalSubstring","maxCharacterLimitSubString","DATEPICKER_NAMESPACE","formControlOverrides","$theme","DatepickerQuestionWrapper","errorMessage","placeholder","datepickerProps","constructAriaLabel","datepickerId","FormControl","Datepicker","StyledDatePicker","SurveyQuestionDatePicker","customizations","currentAnswer","updateAnswer","setAbleToSubmit","showValidation","showRefreshedComponents","id","minDate","maxDate","date","answerIsValidRequired","answerIsValidDate","useEffect","datepickerErrorMessage","setDatepickerErrorMessage","useState","requiredErrorMessage","dateErrorMessage","newValue","DatePickerComponent","day","selected","gql","MentorChatGroupStudentSelect","participantId","mentorshipChatGroupId","useContext","SurveyContext","fetching","error","useQuery","MentorChatGroupsDocument","answerIsValid","graphQLErrorsForAPM","_a","captureError","mentorships","matchedMentorshipsInChatGroup","mentorship","selectedStudentIds","student","user","Checkbox","StyledStudentSelect","MentorChatGroupOptionalStudentInfo","savedStudentInfo","setSavedStudentInfo","mentorshipsInChatGroup","yesNoLabel","selectLabel","RadioGroup","RadioButton","answerIndex","answer","Input","newInfo","StyledLegend","StyledFieldset","QuestionFieldsetLegend","legend","getOptionText","option","getOptionOid","getOptionObjectFromText","optionText","optionList","selectedOptionPresent","selectedOption","StyledSecondaryText","getFormControlLabel","styledSecondaryLabel","INPUT_AREA_NAMESPACE","inputOverrides","maxCharacterCount","InputQuestionWrapper","overrides","ariaLabel","inputProps","mergeOverrides","inputId","TEXT_AREA_NAMESPACE","textareaOverrides","currentCharacterCount","TextareaQuestionWrapper","textareaProps","textAreaId","Textarea","MultiSelectFollowUpQuestionType","maxCharacters","getFollowupErrorMessage","requiredAnswerIsMissing","answerExceedsCharacterLimit","MultiSelectQuestionWrapper","questionPrompt","showErrors","options","onChange","requiredAnswerCount","answerCountStrictness","setErrorMessage","ableToSubmit","selectedOptions","_b","idx","optionIsSelected","formError","_c","_d","_e","_f","_g","_h","MultiSelect","otherOption","followUpErrorMessage","deprecatedMultiSelect","CheckboxGroup","CheckBoxDisplay","updatedWriteIn","multiSelect","optionLabel","newAnswer","optionObject","modeOfCommunicationOptions","ModeOfCommunication","conversationTopicLabel","topic","ConversationTopic","ConversationTopicsQuestion","Conversation","questionId","programId","SurveyParticipantDataDocument","fetchingProgramSegment","errorProgramSegment","programSegmentData","ProgramSegmentDocument","fetchingTopics","topicsData","ConversationTopicsDocument","modeOfCommunicationLabel","topicsLabel","answeredConversationTopicsQuestion","answeredModesOfCommunicationQuestion","TextArea","hasError","TextAreaInput","className","FlagsExtraQuestion","Flags","initialCategory","categoriesFetching","categoriesError","categoriesData","FlagCategoriesDocument","category","flagCategory","program","followUpLabel","schoolSupportLabel","schoolSupportDescriptionLabel","hideSchoolSupportQuestion","sortedCategories","a","b","updatedOptions","updatedResponse","ScaleLabel","times","fn","start","end","num","list","StyledRadioButton","LikertExtraQuestion","Likert","prompt","onChangeValue","followUpPrompt","followUpResponse","followUpLowScore","followUpLowPrompt","followUpLowResponse","followUpLowQuestion","lowScoreThreshold","onChangeLowFollowUp","followUpHighScore","followUpHighPrompt","followUpHighResponse","highScoreThreshold","onChangeHighFollowUp","max","maxLabel","min","minLabel","displayValues","followUpLowDescription","display","SurveyDisplay","RadioGroupDisplay","Nps","newResponse","ALIGN","SELECT_NAMESPACE","StyledPromptWithSecondaryTextWrapper","marginbottom","StyledFollowUpWrapper","marginTop","selectOverrides","radioFormControlOverrides","RADIO_VARIATION_CUTOFF","SelectQuestionWrapper","showFollowUp","followUpIsOptional","followUpCurrentCharacterCount","followUpMaxCharacterCount","followUpValue","followUpAriaLabel","onChangeFollowUpValue","selectProps","selectId","baseuiTheme","Select","params","Radio","isOptional","getOptionsForSelectComponent","optionsForSelectComponent","optionsIncludeOtherOption","getQuestionOptions","questionOptions","questionOptionsIncludesOtherOption","StyledFollowUp","DeprecatedSelect","withOtherOption","followUp","followUpOptionSelected","optionalFollowUp","otherOptionSelected","valueProvidedForOtherOption","valueProvidedForFollowUpOption","followUpIsValid","otherOptionIsValid","DeprecatedRadioGroup","SELECT_FOLLOW_UP_CHARACTER_LIMIT","SurveyQuestionSelect","selectComponentOptions","writeIn","followUpCharacterCount","maximumCharacterLimitExceededBy","followUpRequiredAndWithinCharacterLimit","followUpNotRequiredAndWithinCharacterLimit","noFollowUpIsAsked","followUpCharacterLimitExceeded","characterLimitErrorMessage","followUpMissingButRequired","select","LIKERT_RADIO_NAMESPACE","StyledRadioLabel","StyledTextAreaContainer","likertRadioGroupOverrides","likertRadioOverrides","likertRadioGroupOverridesMobile","likertRadioOverridesMobile","LikertQuestionWrapper","onChangeFollowUp","radioGroupProps","radioValues","followUpLow","followUpHigh","followUpQuestionPrompt","followUpQuestionResponse","mobileView","deprecatedTheme","k","v","TextAreaQuestionWrapper","useNormalizeSurveyQuestionLikertCustomizations","followUpLowDescriptionLabel","followUpLowScoreThreshold","followUpLowScoreIsOptional","followUpHighScoreThreshold","followUpHighScoreIsOptional","LIKERT_FOLLOW_UP_CHARACTER_LIMIT","LIKERT_MULTI_SELECT_OTHER_OPTION_FOLLOW_UP_CHARACTER_LIMIT","useSurveyQuestionLikertValidation","followUpState","triggeredLowScoreFollowUp","triggeredHighScoreFollowUp","followUpLowMultiSelectResponse","hasOpenResponseFollowUp","hasMultiSelectFollowUp","followUpLowResponseLength","followUpHighResponseLength","followUpLowResponseWriteInLength","deprecatedAnswerIsValid","followUpLowScoreIsValid","followUpHighScoreIsValid","SurveyQuestionLikert","valueTriggersLowScoreFollowUp","valueTriggersHighScoreFollowUp","maximumCharacterLimitToRespect","displayValuesFormattedForLikert","followUpLowQuestionOptions","getValueForMultiSelectOption","followUpLowQuestionFormattedForLikert","deprecatedLikert","withoutFollowUpHighResponse","withoutFollowUpLowResponse","likert","useRotatingQuestionIndex","numberOfQuestions","surveyAudienceContext","pause","userId","AppContext","currentSurveyContext","surveyId","ParticipantSurveyResponsesDocument","contextToUse","response","RotatingLikert","questionIndex","likertQuestion","RotatingOpenResponse","question","availableMentorQuestions","studentFirstName","studentGoal","getGeneric","questions","availableStudentQuestions","mentorFirstName","getRotatingCareerOpenResponseQuestions","participant","RotatingCareerOpenResponseInput","rotatingQuestions","genericRotatingQuestions","genericQuestion","RotatingCareerOpenResponse","props","mentorshipId","PostSessionSurveyCareerQuestionDocument","SurveyQuestionSelectWithSelectFollowUp","selectedFollowUpOption","optionIsValid","followUpOptionIsTriggered","followUpOptionIsValid","deprecatedSelectWithSelectFollowUp","selectWithSelectFollowUp","StyledDeprecatedSingleSelect","StyledSingleSelect","SingleSelect","qid","transformedOptions","deprecatedSingleSelect","singleSelect","StyledMultiSelect","StyledMultiSelectContainer","StyledDeprecatedInput","StyledInput","deprecatedInput","input","Generic","followUps","updateAndScrubAnswer","tempNewFollowUps","filterFollowUpConditions","followUpsToRemove","f","newAnswers","_","followUpsToDisplay","QuestionComponent","componentForQuestionType","type","answerArray","Question","CounterpartsInfo","CounterpartsQuestionDocument","filledOut","key","userIsMentor","counterpart","updatedAnswer","NumberErrorLabel","SurveyQuestionNumberInput","showNumberError","setShowNumberError","numericInputErrorMessage","setNumericInputErrorMessage","followUpQuestionErrorMessage","setfollowUpQuestionErrorMessage","touched","setTouched","showMaxCharactersError","setShowMaxCharactersError","currentAnswerValue","maxValue","isFollowUpQuestionAnswerValid","shouldShowFollowUp","numericInputAnswerIsValid","followUpQuestionAnswerIsValid","deprecatedNumberInput","numberIsProperFormat","numberIsWithinValidRange","numberInput","SurveyQuestionOpenResponse","hackToHideFeedback","deprecatedOpenResponse","SurveyQuestionTextInput","hasNoOptionalityError","hasNoLengthError","c","d","g","h","m","n","p","q","t","u","r","reactIs_production_min","reactIsModule","o","s","w","W","H","y","M","E","C","I","T","B","V","D","L","F","S","X","idCounter","noop","scrollIntoView","menuNode","actions","compute","_ref","el","top","left","isOrContainsNode","child","environment","result","debounce","time","timeoutId","cancel","wrapper","callAllEventHandlers","fns","event","_len3","_key3","handleRefs","_len4","refs","_key4","generateId","getState","state","prevState","isControlledProp","normalizeArrowKey","keyCode","getHighlightedIndex","offset","items","isItemDisabled","circular","itemsLastIndex","current","highlightedIndex","getNonDisabledIndex","backwards","_index","targetWithinDownshift","target","downshiftElements","checkActiveElement","contextNode","cleanupStatus","documentProp","getStatusDiv","statusDiv","setStatus","status","div","cleanupStatusDiv","dropdownDefaultStateValues","callOnChangeProps","action","newState","changes","invokeOnChangeHandler","_extends","handler","capitalizeString","stateReducer","updateA11yStatus","useIsomorphicLayoutEffect","useLayoutEffect","useElementIds","labelId","menuId","getItemId","toggleButtonId","reactId","elementIdsRef","useRef","_ref2","_ref2$id","getItemAndIndex","itemProp","indexProp","item","string","useLatestRef","val","useEnhancedReducer","reducer","createInitialState","isStateEqual","prevStateRef","actionRef","enhancedReducer","useCallback","_useReducer","useReducer","dispatch","propsRef","dispatchWithProps","shouldCallOnChangeProps","defaultProps$3","getDefaultValue$1","propKey","defaultStateValues","defaultValue","getInitialValue$1","initialValue","getInitialState$2","selectedItem","isOpen","getInitialHighlightedIndex","inputValue","getHighlightedIndexOnOpen","initialHighlightedIndex","defaultHighlightedIndex","itemToKey","useMouseAndTouchTracker","handleBlur","downshiftElementsRefs","mouseAndTouchTrackersRef","onMouseDown","onMouseUp","onTouchStart","onTouchMove","onTouchEnd","useGetterPropsCalledChecker","useA11yMessageStatus","getA11yStatusMessage","dependencyArray","isInitialMount","useIsInitialMount","useScrollIntoView","_ref3","itemRefs","getItemNodeFromIndex","menuElement","scrollIntoViewProp","shouldScrollRef","getChangesOnSelection","_props$items","shouldSelect","isDropdownsStateEqual","isInitialMountRef","getDefaultHighlightedIndex","commonPropTypes","PropTypes","commonDropdownPropTypes","downshiftCommonReducer","stateChangeTypes","__assign","InputKeyDownArrowDown","InputKeyDownArrowUp","InputKeyDownEscape","InputKeyDownHome","InputKeyDownEnd","InputKeyDownPageUp","InputKeyDownPageDown","InputKeyDownEnter","InputChange","InputBlur","InputClick","MenuMouseLeave","ItemMouseMove","ItemClick","ToggleButtonClick","FunctionToggleMenu","FunctionOpenMenu","FunctionCloseMenu","FunctionSetHighlightedIndex","FunctionSelectItem","FunctionSetInputValue","FunctionReset$1","ControlledPropUpdatedSelectedItem","stateChangeTypes$1","getInitialState$1","initialState","useControlledReducer","previousSelectedItemRef","_useEnhancedReducer","shouldCallDispatch","defaultProps$1","downshiftUseComboboxReducer","altKey","_excluded$1","_excluded2$1","_excluded3","_excluded4","useCombobox","userProps","_useControlledReducer","menuRef","inputRef","toggleButtonRef","elementIds","previousResultCountRef","latest","focusOnOpen","mouseAndTouchTrackers","useMemo","setGetterPropCallInfo","_inputRef$current","inputKeyDownHandlers","latestState","getLabelProps","labelProps","getMenuProps","_temp","_temp2","_extends2","onMouseLeave","_ref$refKey","refKey","_objectWithoutPropertiesLoose","getItemProps","_temp3","_extends3","_ref4","_ref3$refKey","onMouseMove","onClick","disabledProp","_latest$current","latestProps","_getItemAndIndex","disabled","onSelectKey","customClickHandler","itemHandleMouseMove","itemHandleClick","itemHandleMouseDown","itemNode","getToggleButtonProps","_temp4","_extends4","_ref5","_ref5$refKey","toggleButtonHandleClick","toggleButtonNode","getInputProps","_temp5","_temp6","_extends5","_ref6","onKeyDown","onInput","onBlur","_ref6$refKey","_ref7","inputHandleKeyDown","inputHandleChange","inputHandleBlur","isBlurByTabChange","inputHandleClick","onChangeKey","eventHandlers","_eventHandlers","inputNode","toggleMenu","closeMenu","openMenu","setHighlightedIndex","newHighlightedIndex","selectItem","newSelectedItem","setInputValue","newInputValue","reset","ChipGroup","StyledChip","color","ChipColors","Chip","onDelete","FontAwesomeIcon","TagsInputWrapper","StyledTagsContainer","StyledOptions","StyledOption","isHighlighted","isDisabled","TagsInput","onTagSelect","onTagCreate","helperText","toggleTip","adornmentIcon","createTagLabel","availableTags","disableTagCreation","onTagDelete","tagLabelPlural","formattedTags","setFormattedTags","inputItems","setInputItems","valueIsSelected","isCustomValue","itemsToSet","customInputItem","getFormattedTags","availableTag","availableTagsValues","valueToFind","handleTagDelete","deletedItem","createElement","selectedValue","optionData","InputAutocompleteWrapper","maxHeight","InputAutocomplete","onSelect","availableOptions","defaultIsOpen","clearOnSelect","onMenuScrollToBottom","formattedOptions","availableOption","prevOptions","optionsMatch","handleOptionsScroll","previous","currentOption","StyledDropdown","wrapDropdownStyles","Component","StyledDropdownTags","Tags","DropdownComponent","numberToChoose","tagItemList","deprecatedDropdownComponent","deletedTag","selectedTagString","selectedTag","multiselectComponent","useDeviceType","useStyletron","deviceTypes","setDeviceTypes","getDeviceTypes","handleResize","breakpoints","windowWidth","templateId","SurveyQuestionTemplateId","MentorshipChatGroupStudentSelect","MentorshipChatGroupOptionalStudentInfo","SurveyDisplay2","createContext","StyledSurvey","Description","useSurveyState","onSubmit","surveyCustomRenderOverride","answers","setAnswers","idsOfQuestionsAbleToSubmit","setIdsOfQuestionsAbleToSubmit","savingResponse","setSavingResponse","saveResponseResult","saveSurveyResponse","useMutation","SaveSurveyResponseDocument","setShowValidation","SurveyDocument","survey","questionsWithErrors","Survey","context","isMobile","SurveyTypeType","question1","question2","currentIds"],"mappings":"6vCAAA,2LAEA,KAAM,CACJ,QAAAA,GACA,eAAAC,GACA,SAAAC,GACA,eAAAC,GACA,yBAAAC,EACF,EAAI,OACJ,GAAI,CACF,OAAAC,GACA,KAAAC,GACA,OAAAC,EACF,EAAI,OACA,CACF,MAAA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