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AASA,OAAQoD,EAC1C/F,OAAOsI,EAAAA,EAAAA,IAAelB,EAAW9F,KAC7B8G,EAAAA,EAAAA,IAAST,MAKnB,OACElI,IAAAA,cAACiG,IAAAA,MAAU,CACTxF,UAAW0F,IACT,uBAAqBe,EAAA,GAAA5B,EAAA4B,EAAE,WAAFX,OACP/D,GAAiB,MAARA,GAAY8C,EAAA4B,EACjC,gBAAiBS,GAAsB,MAAT9F,GAAaqF,IAG/C,qBAAoB3F,EACpBhB,OAAOsI,EAAAA,EAAAA,IAAelB,EAAW9F,IAEhCL,GAASxB,IAAAA,cAACiG,IAAAA,aAAiB,KACzBzE,EACAe,GAAQI,GAAW3C,IAAAA,cAACiG,IAAAA,SAAa,CAACtD,SAAO,GAAEJ,GAC3CU,GAAYjD,IAAAA,cAACkG,EAAAA,GAAY,OAE3BoC,EACA/F,IAASI,GAAW3C,IAAAA,cAACiG,IAAAA,SAAa,KAAE1D,GAG3C,GACA,CAAC,QAAS,OAAQ,iBAEpBD,EAAAA,EAAAA,GAAM,2BAEN,W,wDC3EI2G,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,07BAA27B,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,wDAAwD,MAAQ,GAAG,SAAW,4UAA4U,eAAiB,CAAC,ggCAAggC,WAAa,MAEx7E,K,wDCJIH,E,MAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,ugBAAwgB,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,wDAAwD,MAAQ,GAAG,SAAW,kHAAkH,eAAiB,CAAC,6nBAA6nB,WAAa,MAEx6C,K","sources":["webpack:///./components/rsuite-field-control/index.js","webpack:///./react-rsuite5/input-text-i18n/index.scss?acf3","webpack:///./react-rsuite5/input-text-i18n/index.js","webpack:///./react-rsuite5/input-text/input-text.scss?eba5","webpack:///./react-rsuite5/input-text/index.js","webpack:///./react-rsuite5/textarea/index.js","webpack:///./react-rsuite5/input-text-i18n/index.scss","webpack:///./react-rsuite5/input-text/input-text.scss"],"sourcesContent":["import React, { useRef, useEffect } from 'react';\n\nimport Whisper from 'rsuite/Whisper';\nimport Popover from 'rsuite/Popover';\n\nconst POPOVER_STYLE = {\n  padding: '6px',\n  color: '#ff6633'\n};\n\nconst RSuite5FieldControl = ({ errorMessage, children }) => {\n  const triggerRef = useRef();\n\n  useEffect(\n    () => {\n      if (errorMessage) {\n        triggerRef.current.open();\n      } else {\n        triggerRef.current.close();\n      }\n    },\n    [errorMessage]\n  );\n\n  return (\n    <Whisper\n      placement=\"bottomStart\"\n      ref={triggerRef}\n      trigger=\"none\"\n      speaker={<Popover \n        style={POPOVER_STYLE} \n        visible={!!errorMessage}\n        className=\"lf-react-rsuite5-error-popover\"\n      ><div>{errorMessage}</div></Popover>}\n    >{children}</Whisper>\n  );\n}\n\nexport { RSuite5FieldControl };\n","\n      import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n      import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n      import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n      import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n      import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n      import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n      import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./index.scss\";\n      \n      \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n      options.insert = insertFn.bind(null, \"head\");\n    \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./index.scss\";\n       export default content && content.locals ? content.locals : undefined;\n","/* eslint-disable jsx-a11y/anchor-is-valid */\n/* eslint-disable jsx-a11y/anchor-has-content */\nimport React, { useState, useContext, useCallback } from 'react';\nimport Form from 'rsuite/Form';\nimport Input from 'rsuite/Input';\nimport InputGroup from 'rsuite/InputGroup';\nimport SelectPicker from 'rsuite/SelectPicker';\nimport _ from 'lodash';\nimport classNames from 'classnames';\n\nimport { IconCheck } from '../../assets/icons';\nimport { RequiredIcon } from '../../components';\nimport FormContext from '../../form-context';\nimport TextInput from '../input-text';\nimport Textarea from '../textarea';\nimport { LOCALES } from '../../common/data/locales';\nimport { isI18n } from '../../helpers';\nimport { lfLog } from '../../helpers/lf-log';\nimport { RSuite5FieldControl } from '../../components/rsuite-field-control';\n\nimport './index.scss';\n\nconst LANGUAGES_OPTIONS = Object.keys(LOCALES['language-names'])\n  .map(lang => ({\n    value: lang,\n    name: LOCALES['language-names'][lang][1],\n    label: LOCALES['language-names'][lang][1]\n  }));\n\nconst languageMenuItem = (label, item) => {\n  return (\n    <div className=\"lf-input-text-i18n-item-locale\">\n      {item.label} <b>{item.value}</b>\n      {item.filled && <IconCheck width={16} height={16} />}\n    </div>\n  )\n};\n\nconst TextareaAccepter = ({ value, ...props }) => {\n  return (\n    <Input\n      as=\"textarea\"\n      value={value}\n      {...props}\n    />\n  );\n};\n\nconst defaultOrEnglish = (obj) => {\n  if (isI18n(obj)) {\n    if (obj['en-US']) {\n      return obj['en-US'];\n    } else if (obj['en-GB']) {\n      return obj['en-GB'];\n    } else if (Object.keys(obj).length !== 0) {\n      return obj[Object.keys(obj)[0]];\n    }\n    return '';\n  }\n  return obj;\n};\n\nconst InputTextI18N = (props) => {\n  const {\n    name,\n    label,\n    hint,\n    value,\n    size,\n    placeholder,\n    tooltip = false,\n    disabled = false,\n    readOnly = false,\n    required = false,\n    width,\n    error,\n    onChange,\n    onBlur,\n    defaultLocale,\n    textarea = false,\n    rows\n  } = props;\n  const { locales = [] } = useContext(FormContext);\n\n  let preselectedLanguage = null;\n  if (_.isObject(value)) {\n    // preselect a value in the drop down of the language only if there's a i18n object\n    // in value, otherwise is a simple string and by definition is not associated with any\n    // language\n    if (defaultLocale && locales.includes(defaultLocale)) {\n      preselectedLanguage = defaultLocale;\n    } else if (!_.isEmpty(locales)) {\n      preselectedLanguage = locales[0];\n    }\n  }\n  let preselectedValue = null;\n  if (_.isObject(value)) {\n    preselectedValue = preselectedLanguage ? value[preselectedLanguage] : null;\n  } else if (_.isString(value)) {\n    preselectedValue = value;\n  }\n\n  const totalLocales = !_.isEmpty(locales) ? locales.length : LANGUAGES_OPTIONS.length;\n  const [currentLanguage, setCurrentLanguage] = useState(preselectedLanguage);\n  const [currentValue, setCurrentValue] = useState(value);\n  const [translation, setTranslation ] = useState(preselectedValue);\n\n  const handleChange = useCallback(\n    value => {\n      // update the UI\n      setTranslation(value);\n      if (_.isEmpty(value)) {\n        // in case the user entered an empty value...\n        if (_.isObject(currentValue) && currentLanguage) {\n          // if i18n object and a language is selected, then void the value for that language\n          const newCurrentValue = _.omit(currentValue, currentLanguage);\n          setCurrentValue(newCurrentValue);\n          onChange(newCurrentValue);\n        } else if (_.isString(currentValue)) {\n          setCurrentValue(value);\n          onChange(value);\n        }\n      } else {\n        // in case the user entered a non empty value...\n        if (currentLanguage) {\n          // if a current language is selected, then the typed text ends up\n          // in a i18n object\n          const newCurrentValue = {\n            ...currentValue,\n            [currentLanguage]: value\n          };\n          setCurrentValue(newCurrentValue);\n          onChange(newCurrentValue);\n          //setTranslation(value);\n        } else if (_.isObject(currentValue)) {\n          // language is not selected, but the current value is a i18n object, do nothing\n          // just update the UI, do nothing in the current value\n          //setTranslation(value);\n        } else {\n          // if language not selected and current value is not an object\n          // just set the current value as string\n          //setTranslation(value);\n          setCurrentValue(value);\n          onChange(value);\n        }\n      }\n    },\n    [currentLanguage, currentValue, onChange]\n  );\n\n  // if no locales, then use plain input text, since it's possible the the value is still\n  // a 18n (in case the user switched from a multi language form to a single language form\n  // then put some defaults)\n  if (_.isEmpty(locales)) {\n    const newProps = {\n      ...props,\n      value: defaultOrEnglish(value)\n    }\n\n    return textarea ? <Textarea {...newProps} /> : <TextInput {...newProps} />;\n  }\n  // evaluate current translated locales\n  const translatedLocales = _.isObject(currentValue) ?\n    Object.keys(currentValue).filter(locale => _.isEmpty(locales) || locales.includes(locale)) : [];\n\n  const multiValuesAndNoLang = _.isObject(currentValue) &&\n    Object.keys(currentValue).length !== 0 &&\n    !currentLanguage;\n\n  const languageData = LANGUAGES_OPTIONS\n    .filter(item => _.isEmpty(locales) || locales.includes(item.value))\n    .map(item => ({ ...item, filled: currentValue && !_.isEmpty(currentValue[item.value]) }));\n\n  const InputComponent = textarea ? TextareaAccepter : Input;\n  return (\n    <Form.Group data-lf-field-name={name} className=\"lf-control-input-text-i18n lf-input-text-i18n\">\n      {label && <Form.ControlLabel>\n        {label}\n        {hint && tooltip && <Form.HelpText tooltip>{hint}</Form.HelpText>}\n        {required && <RequiredIcon />}\n      </Form.ControlLabel>}\n      <div className={classNames('group-input-select', { 'textarea': textarea })}>\n        <InputGroup className=\"translation-control\" inside>\n          <RSuite5FieldControl errorMessage={_.isString(error) ? error : undefined }>\n            <InputComponent\n              name={name}\n              rows={rows}\n              style={width ? { width: `${width}px` } : undefined}\n              value={multiValuesAndNoLang ? '<multiple translations>' : translation}\n              readOnly={readOnly || multiValuesAndNoLang}\n              onChange={handleChange}\n              onBlur={onBlur}\n              disabled={disabled}\n              size={size}\n              placeholder={placeholder}\n              errorMessage={_.isString(error) ? error : undefined }\n            />\n          </RSuite5FieldControl>\n          <InputGroup.Addon>\n            <span className=\"status\">\n              <span className=\"translated\">{translatedLocales.length}</span>\n              &nbsp;/&nbsp;\n              <span>{totalLocales}</span>\n            </span>\n\n          </InputGroup.Addon>\n        </InputGroup>\n        <div className=\"select-control\">\n          <SelectPicker\n            appearance=\"subtle\"\n            cleanable={false}\n            size=\"xs\"\n            readOnly={readOnly}\n            value={currentLanguage}\n            placement=\"autoVerticalEnd\"\n            placeholder=\"no tx\"\n            searchable={languageData.length > 20}\n            renderValue={value => <span>{value}</span>}\n            renderMenuItem={languageMenuItem}\n            onChange={value => {\n              if (_.isString(currentValue) && !_.isEmpty(currentValue)) {\n                // if currentValue is a string and not empty,\n                setCurrentLanguage(value);\n                let newValue = {\n                  [value]: currentValue\n                };\n                setCurrentValue(newValue);\n                onChange(newValue)\n              } else if (_.isObject(currentValue)) {\n                // it's already a i18n object, just switch the language\n                setCurrentLanguage(value);\n                setTranslation(currentValue[value] ?? '');\n              } else {\n                setCurrentLanguage(value);\n              }\n            }}\n            data={languageData}\n          />\n        </div>\n      </div>\n      {hint && !tooltip && <Form.HelpText>{hint}</Form.HelpText>}\n    </Form.Group>\n  );\n};\nlfLog('Loaded RSuite.InputTextI18N');\n\nexport default InputTextI18N;\n","\n      import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n      import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n      import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n      import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n      import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n      import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n      import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./input-text.scss\";\n      \n      \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n      options.insert = insertFn.bind(null, \"head\");\n    \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./input-text.scss\";\n       export default content && content.locals ? content.locals : undefined;\n","import React, { useCallback } from 'react';\nimport Form from 'rsuite/Form';\nimport Input from 'rsuite/Input';\nimport InputGroup from 'rsuite/InputGroup';\nimport _ from 'lodash';\nimport classNames from 'classnames';\n\nimport { RequiredIcon, I18N } from '../../components';\nimport { RSuite5FieldControl } from '../../components/rsuite-field-control';\nimport { TextOrIcon } from '../../common';\nimport { passRest, makeWidthStyle } from '../../helpers';\nimport { lfLog } from '../../helpers/lf-log';\n\nimport './input-text.scss';\n\nconst TextInput = I18N(\n  ({\n    name,\n    label,\n    hint,\n    value,\n    size,\n    placeholder,\n    tooltip = false,\n    disabled = false,\n    readOnly = false,\n    required = false,\n    submitOnEnter = false,\n    error,\n    prefix,\n    postfix,\n    onChange,\n    onBlur,\n    fullWidth,\n    width,\n    autocomplete,\n    inputMode,\n    inputType,\n    inside = false,\n    lfOnEnter = () => {},\n    ...rest\n  }) => {\n    const handleKeyUp = useCallback(e => e.keyCode === 13 && lfOnEnter(), [lfOnEnter]);\n\n    const inner = (\n      <RSuite5FieldControl errorMessage={_.isString(error) ? error : undefined }>\n        <Input\n          accepter={Input}\n          value={value}\n          onChange={onChange}\n          onBlur={onBlur}\n          onKeyUp={submitOnEnter ? handleKeyUp : undefined}\n          disabled={disabled}\n          autoComplete={autocomplete}\n          inputMode={inputMode}\n          type={inputType}\n          size={size}\n          placeholder={placeholder}\n          readOnly={readOnly}\n          {...passRest(rest)}\n        />\n      </RSuite5FieldControl>\n    );\n\n    const needsGroup = postfix || prefix;\n    return (\n      <Form.Group\n        className={classNames(\n          'lf-control-input-text', {\n            [`lf-size-${size}`]: size != null,\n            'lf-full-width': fullWidth || width != null\n          }\n        )}\n        data-lf-field-name={name}\n        style={makeWidthStyle(fullWidth, width)}\n      >\n        {label && <Form.ControlLabel>\n          {label}\n          {hint && tooltip && <Form.HelpText tooltip>{hint}</Form.HelpText>}\n          {required && <RequiredIcon />}\n        </Form.ControlLabel>}\n        {!needsGroup && inner}\n        {needsGroup && (\n          <InputGroup inside={inside}>\n            {prefix && <InputGroup.Addon>{TextOrIcon(prefix)}</InputGroup.Addon>}\n            {inner}\n            {postfix && <InputGroup.Addon>{TextOrIcon(postfix)}</InputGroup.Addon>}\n          </InputGroup>\n        )}\n        {hint && !tooltip && <Form.HelpText>{hint}</Form.HelpText>}\n      </Form.Group>\n    );\n  },\n  ['label', 'hint', 'placeholder']\n);\nlfLog('Loaded RSuite.InputText');\n\nexport default TextInput;\n","import React from 'react';\nimport Form from 'rsuite/Form';\nimport Input from 'rsuite/Input';\nimport _ from 'lodash';\nimport classNames from 'classnames';\n\nimport { RequiredIcon, I18N } from '../../components';\nimport { makeWidthStyle, passRest } from '../../helpers';\nimport { lfLog } from '../../helpers/lf-log';\nimport { RSuite5FieldControl } from '../../components/rsuite-field-control';\n\nconst ControlTextare = (props) => <Input as=\"textarea\" {...props} />\n\nconst Textarea = I18N(\n  ({\n    name,\n    label,\n    hint,\n    value,\n    size,\n    placeholder,\n    tooltip = false,\n    disabled = false,\n    readOnly = false,\n    required = false,\n    error,\n    onChange,\n    onBlur,\n    fullWidth,\n    width,\n    rows = 10,\n    ...rest\n  }) => {\n    const inner = (\n      <RSuite5FieldControl errorMessage={_.isString(error) ? error : undefined }>\n        <ControlTextare\n          name={name}\n\n          rows={rows}\n          value={value}\n          size={size}\n          onChange={onChange}\n          onBlur={onBlur}\n          disabled={disabled}\n          placeholder={placeholder}\n          readOnly={readOnly}\n          errorMessage={_.isString(error) ? error : undefined }\n          style={makeWidthStyle(fullWidth, width)}\n          {...passRest(rest)}\n        />\n      </RSuite5FieldControl>\n    );\n\n    return (\n      <Form.Group\n        className={classNames(\n          'lf-control-textarea', {\n            [`lf-size-${size}`]: size != null,\n            'lf-full-width': fullWidth || width != null\n          }\n        )}\n        data-lf-field-name={name}\n        style={makeWidthStyle(fullWidth, width)}\n      >\n        {label && <Form.ControlLabel>\n          {label}\n          {hint && tooltip && <Form.HelpText tooltip>{hint}</Form.HelpText>}\n          {required && <RequiredIcon />}\n        </Form.ControlLabel>}\n        {inner}\n        {hint && !tooltip && <Form.HelpText>{hint}</Form.HelpText>}\n      </Form.Group>\n    );\n  },\n  ['label', 'hint', 'placeholder']\n);\nlfLog('Loaded RSuite5.Textarea');\n\nexport default Textarea;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".lf-input-text-i18n-item-locale{font-size:.9em}.lf-input-text-i18n .rs-input-group-addon{padding:2px 4px !important}.lf-input-text-i18n .rs-input-group-addon .status{font-size:10px}.lf-input-text-i18n .rs-input-group-addon .btn-clear{display:inline-block;margin-left:5px;margin-top:-2px;color:#666;text-decoration:none}.lf-input-text-i18n .rs-input-group-addon .btn-clear:hover{color:#1675e0}.lf-input-text-i18n .group-input-select{display:flex;flex-direction:row;justify-content:flex-start;align-content:stretch;align-items:flex-start}.lf-input-text-i18n .group-input-select .translation-control{order:0;flex:1 0;align-self:auto;width:unset !important;z-index:1}.lf-input-text-i18n .group-input-select .translation-control .translated{color:#999}.lf-input-text-i18n .group-input-select .select-control{order:1;flex:0 0;align-self:center;z-index:2;margin-left:5px}.lf-input-text-i18n .group-input-select.textarea .select-control{align-self:self-start}\", \"\",{\"version\":3,\"sources\":[\"webpack://./react-rsuite5/input-text-i18n/index.scss\"],\"names\":[],\"mappings\":\"AAAA,gCACE,cAAA,CAIA,0CACE,0BAAA,CAEA,kDACE,cAAA,CAGF,qDACE,oBAAA,CACA,eAAA,CACA,eAAA,CACA,UAAA,CACA,oBAAA,CAEA,2DACE,aAAA,CAKN,wCACE,YAAA,CACA,kBAAA,CACA,0BAAA,CACA,qBAAA,CACA,sBAAA,CAEA,6DACE,OAAA,CACA,QAAA,CACA,eAAA,CACA,sBAAA,CACA,SAAA,CAEA,yEACE,UAAA,CAIJ,wDACE,OAAA,CACA,QAAA,CACA,iBAAA,CACA,SAAA,CACA,eAAA,CAIA,iEACE,qBAAA\",\"sourcesContent\":[\".lf-input-text-i18n-item-locale {\\n  font-size: 0.9em;\\n}\\n\\n.lf-input-text-i18n {\\n  .rs-input-group-addon {\\n    padding: 2px 4px !important;\\n\\n    .status {\\n      font-size: 10px;\\n    }\\n\\n    .btn-clear {\\n      display: inline-block;\\n      margin-left: 5px;\\n      margin-top: -2px;\\n      color: #666666;\\n      text-decoration: none;\\n\\n      &:hover {\\n        color: #1675e0;\\n      }\\n    }\\n  }\\n\\n  .group-input-select {\\n    display: flex;\\n    flex-direction: row;\\n    justify-content: flex-start;\\n    align-content: stretch;\\n    align-items: flex-start;\\n\\n    .translation-control {\\n      order: 0;\\n      flex: 1 0;\\n      align-self: auto;\\n      width: unset !important;\\n      z-index: 1;\\n\\n      .translated {\\n        color: #999999;\\n      }\\n    }\\n\\n    .select-control {\\n      order: 1;\\n      flex: 0 0;\\n      align-self: center;\\n      z-index: 2;\\n      margin-left: 5px;\\n    }\\n\\n    &.textarea {\\n      .select-control {\\n        align-self: self-start;\\n      }\\n    }\\n  }\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".lf-control-input-text .rs-form-control-wrapper>.rs-input,.lf-control-input-text .rs-form-control-wrapper>.rs-input-number{width:100%}.lf-control-input-text.lf-full-width .rs-input-group{width:100%}.lf-control-input-text .lf-prefix-icon{max-height:16px}.lf-control-input-text.lf-size-lg .lf-prefix-icon{max-height:22px}.lf-control-input-text.lf-size-md .lf-prefix-icon{max-height:16px}.lf-control-input-text.lf-size-sm .lf-prefix-icon{max-height:10px}.lf-control-input-text.lf-size-xs .lf-prefix-icon{max-height:4px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./react-rsuite5/input-text/input-text.scss\"],\"names\":[],\"mappings\":\"AAEE,2HACE,UAAA,CAIA,qDACE,UAAA,CAKJ,uCACE,eAAA,CAIA,kDACE,eAAA,CAKF,kDACE,eAAA,CAKF,kDACE,eAAA,CAKF,kDACE,cAAA\",\"sourcesContent\":[\".lf-control-input-text {\\n\\n  .rs-form-control-wrapper>.rs-input, .rs-form-control-wrapper>.rs-input-number {\\n    width: 100%;\\n  }\\n\\n  &.lf-full-width {\\n    .rs-input-group {\\n      width: 100%;\\n    }\\n  }\\n\\n  // this ensure the icon is centered vertically\\n  .lf-prefix-icon {\\n    max-height: 16px;\\n  }\\n\\n  &.lf-size-lg {\\n    .lf-prefix-icon {\\n      max-height: 22px;\\n    }\\n  }\\n\\n  &.lf-size-md {\\n    .lf-prefix-icon {\\n      max-height: 16px;\\n    }\\n  }\\n\\n  &.lf-size-sm {\\n    .lf-prefix-icon {\\n      max-height: 10px;\\n    }\\n  }\\n\\n  &.lf-size-xs {\\n    .lf-prefix-icon {\\n      max-height: 4px;\\n    }\\n  }\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n"],"names":["POPOVER_STYLE","padding","color","RSuite5FieldControl","_ref","errorMessage","children","triggerRef","useRef","useEffect","current","open","close","React","Whisper","placement","ref","trigger","speaker","Popover","style","visible","className","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","LANGUAGES_OPTIONS","Object","keys","LOCALES","map","lang","value","name","label","languageMenuItem","item","filled","IconCheck","width","height","TextareaAccepter","props","_objectWithoutProperties","_excluded","Input","_extends","as","lfLog","hint","size","placeholder","_props$tooltip","tooltip","_props$disabled","disabled","_props$readOnly","readOnly","_props$required","required","error","onChange","onBlur","defaultLocale","_props$textarea","textarea","rows","_useContext$locales","useContext","FormContext","locales","preselectedLanguage","_isObject","includes","_isEmpty","preselectedValue","_isString","obj","totalLocales","length","_useState2","_slicedToArray","useState","currentLanguage","setCurrentLanguage","_useState4","currentValue","setCurrentValue","_useState6","translation","setTranslation","handleChange","useCallback","newCurrentValue","_omit","_objectSpread","_defineProperty","newProps","isI18n","Textarea","TextInput","translatedLocales","filter","locale","multiValuesAndNoLang","languageData","InputComponent","Form","RequiredIcon","classNames","InputGroup","inside","undefined","concat","SelectPicker","appearance","cleanable","searchable","renderValue","renderMenuItem","newValue","_currentValue$value","data","I18N","_classNames","_ref$tooltip","_ref$disabled","_ref$readOnly","_ref$required","_ref$submitOnEnter","submitOnEnter","prefix","postfix","fullWidth","autocomplete","inputMode","inputType","_ref$inside","_ref$lfOnEnter","lfOnEnter","rest","handleKeyUp","e","keyCode","inner","accepter","onKeyUp","autoComplete","type","passRest","needsGroup","makeWidthStyle","TextOrIcon","ControlTextare","_ref$rows","___CSS_LOADER_EXPORT___","push","module","id"],"sourceRoot":""}