option.id}\n getOptionLabel={option => option.title}\n isMulti={isMulti}\n {...rest}\n />\n );\n\n }\n}\n\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\n\nexport const OptionGroup = ({\n value,\n label,\n options\n}) => {\n return ([\n {label} ,\n options.map((opt,i) => (\n - {opt.label} \n ))\n ]);\n};","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport { OptionGroup } from './OptionGroup';\nimport './optiongroup.less';\n\nexport default class GroupedDropdown extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value\n };\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n if (this.props.value !== prevProps.value) {\n this.setState({value: this.props.value})\n }\n }\n\n handleChange(ev) {\n this.props.onChange(ev);\n }\n\n render() {\n let {id, options, placeholder, className, error} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let {value} = this.state;\n\n return (\n \n
\n {placeholder} \n {options.map((opt,i) =>\n {\n if (typeof opt.options != 'undefined') {\n return (\n \n );\n } else {\n return (\n {opt.label} \n );\n }\n }\n )}\n \n {has_error &&\n
{error}
\n }\n
\n );\n }\n}","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport Select from 'react-select';\nimport {getLanguageList} from '../../utils/query-actions';\n\nexport default class LanguageInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n options: [],\n shouldUseId: props.hasOwnProperty('shouldUseId') ? props.shouldUseId : false,\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.setOptions = this.setOptions.bind(this);\n this.abortController = new AbortController();\n }\n\n componentDidMount() {\n getLanguageList(this.setOptions, this.abortController.signal).catch(e => {\n console.log(\"Error get languages: \", e);\n this.setOptions({options: []});\n });\n }\n\n componentWillUnmount(){\n this.abortController.abort();\n }\n\n setOptions(response) {\n let languageList = (this.state.shouldUseId) ?\n response.map(l => ({label: l.name, value: l.id})):\n response.map(l => ({label: l.name, value: l.iso_code}));\n this.setState({options: languageList});\n }\n\n handleChange(value) {\n let isMulti = (this.props.hasOwnProperty('multi'));\n let theValue = null;\n\n if (isMulti) {\n theValue = value.map(v => v.value);\n } else {\n theValue = value.value;\n }\n\n let ev = {target: {\n id: this.props.id,\n value: theValue,\n type: 'laguageinput'\n }};\n\n this.props.onChange(ev);\n }\n\n render() {\n let {value, onChange, id, multi, ...rest} = this.props;\n let {options} = this.state;\n let isMulti = (this.props.hasOwnProperty('multi'));\n let theValue = null;\n\n if (isMulti) {\n theValue = options.filter(op => value.includes(op.value));\n } else {\n theValue = (value instanceof Object || value == null) ? value : options.find(opt => opt.value == value);\n }\n\n return (\n \n );\n\n }\n}\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport {queryMembers} from '../../utils/query-actions';\n\nexport default class MemberInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.getMembers = this.getMembers.bind(this);\n this.getOptionValue = this.getOptionValue.bind(this);\n this.getOptionLabel = this.getOptionLabel.bind(this);\n }\n\n getOptionValue(member){\n if(this.props.hasOwnProperty(\"getOptionValue\")){\n return this.props.getOptionValue(member);\n }\n //default\n return member.id;\n }\n\n getOptionLabel(member){\n if(this.props.hasOwnProperty(\"getOptionLabel\")){\n return this.props.getOptionLabel(member);\n }\n //default\n return `${member.first_name} ${member.last_name} (${member.id})`;\n }\n\n handleChange(value) {\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'memberinput'\n }};\n\n this.props.onChange(ev);\n }\n\n getMembers (input, callback) {\n if (!input) {\n return Promise.resolve({ options: [] });\n }\n queryMembers(input, callback);\n }\n\n render() {\n let {value, error, onChange, id, multi, ...rest} = this.props;\n let isMulti = (this.props.hasOwnProperty('multi'));\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n\n return (\n \n
this.getOptionValue(m)}\n getOptionLabel={m => this.getOptionLabel(m)}\n isMulti={isMulti}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n\n \n );\n\n }\n}\n\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React, { useState, useEffect } from 'react';\nimport Select from 'react-select';\n\nconst OperatorInput = ({ error, label, value, onChange, id, multi, isMulti, className, isDisabled, isClearable, options, selectStyles, customStyle, ...rest }) => {\n\n // Set intial valus from value property, if is an array operator as between, and extract the operator and digits is the value is a string\n const [operatorValue, setOperatorValue] = useState(value ? Array.isArray(value) ? { value: 'between', label: 'Between' } : options.find(e => e.value === value.replace(/\\d/g, '')) : ({ value: null, label: '' }));\n const [inputValue, setInputValue] = useState(value ? Array.isArray(value) ? value[0] : value.replace(/\\D/g, '') : '');\n const [inputValueBetween, setInputValueBetween] = useState(Array.isArray(value) ? value[1] : '');\n const [ddlStyles, setDDLStyles] = useState({\n control: (provided, state) => ({\n ...provided,\n width: 175\n }),\n ...selectStyles\n });\n const [hasError, setHasError] = useState(error);\n\n useEffect(() => {\n setHasError(error);\n }, [error]);\n\n\n const handleOperatorChange = (eventValue) => {\n setInputValueBetween('');\n setOperatorValue({ value: eventValue.value, label: eventValue.label }); \n let ev = {\n target: {\n id: id,\n value: eventValue.value === 'between' ? [inputValue, inputValueBetween] : inputValue,\n type: 'operatorinput',\n operator: eventValue.value\n }\n };\n onChange(ev);\n }\n\n const handleInputChange = (evt) => {\n const onlyDigits = evt.target.value.replace(/\\D/g, '');\n if (operatorValue.value === 'between') {\n evt.target.id === 'operator-input' ? setInputValue(onlyDigits) : setInputValueBetween(onlyDigits);\n let ev = {\n target: {\n id: id,\n value: evt.target.id === 'operator-input' ? [onlyDigits, inputValueBetween] : [inputValue, onlyDigits],\n type: 'operatorinput',\n operator: operatorValue.value\n }\n };\n onChange(ev);\n } else {\n setInputValue(onlyDigits);\n let ev = {\n target: {\n id: id,\n value: onlyDigits,\n type: 'operatorinput',\n operator: operatorValue.value\n }\n };\n onChange(ev);\n }\n }\n\n let selectClassName = className;\n\n const defaultStyle = {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'baseline'\n }\n\n return (\n \n
{label} \n
\n
\n {operatorValue.value === 'between' &&\n <>\n
And \n
\n >\n }\n {hasError &&\n
{error}
\n }\n
\n );\n\n}\n\nexport default OperatorInput;\n\nOperatorInput.defaultProps = {\n options: [\n { value: '>', label: 'Greater than' },\n { value: '<', label: 'Less than' },\n { value: '>=', label: 'Greater or Equal' },\n { value: '<=', label: 'Less or Equal' },\n { value: '==', label: 'Equal' },\n { value: 'between', label: 'Between' },\n ],\n};","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport AsyncCreatableSelect from 'react-select/lib/AsyncCreatable';\nimport {queryOrganizations} from '../../utils/query-actions';\n\nexport default class OrganizationInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n this.handleNew = this.handleNew.bind(this);\n this.getOrganizations = this.getOrganizations.bind(this);\n }\n\n handleChange(value) {\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n\n let ev = {target: {\n id: this.props.id,\n value: {id: value.value, name: value.label},\n type: 'organizationinput'\n }};\n\n this.props.onChange(ev);\n }\n\n handleNew(value) {\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n\n const translateValue = (newValue) => {\n this.handleChange({value: newValue.id, label: newValue.name});\n }\n\n this.props.onCreate(value, translateValue);\n }\n\n getOrganizations (input, callback) {\n if (!input) {\n return Promise.resolve({ options: [] });\n }\n\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n\n const translateOptions = (options) => {\n let newOptions = options.map(org => ({value: org.id.toString(), label: org.name}));\n callback(newOptions);\n };\n\n queryOrganizations(input, translateOptions);\n }\n\n render() {\n let {error, value, id, onChange, ...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let allowCreate = this.props.hasOwnProperty('allowCreate');\n\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n let theValue = value ? {value: value.id.toString(), label: value.name} : null;\n\n const AsyncComponent = allowCreate\n ? AsyncCreatableSelect\n : AsyncSelect;\n\n return (\n \n
\n {has_error &&\n
{error}
\n }\n
\n );\n\n }\n}\n\n\n\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport AsyncSelect from 'react-select/lib/Async';\nimport {DEFAULT_PAGE_SIZE, queryPromocodes} from '../../utils/query-actions';\n\nconst PromocodeInput = ({summitId, error, value, onChange, id, multi, perPage, extraFilters, ...rest}) => {\n\n const handleChange = (value) => {\n let theValue = null;\n const isMulti = multi || rest.isMulti;\n if (value) {\n theValue = isMulti ? value.map(v => ({id: v.value, code: v.label})) : {id: value.value, code: value.label};\n }\n\n let ev = {target: {\n id: id,\n value: theValue,\n type: 'promocodeinput'\n }};\n\n onChange(ev);\n }\n\n const getPromocodes = (input, callback) => {\n\n if (!input) {\n return Promise.resolve({ options: [] });\n }\n\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n\n const translateOptions = (options) => {\n let newOptions = options.map(c => ({value: c.id.toString(), label: c.code}));\n callback(newOptions);\n };\n\n queryPromocodes(summitId, input, translateOptions, perPage, extraFilters);\n }\n\n const has_error = !!( error && error !== '' );\n const isMulti = multi || rest.isMulti;\n\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n\n let theValue = null;\n\n if (isMulti && value.length > 0) {\n theValue = value.map(v => ({value: v.id.toString(), label: v.code} ));\n } else if (!isMulti && value) {\n theValue = {value: value.id.toString(), label: value.code};\n }\n\n return (\n \n
\n {has_error &&\n
{error}
\n }\n
\n );\n}\n\nPromocodeInput.propTypes = {\n perPage: PropTypes.number,\n extraFilters: PropTypes.array\n};\n\nPromocodeInput.defaultProps = {\n perPage: DEFAULT_PAGE_SIZE,\n extraFilters: []\n};\n\nexport default PromocodeInput;\n","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport RawHTML from '../raw-html';\nimport PropTypes from 'prop-types'\n\nimport \"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\";\n\nexport default class RadioList extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value,\n };\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(selection) {\n\n let ev = {target: {\n id: this.props.id,\n value: selection.target.value,\n type: 'radio'\n }};\n\n this.props.onChange(ev);\n }\n\n getLabel(option, id, inline, simple) {\n if (inline) {\n return (\n \n \n {option.label}\n \n \n );\n } else if (simple) {\n return (\n \n {option.label}\n \n );\n } else {\n return (\n \n {option.label} \n {option.description} \n \n );\n }\n }\n\n render() {\n\n let {onChange, value, className, error, ariaLabelledBy, disabled, options,id, name,...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let inline = ( this.props.hasOwnProperty('inline') );\n let simple = ( this.props.hasOwnProperty('simple') );\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n\n let style, label;\n\n if (inline) {\n style = {\n paddingLeft: '22px',\n marginLeft: '20px',\n float: 'left'\n };\n\n\n } else {\n style = {\n paddingLeft: '22px'\n }\n }\n\n return (\n \n { options.map(op => {\n let checked = (op.value == value);\n return (\n
\n \n {this.getLabel(op, id, inline, simple)}\n
\n )\n })}\n\n {has_error &&\n
{error}
\n }\n
\n );\n\n }\n}\n\nRadioList.defaultProps = {\n ariaLabelledBy : null,\n}\n\nRadioList.propTypes = {\n id: PropTypes.string.isRequired\n};\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport PropTypes from 'prop-types'\nimport AsyncCreatableSelect from \"react-select/lib/AsyncCreatable\";\nimport { queryRegistrationCompanies } from '../../utils/query-actions';\nimport _ from 'lodash';\nconst NullValue = { value: null, label: '' };\nconst NewId = 0;\n\nconst RegistrationCompanyInput = ({\n error, onChange, id, disabled, className, summitId, onError,\n value, placeholder, tabSelectsValue, selectStyles, createLabel, options2Show, ...rest }) => {\n\n const isNullValue = (val) => _.isEqual(val, {id: null, name: ''})\n\n const handleChange = (eventValue) => {\n if(!eventValue) eventValue = NullValue;\n const newValue = { id: eventValue.value, name: eventValue.label };\n let ev = {\n target: {\n id: id,\n value: newValue,\n type: 'registration_company_input'\n }\n };\n\n onChange(ev);\n }\n\n const getCompanies = (input, callback) => {\n\n const translateOptions = (options) => {\n\n if (options instanceof Error) {\n onError(options);\n }\n if (options.length === 0) {\n callback([]);\n }\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n let newOptions = [...options.map(c => ({ value: c.id.toString(), label: c.name }))];\n callback(newOptions);\n };\n\n queryRegistrationCompanies(summitId, input, translateOptions, options2Show);\n }\n\n const handleNewOption = (newOption) => {\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n handleChange({value: NewId, label: newOption});\n }\n\n const classNamPrefix =`${className}_prefix`;\n\n // default value ( no selection )\n let theValue = null;\n\n if (value && !isNullValue(value)) {\n theValue = {value: value.id, label: value.name};\n }\n\n return (\n \n
`${createLabel} \"${value}\"`}\n isDisabled={disabled}\n {...rest}\n />\n {error &&\n {error}
\n }\n \n );\n\n}\n\nexport default RegistrationCompanyInput;\n\nRegistrationCompanyInput.defaultProps = {\n placeholder: 'Select a company',\n disabled: false,\n tabSelectsValue: false,\n createLabel: 'Select ',\n className:'registration_company_dll',\n options2Show: 20,\n}\n\nRegistrationCompanyInput.propTypes = {\n onError: PropTypes.func.isRequired,\n placeholder: PropTypes.string,\n options2Show: PropTypes.number,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-select/lib/components\");","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport { components } from 'react-select/lib/components'\nimport { querySpeakers } from '../../utils/query-actions';\n\nexport default class SpeakerInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n this.getSpeakers = this.getSpeakers.bind(this);\n this.handleClick = this.handleClick.bind(this);\n this.getOptionValue = this.getOptionValue.bind(this);\n this.getOptionLabel = this.getOptionLabel.bind(this);\n }\n\n handleChange(value) {\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'speakerinput'\n }};\n\n this.props.onChange(ev);\n }\n\n handleClick(speakerId) {\n let {history} = this.props;\n\n history.push(`/app/speakers/${speakerId}`);\n }\n\n getSpeakers (input, callback) {\n if (!input) {\n return Promise.resolve({ options: [] });\n }\n\n let summitId = (this.props.hasOwnProperty('summitId')) ? this.props.summitId : null;\n\n querySpeakers(summitId, input, callback);\n }\n\n getOptionValue(speaker){\n if(this.props.hasOwnProperty(\"getOptionValue\")){\n return this.props.getOptionValue(speaker);\n }\n //default\n return speaker.id;\n }\n\n getOptionLabel(speaker){\n if(this.props.hasOwnProperty(\"getOptionLabel\")){\n return this.props.getOptionLabel(speaker);\n }\n //default\n return `${speaker.first_name} ${speaker.last_name} (${speaker.id})`;\n }\n\n render() {\n let {value, onChange, history, summitId, error, id, multi, ...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let isMulti = (this.props.hasOwnProperty('multi'));\n\n const MultiValueLabel = (props) => {\n return (\n this.handleClick(props.data.id)} style={{cursor: 'pointer'}}>\n \n \n );\n };\n\n return (\n \n
this.getOptionValue(s)}\n getOptionLabel={s => this.getOptionLabel(s)}\n isMulti={isMulti}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n \n );\n\n }\n}\n\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport { querySponsors } from '../../utils/query-actions';\n\nconst SponsorInput = ({ id, summitId, value, error, multi, onChange, queryFunction, ...rest }) => {\n const queryFn = queryFunction || querySponsors;\n const has_error = error !== '';\n\n const handleChange = (value) => {\n let ev = {\n target: {\n id: id,\n value: value,\n type: 'sponsorinput'\n }\n };\n\n onChange(ev);\n }\n\n const getSponsors = (input, callback) => {\n const filterSponsors = (options) => {\n let newOptions = options.filter(c => c.company);\n callback(newOptions);\n };\n\n queryFn(summitId, input, filterSponsors);\n }\n\n return (\n \n
option.id}\n getOptionLabel={option => `${option.company.name} (${option.sponsorship?.type?.name})`}\n onChange={handleChange}\n loadOptions={getSponsors}\n isMulti={multi}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n \n );\n}\n\nexport default SponsorInput;\n","/**\n * Copyright 2022 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport { querySponsoredProjects } from '../../utils/query-actions';\n\nexport default class SponsoredProjectInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n this.getSponsoredProjects = this.getSponsoredProjects.bind(this);\n }\n\n handleChange(value) {\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'sponsoredprojectinput'\n }};\n\n this.props.onChange(ev);\n }\n\n getSponsoredProjects (input, callback) {\n if (!input) {\n return Promise.resolve({ options: [] });\n }\n\n querySponsoredProjects(input, callback);\n }\n\n render() {\n let {value, error, onChange, id, multi, ...rest} = this.props;\n let isMulti = (this.props.hasOwnProperty('multi'));\n let isClearable = (this.props.hasOwnProperty('clearable'));\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n\n return (\n \n
op.id}\n getOptionLabel={op => (`${op.name} (${op.id})`)}\n isMulti={isMulti}\n isClearable={isClearable}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n\n \n );\n\n }\n}\n","// extracted by mini-css-extract-plugin\nexport default {\"wrapper\":\"tDZTa8dy9OMVyGAtxNOS\",\"valueBox\":\"VoBl8JcsRZelj8EKGKtC\"};","import React from 'react';\nimport styles from './index.module.less';\n\nexport default ({value, options, onChange, ...rest}) => {\n \n const currentOptionKey = options.findIndex(op => op.value === value);\n\n const valueLabel = options.find(op => op.value === value).label;\n\n const onClickMinus = () => {\n if (currentOptionKey > 0) {\n onChange(options[currentOptionKey - 1].value);\n }\n }\n\n const onClickPlus = () => {\n if (currentOptionKey < options.length -1) {\n onChange(options[currentOptionKey + 1].value);\n }\n }\n\n return (\n \n onClickMinus()} disabled={currentOptionKey === 0} title=\"Decrement\">\n \n \n {valueLabel} \n onClickPlus()} disabled={currentOptionKey + 1 === options.length} title=\"Increment\">\n \n \n
\n );\n};\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport Select from 'react-select';\n\nconst SummitDaysSelect = ({ days, currentValue, placeholder, onDayChanged }) => {\n const theValue = days.find(op => op.value === currentValue) || null;\n\n const onChange = (selectedOption) => {\n onDayChanged(selectedOption?.value || null);\n };\n\n return (\n \n );\n}\n\nexport default SummitDaysSelect;\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport {querySummits} from '../../utils/query-actions';\n\nexport default class SummitInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.getSummits = this.getSummits.bind(this);\n }\n\n handleChange(value) {\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'summitinput'\n }};\n\n this.props.onChange(ev);\n }\n\n getSummits (input, callback) {\n if (!input) {\n return Promise.resolve({ options: [] });\n }\n\n querySummits(input, callback);\n }\n\n\n render() {\n let {value, error, onChange, id, multi, ...rest} = this.props;\n let isMulti = (this.props.hasOwnProperty('multi'));\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n\n return (\n \n
op.id}\n getOptionLabel={op => (`${op.name} (${op.id})`)}\n isMulti={isMulti}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n\n \n );\n\n }\n}\n\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport Select from 'react-select';\n\nconst SummitVenuesSelect = ({venues, currentValue, placeholder, onVenueChanged, ...rest}) => {\n const parsedValue = venues.find(v => v.value.id === currentValue?.id) || null;\n const renderOption = (option) => {\n let location = option.value;\n if (location.class_name === 'SummitVenue')\n return ({location.name} );\n return (- {location.name} );\n }\n\n const onChange = (selectedOption) => {\n onVenueChanged(selectedOption?.value || null);\n }\n\n return (\n \n );\n}\n\nexport default SummitVenuesSelect;\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport AsyncSelect from 'react-select/lib/Async';\nimport AsyncCreatableSelect from \"react-select/lib/AsyncCreatable\";\nimport { queryTags } from '../../utils/query-actions';\nimport { shallowEqual } from \"../../utils/methods\";\n\nexport default class TagInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n tagValue: props.value.map((t) => ({ tag: t.tag, id: t.id }))\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.handleNew = this.handleNew.bind(this);\n this.getTags = this.getTags.bind(this);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n if (!shallowEqual(this.props.value, prevProps.value)) {\n let nextValue = this.props.value.map((t) => ({ tag: t.tag, id: t.id }));\n this.setState({ tagValue: nextValue });\n }\n }\n\n handleNew(ev) {\n const newTag = { tag: ev }\n this.props.onCreate(ev, this.setState({ value: [...this.state.tagValue, newTag] }));\n }\n\n handleChange(value) {\n let ev = {\n target: {\n id: this.props.id,\n value: value,\n type: 'taginput'\n }\n };\n\n this.props.onChange(ev);\n }\n\n getTags(input, callback) {\n if (!input) {\n return Promise.resolve({ options: [] });\n }\n\n let summitId = (this.props.hasOwnProperty('summitId')) ? this.props.summitId : null;\n\n const _callback = (options) => {\n if (summitId) {\n options = options.map(t => t.tag);\n }\n callback(options);\n };\n\n queryTags(summitId, input, _callback);\n }\n\n render() {\n let { className, error, allowCreate, ...rest } = this.props;\n let { tagValue } = this.state;\n let has_error = (this.props.hasOwnProperty('error') && error != '');\n let orderedTags = tagValue.sort((a, b) => (a.tag.toLowerCase() > b.tag.toLowerCase() ? 1 : (a.tag.toLowerCase() < b.tag.toLowerCase() ? -1 : 0)));\n\n const AsyncComponent = allowCreate\n ? AsyncCreatableSelect\n : AsyncSelect;\n\n return (\n \n
option.__isNew__ ? option.label : option.tag}\n getOptionValue={option => option.__isNew__ ? option.value : option.tag}\n />\n {has_error &&\n {error}
\n }\n \n );\n\n }\n}\n\nTagInput.propTypes = {\n allowCreate: PropTypes.bool,\n className: PropTypes.string,\n summitId: PropTypes.number,\n id: PropTypes.string.isRequired,\n value: PropTypes.array,\n onCreate: PropTypes.func,\n onChange: PropTypes.func.isRequired,\n};\n\nTagInput.defaultProps = {\n allowCreate: false\n}\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\n\nexport default class Input extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n if (this.props.value !== prevProps.value) {\n this.input.value = this.props.value;\n }\n }\n\n handleChange(ev) {\n this.props.onChange(ev);\n }\n\n render() {\n\n let {onChange, value, className, error, ariaLabelledBy, containerClassName,...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error !== '' );\n let class_name = this.props.hasOwnProperty('className') ? className : 'form-control';\n let container_class_name = this.props.hasOwnProperty('containerClassName') ? containerClassName : 'container-form-control';\n return (\n \n
{this.input = node}}\n defaultValue={value}\n aria-labelledby={ariaLabelledBy}\n onChange={this.handleChange}\n {...rest}\n />\n {has_error &&\n
{error}
\n }\n
\n );\n\n }\n}\n\nInput.defaultProps = {\n ariaLabelledBy : null,\n}","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\n\nconst TextArea = ({ onChange, value, className, error, maxLength, ...rest }) => {\n const has_error = error && error !== '';\n const class_name = className ? className : 'form-control';\n const charCountLeft = Math.max(maxLength - value.length, 0);\n\n const handleChange = (ev) => {\n const isBackSpace = !!(value?.length - ev.target?.value?.length);\n\n if (!maxLength || isBackSpace) onChange(ev);\n\n if (charCountLeft) {\n onChange(ev)\n }\n };\n\n return (\n \n
\n {!!maxLength &&\n
characters left: {charCountLeft}
\n }\n {has_error &&\n
{error}
\n }\n
\n );\n}\n\nTextArea.defaultProps = {\n value: \"\"\n};\n\nexport default TextArea;\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport { queryTicketTypes } from '../../utils/query-actions';\nimport PropTypes from 'prop-types';\n\nclass TicketTypesInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.getTicketTypes = this.getTicketTypes.bind(this);\n this.getOptionValue = this.getOptionValue.bind(this);\n this.getOptionLabel = this.getOptionLabel.bind(this);\n }\n\n getOptionValue(ticketType){\n if(this.props.hasOwnProperty(\"getOptionValue\")){\n return this.props.getOptionValue(ticketType);\n }\n //default\n return ticketType.id;\n }\n\n getOptionLabel(ticketType){\n if(this.props.hasOwnProperty(\"getOptionLabel\")){\n return this.props.getOptionLabel(ticketType);\n }\n //default\n return `${ticketType.name}`;\n }\n\n handleChange(value) {\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'tickettypeinput'\n }};\n\n this.props.onChange(ev);\n }\n\n getTicketTypes (input, callback) {\n let { summitId, version, optionsLimit } = this.props;\n\n let filters = { name : input };\n if(this.props.hasOwnProperty('audience')){\n filters['audience'] = this.props.audience;\n }\n\n queryTicketTypes(summitId, filters , callback, version, optionsLimit);\n }\n\n render() {\n\n let {value, error, onChange, id, multi, optionsLimit, ...rest} = this.props;\n let isMulti = (this.props.hasOwnProperty('multi'));\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n\n return (\n \n
this.getOptionValue(m)}\n getOptionLabel={m => this.getOptionLabel(m)}\n isMulti={isMulti}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n\n \n );\n\n }\n}\n\nTicketTypesInput.defaultProps = {\n version: 'v1',\n}\n\nTicketTypesInput.propTypes = {\n audience: PropTypes.string,\n version: PropTypes.string,\n};\n\n\nexport default TicketTypesInput;\n","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react'\nimport DropzoneJS from '../dropzone'\nimport './index.less';\nimport file_icon from '../upload-input/file.png';\nimport ProgressiveImg from \"../../progressive-img\";\nconst FileNameMaxLen = 20;\n\nexport default class UploadInputV2 extends React.Component {\n\n constructor(props) {\n super(props);\n }\n\n getDefaultAllowedExtensions = () => {\n const { mediaType } = this.props\n return mediaType && mediaType.type ? mediaType?.type?.allowed_extensions.map((ext) => `.${ext.toLowerCase()}`).join(\",\") : '';\n }\n\n getDefaultMaxSize = () => {\n const { mediaType } = this.props\n return mediaType ? mediaType?.max_size / 1024 : 100;\n }\n\n getDropzone = () => {\n const {\n value,\n onRemove,\n canAdd = true,\n mediaType,\n postUrl,\n maxFiles = 1,\n timeOut,\n onUploadComplete,\n djsConfig,\n id,\n parallelChunkUploads = false,\n maxConcurrentChunks = 6,\n onError = () => {},\n getAllowedExtensions = null,\n getMaxSize = null\n } = this.props;\n\n const allowedExt = getAllowedExtensions ? getAllowedExtensions() : this.getDefaultAllowedExtensions();\n const maxSize = getMaxSize ? getMaxSize() : this.getDefaultMaxSize();\n const canUpload = !maxFiles || value.length < maxFiles;\n\n let eventHandlers = {};\n if (onRemove) {\n eventHandlers = {removedfile: onRemove};\n }\n\n const djsConfigSet = {\n paramName: \"file\", // The name that will be used to transfer the file,\n maxFilesize: maxSize, // MB,\n timeout: timeOut || (1000 * 60 * 10),\n chunking: true,\n retryChunks: true,\n parallelChunkUploads: parallelChunkUploads,\n addRemoveLinks: true,\n maxFiles: maxFiles,\n acceptedFiles: allowedExt,\n ...djsConfig\n };\n\n const componentConfig = {\n showFiletypeIcon: false,\n postUrl: postUrl\n };\n\n const data = {\n media_type: mediaType,\n media_upload: value,\n };\n\n if (!postUrl) {\n return (\n \n No Post URL\n
\n );\n }\n if (!canAdd) {\n return (\n \n Upload has been disabled by administrators.\n
\n );\n } else if (!canUpload) {\n return (\n \n Max number of files uploaded for this type - Remove uploaded file to add new file.\n
\n );\n } else {\n return (\n \n );\n }\n }\n\n render() {\n const {value, canDelete = true, onRemove, error} = this.props;\n const has_error = ( this.props.hasOwnProperty('error') && error !== '' );\n\n return (\n \n
\n {this.getDropzone()}\n
\n
\n {has_error &&\n
{error}
\n }\n {value.length > 0 &&\n
\n {value.map((v,i) => {\n let src = v?.private_url || v?.public_url;\n if(src === '#') src = v?.public_url;\n // custom replace for dropbox case ( download vs raw)\n let filename = v.filename;\n let previewSrc = src ? src.replace(\"?dl=0\",\"?raw=1\") : filename;\n let ext = filename.split('.').pop();\n let path = filename.replace(`.${ext}`, '');\n if (path.length > FileNameMaxLen) {\n path = path.substring(0, FileNameMaxLen);\n }\n\n return (\n \n \n \n \n \n \n {`${path}.${ext}`} \n {onRemove && canDelete &&\n \n onRemove(v)} >\n \n \n \n }\n \n )\n })}\n \n }\n
\n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/icons-material\");","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport { DropzoneJS } from '../dropzone';\n\n/**\n * Thin wrapper around DropzoneJS that exposes file lifecycle callbacks\n * without modifying the shared dropzone component.\n */\nexport const DropzoneV3 = ({\n onAddedFile,\n onUploadProgress,\n onFileRemoved,\n onFileCompleted,\n onFileError,\n onDropzoneReady,\n eventHandlers = {},\n children,\n ...props\n}) => {\n const combinedEventHandlers = {\n ...eventHandlers,\n init: (dz) => {\n if (onDropzoneReady) onDropzoneReady(dz);\n if (eventHandlers.init) eventHandlers.init(dz);\n },\n addedfile: (file) => {\n if (onAddedFile) onAddedFile(file);\n if (eventHandlers.addedfile) eventHandlers.addedfile(file);\n },\n removedfile: (file) => {\n if (onFileRemoved) onFileRemoved(file);\n if (eventHandlers.removedfile) eventHandlers.removedfile(file);\n },\n uploadprogress: (file, progress, bytesSent) => {\n if (onUploadProgress) onUploadProgress(file, file.size > 0 ? bytesSent / file.size * 100 : 0);\n if (eventHandlers.uploadprogress) eventHandlers.uploadprogress(file, progress, bytesSent);\n },\n success: (file) => {\n if (onFileCompleted) onFileCompleted(file);\n if (eventHandlers.success) eventHandlers.success(file);\n },\n error: (file, message) => {\n if (onFileError) onFileError(file, message);\n if (eventHandlers.error) eventHandlers.error(file, message);\n },\n };\n\n return (\n \n {children}\n \n );\n};\n\nexport default DropzoneV3;\n","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React, { useState, useRef, useMemo, useCallback, useEffect } from 'react';\nimport {\n Box,\n Typography,\n IconButton,\n Alert,\n LinearProgress,\n} from '@mui/material';\nimport {\n UploadFile as UploadFileIcon,\n Delete as DeleteIcon,\n CheckCircle as CheckCircleIcon,\n ErrorOutline as ErrorOutlineIcon,\n Close as CloseIcon,\n} from '@mui/icons-material';\nimport { DropzoneV3 } from './dropzone-v3';\nimport './index.less';\n\nconst UploadInputV3 = ({\n value = [],\n onRemove,\n canAdd = true,\n canDelete = true,\n mediaType,\n postUrl,\n maxFiles = 1,\n timeOut,\n onUploadComplete,\n djsConfig,\n id,\n parallelChunkUploads = false,\n maxConcurrentChunks = 6,\n onError = () => {},\n getAllowedExtensions = null,\n getMaxSize = null,\n error,\n label,\n helpText\n}) => {\n const dropzoneInstanceRef = useRef(null);\n const [uploadingFiles, setUploadingFiles] = useState([]);\n const [errorFiles, setErrorFiles] = useState([]);\n\n const getDefaultAllowedExtensions = useCallback(() => {\n return mediaType && mediaType.type\n ? mediaType?.type?.allowed_extensions.map((ext) => `.${ext.toLowerCase()}`).join(\",\")\n : '';\n }, [mediaType]);\n\n const getDefaultMaxSize = useCallback(() => {\n return mediaType ? mediaType?.max_size / (1024 * 1024) : 100;\n }, [mediaType]);\n\n const allowedExt = useMemo(() =>\n getAllowedExtensions ? getAllowedExtensions() : getDefaultAllowedExtensions(),\n [getAllowedExtensions, getDefaultAllowedExtensions]\n );\n\n const maxSize = useMemo(() =>\n getMaxSize ? getMaxSize() : getDefaultMaxSize(),\n [getMaxSize, getDefaultMaxSize]\n );\n\n const canUpload = useMemo(() =>\n !maxFiles || value.length < maxFiles,\n [maxFiles, value.length]\n );\n\n const showDropzone = useMemo(() =>\n canUpload && uploadingFiles.length === 0 && errorFiles.length === 0,\n [canUpload, uploadingFiles.length, errorFiles.length]\n );\n\n const eventHandlers = useMemo(() => {\n return onRemove ? { removedfile: onRemove } : {};\n }, [onRemove]);\n\n const djsConfigSet = useMemo(() => ({\n paramName: \"file\",\n maxFilesize: maxSize,\n timeout: timeOut || (1000 * 60 * 10),\n chunking: true,\n retryChunks: true,\n parallelChunkUploads: parallelChunkUploads,\n addRemoveLinks: true,\n maxFiles: maxFiles,\n acceptedFiles: allowedExt,\n dictDefaultMessage: '',\n ...djsConfig\n }), [maxSize, timeOut, parallelChunkUploads, maxFiles, allowedExt, djsConfig]);\n\n const componentConfig = useMemo(() => ({\n showFiletypeIcon: false,\n postUrl: postUrl\n }), [postUrl]);\n\n const data = useMemo(() => ({\n media_type: mediaType,\n media_upload: value,\n }), [mediaType, value]);\n\n const formatFileSize = useCallback((bytes) => {\n if (!bytes) return '0 KB';\n if (bytes >= 1024 * 1024) return `${Math.round(bytes / (1024 * 1024))} MB`;\n return `${Math.round(bytes / 1024)} KB`;\n }, []);\n\n const formatExtensionsDisplay = useCallback(() => {\n if (!allowedExt) return '';\n const exts = allowedExt.split(',')\n .map(e => e.trim().replace('.', '').toUpperCase())\n .filter(Boolean);\n if (exts.length === 0) return '';\n if (exts.length === 1) return exts[0];\n return `${exts.slice(0, -1).join(', ')} or ${exts[exts.length - 1]}`;\n }, [allowedExt]);\n\n const handleRemove = useCallback((file) => (ev) => {\n ev.preventDefault();\n onRemove(file);\n }, [onRemove]);\n\n const handleDropzoneReady = useCallback((dz) => {\n dropzoneInstanceRef.current = dz;\n }, []);\n\n const handleAddedFile = useCallback((file) => {\n setUploadingFiles(prev => [...prev, { name: file.name, size: file.size, progress: 0, complete: false }]);\n }, []);\n\n const handleUploadProgress = useCallback((file, progress) => {\n setUploadingFiles(prev => prev.map(f =>\n f.name === file.name && f.size === file.size ? { ...f, progress } : f\n ));\n }, []);\n\n const handleFileRemoved = useCallback((file) => {\n setUploadingFiles(prev => prev.filter(f => !(f.name === file.name && f.size === file.size)));\n }, []);\n\n // Mark as complete instead of removing — keep it visible until value is updated by the parent\n const handleFileCompleted = useCallback((file) => {\n setUploadingFiles(prev => prev.map(f =>\n f.name === file.name && f.size === file.size ? { ...f, progress: 100, complete: true } : f\n ));\n }, []);\n\n // Once the parent updates value, remove the matching completed file from uploadingFiles\n useEffect(() => {\n if (uploadingFiles.length === 0 || value.length === 0) return;\n setUploadingFiles(prev => prev.filter(f => {\n if (!f.complete) return true;\n return !value.some(v => v.filename === f.name);\n }));\n }, [value]);\n\n const handleFileError = useCallback((file, message) => {\n setUploadingFiles(prev => prev.filter(f => !(f.name === file.name && f.size === file.size)));\n setErrorFiles(prev => [...prev, { name: file.name, size: file.size, message }]);\n }, []);\n\n const handleDismissError = useCallback((file) => {\n if (dropzoneInstanceRef.current) {\n const dzFile = dropzoneInstanceRef.current.files?.find(\n f => f.name === file.name && f.size === file.size\n );\n if (dzFile) dropzoneInstanceRef.current.removeFile(dzFile);\n }\n setErrorFiles(prev => prev.filter(f => !(f.name === file.name && f.size === file.size)));\n }, []);\n\n const handleDeleteUploading = useCallback((file) => {\n if (dropzoneInstanceRef.current) {\n const dzFile = dropzoneInstanceRef.current.files?.find(\n f => f.name === file.name && f.size === file.size\n );\n if (dzFile) dropzoneInstanceRef.current.removeFile(dzFile);\n }\n setUploadingFiles(prev => prev.filter(f => !(f.name === file.name && f.size === file.size)));\n }, []);\n\n const wrappedOnUploadComplete = useCallback((response, dzId, dzData) => {\n if (onUploadComplete) onUploadComplete(response, dzId, dzData);\n }, [onUploadComplete]);\n\n const extDisplay = formatExtensionsDisplay();\n\n const renderDropzone = () => {\n if (!postUrl) {\n return (\n \n No Post URL\n \n );\n }\n if (!canAdd) {\n return (\n \n Upload has been disabled by administrators.\n \n );\n }\n\n return (\n \n \n \n \n Click to upload or drag and drop\n \n {(extDisplay || maxSize) && (\n \n {extDisplay ? `${extDisplay} files` : ''}\n {maxSize ? ` (max. ${maxSize}MB)` : ''}\n \n )}\n \n \n );\n };\n\n const fileRowSx = {\n display: 'flex',\n alignItems: 'center',\n py: 1.5,\n mb: 1,\n };\n\n return (\n \n {label && (\n \n {label}\n \n )}\n\n {helpText && (\n \n {helpText}\n \n )}\n\n {canUpload && (\n \n {renderDropzone()}\n \n )}\n\n {error && (\n \n {error}\n \n )}\n\n {uploadingFiles.length > 0 && (\n \n {uploadingFiles.map((file, index) => (\n \n \n \n \n\n \n \n {file.name}\n \n \n {formatFileSize(file.size)} · {file.complete ? 'Complete' : 'Loading'}\n \n {!file.complete && (\n \n )}\n \n\n \n handleDeleteUploading(file)}\n sx={{ color: 'text.secondary', '&:hover': { color: 'error.main' } }}\n >\n \n \n {file.complete && (\n \n )}\n \n \n ))}\n \n )}\n\n {errorFiles.length > 0 && (\n \n {errorFiles.map((file, index) => (\n \n \n \n \n\n \n \n {file.name}\n \n \n {file.message}\n \n \n\n handleDismissError(file)}\n sx={{ color: 'error.main' }}\n >\n \n \n \n ))}\n \n )}\n\n {value.length > 0 && (\n \n {value.map((file, index) => {\n const filename = file.filename;\n const fileSize = formatFileSize(file.size);\n\n return (\n \n \n \n \n\n \n \n {filename}\n \n \n {fileSize} · Complete\n \n \n\n \n {onRemove && canDelete && (\n \n \n \n )}\n \n \n \n );\n })}\n \n )}\n\n \n );\n};\n\nexport default UploadInputV3;\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-dropzone\");","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React, {useEffect, useState} from 'react';\nimport Dropzone from 'react-dropzone';\nimport T from 'i18n-react/dist/i18n-react';\nimport './upload.less';\n\nimport file_icon from './file.png';\nimport pdf_icon from './pdf.png';\nimport mov_icon from './mov.png';\nimport mp4_icon from './mp4.png';\nimport csv_icon from './csv.png';\n\nconst fileHasPreview = (fileName) => {\n if (!fileName) return false;\n const pattern = /(.*)\\.(gif|bmp|svg|jpe?g|png)/g\n return pattern.test(fileName);\n}\n\nconst getPreviewIcon = (value, fileName) => {\n if (value && fileHasPreview(fileName)) {\n return value;\n }\n\n const ext = fileName.split('.').pop();\n\n switch (ext) {\n case 'pdf':\n return pdf_icon;\n case 'mov':\n return mov_icon;\n case 'mp4':\n return mp4_icon;\n case 'csv':\n return csv_icon;\n default:\n return file_icon;\n }\n}\n\nconst UploadInput = ({value, error, handleRemove, handleUpload, handleError, ...rest}) => {\n const [showRemove, setShowRemove] = useState(false);\n const [logoPreview, setLogoPreview] = useState({preview: null, name: ''});\n\n useEffect(() => {\n const logoPreviewTmp = {preview: null, name: ''};\n\n if (value) {\n const fileName = value.split(\"/\").pop();\n logoPreviewTmp.preview = getPreviewIcon(value, fileName);\n logoPreviewTmp.name = fileName;\n setLogoPreview(logoPreviewTmp);\n }\n }, [value]);\n\n const onDrop = (acceptedFiles, fileRejections) => {\n if (acceptedFiles.length > 0) {\n const file = acceptedFiles[0];\n handleUpload(file, {...rest});\n }\n\n if (fileRejections.length > 0 && handleError)\n handleError(fileRejections, {...rest});\n }\n\n const onRemove = (ev) => {\n ev.preventDefault();\n handleRemove(ev, {...rest});\n }\n\n const showVeil = () => {\n setShowRemove(true)\n }\n\n const hideVeil = () => {\n setShowRemove(false);\n }\n\n const has_error = error !== '';\n\n return (\n \n
\n {T.translate(\"general.drop_files\")}
\n \n
\n
Selected Files
\n
\n {value &&\n
\n }\n {has_error &&\n
{error}
\n }\n
\n
\n
\n )\n}\n\nexport default UploadInput;\n","// extracted by mini-css-extract-plugin\nexport default {\"loading\":\"T1PEDYso224efj98hUw9\",\"loaded\":\"HydBuzzegFMoqMkrptg7\",\"image\":\"Pq0tg32DAJ33TmIQMvMs\"};","/**\n * Copyright 2023 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\nimport React,{ useState, useEffect, useRef } from \"react\";\nimport styles from './index.module.scss';\nimport pdf_icon from \"../inputs/upload-input/pdf.png\";\nimport mov_icon from \"../inputs/upload-input/mov.png\";\nimport mp4_icon from \"../inputs/upload-input/mp4.png\";\nimport csv_icon from \"../inputs/upload-input/csv.png\";\nimport file_icon from \"../inputs/upload-input/file.png\";\n/**\n *\n * @param placeholderSrc\n * @param src\n * @param props\n * @returns {JSX.Element}\n * @constructor\n */\nconst ProgressiveImg = ({ placeholderSrc, src, ...props }) => {\n const isCancelled = useRef(false);\n const [imgSrc, setImgSrc] = useState(placeholderSrc || src);\n const [customClass, setCustomClass] = useState(styles.loading);\n\n useEffect(() => {\n const img = new Image();\n const ext = src ? src.split('.').pop() : null;\n img.src = src;\n\n img.onload = () => {\n if (isCancelled.current) return\n setImgSrc(src)\n setCustomClass(styles.loaded)\n };\n\n img.onerror = () => {\n if (isCancelled.current) return\n img.onerror = null;\n if(ext && ext.toString().toLowerCase().includes('pdf'))\n setImgSrc(pdf_icon)\n else if(ext && ext.toString().toLowerCase().includes('mov'))\n setImgSrc(mov_icon);\n else if(ext && ext.toString().toLowerCase().includes('mp4'))\n setImgSrc(mp4_icon);\n else if(ext && ext.toString().toLowerCase().includes('csv'))\n setImgSrc(csv_icon);\n else\n setImgSrc(file_icon);\n setCustomClass(styles.loaded)\n };\n\n return () => {\n isCancelled.current = true;\n };\n }, [src]);\n\n return (\n \n );\n};\nexport default ProgressiveImg;\n","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\", ...rest}) =>\n ') : children}} {...rest}/>\n\nexport default RawHTML;","export const DraggableItemTypes = {\n UNSCHEDULEEVENT: 'UnScheduleEvent',\n SCHEDULEEVENT: 'ScheduleEvent',\n};\n\nexport const TBALocation = {id : 0, name : 'TBD', class_name: 'SummitVenue'};\nexport const SlotSizeOptions = [1,5,10,15,30,60]; // 12 - 6 - 4 - 2 - 1\nexport const PixelsPerMinute = 3;\n\nexport const BulkActionEdit = 'BULK_ACTION_EDIT';\nexport const BulkActionPublish = 'BULK_ACTION_PUBLISH';\nexport const BulkActionUnPublish = 'BULK_ACTION_UNPUBLISH';\n\nexport const bulkOptions = [\n {value: BulkActionEdit, label: 'Edit'},\n {value: BulkActionUnPublish, label: 'Unpublish'},\n];\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-bootstrap\");","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React, {useState, useEffect} from 'react';\nimport {DraggableItemTypes} from './constants';\nimport {useDrag} from 'react-dnd';\nimport {Popover, OverlayTrigger} from 'react-bootstrap';\nimport RawHTML from '../raw-html';\n\nconst RESIZING_DIR_NORTH = 'N';\nconst RESIZING_DIR_SOUTH = 'S';\n\nconst ScheduleEvent = ({\n event,\n step,\n initialTop,\n initialHeight,\n minHeight,\n maxHeight,\n canResize,\n allowResize,\n allowDrag,\n onResized,\n onUnPublishEvent,\n onEditEvent,\n onClickSelected,\n selectedPublishedEvents,\n onMoveEvent\n }) => {\n const [collected, drag] = useDrag(() => ({\n type: DraggableItemTypes.SCHEDULEEVENT,\n item: {id: event.id, title: event.title, is_published: event.is_published, start_date: event.start_date, end_date: event.end_date, duration: event.duration},\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n }),\n canDrag: allowDrag && !event.static\n }), [event.id, event.duration, event.start_date, event.end_date]);\n const [resizeInfo, setResizeInfo] = useState({resizing: false, type: null, lastYPos: null});\n const [size, setSize] = useState({top: initialTop, height: initialHeight});\n const isSelected = selectedPublishedEvents?.includes(event.id) || false;\n const canEdit = !event.static;\n const isResizable = allowResize && canEdit && size.height > 15;\n\n const popoverHoverFocus = () =>\n \n {event.description} \n \n\n // resize behavior\n\n const onMouseDown = (evt) => {\n if (!evt.target.getAttribute('data-resizable')) return;\n\n const box = evt.target.getBoundingClientRect();\n\n let type;\n if (evt.clientY - box.top < 10) {\n type = RESIZING_DIR_NORTH;\n } else if (box.bottom - evt.clientY < 10) {\n type = RESIZING_DIR_SOUTH;\n } else {\n return;\n }\n\n setResizeInfo({resizing: true, type, lastYPos: evt.pageY});\n\n evt.preventDefault();\n }\n\n const onMouseMove = (evt) => {\n if (!resizeInfo.resizing) return;\n\n let lastYPos = resizeInfo.lastYPos;\n let newYPos = evt.pageY;\n let deltaY = newYPos - lastYPos;\n\n if (step && step > 0) {\n let steps = parseInt(Math.round(Math.abs(deltaY) / step));\n deltaY = Math.sign(deltaY) * steps * step;\n if (!deltaY) {\n evt.preventDefault();\n return false;\n }\n }\n\n let newHeight = size.height;\n let newTop = size.top;\n\n if (resizeInfo.type === RESIZING_DIR_SOUTH) {\n newHeight = size.height + deltaY;\n }\n\n if (resizeInfo.type === RESIZING_DIR_NORTH) {\n if (deltaY < 0) {\n newTop = size.top - Math.abs(deltaY);\n newHeight = size.height + Math.abs(deltaY);\n } else {\n newTop = size.top + Math.abs(deltaY);\n newHeight = size.height - Math.abs(deltaY);\n }\n }\n\n // check constraints\n if (newHeight < minHeight) {\n newHeight = minHeight;\n newYPos = lastYPos;\n newTop = size.top;\n }\n\n let maxHeightTmp = (typeof maxHeight === \"function\") ? maxHeight() : maxHeight;\n\n if (newHeight > maxHeightTmp) {\n newHeight = maxHeightTmp;\n newYPos = lastYPos;\n newTop = size.top;\n }\n\n if (newTop < 0) {\n newTop = 0;\n newHeight = size.height;\n newYPos = lastYPos;\n }\n\n if (canResize(event.id, newTop, newHeight)) {\n setResizeInfo({\n ...resizeInfo,\n resizing: true,\n lastYPos: newYPos\n });\n\n setSize({\n top: newTop,\n height: newHeight,\n });\n }\n\n evt.preventDefault();\n };\n\n const onMouseUp = (evt) => {\n evt.preventDefault();\n setResizeInfo({type: null, lastYPos: null, resizing: false});\n };\n \n const eventTitleBlock = () => {\n let block = null;\n \n if (event.description) {\n block = (\n \n {`${event.id} - ${event.title}${event.duration ? ` - ${event.duration/60} minutes` : ''}`} \n
\n );\n } else {\n block = (\n {`${event.id} - ${event.title}${event.duration ? ` - ${event.duration/60} minutes` : ''}`} \n
);\n }\n \n return block;\n }\n\n // end resize behavior\n\n useEffect(() => {\n if (resizeInfo.resizing) {\n document.addEventListener('mousemove', onMouseMove, false);\n document.addEventListener('mouseup', onMouseUp, false);\n } else {\n document.removeEventListener('mousemove', onMouseMove, false);\n document.removeEventListener('mouseup', onMouseUp, false);\n\n if (size.top !== initialTop || size.height !== initialHeight) {\n onResized(event.id, size.top, size.height);\n }\n }\n\n return () => {\n document.removeEventListener('mousemove', onMouseMove, false);\n document.removeEventListener('mouseup', onMouseUp, false);\n }\n }, [resizeInfo.resizing])\n\n return (\n \n {onClickSelected &&\n
\n onClickSelected(event)}\n />\n
\n }\n
\n {eventTitleBlock()}\n
\n
\n {!event.static && onUnPublishEvent &&\n onUnPublishEvent(event)}\n />\n }\n {onEditEvent &&\n onEditEvent(event)}\n />\n }\n {!event.static && onMoveEvent &&\n onMoveEvent(event)}\n />\n }\n
\n
\n );\n}\n\nexport default ScheduleEvent;\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-dom\");","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributschedule-event-list'ed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React, {useEffect, useRef, useState} from 'react';\nimport moment from 'moment-timezone'\nimport {useDrop} from 'react-dnd'\nimport {DraggableItemTypes} from './constants';\nimport ScheduleEvent from './schedule-event';\nimport ReactDOM from 'react-dom';\nimport SummitEvent from '../../models/summit-event';\n\nconst TimeSlot = ({timeLabel, id}) => {\n return (\n \n )\n}\n\nconst TimeSlotContainer = ( props ) => {\n const {currentDay, currentSummit, events, timeSlot, pixelsPerMinute, interval, canDropEvent, onDroppedEvent} = props;\n const divId = `time_slot_container_${timeSlot.format('HH_mm')}`;\n const [collectedProps, drop] = useDrop(() => ({\n accept: [DraggableItemTypes.UNSCHEDULEEVENT, DraggableItemTypes.SCHEDULEEVENT],\n collect: (monitor) => ({\n isOver: monitor.isOver(),\n canDrop: monitor.canDrop()\n }),\n canDrop: (item, monitor) => {\n if (canDropEvent) return canDropEvent(item, monitor);\n const eventModel = new SummitEvent(item, currentSummit);\n return eventModel.canMove(events, currentDay, timeSlot, interval);\n },\n drop: (item, monitor, component) => {\n onDroppedEvent(item, timeSlot);\n }\n }), [interval, timeSlot, currentDay]);\n const {isOver, canDrop} = collectedProps;\n\n const renderMinutesContainer = (interval, pixelsPerMinute) => {\n let minutesContainers = [];\n let container_count = 2;\n let container_height = pixelsPerMinute * 5;\n\n for (var i = 0; i < container_count; i++) {\n\n minutesContainers[i] =
;\n }\n\n return minutesContainers;\n };\n\n const placeHolderStyle = () => {\n const style = {};\n\n if (isOver) {\n style.backgroundColor = canDrop ? 'green' : 'red';\n style.opacity = 0.5;\n } else if (canDrop) {\n style.backgroundColor = 'yellow';\n style.opacity = 0.5;\n }\n\n return style;\n }\n\n return (\n \n
\n {renderMinutesContainer(interval, pixelsPerMinute)}\n
\n
\n );\n};\n\nconst ScheduleEventList = (props) => {\n const listRef = useRef();\n const prevIntervalRef = useRef();\n const [timeSlotsList, setTimeSlotsList] = useState([]);\n const [newScrollTop, setNewScrollTop] = useState(null);\n const scheduleEventContainer = useRef(null);\n \n // sets scrollbar position after interval change and render\n useEffect(() => {\n if (newScrollTop) {\n listRef.current.scrollTop = newScrollTop;\n setNewScrollTop(null);\n }\n }, [newScrollTop]);\n\n useEffect(() => {\n const slotChangeRatio = prevIntervalRef.current / props.interval;\n // set scroll pos to set scrollbar after render\n setNewScrollTop(listRef.current.scrollTop * slotChangeRatio);\n createSlots();\n prevIntervalRef.current = props.interval;\n }, [props.interval, props.startTime, props.endTime]);\n\n const onDroppedEvent = (event, startTime) => {\n props.onScheduleEvent(event, props.currentDay, startTime);\n }\n\n const canResize = (eventId, newTop, newHeight) => {\n const {events, currentDay, startTime, pixelsPerMinute, currentSummit} = props;\n const {height} = getBoundingBox();\n\n if (height < (newTop + newHeight)) {\n return false;\n }\n\n const filteredEvents = events.filter(evt => {\n return evt.id !== eventId;\n });\n // calculate new event start date, end date\n const minutes = Math.floor(newTop / (pixelsPerMinute * (10 / interval)));\n const duration = Math.floor(newHeight / (pixelsPerMinute * (10 / interval)));\n\n let startDateTime = moment.tz(currentDay + ' ' + startTime, 'YYYY-MM-DD HH:mm', currentSummit.time_zone.name);\n startDateTime = startDateTime.add(minutes, 'minutes');\n let endDateTime = moment.tz(currentDay + ' ' + startTime, 'YYYY-MM-DD HH:mm', currentSummit.time_zone.name);\n endDateTime = endDateTime.add(minutes + duration, 'minutes');\n\n for (const auxEvent of filteredEvents) {\n const auxEventStartDateTime = moment(auxEvent.start_date * 1000).tz(currentSummit.time_zone.name);\n const auxEventEndDateTime = moment(auxEvent.end_date * 1000).tz(currentSummit.time_zone.name);\n // if time segments overlap\n if (auxEventStartDateTime.isBefore(endDateTime) && auxEventEndDateTime.isAfter(startDateTime))\n return false;\n }\n\n return true;\n }\n\n const onResized = (eventId, newTop, newHeight) => {\n const {events, currentDay, startTime, pixelsPerMinute, currentSummit} = props;\n const event = events.filter(evt => {\n return evt.id === eventId;\n }).shift();\n const minutes = Math.floor(newTop / (pixelsPerMinute * (10 / interval)));\n const duration = Math.floor(newHeight / (pixelsPerMinute * (10 / interval)));\n let startDateTime = moment.tz(currentDay + ' ' + startTime, 'YYYY-MM-DD HH:mm', currentSummit.time_zone.name);\n startDateTime = startDateTime.add(minutes, 'minutes');\n\n props.onScheduleEvent(event, currentDay, moment(startDateTime.format('HH:mm'), 'HH:mm'), duration);\n }\n\n const getMaxHeight = () => {\n return getBoundingBox().height;\n }\n\n const getBoundingBox = () => {\n return ReactDOM.findDOMNode(scheduleEventContainer.current).getBoundingClientRect();\n }\n\n const calculateInitialTop = (event) => {\n const {currentDay, startTime, pixelsPerMinute, currentSummit} = props;\n const eventStartDateTime = moment(event.start_date * 1000).utc().tz(currentSummit.time_zone.name);\n const dayStartDateTime = moment.tz(currentDay + ' ' + startTime, 'YYYY-MM-DD HH:mm', currentSummit.time_zone.name);\n const minutes = eventStartDateTime.diff(dayStartDateTime, 'minutes');\n return minutes * pixelsPerMinute * (10 / interval);\n }\n\n const calculateInitialHeight = (event) => {\n const {pixelsPerMinute, currentSummit, interval} = props;\n const eventStartDateTime = moment(event.start_date * 1000).tz(currentSummit.time_zone.name);\n const eventEndDateTime = moment(event.end_date * 1000).tz(currentSummit.time_zone.name);\n const minutes = eventEndDateTime.diff(eventStartDateTime, 'minutes');\n return minutes * pixelsPerMinute * (10 / interval);\n }\n\n const createSlots = () => {\n const tmpList = [];\n let done = false;\n const startTimeTZ = moment.tz(startTime, 'HH:mm', currentSummit.time_zone.name);\n const endTimeTZ = moment.tz(endTime, 'HH:mm', currentSummit.time_zone.name);\n // create UI\n let slot = startTimeTZ;\n do {\n tmpList.push(slot);\n slot = slot.clone();\n slot.add(interval, 'm');\n done = slot.isAfter(endTimeTZ);\n } while (!done);\n\n setTimeSlotsList(tmpList);\n };\n\n const {\n events,\n startTime,\n endTime,\n interval,\n pixelsPerMinute,\n currentDay,\n currentSummit,\n canDropEvent,\n onEditEvent,\n onUnPublishEvent,\n onClickSelected,\n selectedPublishedEvents\n } = props;\n\n return (\n \n
\n {\n timeSlotsList.map((slot, idx) => (\n \n ))\n }\n
\n
\n {\n timeSlotsList.map((slot, idx) => (\n \n \n ))\n }\n {\n events.map((event, idx) => {\n return (\n \n )\n })\n }\n
\n
\n );\n}\n\nexport default ScheduleEventList;\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@react-pdf/renderer\");","/**\n * Copyright 2020 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Document, Page, StyleSheet, View, Text, Image } from '@react-pdf/renderer';\nimport { convertSVGtoImg, getEventHosts, getEventLocation, epochToMomentTimeZone } from '../../utils/methods';\n\n// Create styles\nconst styles = StyleSheet.create({\n header: {\n fontSize: '18px',\n textAlign: 'center'\n },\n headlineWrapper: {\n margin: '0 10px 20px',\n display: 'flex',\n flexDirection: 'row',\n },\n headline: {\n margin: 'auto'\n },\n logo: {\n marginRight: '20px',\n backgroundColor: 'lightgray'\n },\n subtitle: {\n padding: '10px',\n fontSize: '12px',\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between'\n },\n label: {\n fontSize: '8px',\n textTransform: 'uppercase'\n },\n eventList: {\n flexDirection: 'column',\n display: 'flex',\n overflow: 'hidden',\n padding: '20px'\n },\n eventWrapper: {\n margin: 5,\n padding: 5,\n border: '1px solid black'\n },\n locationWrapper: {\n marginBottom: 8,\n fontSize: '10px',\n color: '#4A4A4A',\n fontWeight: 600,\n },\n title: {\n marginBottom: 10,\n display: 'inline-flex',\n fontSize: '12px',\n color: '#4A4A4A',\n fontWeight: 600,\n },\n footer: {\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n width: '100%'\n },\n leftCol: {\n display: 'flex',\n flex: 1,\n flexDirection: 'column',\n maxWidth: '65%',\n },\n speakers: {\n fontSize: '10px',\n color: '#4A4A4A',\n },\n trackWrapper: {\n fontWeight: 'bold',\n fontSize: '10px',\n position: 'relative',\n marginTop: 'auto',\n },\n rightCol: {\n maxWidth: '35%'\n },\n tagsWrapper: {\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'right'\n },\n tag: {\n backgroundColor: '#F6F6F6',\n borderRadius: '8px',\n height: '10px',\n margin: '4px 4px 0 0',\n padding: '1px 2px',\n textTransform: 'uppercase',\n fontSize: '6px',\n color: '#4A4A4A',\n }\n});\n\nconst SchedulePrintView = ({ events, summit, nowUtc }) => {\n const [imgData, setImgData] = useState(null);\n const getSpeakers = (event) => {\n const speakerTags = getEventHosts(event).map(sp => `${sp.first_name} ${sp.last_name}`);\n\n if (speakerTags.length > 0) {\n return (\n \n By {speakerTags.join(', ')} \n \n );\n }\n\n return null;\n };\n\n const sortedEvents = events.sort((a,b) => a.start_date - b.start_date);\n const venue = summit.locations.find(l => l.class_name === 'SummitVenue');\n const summitStart = epochToMomentTimeZone(summit.start_date, summit.time_zone_id).format('MMMM Do YYYY');\n const summitEnd = epochToMomentTimeZone(summit.end_date, summit.time_zone_id).format('MMMM Do YYYY');\n \n useEffect(() => {\n if (summit.logo) {\n const getPngLogo = async () => {\n const _imgData = await convertSVGtoImg(summit.logo);\n setImgData(_imgData);\n }\n\n getPngLogo();\n }\n }, [summit.logo])\n\n if (!imgData) return null;\n\n return (\n \n \n \n \n \n Schedule for {summit.name} \n \n \n \n Venue: {venue?.name} \n \n \n Start: {summitStart} \n \n \n End: {summitEnd} \n \n \n \n {sortedEvents.map(event => {\n const eventDate = epochToMomentTimeZone(event.start_date, summit.time_zone_id).format('ddd, MMMM D');\n const eventStartTime = epochToMomentTimeZone(event.start_date, summit.time_zone_id).format('h:mma');\n const eventEndTime = epochToMomentTimeZone(event.end_date, summit.time_zone_id).format('h:mma');\n const venueCount = summit.locations.filter(loc => loc.class_name === 'SummitVenue');\n const locationStr = getEventLocation(event, venueCount, summit.start_showing_venues_date, nowUtc);\n const eventColorStyle = event.eventColor ? {borderLeft: `4px solid ${event.eventColor}`} : {};\n\n return (\n \n \n \n {`${eventDate}, ${eventStartTime} - ${eventEndTime} | ${locationStr}`}\n \n \n \n {event.title} \n \n \n \n {event.track &&\n \n {event.track?.name} \n \n }\n {(event.speakers?.length > 0 || event.moderator) &&\n \n {getSpeakers(event)}\n \n }\n \n \n \n {event.tags?.map(t =>\n \n {t.tag} \n \n )}\n \n \n \n \n );\n })}\n \n \n );\n};\n\nSchedulePrintView.propTypes = {\n events: PropTypes.array.isRequired,\n summit: PropTypes.object.isRequired\n};\n\nexport default SchedulePrintView;\n\n","// extracted by mini-css-extract-plugin\nexport default {\"button\":\"XZyB3zy09oNiJPYXzMaR\",\"cal\":\"V8lrMEK6XXJUFDwsrtSs\"};","import React, {useState} from 'react'\nimport {PDFDownloadLink} from '@react-pdf/renderer';\nimport SchedulePrintView from \"../schedule-print/schedule-print-view\";\nimport styles from './styles.module.scss'\n\n\nconst SchedulePrintButton = ({events, summit, nowUtc = null}) => {\n const [downloadPdf, setDownloadPdf] = useState(false);\n \n return (\n <>\n {!downloadPdf &&\n setDownloadPdf(true)}>\n \n Print\n \n }\n \n {downloadPdf &&\n }\n fileName=\"schedule.pdf\"\n >\n {({blob, url, loading, error}) => {\n return (!blob || loading ? 'Creating document...' : 'Download PDF');\n }\n }\n \n }\n >\n );\n}\n\nexport default SchedulePrintButton;\n","import React, {useEffect, useMemo} from 'react';\nimport SummitDaysSelect from \"../inputs/summit-days-select\";\nimport SummitVenuesSelect from \"../inputs/summit-venues-select\";\nimport SteppedSelect from \"../inputs/stepped-select/index.jsx\";\nimport ScheduleEventList from \"./schedule-event-list\";\nimport {epochToMomentTimeZone, parseLocationHour} from \"../../utils/methods\";\nimport BulkActionsSelector from \"../bulk-actions-selector/index.js\";\nimport {bulkOptions, PixelsPerMinute, SlotSizeOptions, TBALocation} from \"./constants\";\nimport SchedulePrintButton from \"../schedule-print/schedule-print-button\";\n\nimport './schedule-builder-view.less';\n\nconst getDaysOptions = (summit, trackSpaceTime, currentLocation) => {\n const days = [];\n const summitLocalStartDate = epochToMomentTimeZone(summit.start_date, summit.time_zone_id);\n const summitLocalEndDate = epochToMomentTimeZone(summit.end_date, summit.time_zone_id);\n let currentAuxDay = summitLocalStartDate.clone();\n const allowedDays =\n trackSpaceTime\n ?.find(sp => sp.location_id === currentLocation?.id)\n ?.allowed_timeframes?.map(\n at => epochToMomentTimeZone(at.day, summit.time_zone_id).format(\"YYYY-MM-DD\")\n ) || null;\n \n do {\n const option = {\n value: currentAuxDay.format(\"YYYY-MM-DD\"),\n label: currentAuxDay.format('dddd Do , MMMM YYYY')\n };\n \n if (!allowedDays || allowedDays.length === 0 || allowedDays.includes(option.value)) {\n days.push(option);\n }\n currentAuxDay = currentAuxDay.clone();\n currentAuxDay.add(1, 'day');\n } while (!currentAuxDay.isAfter(summitLocalEndDate));\n \n return days;\n};\n\nconst getVenuesOptions = (summit, trackSpaceTime) => {\n const venues = [{value: TBALocation, label: TBALocation.name}];\n const allowedLocationIds = trackSpaceTime?.map(st => st.location_id) || null;\n \n const locations = summit.locations.filter(loc => {\n const isNotVenue = loc.class_name !== \"SummitVenue\";\n const isAllowed = allowedLocationIds ? allowedLocationIds.includes(loc.id) : true;\n return isNotVenue && isAllowed;\n })\n \n locations.forEach(loc => {\n const option = {value: loc, label: loc.name};\n venues.push(option);\n if (loc.hasOwnProperty('rooms')) {\n loc.rooms.forEach(r => {\n const subOption = {value: r, label: r.name};\n venues.push(subOption);\n })\n }\n })\n \n return venues;\n};\n\nconst getTimeframe = (currentDay, currentLocation, trackSpaceTime, summitTZ) => {\n if (currentDay && currentLocation && trackSpaceTime) {\n const allowedDays = trackSpaceTime.find(st => st.location_id === currentLocation.id)?.allowed_timeframes;\n \n if (allowedDays?.length > 0) {\n const allowedTimeFrame = allowedDays?.find(tf => epochToMomentTimeZone(tf.day, summitTZ).format(\"YYYY-MM-DD\") === currentDay);\n if (allowedTimeFrame) {\n return {open: parseLocationHour(allowedTimeFrame.opening_hour), close: parseLocationHour(allowedTimeFrame.closing_hour)};\n }\n }\n }\n \n if (currentLocation?.opening_hour && currentLocation?.closing_hour) {\n return {open: parseLocationHour(currentLocation.opening_hour), close: parseLocationHour(currentLocation.closing_hour)};\n }\n \n return {open: \"00:00\", close: \"23:50\"};\n};\n\nconst ScheduleBuilderView = ({\n summit,\n trackSpaceTime,\n scheduleEvents,\n selectedEvents,\n currentDay,\n currentVenue,\n slotSize,\n hideBulkSelect,\n ...props\n }) => {\n const days = useMemo(() => getDaysOptions(summit, trackSpaceTime, currentVenue), [summit.start_date, summit.end_date, trackSpaceTime, currentVenue]);\n const venues = useMemo(() => getVenuesOptions(summit, trackSpaceTime), [summit.locations, trackSpaceTime]);\n const slotSizeOptions = SlotSizeOptions.map(op => ({value: op, label: `${op} min.`}));\n const {allowResize = true, allowDrag = true} = props;\n const {open, close} = useMemo(() => getTimeframe(currentDay, currentVenue, trackSpaceTime, summit.time_zone_id), [currentDay, currentVenue, trackSpaceTime]);\n \n useEffect(() => {\n // if new location doesn't allow currentDay value, reset\n if (currentDay && !days.find(op => op.value === currentDay)) {\n props.onDayChanged(null);\n }\n }, [currentVenue])\n \n return (\n \n {(props.onSlotSizeChange || props.showPrint) &&\n
\n {props.onSlotSizeChange &&\n
\n Slot size: \n \n
\n }\n {props.showPrint &&\n
\n \n
\n }\n
\n }\n
\n
0}\n />\n \n {currentDay && currentVenue &&\n \n }\n \n );\n}\n\nexport default ScheduleBuilderView;\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\n\n\nexport default class Panel extends React.Component {\n\n render() {\n\n let {children, show, title, handleClick, className, id} = this.props;\n let theId = this.props.hasOwnProperty('id') ? id : `id_${title}`;\n let theClass = this.props.hasOwnProperty('className') ? className : '';\n\n return (\n \n );\n\n }\n}","export const AUTH_ERROR_MISSING_AUTH_INFO = 'AUTH_ERROR_MISSING_AUTH_INFO';\nexport const AUTH_ERROR_MISSING_REFRESH_TOKEN = 'AUTH_ERROR_MISSING_REFRESH_TOKEN';\nexport const AUTH_ERROR_ACCESS_TOKEN_EXPIRED = 'AUTH_ERROR_ACCESS_TOKEN_EXPIRED';\nexport const AUTH_ERROR_LOCK_ACQUIRE_ERROR = 'AUTH_ERROR_LOCK_ACQUIRE_ERROR'\nexport const AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR';\nexport const AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR';\nexport const AUTH_ERROR_ID_TOKEN_INVALID = 'AUTH_ERROR_ID_TOKEN_INVALID';\nexport const AUTH_ERROR_MISSING_OTP_PARAM = 'AUTH_ERROR_MISSING_OTP_PARAM';\nexport const AUTH_ERROR_MISSING_PKCE_PARAM = 'AUTH_ERROR_MISSING_PKCE_PARAM';\nexport const AUTH_ERROR_MISSING_NONCE_PARAM = 'AUTH_ERROR_MISSING_NONCE_PARAM';\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"browser-tabs-lock\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"js-cookie\");","import {\n base64URLEncode,\n getAuthCallback,\n getCurrentLocation,\n getFromLocalStorage,\n removeFromLocalStorage,\n getOrigin,\n putOnLocalStorage,\n retryPromise,\n setSessionClearingState,\n} from \"../../utils/methods\";\nimport moment from \"moment-timezone\";\nimport request from 'superagent/lib/client';\nimport SuperTokensLock from 'browser-tabs-lock';\nimport Cookies from 'js-cookie'\nlet http = request;\nimport URI from \"urijs\";\nimport IdTokenVerifier from \"idtoken-verifier\";\nimport {SET_LOGGED_USER} from \"./actions\";\nimport {getRandomBytes, getSHA256} from \"../../utils/crypto\";\n\nimport {\n AUTH_ERROR_ACCESS_TOKEN_EXPIRED,\n AUTH_ERROR_MISSING_AUTH_INFO,\n AUTH_ERROR_MISSING_REFRESH_TOKEN,\n AUTH_ERROR_LOCK_ACQUIRE_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR,\n AUTH_ERROR_ID_TOKEN_INVALID,\n AUTH_ERROR_MISSING_OTP_PARAM,\n AUTH_ERROR_MISSING_PKCE_PARAM,\n AUTH_ERROR_MISSING_NONCE_PARAM,\n} from \"./constants\";\n\n/**\n * @ignore\n */\nconst Lock = new SuperTokensLock();\n/**\n * @ignore\n */\nconst GET_TOKEN_SILENTLY_LOCK_KEY = 'openstackuicore.lock.getTokenSilently';\nconst GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT = 6000;\nconst NONCE_LEN = 16;\nexport const ACCESS_TOKEN_SKEW_TIME = 60;\nexport const RESPONSE_TYPE_IMPLICIT = \"token id_token\";\nexport const RESPONSE_TYPE_CODE = 'code';\nconst AUTH_INFO = 'authInfo';\nconst NONCE = 'nonce';\nconst PKCE = 'pkce';\nconst ID_TOKEN = 'idToken';\nconst BACK_ULR_PARAM_NAME = 'BackUrl';\n\n\n/**\n *\n * @param backUrl\n * @param prompt\n * @param tokenIdHint\n * @param provider\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n * @param backUrlParamName\n * @returns {*}\n */\nexport const getAuthUrl = (\n backUrl = null,\n prompt = null,\n tokenIdHint = null,\n provider = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null,\n backUrlParamName = BACK_ULR_PARAM_NAME\n ) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let baseUrl = getOAuth2IDPBaseUrl();\n let scopes = getOAuth2Scopes();\n let flow = getOAuth2Flow();\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n let nonce = createNonce(NONCE_LEN);\n\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let query = {\n \"response_type\": encodeURI(flow),\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"response_mode\": 'fragment',\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n if (flow === RESPONSE_TYPE_CODE) {\n const pkce = createPKCECodes()\n putOnLocalStorage(PKCE, JSON.stringify(pkce));\n query['code_challenge'] = pkce.codeChallenge;\n query['code_challenge_method'] = 'S256';\n query['approval_prompt'] = 'force';\n }\n\n if (prompt) {\n query['prompt'] = prompt;\n }\n\n if (scopes && scopes.includes('offline_access')) {\n // then we need to force prompt=consent bc we are requesting an offline access\n // and we need to let the user know\n query['prompt'] = 'consent';\n }\n\n if (tokenIdHint) {\n query['id_token_hint'] = tokenIdHint;\n }\n\n if (provider) {\n query['provider'] = provider;\n }\n\n if (otpLoginHint) {\n query['otp_login_hint'] = otpLoginHint;\n }\n\n if (loginHint) {\n query['login_hint'] = encodeURI(loginHint);\n }\n\n if (tenant) {\n query['tenant'] = tenant;\n }\n\n url = url.query(query);\n //console.log(`getAuthUrl ${url.toString()}`);\n return url;\n}\n\n/**\n * @param idToken\n * @returns {*}\n */\nexport const getLogoutUrl = (idToken = null) => {\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let url = URI(`${baseUrl}/oauth2/end-session`);\n let state = createNonce(NONCE_LEN);\n let postLogOutUri = `${getOrigin()}/auth/logout`;\n // store nonce to check it later\n putOnLocalStorage('post_logout_state', state);\n /**\n * post_logout_redirect_uri should be listed on oauth2 client settings\n * on IDP\n * \"Security Settings\" Tab -> Logout Options -> Post Logout Uris\n */\n const queryParams = {\n \"post_logout_redirect_uri\": encodeURI(postLogOutUri),\n \"client_id\": encodeURI(oauth2ClientId),\n \"state\": state,\n }\n\n if (idToken)\n queryParams.id_token_hint = idToken;\n\n return url.query(queryParams);\n}\n\nconst createNonce = (len) => {\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let nonce = '';\n for (let i = 0; i < len; i++) {\n nonce += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return nonce;\n}\n\n/**\n *\n * @param backUrl\n * @param provider\n * @param prompt\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n */\nexport const doLogin = (\n backUrl = null,\n provider = null,\n prompt = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null\n) => {\n let url = getAuthUrl(backUrl, prompt, null, provider, loginHint, otpLoginHint, tenant);\n let location = getCurrentLocation()\n location.replace(url.toString());\n}\n\n/**\n *\n * @param backUrl\n * @param loginHint\n * @param otpLoginHint\n */\nexport const doLoginBasicLogin = (backUrl = null, loginHint = null, otpLoginHint = null) => {\n doLogin(backUrl, null, null, loginHint, otpLoginHint);\n}\n\nconst createPKCECodes = () => {\n const codeVerifier = base64URLEncode(getRandomBytes(64))\n const codeChallenge = getSHA256(codeVerifier, 'Base64url')\n const createdAt = new Date()\n const codePair = {\n codeVerifier,\n codeChallenge,\n createdAt\n }\n return codePair\n}\n\n/**\n\n * @param code\n * @param backUrl\n * @param backUrlParamName\n * @returns {Promise<{access_token: *, refresh_token: *, id_token: *, expires_in: *, error: *, error_description: *}>}\n */\nexport const emitAccessToken = async (code, backUrl = null, backUrlParamName = BACK_ULR_PARAM_NAME) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let pkce = JSON.parse(getFromLocalStorage(PKCE, true));\n\n if (!pkce)\n throw Error(AUTH_ERROR_MISSING_PKCE_PARAM);\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n const payload = {\n 'code': code,\n 'grant_type': 'authorization_code',\n 'code_verifier': pkce.codeVerifier,\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n try {\n //const response = await http.post(`${baseUrl}/oauth2/token`, payload);\n //const {body: {access_token, refresh_token, id_token, expires_in}} = response;\n const response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }).catch(function (error) {\n console.log('Request failed:', error.message);\n });\n const json = await response.json();\n let {access_token, refresh_token, id_token, expires_in, error, error_description} = json;\n return {access_token, refresh_token, id_token, expires_in, error, error_description}\n } catch (err) {\n console.log(err);\n }\n};\n\nexport const MAX_RETRIES = 5;\nexport const BACKOFF_BASE_MS = 1000;\nexport const REFRESH_TOKEN_FETCH_TIMEOUT_MS = 10000;\n\nexport const retryWithBackoff = async (fn, maxRetries = MAX_RETRIES, baseDelayMs = BACKOFF_BASE_MS) => {\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n return await fn();\n } catch (err) {\n // only retry transient network/server errors — everything else fails fast\n const isRetryable = err.message && err.message.startsWith(AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR);\n if (!isRetryable || attempt === maxRetries - 1) {\n throw err;\n }\n const delay = baseDelayMs * Math.pow(2, attempt);\n console.log(`retryWithBackoff retry ${attempt + 1}/${maxRetries} in ${delay}ms`);\n await new Promise(resolve => setTimeout(resolve, delay));\n }\n }\n};\n\nconst processRefreshToken = async (flow, refreshToken) => {\n\n if (flow === RESPONSE_TYPE_CODE && useOAuth2RefreshToken()) {\n if (!refreshToken) {\n clearAuthInfo();\n throw Error(AUTH_ERROR_MISSING_REFRESH_TOKEN);\n }\n\n let response = await retryWithBackoff(() => refreshAccessToken(refreshToken));\n let {access_token, expires_in, refresh_token, id_token} = response;\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n return access_token;\n }\n clearAuthInfo();\n throw Error(AUTH_ERROR_ACCESS_TOKEN_EXPIRED);\n}\n\n/**\n * @returns {Promise<*>}\n * @private\n */\nconst _getAccessToken = async () => {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken`);\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n let flow = getOAuth2Flow();\n // check lifetime\n const now = moment().unix();\n let timeElapsedSecs = (now - accessTokenUpdatedAt);\n\n expiresIn = (expiresIn - ACCESS_TOKEN_SKEW_TIME);\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${now} accessTokenUpdatedAt ${accessTokenUpdatedAt} expiresIn ${expiresIn} timeElapsedSecs ${timeElapsedSecs}`)\n if (timeElapsedSecs >= expiresIn || accessToken == null) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ...`);\n accessToken = await processRefreshToken(flow, refreshToken);\n }\n return accessToken;\n}\n\n/**\n * Optional resolver for getAccessToken, set via setAccessTokenResolver. When\n * present, getAccessToken delegates to it; otherwise the built-in flow runs.\n * Pass a non-function (or nothing) to reset to the built-in.\n *\n * The slot lives on globalThis under a Symbol.for key so every copy of this\n * module shares it: bundles that inlined methods.js, nested installs of the\n * package, and symlinked dev installs all read the same registry entry.\n */\nconst ACCESS_TOKEN_RESOLVER_KEY = Symbol.for('openstack-uicore-foundation.accessTokenResolver');\n\nexport const setAccessTokenResolver = (resolver) => {\n globalThis[ACCESS_TOKEN_RESOLVER_KEY] = typeof resolver === 'function' ? resolver : null;\n};\n\n/**\n * @returns {Promise<*|undefined>}\n */\nexport const getAccessToken = async () => {\n const resolveAccessToken = globalThis[ACCESS_TOKEN_RESOLVER_KEY];\n if (resolveAccessToken) return resolveAccessToken();\n\n if (typeof navigator !== 'undefined' && navigator.locks) {\n return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::getAccessToken web lock api`, lock);\n return await _getAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n return await _getAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n/**\n * @private\n */\nconst _clearAccessToken = () => {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken`);\n\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n\n storeAuthInfo(null, 0, refreshToken)\n}\n\nexport const clearAccessToken = async () => {\n // see https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n if (typeof navigator !== 'undefined' && navigator.locks) {\n await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::clearAccessToken web lock api`, lock);\n _clearAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n _clearAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n\nexport const refreshAccessToken = async (refresh_token) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n\n const payload = {\n 'grant_type': 'refresh_token',\n \"client_id\": encodeURI(oauth2ClientId),\n \"refresh_token\": refresh_token\n };\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), REFRESH_TOKEN_FETCH_TIMEOUT_MS);\n\n let response;\n try {\n response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload),\n signal: controller.signal\n });\n } catch (networkError) {\n // fetch rejects on network failures (DNS, timeout, no connectivity, abort)\n console.log('refreshAccessToken network error:', networkError.message);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${networkError.message}`);\n } finally {\n clearTimeout(timeoutId);\n }\n\n if (!response.ok) {\n console.log(`refreshAccessToken server error: ${response.status} - ${response.statusText}`);\n if (response.status >= 500 || response.status === 408 || response.status === 429) {\n // transient error (server error, request timeout, rate limit) — should be retried\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${response.status} - ${response.statusText}`);\n }\n // token is genuinely revoked — this is a real auth error\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${response.status} - ${response.statusText}`);\n }\n\n let json;\n try {\n json = await response.json();\n } catch (parseError) {\n // IDP returned non-JSON (HTML error page, empty body, etc.) — treat as transient\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`);\n }\n let {access_token, refresh_token: new_refresh_token, expires_in, id_token} = json;\n // Defensively ensure we never propagate an undefined access token.\n if (!access_token) {\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);\n }\n return {access_token, refresh_token: new_refresh_token, expires_in, id_token}\n}\n\nexport const storeAuthInfo = (accessToken, expiresIn, refreshToken = null, idToken = null) => {\n\n let formerAuthInfo = getAuthInfo();\n\n let authInfo = {\n accessToken: accessToken,\n expiresIn: expiresIn,\n accessTokenUpdatedAt: Math.floor(Date.now() / 1000),\n };\n\n if (refreshToken == null && formerAuthInfo) {\n refreshToken = formerAuthInfo.refreshToken;\n }\n\n if (idToken == null && formerAuthInfo) {\n idToken = formerAuthInfo.idToken;\n }\n\n if (refreshToken) {\n authInfo['refreshToken'] = refreshToken;\n }\n\n if (idToken) {\n authInfo[ID_TOKEN] = idToken;\n Cookies.set(ID_TOKEN, idToken, {secure: true, sameSite: 'Lax'});\n } else {\n Cookies.remove(ID_TOKEN);\n }\n\n putOnLocalStorage(AUTH_INFO, JSON.stringify(authInfo));\n}\n\nexport const getAuthInfo = () => {\n try {\n let res = getFromLocalStorage(AUTH_INFO, false)\n if (!res) return null;\n return JSON.parse(res);\n } catch (err) {\n return null;\n }\n}\n\nexport const clearAuthInfo = () => {\n if (typeof window !== 'undefined') {\n removeFromLocalStorage(AUTH_INFO);\n Cookies.remove(ID_TOKEN);\n }\n};\n\nexport const getIdToken = () => {\n if (typeof window !== 'undefined') {\n const authInfo = getAuthInfo();\n if (authInfo) {\n return authInfo.idToken;\n }\n return null;\n }\n return null;\n};\n\nexport const getOAuth2ClientId = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_CLIENT_ID;\n }\n return null;\n};\n\nexport const getOAuth2Flow = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_FLOW || \"token id_token\";\n }\n return \"token id_token\";\n}\n\nexport const useOAuth2RefreshToken = () => {\n if (typeof window !== 'undefined') {\n return new Boolean(window.OAUTH2_USE_REFRESH_TOKEN || true);\n }\n return true;\n}\n\nexport const getOAuth2IDPBaseUrl = () => {\n if (typeof window !== 'undefined') {\n return window.IDP_BASE_URL;\n }\n return null;\n};\n\nexport const getOAuth2Scopes = () => {\n if (typeof window !== 'undefined') {\n return window.SCOPES;\n }\n return null;\n};\n\nexport const initLogOut = () => {\n let location = getCurrentLocation();\n location.replace(getLogoutUrl(getIdToken()).toString());\n}\n\nexport const validateIdToken = (idToken, issuer, audience) => {\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n let storedNonce = getFromLocalStorage(NONCE, true);\n if (!storedNonce)\n throw Error(AUTH_ERROR_MISSING_NONCE_PARAM);\n\n let jwt = verifier.decode(idToken);\n let alg = jwt.header.alg;\n let kid = jwt.header.kid;\n let aud = jwt.payload.aud;\n let iss = jwt.payload.iss;\n let exp = jwt.payload.exp;\n let nbf = jwt.payload.nbf;\n let tnonce = jwt.payload.nonce || null;\n\n return tnonce == storedNonce && aud == audience && iss == issuer;\n}\n\nexport const passwordlessStart = (params) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let nonce = createNonce(NONCE_LEN);\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let payload = {\n \"response_type\": \"otp\",\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"client_id\": encodeURI(oauth2ClientId),\n \"connection\": params.connection || \"email\",\n \"send\": params.send || \"code\",\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n if (params.hasOwnProperty('redirect_uri')) {\n payload[\"redirect_uri\"] = encodeURIComponent(params.redirect_uri);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n let json = res.body;\n return Promise.resolve({response: json});\n }).catch((err) => {\n return Promise.reject(err);\n });\n\n}\n\nexport const passwordlessLogin = (params) => (dispatch) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/token`);\n\n if (!params.hasOwnProperty(\"otp\")) {\n throw Error(AUTH_ERROR_MISSING_OTP_PARAM);\n }\n\n let payload = {\n \"grant_type\": \"passwordless\",\n \"connection\": params.connection || \"email\",\n \"scope\": encodeURI(scopes),\n \"client_id\": encodeURI(oauth2ClientId),\n \"otp\": params.otp\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n try {\n // now we got token\n let json = res.body;\n let {access_token, expires_in, refresh_token, id_token} = json;\n\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n\n if (typeof id_token === 'undefined') {\n id_token = null; // not using rotate policy\n }\n\n // verify id token\n\n if (id_token) {\n if (!validateIdToken(id_token, baseUrl, oauth2ClientId)) {\n throw Error(AUTH_ERROR_ID_TOKEN_INVALID);\n }\n }\n\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n\n if (dispatch) {\n dispatch({\n type: SET_LOGGED_USER,\n payload: {sessionState: null}\n });\n }\n\n return Promise.resolve({response: json});\n } catch (e) {\n console.log(e);\n return Promise.reject(e);\n }\n }).catch((err) => {\n return Promise.reject(err);\n });\n}\n\nexport const isIdTokenAlive = (nowEpoch = null) => () => {\n\n if (!nowEpoch) {\n nowEpoch = Math.floor(Date.now() / 1000);\n }\n\n const idToken = getIdToken();\n if (!idToken)\n throw Error('Id Token not set.');\n\n const issuer = getOAuth2IDPBaseUrl();\n const audience = getOAuth2ClientId();\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n const jwt = verifier.decode(idToken);\n const exp = jwt.payload.exp;\n\n // check life time\n return exp - (nowEpoch + ACCESS_TOKEN_SKEW_TIME) > 0;\n}\n","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport './simple-link-list.less';\nimport AsyncSelect from 'react-select/lib/Async';\nimport Table from \"../table/Table\";\nimport T from 'i18n-react/dist/i18n-react';\nimport AsyncCreatableSelect from \"react-select/lib/AsyncCreatable\";\n\n\nclass SimpleLinkList extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: ''\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.getOptions = this.getOptions.bind(this);\n this.handleLink = this.handleLink.bind(this);\n this.filterOption = this.filterOption.bind(this);\n this.handleNew = this.handleNew.bind(this);\n this.getNewOptionData = this.getNewOptionData.bind(this);\n this.isValidNewOption = this.isValidNewOption.bind(this);\n }\n\n getOptions(input, callback) {\n let {options} = this.props;\n let defaultOptions = options.hasOwnProperty('defaultOptions') ? options.defaultOptions : undefined;\n\n if (!input && !defaultOptions) {\n return Promise.resolve({ options: [] });\n }\n\n this.props.options.actions.search(input, callback);\n }\n\n handleChange(value) {\n this.setState({value});\n }\n\n handleLink(ev) {\n ev.preventDefault();\n this.props.options.actions.add.onClick(this.state.value);\n this.setState({value: ''});\n }\n\n getNewOptionData(inputValue, optionLabel) {\n return {tag: optionLabel, id:inputValue};\n }\n\n isValidNewOption(inputValue, selectValue, selectOptions) {\n let {options} = this.props;\n let labelKey = options.hasOwnProperty('labelKey') ? options.labelKey : 'label';\n let optionFound = selectOptions.find(op => op[labelKey] == inputValue);\n return (!inputValue || optionFound) ? false : true;\n }\n\n handleNew(value) {\n this.props.options.onCreateTag(value, this.handleChange);\n }\n\n filterOption(candidate, inputValue) {\n let {options, values} = this.props;\n let allowDuplicates = this.props.hasOwnProperty('allowDuplicates');\n let labelKey = options.hasOwnProperty('labelKey') ? options.labelKey : 'label';\n\n if (allowDuplicates) return true;\n\n let optionFound = values.find(val => val[labelKey] === candidate.label);\n\n return !optionFound;\n }\n\n\n render() {\n\n let {options, values, columns} = this.props;\n let disabledAdd = (!this.state.value);\n\n let title = options.hasOwnProperty('title') ? options.title : 'Table';\n let valueKey = options.hasOwnProperty('valueKey') ? options.valueKey : 'value';\n let labelKey = options.hasOwnProperty('labelKey') ? options.labelKey : 'label';\n let allowCreate = options.hasOwnProperty('onCreateTag');\n let defaultOptions = options.hasOwnProperty('defaultOptions') ? options.defaultOptions : undefined;\n\n let tableOptions = {\n className: 'dataTable',\n actions: {\n delete: options.actions.delete\n }\n };\n\n if (options.hasOwnProperty('className')) {\n tableOptions.className = options.className;\n }\n\n if (options.actions.hasOwnProperty('edit')) {\n tableOptions.actions.edit = options.actions.edit;\n }\n\n if (options.actions.hasOwnProperty('custom')) {\n tableOptions.actions.custom = options.actions.custom;\n }\n\n if (options.hasOwnProperty('sortCol')) {\n values = values.sort(\n (a, b) => {\n const itemA = isNaN(a[options.sortCol]) ? a[options.sortCol].toLowerCase() : a[options.sortCol];\n const itemB = isNaN(b[options.sortCol]) ? b[options.sortCol].toLowerCase() : b[options.sortCol];\n return (itemA > itemB ? 1 : (itemA < itemB ? -1 : 0))\n }\n );\n }\n\n\n let AsyncComponent = null;\n\n if (allowCreate) {\n AsyncComponent =\n option[valueKey]}\n getOptionLabel={option => option[labelKey]}\n onChange={this.handleChange}\n loadOptions={this.getOptions}\n filterOption={this.filterOption}\n onCreateOption={this.handleNew}\n getNewOptionData={this.getNewOptionData}\n isValidNewOption={this.isValidNewOption}\n />;\n } else {\n AsyncComponent =\n option[valueKey]}\n getOptionLabel={option => option[labelKey]}\n onChange={this.handleChange}\n loadOptions={this.getOptions}\n filterOption={this.filterOption}\n defaultOptions={defaultOptions}\n />;\n }\n\n return (\n \n
\n
{title} \n \n
\n {AsyncComponent}\n \n {T.translate(\"general.add\")}\n \n
\n
\n
\n );\n\n }\n}\n\nSimpleLinkList.propTypes = {\n values: PropTypes.array.isRequired,\n options: PropTypes.shape({\n title: PropTypes.string,\n sortCol: PropTypes.string,\n valueKey: PropTypes.string.isRequired,\n labelKey: PropTypes.string.isRequired,\n className: PropTypes.string,\n actions: PropTypes.shape({\n search: PropTypes.func.isRequired,\n delete: PropTypes.shape({onClick:PropTypes.func.isRequired}),\n add: PropTypes.shape({onClick:PropTypes.func.isRequired}),\n edit: PropTypes.shape({onClick:PropTypes.func.isRequired}),\n custom: PropTypes.array,\n }).isRequired\n }).isRequired,\n columns: PropTypes.array.isRequired\n}\n\nexport default SimpleLinkList;\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport './summit-dropdown.less';\nimport Select from 'react-select';\nimport T from 'i18n-react/dist/i18n-react';\n\nexport default class SummitDropdown extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n summitValue: null,\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.handleClick = this.handleClick.bind(this);\n }\n\n handleChange(summit) {\n this.setState({summitValue: summit});\n }\n\n handleClick(ev) {\n ev.preventDefault();\n this.props.onClick(this.state.summitValue.value);\n }\n\n render() {\n\n let {summits, actionLabel, actionClass} = this.props;\n let summitOptions = summits\n .sort(\n (a, b) => (a.start_date < b.start_date ? 1 : (a.start_date > b.start_date ? -1 : 0))\n ).map(s => ({label: s.name, value: s.id}));\n\n let bigClass = this.props.hasOwnProperty('big') ? 'big' : '';\n const isDisabled = !this.state.summitValue;\n\n return (\n \n \n \n {actionLabel}\n \n
\n );\n\n }\n}\n","import React from 'react';\n\nclass EditableTableHeading extends React.Component {\n\n constructor (props) {\n super(props);\n }\n\n render () {\n return (\n \n {this.props.children}\n \n );\n }\n\n}\n\nexport default EditableTableHeading;","import React from 'react';\n\nconst EditableTableCell = (props) => {\n\n if (props.is_edit) {\n return (\n \n {!props.shouldUseTextArea &&\n \n }\n {props.shouldUseTextArea &&\n \n );\n } else {\n return (\n {props.children} \n );\n }\n\n};\n\nexport default EditableTableCell;","import React from 'react';\n\nexport default class EditableActionsTableCell extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n is_editing: false\n }\n\n }\n\n onDelete(id, ev) {\n ev.preventDefault();\n ev.stopPropagation();\n\n this.props.actions.delete(id);\n }\n\n onSave(id, ev) {\n ev.preventDefault();\n ev.stopPropagation();\n\n this.setState({\n is_editing: false\n });\n\n this.props.actions.save(id);\n }\n\n onEdit(id, ev) {\n ev.preventDefault();\n ev.stopPropagation();\n\n this.setState({\n is_editing: true\n });\n\n this.props.actions.edit(id);\n }\n\n onCancel(id, ev) {\n ev.preventDefault();\n ev.stopPropagation();\n\n this.setState({\n is_editing: false\n });\n\n this.props.actions.cancel(id);\n }\n\n render() {\n let {actions, id} = this.props;\n\n if (this.state.is_editing) {\n return (\n \n \n \n \n \n \n \n \n );\n } else {\n return (\n \n {'edit' in actions &&\n \n \n \n }\n {'delete' in actions &&\n \n \n \n }\n \n );\n }\n }\n};\n","import React from 'react';\n\nexport default class EditableTableRow extends React.Component {\n\n render() {\n const { children, even, id } = this.props;\n\n return (\n \n {children}\n \n );\n }\n}\n","import React from 'react';\nimport EditableTableHeading from './EditableTableHeading';\nimport EditableTableCell from './EditableTableCell';\nimport EditableActionsTableCell from './EditableActionsTableCell';\nimport EditableTableRow from './EditableTableRow';\nimport Swal from \"sweetalert2\";\nimport T from \"i18n-react/dist/i18n-react\";\nimport { Tooltip } from \"react-tooltip\";\nimport { shallowEqual } from '../../utils/methods'\n\nimport './editable-table.less';\n\n\nconst defaults = {\n colWidth: ''\n};\n\nconst createRow = (row, columns, actions, shouldUseTextArea) => {\n\n var action_buttons = '';\n var cells = columns.map((col,i) => {\n return (\n \n {row[col.columnKey]}\n \n );\n });\n\n if (actions) {\n cells.push();\n }\n\n return cells;\n};\n\nconst createNewRow = (columns, new_row, addNew, handleChange, shouldUseTextArea) => {\n\n var cells = columns.map((col,i) => {\n let cell_value = (typeof new_row[col.columnKey] !== 'undefined') ? new_row[col.columnKey] : '';\n return (\n \n {shouldUseTextArea &&\n \n );\n });\n\n cells.push(\n \n Add \n \n );\n\n return cells;\n};\n\n\nexport default class EditableTable extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n rows: props.data,\n new_row: {}\n };\n\n // we store the delete and save functions in props cause we need to extend them\n this.onSave = props.options.actions?.save?.onClick;\n\n this.actions = props.options.actions || {};\n this.actions.edit = this.editRow.bind(this);\n this.actions.save = this.saveRow.bind(this);\n this.actions.delete = this.deleteClick.bind(this);\n this.actions.handleChange = this.onChangeCell.bind(this);\n this.actions.cancel = this.editRowCancel.bind(this);\n\n this.saveNewRow = this.saveNewRow.bind(this);\n this.handleNewChange = this.onChangeNewCell.bind(this);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n if(!shallowEqual(this.props.data, prevProps.data)) {\n this.setState({rows: this.props.data})\n }\n }\n\n saveRow(id, ev) {\n const { rows } = this.state;\n let row = rows.find(r => r.id == id);\n row.is_edit = false;\n\n this.editing_row = null;\n\n this.setState({\n rows: rows\n });\n\n this.onSave(row);\n }\n\n deleteClick(id) {\n let onDelete = this.props.options.actions?.delete?.onClick;\n let noAlert = this.props.options.hasOwnProperty('noAlert');\n\n if (noAlert) {\n onDelete(id);\n } else {\n Swal.fire({\n title: T.translate(\"general.are_you_sure\"),\n text: T.translate(\"general.remove_warning\"),\n type: \"warning\",\n showCancelButton: true,\n confirmButtonColor: \"#DD6B55\",\n confirmButtonText: T.translate(\"general.yes_delete\")\n }).then(function(result){\n if (result.value) {\n onDelete(id);\n }\n });\n }\n }\n\n editRow(id, ev) {\n const { rows } = this.state;\n let row = rows.find(r => r.id == id);\n\n //save editing row for cancel\n this.editing_row = {...row};\n\n row.is_edit = true;\n\n this.setState({\n rows: rows\n });\n }\n\n editRowCancel(id, ev) {\n const { rows } = this.state;\n rows.forEach(r => {\n r.is_edit = false;\n });\n\n let rowIdx = rows.findIndex(r => r.id == id);\n\n rows[rowIdx] = this.editing_row;\n\n this.setState({\n rows: rows\n });\n }\n\n onChangeCell(ev) {\n const { rows } = this.state;\n let field = ev.target;\n let row = rows.find(r => r.id == field.id);\n\n row[field.name] = field.value;\n\n this.setState({\n rows: rows\n });\n }\n\n onChangeNewCell(ev) {\n const {new_row} = this.state;\n let field = ev.target;\n\n new_row[field.name] = field.value;\n\n this.setState({\n new_row: new_row\n });\n }\n\n saveNewRow(ev) {\n const {new_row} = this.state;\n ev.preventDefault();\n\n this.onSave(new_row);\n\n this.setState({\n new_row: {}\n });\n }\n\n render() {\n let {options, columns } = this.props;\n let tableClass = options.hasOwnProperty('className') ? options.className : '';\n let textArea = this.props.hasOwnProperty(\"textArea\");\n return (\n \n
\n \n \n {columns.map((col,i) => {\n let colWidth = (col.width) ? col.width : defaults.colWidth;\n return (\n \n {col.value}\n \n );\n })}\n {this.actions &&\n \n Actions\n \n }\n \n \n \n {columns.length > 0 && this.state.rows.map((row,i) => {\n if(Array.isArray(row) && row.length !== columns.length) {\n console.warn(`Data at row ${i} is ${row.length}. It should be ${columns.length}.`);\n return \n }\n return (\n \n {createRow(row, columns, this.actions, textArea)}\n \n\n );\n })}\n \n {createNewRow(columns, this.state.new_row, this.saveNewRow, this.handleNewChange, textArea)}\n \n \n
\n
\n
\n );\n }\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nclass SelectableTableHeading extends React.Component {\n\n\tconstructor (props) {\n\t\tsuper(props);\n\t\tthis.handleSort = this.handleSort.bind(this);\n\t}\n\n\tgetSortClass() {\n\n\t\tif (!this.props.sortable) return null;\n\n\t\tswitch(this.props.sortDir) {\n\t\t\tcase 1:\n\t\t\t\treturn 'sorting_asc';\n\t\t\tcase -1:\n\t\t\t\treturn 'sorting_desc';\n\t\t\tdefault:\n\t\t\t\treturn this.props.sortable ? 'sorting' : null\n\t\t}\n\t}\n\n\thandleSort(e) {\n\t\te.preventDefault();\n\t\tif(!this.props.hasOwnProperty('onSort') || !this.props.sortable) return;\n\n\t\tthis.props.onSort(\n\t\t\tthis.props.columnIndex,\n\t\t\tthis.props.columnKey,\n\t\t\tthis.props.sortDir ? this.props.sortDir*-1 : 1,\n\t\t\tthis.props.sortFunc\n\t\t);\n\t}\n\n\trender () {\n\t\treturn (\n\t\t\t\n\t\t\t\t{this.props.children}\n\t\t\t \n\t\t);\t\n\t}\n\t\n}\n\nSelectableTableHeading.propTypes = {\n\tonSort: PropTypes.func,\n\tsortDir: PropTypes.number,\n\tcolumnIndex: PropTypes.number,\n\tcolumnKey: PropTypes.any,\n\tsortable: PropTypes.bool,\n\tsortFunc: PropTypes.func\n};\n\nexport default SelectableTableHeading;","import React from 'react';\nimport RawHTML from '../raw-html';\n\nconst SelectableTableCell = (props) => {\n let {children} = props;\n\tlet value = '';\n\tif(children) {\n\t if (React.isValidElement(children)) {\n\t value = children;\n } else {\n\t value = {children.toString()} \n }\n }\n\n\treturn (\n\t\t\n {value}\n\t\t \n\t);\n};\n\nexport default SelectableTableCell;\n","import React from 'react';\n\nexport default class SelectableTableRow extends React.Component {\n\n constructor(props) {\n super(props);\n this.handleEdit = this.handleEdit.bind(this);\n this.handleSelect = this.handleSelect.bind(this);\n }\n\n shouldDisplayAction(action) {\n let {id} = this.props;\n if (!action.hasOwnProperty('display')) {\n return true;\n } else {\n return action.display(id);\n }\n }\n\n handleEdit(id, ev) {\n // by pass\n if(ev.target.type === \"checkbox\")\n return;\n ev.stopPropagation();\n ev.preventDefault();\n this.props.actions.edit.onClick(id);\n }\n\n handleSelect(id, ev) {\n this.props.actions.edit.onSelected(id, ev.target.checked);\n }\n\n render() {\n\n let {even, actions, id, children, checked} = this.props;\n let canEdit = (actions?.edit && this.shouldDisplayAction(actions.edit));\n let rowClass = even ? 'even' : 'odd';\n\n if (canEdit) {\n return (\n \n \n \n \n {children}\n \n );\n }\n\n return (\n \n \n \n \n {children}\n \n );\n\n }\n};\n\n","import React from 'react';\n\nexport default class SelectableActionsTableCell extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleAction = this.handleAction.bind(this);\n this.shouldDisplayAction = this.shouldDisplayAction.bind(this);\n\n }\n\n shouldDisplayAction(action) {\n let {id} = this.props;\n\n if (!action.hasOwnProperty('display')) {\n return true;\n } else {\n return action.display(id);\n }\n }\n\n handleAction(action, id, ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n action(id);\n }\n\n render() {\n let {actions, id} = this.props;\n return (\n \n {actions.hasOwnProperty('delete') && this.shouldDisplayAction(actions.delete) &&\n \n \n \n }\n {actions.hasOwnProperty('custom') && actions.custom.map(a =>\n this.shouldDisplayAction(a) &&\n \n {a.icon}\n \n )}\n \n );\n }\n};\n","import React from 'react';\nimport SelectableTableHeading from './SelectableTableHeading';\nimport SelectableTableCell from './SelectableTableCell';\nimport SelectableTableRow from './SelectableTableRow';\nimport SelectableActionsTableCell from './SelectableActionsTableCell';\nimport { Tooltip } from 'react-tooltip'\nimport './selectable-table.less';\n\nconst defaults = {\n sortFunc: (a, b) => (a < b ? -1 : a > b ? 1 : 0),\n sortable: false,\n sortCol: 0,\n sortDir: 1,\n colWidth: \"\",\n};\n\nconst createRow = (row, columns, actions) => {\n var action_buttons = \"\";\n var cells = columns.map((col, i) => {\n if (col.hasOwnProperty(\"render\"))\n return (\n \n {col.render(row, row[col.columnKey])}\n \n );\n\n return (\n \n {row[col.columnKey]}\n \n );\n });\n\n if (actions) {\n cells.push(\n \n );\n }\n\n return cells;\n};\n\nconst getSortDir = (columnKey, columnIndex, sortCol, sortDir) => {\n if (columnKey && columnKey === sortCol) {\n return sortDir;\n }\n if (sortCol === columnIndex) {\n return sortDir;\n }\n return null;\n};\n\nclass SelectableTable extends React.Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n let { options, columns } = this.props;\n let tableClass = options.hasOwnProperty(\"className\")\n ? options.className\n : \"\";\n tableClass += options.actions?.edit ? \" table-hover\" : \"\";\n\n return (\n \n );\n }\n}\n\nexport default SelectableTable;\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"immutability-helper\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-dnd-html5-backend\");","import React from 'react';\n\nclass SortableTableHeading extends React.Component {\n\n\tconstructor (props) {\n\t\tsuper(props);\n\t}\n\n\trender () {\n\t\treturn (\n\t\t\t\n\t\t\t\t{this.props.children}\n\t\t\t \n\t\t);\t\n\t}\n\t\n}\n\nexport default SortableTableHeading;","import React from 'react';\n\nexport default class SortableActionsTableCell extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleAction = this.handleAction.bind(this);\n\n }\n\n shouldDisplayAction(action) {\n let {id} = this.props;\n\n if (!action.hasOwnProperty('display')) {\n return true;\n } else {\n return action.display(id);\n }\n }\n\n handleAction(action, id, ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n action(id);\n }\n\n render() {\n let {actions, id} = this.props;\n return (\n \n {actions.hasOwnProperty('edit') && this.shouldDisplayAction(actions.edit) &&\n \n \n \n }\n {actions.hasOwnProperty('delete') && this.shouldDisplayAction(actions.delete) &&\n \n \n \n }\n {'custom' in actions && actions.custom.map(a =>\n this.shouldDisplayAction(a, id) &&\n \n {a.icon}\n \n )}\n \n );\n }\n};\n","import React, { useRef } from 'react';\nimport { useDrag, useDrop } from 'react-dnd';\nimport PropTypes from 'prop-types';\n\nconst SortableTableRow = ({ text, even, id, index, moveCard, dropItem, children, findRow }) => {\n const originalIndex = findRow(id).index;\n\n const style = {\n border: '1px dashed gray',\n padding: '0.5rem 1rem',\n marginBottom: '.5rem',\n backgroundColor: 'white',\n cursor: 'move',\n };\n\n const refRow = useRef(null);\n const [{ handlerId }, drop] = useDrop({\n accept: 'row',\n collect(monitor) {\n return {\n handlerId: monitor.getHandlerId(),\n };\n },\n hover(item, monitor) {\n if (!refRow.current) {\n return;\n }\n const dragIndex = item.index;\n const hoverIndex = index;\n // Don't replace items with themselves\n if (dragIndex === hoverIndex) {\n return;\n }\n // Determine rectangle on screen\n const hoverBoundingRect = refRow.current?.getBoundingClientRect();\n // Get vertical middle\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n // Determine mouse position\n const clientOffset = monitor.getClientOffset();\n // Get pixels to the top\n const hoverClientY = clientOffset.y - hoverBoundingRect.top;\n // Only perform the move when the mouse has crossed half of the items height\n // When dragging downwards, only move when the cursor is below 50%\n // When dragging upwards, only move when the cursor is above 50%\n // Dragging downwards\n if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n // Dragging upwards\n if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n // Time to actually perform the action\n moveCard(dragIndex, hoverIndex);\n // Note: we're mutating the monitor item here!\n // Generally it's better to avoid mutations,\n // but it's good here for the sake of performance\n // to avoid expensive index searches.\n item.index = hoverIndex;\n },\n });\n const [{ isDragging }, drag] = useDrag({\n type: 'row',\n item: () => {\n return { id, index };\n },\n end:(_item, monitor) => {\n const { id: droppedId, index } = _item;\n const didDrop = monitor.didDrop()\n if(didDrop)\n return dropItem(droppedId, index + 1)\n // rollback\n return moveCard(index, originalIndex);\n },\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n }),\n });\n\n const opacity = isDragging ? 0 : 1;\n\n drag(drop(refRow));\n\n return (\n \n {children}\n \n );\n}\n\nSortableTableRow.propTypes = {\n index: PropTypes.number.isRequired,\n id: PropTypes.any.isRequired,\n moveCard: PropTypes.func.isRequired,\n};\n\nexport default SortableTableRow;\n\n","import React, {useEffect, useState, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport update from 'immutability-helper';\nimport {DndProvider} from 'react-dnd'\nimport {HTML5Backend} from 'react-dnd-html5-backend'\nimport SortableTableHeading from './SortableTableHeading';\nimport SortableActionsTableCell from './SortableActionsTableCell';\nimport SortableTableRow from './SortableTableRow';\nimport T from 'i18n-react/dist/i18n-react';\nimport TableCell from \"../table/TableCell\";\nimport _ from 'lodash';\n\nimport './table-sortable.less';\n\nconst defaults = {\n colWidth: ''\n}\n\nconst createRow = (row, columns, actions) => {\n\n let cells = columns.map((col, i) => {\n if (col.hasOwnProperty(\"render\"))\n return (\n \n {col.render(row, row[col.columnKey])}\n \n );\n\n return (\n \n {row[col.columnKey]}\n \n );\n });\n\n if (actions) {\n cells.push();\n }\n\n return cells;\n};\n\n\nconst renderNewRow = (columns, new_row, addNew, handleChange) => {\n\n let cells = columns.map((col, i) => {\n let cell_value = (typeof new_row[col.columnKey] !== 'undefined') ? new_row[col.columnKey] : '';\n\n if (col?.input === \"checkbox\")\n return (\n \n \n );\n else\n return (\n \n \n );\n\n });\n\n cells.push(\n \n Add \n \n );\n\n return cells;\n};\n\nconst SortableTable = ({data, options, columns, dropCallback, orderField, idField}) => {\n\n const [rows, setRows] = useState(data);\n const [newRow, setNewRow] = useState({});\n\n useEffect(() => {\n setRows(data);\n }, [data])\n\n\n const renderRow = (row, columns, options, index) => {\n return (\n \n {createRow(row, columns, options.actions)}\n \n )\n };\n\n const saveNewRow = (ev) => {\n ev.preventDefault();\n options?.actions?.save?.onClick(newRow);\n setNewRow({});\n }\n\n const sortRows = (rows2Sort) => {\n rows2Sort.sort(function (a, b) {\n const x = a[orderField];\n const y = b[orderField];\n return ((x < y) ? -1 : ((x > y) ? 1 : 0));\n });\n return rows2Sort;\n }\n\n const findRow = useCallback(\n (id) => {\n const row = rows.filter((r) => r[idField] === id)[0]\n return {\n row,\n index: rows.indexOf(row),\n }\n },\n [rows],\n )\n\n const moveRow = useCallback(\n (dragIndex, hoverIndex) => {\n\n setRows((prevRows) => {\n\n prevRows = update(prevRows, {\n $splice: [\n [dragIndex, 1],\n [hoverIndex, 0, prevRows[dragIndex]],\n ],\n });\n\n for (let i in prevRows) {\n prevRows[i][orderField] = parseInt(i) + 1;\n }\n\n return sortRows(prevRows)\n });\n },\n [rows, setRows],\n )\n\n const onDropItem = (id, newOrder) => {\n const sortedRows = sortRows(rows);\n setRows(sortedRows);\n dropCallback(sortedRows, id, newOrder)\n }\n\n const handleNewChange = (ev) => {\n let field = ev.target;\n let newRowTmp = {...newRow};\n let {name, value} = field;\n\n if (field.type === 'checkbox') {\n value = field.checked;\n }\n newRowTmp[name] = value;\n setNewRow(newRowTmp);\n }\n\n let tableClass = options.hasOwnProperty('className') ? options.className : '';\n let shouldRenderNewRow = options?.actions?.save?.onClick && options?.actions?.save?.onClick !== null;\n\n return (\n \n
{T.translate(\"general.drag_and_drop\")} \n
\n \n \n {columns.map((col, i) => {\n let colWidth = (col.width) ? col.width : defaults.colWidth;\n return (\n \n {col.value}\n \n );\n })}\n {options.actions &&\n \n Actions\n \n }\n \n \n \n {columns.length > 0 && rows.map((row, i) => {\n if (Array.isArray(row) && row.length !== columns.length) {\n console.warn(`Data at row ${i} is ${row.length}. It should be ${columns.length}.`);\n return \n }\n return (\n \n {renderRow(row, columns, options, i)}\n \n );\n })}\n \n {shouldRenderNewRow &&\n \n \n {renderNewRow(columns, newRow, saveNewRow, handleNewChange)}\n \n \n }\n
\n
\n );\n};\n\nSortableTable.defaultProps = {\n idField: 'id',\n}\n\nSortableTable.propTypes = {\n data: PropTypes.array.isRequired,\n options: PropTypes.shape({\n className: PropTypes.string,\n actions: PropTypes.object\n }).isRequired,\n columns: PropTypes.arrayOf(PropTypes.shape({\n columnKey: PropTypes.string.isRequired,\n value: PropTypes.any.isRequired,\n input: PropTypes.string,\n render: PropTypes.func,\n })).isRequired,\n dropCallback: PropTypes.func.isRequired,\n orderField: PropTypes.string.isRequired,\n idField: PropTypes.string,\n}\n\nexport default SortableTable;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nclass TableHeading extends React.Component {\n\n\tconstructor (props) {\n\t\tsuper(props);\n\t\tthis.handleSort = this.handleSort.bind(this);\n\t}\n\n\tgetSortClass() {\n\n\t\tif (!this.props.sortable) return null;\n\n\t\tswitch(this.props.sortDir) {\n\t\t\tcase 1:\n\t\t\t\treturn 'sorting_asc';\n\t\t\tcase -1:\n\t\t\t\treturn 'sorting_desc';\n\t\t\tdefault:\n\t\t\t\treturn this.props.sortable ? 'sorting' : null\n\t\t}\n\t}\n\n\thandleSort(e) {\n\t\te.preventDefault();\n\t\tif(!this.props.hasOwnProperty('onSort') || !this.props.sortable) return;\n\n\t\tthis.props.onSort(\n\t\t\tthis.props.columnIndex,\n\t\t\tthis.props.columnKey,\n\t\t\tthis.props.sortDir ? this.props.sortDir*-1 : 1,\n\t\t\tthis.props.sortFunc\n\t\t);\n\t}\n\n\trender () {\n\t\treturn (\n\t\t\t\n\t\t\t\t{this.props.children}\n\t\t\t \n\t\t);\t\n\t}\n\t\n}\n\nTableHeading.propTypes = {\n\tonSort: PropTypes.func,\n\tsortDir: PropTypes.number,\n\tcolumnIndex: PropTypes.number,\n\tcolumnKey: PropTypes.any,\n\tsortable: PropTypes.bool,\n\tsortFunc: PropTypes.func\n};\n\nexport default TableHeading;","import React from 'react';\n\nexport default class TableRow extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleEdit = this.handleEdit.bind(this);\n }\n\n shouldDisplayAction(action) {\n let {id} = this.props;\n\n if (!action.hasOwnProperty('display')) {\n return true;\n } else {\n return action.display(id);\n }\n }\n\n handleEdit(id, ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n this.props.actions.edit.onClick(id);\n }\n\n render() {\n let {even, actions, id, children} = this.props;\n let canEdit = (actions?.edit && this.shouldDisplayAction(actions.edit));\n let rowClass = even ? 'even' : 'odd';\n\n if (canEdit) {\n return (\n \n {children}\n \n );\n } else {\n return (\n \n {children}\n \n );\n }\n }\n};\n\n","import React from 'react';\n\nexport default class ActionsTableCell extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleAction = this.handleAction.bind(this);\n this.shouldDisplayAction = this.shouldDisplayAction.bind(this);\n\n }\n\n shouldDisplayAction(action) {\n let {id} = this.props;\n\n if (!action.hasOwnProperty('display')) {\n return true;\n } else {\n return action.display(id);\n }\n }\n\n handleAction(action, id, ev) {\n ev.stopPropagation();\n ev.preventDefault();\n\n action(id);\n }\n\n render() {\n let {actions, id} = this.props;\n return (\n \n {actions.hasOwnProperty('delete') && this.shouldDisplayAction(actions.delete) &&\n \n \n \n }\n {actions.hasOwnProperty('custom') && actions.custom.map(a =>\n this.shouldDisplayAction(a) &&\n \n {a.icon}\n \n )}\n \n );\n }\n};\n","import React from 'react';\nimport TableHeading from './TableHeading';\nimport TableCell from './TableCell';\nimport TableRow from './TableRow';\nimport ActionsTableCell from './ActionsTableCell';\nimport { Tooltip } from 'react-tooltip';\n\nimport './table.less';\n\nconst defaults = {\n sortFunc: (a,b) => (a < b ? -1 : (a > b ? 1 : 0)),\n sortable: false,\n sortCol: 0,\n sortDir: 1,\n colWidth: ''\n}\n\nconst createRow = (row, columns, actions) => {\n const cells = columns.map((col,i) => {\n const colStyles = col?.styles || {};\n\n if(col.hasOwnProperty(\"render\"))\n return (\n \n {col.render(row, row[col.columnKey])}\n \n );\n\n return (\n \n {row[col.columnKey]}\n \n );\n });\n\n if (actions) {\n cells.push( );\n }\n\n return cells;\n};\n\nconst getSortDir = (columnKey, columnIndex, sortCol, sortDir) => {\n if(columnKey && (columnKey === sortCol)) {\n return sortDir;\n }\n if(sortCol === columnIndex) {\n return sortDir;\n }\n return null\n};\n\nconst Table = (props) => {\n let {options, columns} = props;\n let tableClass = options.hasOwnProperty('className') ? options.className : '';\n tableClass += options.actions?.edit ? ' table-hover' : '';\n\n return (\n \n
\n \n \n {columns.map((col,i) => {\n\n let sortCol = (typeof options.sortCol != 'undefined') ? options.sortCol : defaults.sortCol;\n let sortDir = (typeof options.sortDir != 'undefined') ? options.sortDir : defaults.sortDir;\n let sortFunc = (typeof options.sortFunc != 'undefined') ? options.sortFunc : defaults.sortFunc;\n let sortable = (typeof col.sortable != 'undefined') ? col.sortable : defaults.sortable;\n let colWidth = (typeof col.width != 'undefined') ? col.width : defaults.colWidth;\n\n return (\n \n {col.value}\n \n );\n })}\n {options.actions &&\n \n {options.actionsHeader || ' '}\n \n }\n \n \n \n {columns.length > 0 && props.data.map((row,i) => {\n if(Array.isArray(row) && row.length !== columns.length) {\n console.warn(`Data at row ${i} is ${row.length}. It should be ${columns.length}.`);\n return \n }\n\n return (\n \n {createRow(row, columns, options.actions)}\n \n );\n })}\n \n
\n
\n
\n );\n};\n\nexport default Table;\n","import React from 'react';\nimport RawHTML from '../raw-html';\n\nconst TableCell = (props) => {\n let {children} = props;\n\tlet value = '';\n\tif(children) {\n\t if (React.isValidElement(children)) {\n\t value = children;\n } else {\n\t value = {children.toString()} \n }\n }\n\n\treturn (\n\t\t\n {value}\n\t\t \n\t);\n};\n\nexport default TableCell;\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"video.js\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"video.js/dist/video-js.css\");","/**\n * Copyright 2020 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport videojs from 'video.js'\n\nimport 'video.js/dist/video-js.css'\n\nconst YoutubeVideoComponent = ({ videoSrcURL, videoTitle }) => (\n \n \n
\n);\n\n\nclass LiveVideoPlayer extends React.Component {\n\n componentDidMount() {\n this.player = videojs(this.videoNode, this.props);\n }\n\n componentWillUnmount() {\n if (this.player) {\n this.player.dispose();\n }\n }\n\n render() {\n return (\n \n this.videoNode = node} className=\"video-js vjs-big-play-centered\" />\n
\n );\n }\n}\n\nconst VideoStream = ({ url }) => {\n let layout = null;\n const checkLiveVideo = () => {\n let isLiveVideo = null;\n url.match(/.m3u8/) ? isLiveVideo = true : isLiveVideo = false;\n return isLiveVideo;\n };\n\n if (url) {\n if (checkLiveVideo()) {\n const videoJsOptions = {\n autoplay: true,\n controls: true,\n fluid: true,\n sources: [{\n src: url,\n type: 'application/x-mpegURL'\n }]\n }\n layout = ;\n } else {\n layout = ;\n }\n } else {\n layout = No video URL Provided ;\n }\n\n return layout;\n};\n\nexport default VideoStream;\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone'\n\nclass SummitEvent {\n\n constructor(event, summit = null){\n this._event = event;\n this._summit = summit;\n }\n\n set summit(summit){\n this._summit = summit;\n }\n\n get summit(){\n return this._summit;\n }\n\n getId(){\n return this._event.id;\n }\n\n isPublished(){\n return this._event.hasOwnProperty('is_published') && this._event.is_published;\n }\n\n getMinutesDuration(slotSize){\n\n if(this._event.hasOwnProperty('start_date') && this._event.hasOwnProperty('end_date') && this._event.start_date != null && this._event.end_date != null ) {\n let eventStartDateTime = moment(this._event.start_date * 1000).tz(this._summit.time_zone.name);\n let eventEndDateTime = moment(this._event.end_date * 1000).tz(this._summit.time_zone.name);\n return eventEndDateTime.diff(eventStartDateTime, 'minutes');\n }\n // default\n\n return this._event.hasOwnProperty('duration') && this._event.duration > 0 ? parseInt( this._event.duration / 60 ) : slotSize;\n }\n\n canMove(siblings, day, startTime, interval){\n\n let duration = this._event.hasOwnProperty('duration') && this._event.duration > 0 ? parseInt( this._event.duration / 60 ) : interval;\n // check if published to get real duration ...\n if(this.isPublished())\n duration = this.getMinutesDuration();\n\n let startDateTime = moment.tz(day+' '+ startTime.format('HH:mm'), 'YYYY-MM-DD HH:mm', this._summit.time_zone.name);\n let endDateTime = moment.tz(day+' '+ startTime.format('HH:mm'), 'YYYY-MM-DD HH:mm', this._summit.time_zone.name);\n endDateTime = endDateTime.add(duration, 'minutes');\n\n // check siblings overlap\n for (let auxEvent of siblings.filter(item => item.id !== this.getId())) {\n let auxEventStartDateTime = moment(auxEvent.start_date * 1000).tz(this._summit.time_zone.name);\n let auxEventEndDateTime = moment(auxEvent.end_date * 1000).tz(this._summit.time_zone.name);\n\n // if time segments overlap\n if(auxEventStartDateTime.isBefore(endDateTime) && auxEventEndDateTime.isAfter(startDateTime))\n return false;\n }\n\n return true;\n }\n\n calculateNewDates(day, startTime, minutes){\n\n minutes = this._event.hasOwnProperty('duration') && this._event.duration > 0 ?\n parseInt( this._event.duration / 60 ) : minutes;\n\n let newStarDateTime = moment.tz(day+' '+startTime.format('HH:mm'), 'YYYY-MM-DD HH:mm', this._summit.time_zone.name);\n let newEndDateTime = moment.tz(day+' '+startTime.format('HH:mm'), 'YYYY-MM-DD HH:mm', this._summit.time_zone.name).add(minutes, 'minutes');\n return [newStarDateTime, newEndDateTime];\n }\n\n isValidEndDate(endDate){\n if(!endDate) return true;\n const _endDate = moment.tz(endDate * 1000, this._summit.time_zone.name);\n const summitEndDate = moment.tz(this._summit.end_date * 1000, this._summit.time_zone.name);\n const startDate = moment.tz(this._event.start_date * 1000, this._summit.time_zone.name);\n return _endDate.isSameOrBefore(summitEndDate) && _endDate.isAfter(startDate);\n }\n\n isValidStartDate(startDate){\n if(!startDate) return true;\n const _startDate = moment.tz(startDate * 1000, this._summit.time_zone.name);\n // if we have set duration , end date is optional\n const durationInMinutes = this._event.hasOwnProperty('duration') && this._event.duration > 0 ?\n parseInt( this._event.duration / 60 ) : 0;\n const summitStartDate = moment.tz(this._summit.start_date * 1000, this._summit.time_zone.name);\n const endDate = this._event.end_date ?\n moment.tz(this._event.end_date * 1000, this._summit.time_zone.name):\n ( durationInMinutes > 0 ? moment.tz(startDate * 1000, this._summit.time_zone.name).add(durationInMinutes, 'minutes'): null);\n\n return _startDate.isSameOrAfter(summitStartDate) && moment.isMoment(endDate) && _startDate.isBefore(endDate);\n }\n\n isValidTitle(title){\n return title.trim() !== '';\n }\n\n isValid(){\n return this.isValidTitle(this._event.title)\n && this.isValidStartDate(this._event.start_date)\n && this.isValidEndDate(this._event.end_date);\n }\n\n}\n\nexport default SummitEvent;\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific flanguage governing permissions and\n * limitations under the License.\n **/\n\nimport request from 'superagent/lib/client';\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\n\nlet http = request;\nimport Swal from 'sweetalert2';\nimport T from \"i18n-react/dist/i18n-react\";\nimport { isClearingSessionState, setSessionClearingState, getCurrentPathName } from './methods';\nimport { CLEAR_SESSION_STATE } from '../components/security/actions';\nimport { doLogin, initLogOut } from '../components/security/methods';\n\nexport const GENERIC_ERROR = \"Yikes. Something seems to be broken. Our web team has been notified, and we apologize for the inconvenience.\";\nexport const RESET_LOADING = 'RESET_LOADING';\nexport const START_LOADING = 'START_LOADING';\nexport const STOP_LOADING = 'STOP_LOADING';\nexport const VALIDATE = 'VALIDATE';\nexport const CLEAR_MESSAGE = 'CLEAR_MESSAGE';\nexport const SHOW_MESSAGE = 'SHOW_MESSAGE';\n\nexport const createAction = type => payload => ({\n type,\n payload\n});\n\nexport const resetLoading = createAction(RESET_LOADING);\nexport const startLoading = createAction(START_LOADING);\nexport const stopLoading = createAction(STOP_LOADING);\n\nconst xhrs = {};\nconst etagCache = {};\n\nconst cancel = (key) => {\n if(xhrs[key]) {\n xhrs[key].abort();\n console.log(`aborted request ${key}`);\n delete xhrs[key];\n }\n}\n\nconst schedule = (key, req) => {\n // console.log(`scheduling ${key}`);\n xhrs[key] = req;\n};\n\nconst isObjectEmpty = (obj) => {\n return Object.keys(obj).length === 0 && obj.constructor === Object ;\n}\n\nconst buildNotifyHandlerPayload = (httpCode, title, content, type) => ({ httpCode, title, html: content, type });\nconst buildNotifyHandlerErrorPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"error\");\nconst buildNotifyHandlerWarningPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"warning\");\n\nconst initLogin = () => (dispatch) => {\n const currentLocation = getCurrentPathName();\n const clearingSessionState = isClearingSessionState();\n dispatch({\n type: CLEAR_SESSION_STATE,\n payload: {}\n });\n if (!clearingSessionState) {\n setSessionClearingState(true);\n console.log(\"authErrorHandler 401 - re login\");\n doLogin(currentLocation);\n }\n};\n\nconst normalizeFormDataPayload = (req, formData) => {\n if(!isObjectEmpty(formData)) {\n Object.keys(formData).forEach(function (key) {\n let value = formData[key];\n if (Array.isArray(value)) {\n value.forEach(item => {\n req.field(`${key}[]`, item);\n });\n } else {\n req.field(key, value);\n }\n });\n }\n};\n\nexport const authErrorHandler = (\n err,\n res,\n notifyErrorHandler = showMessage\n) => (dispatch) => {\n\n const code = err.status;\n let msg = \"\";\n let payload, callback;\n\n dispatch(stopLoading());\n\n switch (code) {\n case 401:\n if (notifyErrorHandler !== showMessage) {\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_auth\"));\n callback = () => dispatch(initLogin());\n } else {\n dispatch(initLogin());\n }\n break;\n case 403:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_authz\"));\n callback = initLogOut;\n break;\n case 404:\n msg = err.response.body?.message || err.response.error?.message || err.message;\n if (err.response.body?.errors?.length) {\n msg += ` ${err.response.body.errors.join(\" \")}`;\n }\n payload = buildNotifyHandlerWarningPayload(code, \"Not Found\", msg);\n break;\n case 412:\n for (const [key, value] of Object.entries(err.response.body.errors)) {\n msg += isNaN(key) ? `${key}: ` : \"\";\n msg += `${value} `;\n }\n dispatch({\n type: VALIDATE,\n payload: { errors: err.response.body.errors }\n });\n payload = buildNotifyHandlerWarningPayload(code, \"Validation error\", msg);\n break;\n default:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.server_error\"));\n }\n\n if (payload)\n dispatch(notifyErrorHandler(payload, callback));\n}\n\nexport const getRequest =(\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {},\n useEtag = false\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n let key = url.toString();\n\n if(!isObjectEmpty(params)) {\n // remove the access token\n const { access_token: _, ...newParams} = params;\n // and generate new key\n key = url.query(newParams).toString();\n url = url.query(params);\n }\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n cancel(key);\n\n return new Promise((resolve, reject) => {\n let req = http.get(url.toString());\n if(useEtag && etagCache.hasOwnProperty(key)){\n const { etag } = etagCache[key];\n if(etag){\n req.set('If-None-Match', etag)\n }\n }\n\n req.timeout({\n response: 60000,\n deadline: 60000,\n })\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key, useEtag))\n\n schedule(key, req);\n });\n};\n\nexport const putRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => ( dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n http.put(url.toString())\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject))\n });\n};\n\nexport const deleteRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params) => (dispatch, state) => {\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n\n http.delete(url)\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n let request = http.post(url);\n\n if(payload != null)\n request.send(payload);\n else // to be a simple CORS request\n request.set('Content-Type', 'text/plain');\n\n request.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.post(url)\n .attach('file', file);\n\n normalizeFormDataPayload(req, fileMetadata);\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const putFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file = null,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.put(url);\n\n if(file != null){\n req.attach('file', file);\n }\n\n normalizeFormDataPayload(req, fileMetadata)\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const defaultErrorHandler = (err, res) => (dispatch) => {\n let body = res.body;\n let text = '';\n if(body instanceof Object){\n if(body.hasOwnProperty('message'))\n text = body.message;\n }\n Swal.fire(res.statusText, text, \"error\");\n}\n\nconst byLowerCase = toFind => value => toLowerCase(value) === toFind;\nconst toLowerCase = value => value.toLowerCase();\nconst getKeys = headers => Object.keys(headers);\n\nexport const getHeaderCaseInsensitive = (headerName, headers = {}) => {\n const key = getKeys(headers).find(byLowerCase(headerName));\n return key ? headers[key] : undefined;\n};\n\nexport const responseHandler = ( dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key = null, useEtag= false ) =>\n\n (err, res) => {\n\n if (err || !res.ok) {\n let code = err.status;\n\n if(code === 304 && etagCache.hasOwnProperty(key) && useEtag){\n const { body } = etagCache[key];\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: body}));\n return resolve({response: body});\n }\n\n dispatch(receiveActionCreator);\n return resolve({response: body});\n }\n if(errorHandler) {\n errorHandler(err, res)(dispatch, state);\n }\n return reject({ err, res, dispatch, state })\n }\n\n let json = res.body;\n\n if(useEtag) {\n const responseETAG = getHeaderCaseInsensitive('etag', res.headers);\n if (responseETAG) {\n etagCache[key] = { etag: responseETAG, body: json};\n }\n }\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: json}));\n return resolve({response: json});\n }\n dispatch(receiveActionCreator);\n return resolve({response: json});\n}\n\n\nexport const fetchErrorHandler = (response) => {\n let code = response.status;\n let msg = response.statusText;\n\n switch (code) {\n case 403:\n Swal.fire(\"ERROR\", T.translate(\"errors.user_not_authz\"), \"warning\");\n break;\n case 401:\n Swal.fire(\"ERROR\", T.translate(\"errors.session_expired\"), \"error\");\n break;\n case 412:\n Swal.fire(\"ERROR\", msg, \"warning\");\n case 500:\n Swal.fire(\"ERROR\", T.translate(\"errors.server_error\"), \"error\");\n }\n}\n\nexport const fetchResponseHandler = (response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.json();\n }\n}\n\nexport const showMessage = (settings, callback = null) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire(settings).then((result) => {\n if (result.value && typeof callback === 'function') {\n callback();\n }\n });\n}\n\nexport const showSuccessMessage = (html) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire({\n title: T.translate(\"general.done\"),\n html: html,\n type: 'success'\n });\n}\n\nexport const downloadFileByContent = (filename, content, mime) => {\n let link = document.createElement('a');\n link.textContent = 'download';\n link.download = filename;\n link.href = `data:${mime},${encodeURIComponent(content)}`\n document.body.appendChild(link); // Required for FF\n link.click();\n document.body.removeChild(link);\n}\n\nexport const getCSV = (endpoint, params, filename, header = null) => (dispatch) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n dispatch(startLoading());\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n dispatch(stopLoading());\n\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n downloadFileByContent(filename, csv, 'text/csv;charset=utf-8');\n })\n .catch(fetchErrorHandler);\n};\n\nexport const getRawCSV = (endpoint, params, header = null) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n\n return csv;\n })\n .catch(fetchErrorHandler);\n};\n\nexport const escapeFilterValue = (value) => {\n value = String(value);\n // escape backslash first so you don't accidentally break your own escapes\n value = value.replace(/\\\\/g, \"\\\\\\\\\");\n value = value.replace(/,/g, \"\\\\,\");\n value = value.replace(/;/g, \"\\\\;\");\n // especial case for literal +\n value = value.replace(/\\+/g, \"%2B\");\n return value;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"spark-md5\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/sha256\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-base64url\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-hex\");","import SparkMD5 from \"spark-md5\";\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nconst MAX_BYTES = 65536\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nconst MAX_UINT32 = 4294967295\nconst crypto = typeof window !== 'undefined' ? (window.crypto || window.msCrypto) : null;\nimport sha256 from 'crypto-js/sha256';\nimport Base64url from 'crypto-js/enc-base64url'\nimport Hex from 'crypto-js/enc-hex'\nexport const getRandomBytes = (size) => {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n const bytes = Buffer.allocUnsafe(size)\n if(!crypto) return a;\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (let generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n return bytes\n}\n\nexport const getSHA256 = (message, format = 'hex') => {\n\n let f = Hex;\n if(format === 'Base64url')\n f = Base64url;\n\n return sha256(message).toString(f);\n}\n\nexport const getMD5 = (file) => {\n return new Promise((resolve, reject) => {\n const chunkSize = 2 * 1024 * 1024; // 2 MB by chunk\n const spark = new SparkMD5.ArrayBuffer();\n const fileReader = new FileReader();\n let cursor = 0;\n\n fileReader.onload = e => {\n spark.append(e.target.result); \n cursor += chunkSize;\n\n if (cursor < file.size) {\n readNextChunk();\n } else {\n resolve(spark.end()); // final MD5\n }\n };\n\n fileReader.onerror = () => reject(\"Error reading the file\");\n\n function readNextChunk() {\n const slice = file.slice(cursor, cursor + chunkSize);\n fileReader.readAsArrayBuffer(slice);\n }\n\n readNextChunk();\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"use-sync-external-store/shim\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"use-sync-external-store/shim/with-selector\");","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * createExternalStore - Factory for creating React-optimized external stores.\n *\n * Problem:\n * When a frequently-updating data source (clock, WebSocket, polling, etc.)\n * pushes its value into shared state (global store, lifted useState, or a\n * context value), every consuming component re-renders on every update,\n * even when they only care about a derived condition that rarely changes.\n *\n * Solution:\n * createExternalStore() returns a Provider and hooks that store the value\n * in a ref (no re-renders) and use useSyncExternalStore so components\n * can opt in to updates selectively:\n *\n * - useValue() → re-renders on every update\n * - useSelector(compute, isEqual) → re-renders only when the computed result changes\n *\n * Components that don't call either hook are never affected by updates.\n *\n * How it works:\n * 1. The Provider stores the value in a ref (writing to a ref never triggers\n * a React re-render) and keeps a Set of listener callbacks.\n * 2. When emit(value) is called, the ref is updated and all listeners are\n * notified. These listeners come from useSyncExternalStore.\n * 3. useSyncExternalStore (React 18, shimmed for 16/17) calls getSnapshot()\n * to read the ref, compares with the previous value, and only re-renders\n * the component if the value changed.\n * 4. useMemo adds a layer on top: it runs a compute function on the raw value\n * and only re-renders if the computed result changed (checked via isEqual).\n *\n * API:\n * createExternalStore(name) returns:\n *\n * - Provider Wraps your component tree. Pass children as a render function\n * to receive the emit callback: (emit) => JSX. Call emit(value)\n * each time your data source has a new value.\n *\n * - useValue() Returns the latest emitted value. The component re-renders\n * on every emit.\n *\n * - useSelector(compute, isEqual?)\n * Returns a derived value. compute(rawValue) runs on every emit,\n * but the component only re-renders when isEqual returns false\n * (default: ===). Useful when you need to derive something that\n * changes less frequently than the raw value.\n *\n * The name parameter is used in error messages. For example,\n * createExternalStore('Clock') throws \"Clock hooks must be used within\n * their Provider\" when a hook is called outside the Provider.\n *\n * For clock-specific usage:\n * A pre-built clock store is available at:\n * import { ClockProvider, useClock, useClockSelector } from 'openstack-uicore-foundation/lib/components/clock-context';\n * This wires createExternalStore to the Clock component so projects don't\n * have to repeat that boilerplate.\n *\n * Custom store example:\n * import { createExternalStore } from 'openstack-uicore-foundation/lib/utils/external-store';\n *\n * const { Provider, useValue, useSelector } = createExternalStore('WebSocket');\n *\n * const WebSocketProvider = ({ url, children }) => (\n * \n * {(emit) => (\n * <>\n * \n * {children}\n * >\n * )}\n * \n * );\n *\n * // Re-renders on every message:\n * const message = useValue();\n *\n * // Re-renders only when the derived value changes:\n * const isActive = useSelector((msg) => msg?.status === 'active');\n **/\n\nimport React, { createContext, useContext, useRef, useCallback, useMemo as reactUseMemo } from 'react';\n// Shim for React 16/17 compatibility, falls back to native in React 18+\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\n\nconst strictEqual = (a, b) => a === b;\n\n/**\n * Creates an external store with a Provider and subscription hooks.\n *\n * @param {string} name - Store name, used in error messages (e.g., \"Clock\", \"WebSocket\")\n * @returns {{ Provider, useValue, useSelector }}\n */\nexport function createExternalStore(name = 'ExternalStore') {\n const Context = createContext(null);\n\n const useStoreContext = () => {\n const context = useContext(Context);\n if (context === null) {\n throw new Error(`${name} hooks must be used within their Provider`);\n }\n return context;\n };\n\n /**\n * Provider - Wraps your component tree and provides the store.\n *\n * Pass children as a render function to receive the `emit` callback:\n * {(emit) => } \n *\n * Or pass children normally if you wire emit externally.\n *\n * Pass `initialValue` to seed the store synchronously so that hooks\n * called before the first emit see a real value instead of null.\n */\n const Provider = ({ initialValue = null, children }) => {\n const valueRef = useRef(initialValue);\n const listenersRef = useRef(new Set());\n\n const subscribe = useCallback((callback) => {\n listenersRef.current.add(callback);\n return () => listenersRef.current.delete(callback);\n }, []);\n\n const getSnapshot = useCallback(() => valueRef.current, []);\n\n const emit = useCallback((value) => {\n valueRef.current = value;\n listenersRef.current.forEach(listener => listener());\n }, []);\n\n const contextValue = reactUseMemo(() => ({ subscribe, getSnapshot }), [subscribe, getSnapshot]);\n\n return (\n \n {typeof children === 'function' ? children(emit) : children}\n \n );\n };\n\n /**\n * useValue - Subscribe to every update.\n * Component re-renders each time emit() is called.\n *\n * @returns {*} The current value, or null before first emit\n */\n const useValue = () => {\n const { subscribe, getSnapshot } = useStoreContext();\n return useSyncExternalStore(subscribe, getSnapshot);\n };\n\n /**\n * useSelector - Subscribe with a selector function.\n * Only re-renders when the selected/derived value changes.\n *\n * @param {Function} compute - (value) => derivedValue\n * @param {Function} isEqual - Optional equality function (default: ===)\n * @returns {*} The computed value\n */\n const useSelector = (compute, isEqual = strictEqual) => {\n const { subscribe, getSnapshot } = useStoreContext();\n return useSyncExternalStoreWithSelector(\n subscribe,\n getSnapshot,\n getSnapshot,\n compute,\n isEqual\n );\n };\n\n return { Provider, useValue, useSelector };\n}\n","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"lodash/debounce\");","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport { fetchErrorHandler, fetchResponseHandler, escapeFilterValue } from \"./actions\";\nimport { getAccessToken } from '../components/security/methods';\nimport { buildAPIBaseUrl } from \"./methods\";\nimport debounce from 'lodash/debounce';\nexport const RECEIVE_COUNTRIES = 'RECEIVE_COUNTRIES';\nconst callDelay = 500; // milliseconds\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\nexport const DEFAULT_PAGE_SIZE = 10;\n\nconst _fetchPublic = async (endpoint, callback, options = {}) => {\n return fetch(buildAPIBaseUrl(endpoint.toString()), options)\n .then(fetchResponseHandler)\n .then((json) => {\n if(typeof callback === 'function')\n callback(json.data);\n })\n .catch(response => {\n const code = response && response.status;\n if (code === 404 && typeof callback === 'function') callback([]);\n return response;\n })\n .catch(fetchErrorHandler);\n}\n\n/**\n * @param endpoint\n * @param callback\n * @param options\n * @returns {Promise}\n * @private\n */\nconst _fetch = async (endpoint, callback, options = {}) => {\n\n let accessToken;\n\n try {\n accessToken = await getAccessToken();\n } catch (e) {\n // The caller is told through its callback; the query* functions do not\n // await this promise, so rejecting here would only surface as an\n // unhandled rejection.\n if(typeof callback === 'function')\n callback(e);\n return;\n }\n\n endpoint.addQuery('access_token', accessToken);\n\n return _fetchPublic(endpoint, callback, options);\n}\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryMembers = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/members`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryAttendees = debounce(async (summitId, input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n \n let endpoint = URI(`/api/v1/summits/${summitId}/attendees`);\n \n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n \n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name=@${input},email=@${input}`);\n }\n \n _fetch(endpoint, callback);\n \n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySummits = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/all`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySpeakers = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE ) => {\n\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/speakers`:`speakers`}`);\n\n endpoint.addQuery('expand', `member,registration_request`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTags = debounce(async (summitId, input, callback, per_page = 50) => {\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/track-tag-groups/all/allowed-tags`:`tags`}`);\n\n if(summitId)\n endpoint.addQuery('expand', `tag,track_tag_group`);\n\n endpoint.addQuery('order','tag');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `tag@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTracks = debounce(async (summitId, input, callback, excludedIds = [], per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/tracks`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if (excludedIds?.length > 0) {\n endpoint.addQuery('filter[]', `not_id==${excludedIds.join(\"||\")}`);\n }\n\n if (input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTrackGroups = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/track-groups`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=, *): Promise)|*>}\n */\nexport const queryEvents = debounce(async (summitId, input, onlyPublished = false, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/events` + (onlyPublished ? '/published' : ''));\n\n endpoint.addQuery('order','title');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=, *=): Promise)|*>}\n */\nexport const queryEventTypes = debounce(async (summitId, input, callback, eventTypeClassName = null, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/event-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n if (eventTypeClassName) {\n eventTypeClassName = escapeFilterValue(eventTypeClassName);\n endpoint.addQuery('filter[]', `class_name==${eventTypeClassName}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryGroups = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/groups`);\n\n endpoint.addQuery('order','title,code');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input},code@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryCompanies = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/companies`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryRegistrationCompanies = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/registration-companies`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsors = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type')\n endpoint.addQuery('order','id')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsorsWithBadgeScans = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type');\n endpoint.addQuery('fields','id,company.name,sponsorship.type.name');\n endpoint.addQuery('relations','none,company.none,sponsorship.type.none');\n endpoint.addQuery('filter[]','badge_scans_count>0');\n endpoint.addQuery('order','+company_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryAccessLevels = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/access-level-types`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryOrganizations = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/organizations`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\nexport const getLanguageList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/languages`), callback, { signal });\n};\n\nexport const getCountryList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/countries`), callback, { signal });\n};\n\nlet geocoder;\n\nexport const geoCodeAddress = (address) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\nexport const geoCodeLatLng = (lat, lng) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n let latlng = {lat: parseFloat(lat), lng: parseFloat(lng)};\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'location': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\n/**\n * @type {DebouncedFunc<(function(*, *=, *, *=, *=): Promise)|*>}\n */\nexport const queryTicketTypes = debounce(async (summitId, filters = {}, callback, version = 'v1', per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/${version}/summits/${summitId}/ticket-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(filters.hasOwnProperty('name')) {\n const name = escapeFilterValue(filters.name);\n if(name && name != '')\n endpoint.addQuery('filter[]', `name@@${name}`);\n }\n\n if(filters.hasOwnProperty('audience')){\n const audience = escapeFilterValue(filters.audience);\n if(audience && audience != '')\n endpoint.addQuery('filter[]', `audience==${audience}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySponsoredProjects = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n\n const endpoint = URI(`/api/v1/sponsored-projects`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryPromocodes = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE, extraFilters = []) => {\n\n\n let endpoint = URI(`/api/v1/summits/${summitId}/promo-codes`);\n\n endpoint.addQuery('order','code')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `code@@${input}`);\n }\n\n //eg: filter = 'class_name==SummitRegistrationPromoCode'\n for (const filter of extraFilters) {\n endpoint.addQuery('filter[]', filter);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n","export const CheckBoxQuestionType = 'CheckBox';\nexport const ComboBoxQuestionType = 'ComboBox'\nexport const CheckBoxListQuestionType = 'CheckBoxList';\nexport const RadioButtonListQuestionType = 'RadioButtonList';\nexport const AllowedMultipleValueQuestionType = [ComboBoxQuestionType, CheckBoxListQuestionType, RadioButtonListQuestionType];\nexport const AnswerValuesOperator_And = 'And';\nexport const AnswerValuesOperator_Or = 'Or';\nexport const VisibilityCondition_Equal = 'Equal';\nexport const VisibilityCondition_NotEqual = 'NotEqual';\nexport const Visibility_Visible = 'Visible';\nexport const MainQuestionClassType = 'MainQuestion';\nimport {toSlug} from \"./methods\";\n\nexport default class QuestionsSet {\n\n constructor(questions, answers = []) {\n this.questions = questions;\n this.originalAnswers = answers\n this.answers = [];\n // map answers to associate array\n for (let a of this.originalAnswers)\n this.answers[a.question_id] = a;\n this.questionByName = {}\n this.questionById = {}\n // associative array ( rule id , rule);\n this.rules = {};\n this._parseQuestions();\n }\n\n _parseQuestion = (q) => {\n this.questionByName[toSlug(q.name)] = q;\n this.questionById[parseInt(q.id)] = q;\n if(q.hasOwnProperty('sub_question_rules'))\n for (let r of q.sub_question_rules) {\n this.rules[parseInt(r.id)] = r;\n this._parseQuestion(r.sub_question);\n }\n }\n\n _parseQuestions = () => {\n for (let q of this.questions) {\n this._parseQuestion(q);\n }\n }\n\n _allowsValues = (q) => {\n return AllowedMultipleValueQuestionType.includes(q.type);\n }\n\n _allowsValue = (q, answer) => {\n let value = answer.value.split(',').map(v => parseInt(v));\n for (let av of value) {\n if (!q.values.map(e => e.id).includes(av))\n return false;\n }\n return true;\n }\n\n _getAnswerFor = (q) => {\n let id = Number.isInteger(q) ? q : q.id;\n let a = this.answers[id] || null;\n return a ? a : null;\n }\n\n _hasValue = (answer) => {\n return answer.value !== '';\n }\n\n _answerContains = (answer, val) => {\n return answer.value.split(',').includes(val);\n }\n\n _isSubQuestionVisible = (rule) => {\n let initialCondition = rule.answer_values_operator === AnswerValuesOperator_And ? true : false;\n const parentQuestionAnswer = this._getAnswerFor(rule.parent_question_id);\n if (!parentQuestionAnswer) {\n initialCondition = rule.visibility_condition === VisibilityCondition_Equal ? false : true;\n } else {\n switch (rule.visibility_condition) {\n case VisibilityCondition_Equal: {\n for (let answerValue of rule.answer_values) {\n if (rule.answer_values_operator === AnswerValuesOperator_And)\n initialCondition = initialCondition && this._answerContains(parentQuestionAnswer, answerValue);\n else\n initialCondition = initialCondition || this._answerContains(parentQuestionAnswer, answerValue);\n }\n }\n break;\n case VisibilityCondition_NotEqual: {\n for (let answerValue of rule.answer_values) {\n if (rule.answer_values_operator === AnswerValuesOperator_And)\n initialCondition = initialCondition && !this._answerContains(parentQuestionAnswer, answerValue);\n else\n initialCondition = initialCondition || !this._answerContains(parentQuestionAnswer, answerValue);\n }\n }\n break;\n }\n }\n // final visibility check\n if (rule.visibility === Visibility_Visible) {\n return initialCondition;\n }\n // not visible\n return !initialCondition;\n }\n\n _isAnswered = (q) => {\n const answer = this._getAnswerFor(q);\n\n if (q.class === MainQuestionClassType) {\n if (!q.mandatory) return true;\n if (!answer) return false;\n if (!this._hasValue(answer)) return false;\n if (this._allowsValues(q) && !this._allowsValue(q, answer))\n return false;\n return true;\n }\n\n // check parent rules ...\n for (let ruleId of q.parent_rules) {\n if (!this._isSubQuestionVisible(this.rules[ruleId])) // if question is not visible skip it\n continue;\n if (!q.mandatory) return true;\n if (!answer) return false;\n if (!this._hasValue(answer)) return false;\n if (this._allowsValues(q) && !this._allowsValue(q, answer))\n return false;\n return true;\n }\n\n return true;\n }\n\n _checkQuestion = (q) => {\n let res = this._isAnswered(q);\n if(q.hasOwnProperty('sub_question_rules'))\n for (let rule of q.sub_question_rules) {\n // check recursive all the tree till leaves ...\n res = res && this._checkQuestion(rule.sub_question);\n }\n return res;\n }\n\n _formatQuestionAnswer = (question) => {\n let res = {};\n const slug = toSlug(question.name);\n let userAnswer = this.originalAnswers.find(a => a.question_id === question.id)?.value;\n if(!userAnswer && question?.values?.length > 0){\n // check default value\n const defaultVal = question.values.find(v => v.is_default);\n if(defaultVal) userAnswer = defaultVal.id.toString();\n }\n if(userAnswer) {\n if (question.type === CheckBoxQuestionType) userAnswer = userAnswer === 'false' ? false : !!userAnswer;\n if (question.type === RadioButtonListQuestionType || question.type === ComboBoxQuestionType) userAnswer = parseInt(userAnswer);\n if (question.type === CheckBoxListQuestionType) userAnswer = userAnswer.split(',').map(ansVal => parseInt(ansVal)) || [];\n }\n\n res[slug] = userAnswer || '';\n if(question.type === CheckBoxListQuestionType && res[slug] === '') res[slug] = []\n if(question.hasOwnProperty('sub_question_rules'))\n for (let rule of question.sub_question_rules) {\n // check recursive all the tree till leaves ...\n let res1 = this._formatQuestionAnswer(rule.sub_question);\n res = {...res, ...res1};\n }\n return res;\n }\n\n formatAnswers = () => {\n let res = {}\n this.questions.forEach(q => {\n let res1 = this._formatQuestionAnswer(q);\n res = {...res,...res1};\n });\n return res;\n }\n\n completed = () => {\n let res = true;\n for (let q of this.questions) {\n res = res && this._checkQuestion(q);\n }\n return res;\n }\n\n getQuestionByName = (name) => {\n const slug = toSlug(name)\n return this.questionByName[name] || this.questionByName[slug] || null;\n }\n\n getQuestionById = (id) => {\n return this.questionById[parseInt(id)] || null;\n }\n}\n","var map = {\n\t\"./en.json\": 5553,\n\t\"./es.json\": 2706,\n\t\"./zh.json\": 4028\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 9401;","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\");","module.exports = require(\"dropzone\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"idtoken-verifier\");","module.exports = require(\"lodash\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","module.exports = require(\"react-dnd\");","module.exports = require(\"react-rte\");","module.exports = require(\"react-select\");","module.exports = require(\"react-select/lib/Async\");","module.exports = require(\"react-select/lib/AsyncCreatable\");","module.exports = require(\"react-tooltip\");","module.exports = require(\"superagent/lib/client\");","module.exports = require(\"sweetalert2\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"i18n-react\");","import React from 'react';\nimport T from 'i18n-react';\nimport { getCurrentUserLanguage } from '../utils/methods';\n\nexport {default as AjaxLoader} from './ajaxloader';\nexport {default as RawHTML} from './raw-html';\nexport {default as FreeTextSearch} from './free-text-search';\nexport {default as DateTimePicker} from './inputs/datetimepicker'\nexport {default as GroupedDropdown} from './inputs/grouped-dropdown'\nexport {default as UploadInput} from './inputs/upload-input'\nexport {default as UploadInputV2} from './inputs/upload-input-v2'\nexport {default as UploadInputV3} from './inputs/upload-input-v3'\nexport {default as CompanyInput} from './inputs/company-input'\nexport {default as PromocodeInput} from './inputs/promocode-input'\nexport {default as SponsorInput} from './inputs/sponsor-input'\nexport {default as OrganizationInput} from './inputs/organization-input'\nexport {default as CountryDropdown} from './inputs/country-dropdown'\nexport {default as Dropdown} from './inputs/dropdown'\nexport {default as TextEditor} from './inputs/editor-input'\nexport {default as TextArea} from './inputs/textarea-input'\nexport {default as EventInput} from './inputs/event-input'\nexport {default as GroupInput} from './inputs/group-input'\nexport {default as MemberInput} from './inputs/member-input'\nexport {default as AttendeeInput} from './inputs/attendee-input'\nexport {default as SummitInput} from './inputs/summit-input'\nexport {default as SpeakerInput} from './inputs/speaker-input'\nexport {default as OperatorInput} from './inputs/operator-input'\nexport {default as TagInput} from './inputs/tag-input'\nexport {default as Input} from './inputs/text-input'\nexport {default as Panel} from './sections/panel'\nexport {default as SimpleLinkList} from './simple-link-list'\nexport {default as SummitDropdown} from './summit-dropdown'\nexport {default as Table} from './table/Table'\nexport {default as SortableTable} from './table-sortable/SortableTable'\nexport {default as EditableTable} from './table-editable/EditableTable'\nexport {default as SelectableTable} from './table-selectable/SelectableTable'\nexport {default as SimpleForm} from './forms/simple-form'\nexport {default as RsvpForm} from './forms/rsvp-form';\nexport {default as RadioList} from './inputs/radio-list'\nexport {default as CheckboxList} from './inputs/checkbox-list'\nexport {default as ActionDropdown} from './inputs/action-dropdown'\nexport {default as CountryInput} from './inputs/country-input'\nexport {default as LanguageInput} from './inputs/language-input'\nexport {default as FreeMultiTextInput} from \"./inputs/free-multi-text-input\";\nexport {default as Exclusive} from \"./exclusive-wrapper\";\nexport {default as Clock} from \"./clock\";\nexport {ClockProvider, useClock, useClockSelector} from \"./clock-context\";\nexport {createExternalStore} from \"../utils/external-store\";\nexport {default as CircleButton} from \"./circle-button\";\nexport {default as VideoStream} from \"./video-stream\";\nexport {default as AttendanceTracker} from \"./attendance-tracker\";\nexport {default as AccessLevelsInput} from './inputs/access-levels-input';\nexport {default as RegistrationCompanyInput} from './inputs/registration-company-input';\nexport {default as TicketTypesInput} from './inputs/ticket-types-input.js'\nexport {default as SponsoredProjectInput} from './inputs/sponsored-project-input.js'\nexport {default as SteppedSelect} from './inputs/stepped-select/index.jsx'\nexport {default as SummitDaysSelect} from './inputs/summit-days-select'\nexport {default as SummitVenuesSelect} from './inputs/summit-venues-select'\nexport {default as BulkActionsSelector} from './bulk-actions-selector'\nexport {default as ScheduleBuilderView} from './schedule-builder-view'\n\n// this 5 includes 3rd party deps\n// export {default as ExtraQuestionsForm } from './extra-questions/index.js';\n// export {default as GMap} from './google-map';\n// export {default as TextEditorV2} from './inputs/editor-input-v2'\n// export {default as TextEditorV3} from './inputs/editor-input-v3'\n// export {default as CompanyInputV2} from './inputs/company-input-v2.js'\n\nlet language = getCurrentUserLanguage();\n\n// language would be something like es-ES or es_ES\n// However we store our files with format es.json or en.json\n// therefore retrieve only the first 2 digits\n\nif (language.length > 2) {\n language = language.split(\"-\")[0];\n language = language.split(\"_\")[0];\n}\n\ntry {\n T.setTexts(require(`../i18n/${language}.json`));\n} catch (e) {\n T.setTexts(require(`../i18n/en.json`));\n}\n"],"names":["root","factory","exports","module","define","amd","this","AjaxLoader","show","relative","color","size","children","styles","display","width","height","position","zIndex","margin","cursor","backgroundColor","top","left","styleSpinner","fontSize","styleSpinnerContainer","textAlign","right","bottom","styleBackground","background","opacity","React","className","style","AttendanceTracker","constructor","args","_defineProperty","async","apiBaseUrl","summitId","sourceId","sourceName","props","location","getLocation","accessToken","getAccessToken","http","send","access_token","type","source_id","end","console","log","e","navigator","sendBeacon","window","encodeURIComponent","href","componentDidMount","trackEnter","onBeforeUnload","addEventListener","componentWillUnmount","trackLeave","removeEventListener","render","propTypes","PropTypes","isRequired","defaultProps","ScheduleAdminsBulkActionsSelector","onPerformBulkAction","selectedBulkAction","actionTypeSelect","value","onSelectedBulkAction","onSelectAll","bulkOptions","onClick","ref","select","T","map","option","idx","key","label","bind","title","CircleButton","event","isScheduled","nowUtc","addToSchedule","removeFromSchedule","enterClick","alwaysShowEnter","isLiveNow","isLive","hasEnded","end_date","start_date","buttonClass","iconClass","handleClick","ev","action","preventDefault","stopPropagation","Provider","useValue","useClock","useSelector","useClockSelector","createExternalStore","ClockProvider","timezone","now","initialValue","emit","Clock","onTick","super","response","localBefore","localAfter","moment","unix","timestamp","_isMounted","setState","timeServiceUrl","getTimeServiceUrl","fetch","then","status","json","Promise","reject","catch","err","state","fragmentParser","FragmentParser","interval","manualSet","onVisibilityChange","nowQS","getParam","momentQS","isValid","valueOf","getServerTime","processServerTimeResponse","processServerTimeResponseError","setInterval","tick","document","visibilityState","clearInterval","marginTop","format","Exclusive","showField","name","exclusiveSections","EXCLUSIVE_SECTIONS","includes","require","QuestionType_Checkbox","QuestionType_RadioButton","InputAdapter","_ref","input","meta","question","isDisabled","rest","_objectWithoutProperties","_excluded","Input","_extends","containerClassName","toSlug","ariaLabelledBy","id","disabled","required","onChange","placeholder","RadioButtonListAdapter","_ref2","_excluded2","RadioList","overrideCSS","DropdownAdapter","_ref3","_excluded3","Dropdown","classNamePrefix","CheckBoxListAdapter","_ref4","maxValues","_excluded4","CheckboxList","question_answers","target","length","getValidator","undefined","ExtraQuestionsForm","extraQuestions","userAnswers","onAnswerChanges","questionContainerClassName","questionLabelContainerClassName","questionControlContainerClassName","readOnly","debug","buttonText","RequiredErrorMessage","ValidationErrorClassName","allowExtraQuestionsEdit","onError","shouldScroll2FirstError","submit","questionRefs","useRef","formRef","answers","setAnswers","useState","useEffect","formatUserAnswers","useImperativeHandle","doSubmit","_formRef$current","current","dispatchEvent","Event","cancelable","bubbles","scroll2QuestionById","questionId","scrollToQuestion","getQuestionRef","qs","QuestionsSet","formatAnswers","Condition","when","rule","Field","subscription","checkVisibility","checkRule","Error","error","touched","submitFailed","values","answer_values","Array","isArray","res","answer_values_operator","forEach","v","parseInt","toString","ruleResult","visibility","visibility_condition","sub_question","getLabel","q","_q$label","nonBreakingSpace","String","fromCharCode","replace","questions2Exclude","labelText","mandatory","dangerouslySetInnerHTML","__html","htmlFor","renderQuestion","questionValues","isAnswered","slug","hasOwnProperty","answer","_q$sub_question_rules","_q$sub_question_rules2","_q$sub_question_rules3","_q$sub_question_rules4","Fragment","validate","component","sub_question_rules","r","_q$sub_question_rules5","options","val","_q$sub_question_rules6","_q$sub_question_rules7","max_selected_values","validateQuestion","errors","_q$sub_question_rules8","isVisible","Object","keys","getErrorFields","invalidFormFields","errorFields","_q$sub_question_rules9","push","getFirstError","sort","a","b","order","focus","scrollIntoView","behavior","block","Form","onSubmit","initialValues","handleSubmit","form","submitting","pristine","getRegisteredFields","filter","field","getFieldState","invalid","firstError","scrollToFirstError","JSON","stringify","RsvpForm","questions","question_id","handleChange","hasErrors","find","class_name","RawHTML","simple","is_country_selector","isMulti","is_multiselect","empty_string","is_mandatory","SimpleForm","entity","_objectSpread","componentDidUpdate","prevProps","prevState","snapshot","scrollToError","shallowEqual","isEmpty","checked","createField","fields","f","originalHash","hash","convertToHash","strHash","params","substr","toLowerCase","split","param","trim","clearParams","getParams","deleteParam","deleteParams","setParam","serialize","FreeTextSearch","onSearchClick","onClearClick","onKeyPressed","preventEvents","doFiltering","term","onSearch","keyCode","which","onKeyPress","AccessLevelsInput","getAccessLevels","getOptionValue","getOptionLabel","accessLevel","callback","defaultOptions","resolve","queryAccessLevels","_this$props","multi","has_error","AsyncSelect","loadOptions","m","ActionDropdown","actionLabel","smallDdl","smallBtn","theValue","opt","Select","isClearable","queryFunction","queryFn","queryAttendees","_value","_setValue","getAttendees","attendee","_getOptionValue","first_name","last_name","_getOptionLabel","otherValue","op","otherChecked","handleOtherCBChange","optionValues","theVal","isNaN","inline","allowOther","paddingLeft","marginLeft","float","CompanyInput","handleNew","getCompanies","onCreate","newValue","extraOptions","queryCompanies","newOptions","c","allowCreate","AsyncComponent","AsyncCreatableSelect","onCreateOption","CountryDropdown","setOptions","abortController","AbortController","getCountryList","signal","abort","countryList","iso_code","CountryInput","DateTimePicker","isValidDate","date","currentDate","selectedDate","validation","after","before","isBefore","isSameOrBefore","isAfter","isSameOrAfter","afterDate","subtract","beforeDate","inputProps","inputDisabled","Datetime","dateFormat","timeFormat","time","autoComplete","selection","clearable","selectClassName","selectStyles","menu","formatOptionLabel","data","Icon","filetype","Dropzone","DropzoneJS","dropzoneRef","files","onUploadComplete","activeXHRs","Map","chunkQueue","chunksInFlight","processChunkQueue","maxConcurrent","maxConcurrentChunks","dataBlocks","shift","_originalUploadData","setupChunkThrottle","dropzone","_uploadData","chunkIndex","onChunkComplete","Math","max","pollUploadStatus","fileId","baseUrl","file","_pollingActive","statusUrl","attempts","_pollInterval","message","headers","_chunksUploadedDone","getDjsConfig","defaults","url","config","postUrl","djsConfig","extend","accept","done","md5","getMD5","fileSize","startsWith","AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR","initLogOut","maxFiles","uploadCount","chunksUploaded","_asyncProcessing","autoDiscover","eventHandlers","drop","info","dropzoneNode","setupEvents","xhrs","xhr","readyState","XMLHttpRequest","DONE","clear","getActiveFiles","cancelUpload","destroy","djsConfigObj","postUrlConfigObj","queueDestroy","icons","showFiletypeIcon","iconFiletypes","i","eventHandler","prototype","call","on","get","delete","fileInFiles","splice","progress","bytesSent","effectiveBytes","_completedBytes","min","previewElement","elem","querySelectorAll","formData","setRequestHeader","append","has","set","_this","dropzoneOnLoad","onload","_this$dropzone","_this$dropzone$option","index","indexOf","chunkSize","uploadResponse","parse","responseText","ex","file_id","dropzoneOnError","onerror","off","TextEditor","_this$RichTextEditor","RichTextEditor","getTextAlignClassName","getTextAlignStyles","default","editorValue","createEmptyValue","currentValue","getDerivedStateFromProps","newEditorValue","setContentFromString","getTextAlignBlockMetadata","customBlockFn","oldEditorValue","getEditorState","getCurrentContent","stringValue","blockStyleFn","maxLength","charCountLeft","EventInput","getEvents","summit","onlyPublished","queryEvents","FreeMultiTextInput","inputValue","handleInputChange","handleKeyDown","limit","CreatableSelect","components","DropdownIndicator","menuContainerStyle","onInputChange","onInputKeyDown","GroupInput","getGroups","queryGroups","OptionGroup","GroupedDropdown","LanguageInput","shouldUseId","getLanguageList","languageList","l","MemberInput","getMembers","member","queryMembers","OperatorInput","customStyle","operatorValue","setOperatorValue","setInputValue","inputValueBetween","setInputValueBetween","ddlStyles","setDDLStyles","control","provided","hasError","setHasError","evt","onlyDigits","operator","justifyContent","alignItems","eventValue","OrganizationInput","getOrganizations","queryOrganizations","org","PromocodeInput","perPage","extraFilters","code","getPromocodes","queryPromocodes","DEFAULT_PAGE_SIZE","description","NullValue","RegistrationCompanyInput","tabSelectsValue","createLabel","options2Show","classNamPrefix","_","isNullValue","inputId","queryRegistrationCompanies","newOption","formatCreateLabel","SpeakerInput","getSpeakers","speakerId","history","querySpeakers","speaker","MultiValueLabel","s","querySponsors","_option$sponsorship","_option$sponsorship$t","company","sponsorship","getSponsors","SponsoredProjectInput","getSponsoredProjects","querySponsoredProjects","currentOptionKey","findIndex","valueLabel","onClickMinus","onClickPlus","SummitDaysSelect","days","onDayChanged","selectedOption","SummitInput","getSummits","querySummits","venues","onVenueChanged","parsedValue","optionRenderer","TagInput","tagValue","t","tag","getTags","nextValue","newTag","queryTags","orderedTags","__isNew__","container_class_name","node","defaultValue","TextArea","_ev$target","_ev$target$value","isBackSpace","TicketTypesInput","getTicketTypes","ticketType","version","optionsLimit","filters","audience","queryTicketTypes","UploadInputV2","_mediaType$type","mediaType","allowed_extensions","ext","join","max_size","onRemove","canAdd","timeOut","parallelChunkUploads","getAllowedExtensions","getMaxSize","allowedExt","getDefaultAllowedExtensions","maxSize","getDefaultMaxSize","canUpload","removedfile","djsConfigSet","paramName","maxFilesize","timeout","chunking","retryChunks","addRemoveLinks","acceptedFiles","componentConfig","media_type","media_upload","canDelete","getDropzone","src","private_url","public_url","filename","previewSrc","pop","path","substring","ProgressiveImg","alt","placeholderSrc","file_icon","DropzoneV3","onAddedFile","onUploadProgress","onFileRemoved","onFileCompleted","onFileError","onDropzoneReady","combinedEventHandlers","init","dz","addedfile","uploadprogress","success","UploadInputV3","helpText","dropzoneInstanceRef","uploadingFiles","setUploadingFiles","errorFiles","setErrorFiles","useCallback","useMemo","showDropzone","dictDefaultMessage","formatFileSize","bytes","round","formatExtensionsDisplay","exts","toUpperCase","Boolean","slice","handleRemove","handleDropzoneReady","handleAddedFile","prev","complete","handleUploadProgress","handleFileRemoved","handleFileCompleted","some","handleFileError","handleDismissError","_dropzoneInstanceRef$","dzFile","removeFile","handleDeleteUploading","_dropzoneInstanceRef$2","wrappedOnUploadComplete","dzId","dzData","extDisplay","fileRowSx","py","mb","Box","Typography","variant","fontWeight","gutterBottom","sx","renderDropzone","UploadFileIcon","Alert","severity","borderRadius","mt","mr","minWidth","flex","overflow","textOverflow","whiteSpace","LinearProgress","gap","IconButton","DeleteIcon","CheckCircleIcon","ErrorOutlineIcon","CloseIcon","handleUpload","handleError","showRemove","setShowRemove","logoPreview","setLogoPreview","preview","logoPreviewTmp","fileName","getPreviewIcon","test","fileHasPreview","pdf_icon","mov_icon","mp4_icon","csv_icon","onDrop","fileRejections","onMouseEnter","showVeil","onMouseLeave","hideVeil","isCancelled","imgSrc","setImgSrc","customClass","setCustomClass","img","Image","replaceNewLine","DraggableItemTypes","UNSCHEDULEEVENT","SCHEDULEEVENT","TBALocation","SlotSizeOptions","PixelsPerMinute","ScheduleEvent","step","initialTop","initialHeight","minHeight","maxHeight","canResize","allowResize","allowDrag","onResized","onUnPublishEvent","onEditEvent","onClickSelected","selectedPublishedEvents","onMoveEvent","collected","drag","useDrag","item","is_published","duration","collect","monitor","isDragging","canDrag","static","resizeInfo","setResizeInfo","resizing","lastYPos","setSize","isSelected","canEdit","isResizable","popoverHoverFocus","Popover","onMouseMove","newYPos","pageY","deltaY","steps","abs","sign","newHeight","newTop","maxHeightTmp","onMouseUp","onMouseDown","getAttribute","box","getBoundingClientRect","clientY","eventTitleBlock","OverlayTrigger","trigger","placement","overlay","TimeSlot","timeLabel","TimeSlotContainer","currentDay","currentSummit","events","timeSlot","pixelsPerMinute","canDropEvent","onDroppedEvent","divId","collectedProps","useDrop","isOver","canDrop","SummitEvent","canMove","placeHolderStyle","renderMinutesContainer","minutesContainers","container_height","listRef","prevIntervalRef","timeSlotsList","setTimeSlotsList","newScrollTop","setNewScrollTop","scheduleEventContainer","scrollTop","slotChangeRatio","createSlots","startTime","endTime","onScheduleEvent","eventId","getBoundingBox","filteredEvents","minutes","floor","startDateTime","time_zone","add","endDateTime","auxEvent","auxEventStartDateTime","tz","auxEventEndDateTime","getMaxHeight","ReactDOM","calculateInitialTop","eventStartDateTime","utc","dayStartDateTime","diff","calculateInitialHeight","tmpList","startTimeTZ","endTimeTZ","slot","clone","last_edited","StyleSheet","create","header","headlineWrapper","flexDirection","headline","logo","marginRight","subtitle","padding","textTransform","eventList","eventWrapper","border","locationWrapper","marginBottom","footer","leftCol","maxWidth","speakers","trackWrapper","rightCol","tagsWrapper","flexWrap","SchedulePrintView","imgData","setImgData","sortedEvents","venue","locations","summitStart","epochToMomentTimeZone","time_zone_id","summitEnd","_imgData","convertSVGtoImg","getPngLogo","Document","Page","View","Text","_event$track","_event$speakers","_event$tags","eventDate","eventStartTime","eventEndTime","venueCount","loc","locationStr","getEventLocation","start_showing_venues_date","eventColorStyle","eventColor","borderLeft","wrap","track","moderator","speakerTags","getEventHosts","sp","tags","SchedulePrintButton","downloadPdf","setDownloadPdf","PDFDownloadLink","blob","loading","trackSpaceTime","scheduleEvents","selectedEvents","currentVenue","slotSize","hideBulkSelect","getDaysOptions","currentLocation","_trackSpaceTime$find","_trackSpaceTime$find$","summitLocalStartDate","summitLocalEndDate","currentAuxDay","allowedDays","location_id","allowed_timeframes","at","day","getVenuesOptions","allowedLocationIds","st","isNotVenue","isAllowed","rooms","subOption","slotSizeOptions","open","close","getTimeframe","summitTZ","_trackSpaceTime$find2","allowedTimeFrame","tf","parseLocationHour","opening_hour","closing_hour","onSlotSizeChange","showPrint","SteppedSelect","SummitVenuesSelect","BulkActionsSelector","customBulkOptions","ScheduleEventList","onMoveSingleEvent","Panel","theId","theClass","AUTH_ERROR_MISSING_AUTH_INFO","AUTH_ERROR_MISSING_REFRESH_TOKEN","AUTH_ERROR_ACCESS_TOKEN_EXPIRED","AUTH_ERROR_LOCK_ACQUIRE_ERROR","AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR","Lock","SuperTokensLock","GET_TOKEN_SILENTLY_LOCK_KEY","RESPONSE_TYPE_CODE","AUTH_INFO","ID_TOKEN","createNonce","len","possible","nonce","charAt","random","processRefreshToken","flow","refreshToken","useOAuth2RefreshToken","clearAuthInfo","fn","maxRetries","baseDelayMs","attempt","delay","pow","setTimeout","retryWithBackoff","refreshAccessToken","expires_in","refresh_token","id_token","storeAuthInfo","_getAccessToken","authInfo","getAuthInfo","expiresIn","accessTokenUpdatedAt","getOAuth2Flow","timeElapsedSecs","ACCESS_TOKEN_RESOLVER_KEY","Symbol","for","resolveAccessToken","globalThis","locks","request","lock","retryPromise","acquireLock","releaseLock","getOAuth2IDPBaseUrl","oauth2ClientId","getOAuth2ClientId","payload","encodeURI","controller","timeoutId","method","body","networkError","clearTimeout","ok","statusText","setSessionClearingState","parseError","new_refresh_token","idToken","formerAuthInfo","Date","Cookies","secure","sameSite","putOnLocalStorage","getFromLocalStorage","removeFromLocalStorage","getIdToken","OAUTH2_CLIENT_ID","OAUTH2_FLOW","OAUTH2_USE_REFRESH_TOKEN","IDP_BASE_URL","getCurrentLocation","getLogoutUrl","URI","postLogOutUri","getOrigin","queryParams","id_token_hint","query","SimpleLinkList","getOptions","handleLink","filterOption","getNewOptionData","isValidNewOption","actions","search","optionLabel","selectValue","selectOptions","labelKey","optionFound","onCreateTag","candidate","allowDuplicates","columns","disabledAdd","valueKey","tableOptions","edit","custom","itemA","sortCol","itemB","Table","SummitDropdown","summitValue","summits","actionClass","summitOptions","bigClass","EditableTableHeading","is_edit","shouldUseTextArea","EditableActionsTableCell","is_editing","onDelete","onSave","save","onEdit","onCancel","cancel","EditableTableRow","even","role","EditableTable","_props$options$action","_props$options$action2","rows","new_row","editRow","saveRow","deleteClick","onChangeCell","editRowCancel","saveNewRow","handleNewChange","onChangeNewCell","row","editing_row","_this$props$options$a","_this$props$options$a2","Swal","text","showCancelButton","confirmButtonColor","confirmButtonText","result","rowIdx","tableClass","textArea","col","colWidth","warn","createRow","cells","EditableTableCell","columnKey","createNewRow","addNew","cell_value","Tooltip","delayShow","SelectableTableHeading","handleSort","getSortClass","sortable","sortDir","onSort","columnIndex","sortFunc","SelectableTableRow","handleEdit","handleSelect","shouldDisplayAction","onSelected","rowClass","SelectableActionsTableCell","handleAction","tooltip","icon","getSortDir","SelectableTable","_options$actions","_options$actions2","_options$actions2$edi","disableSelectAll","onSelectedAll","selectedAll","actionsHeader","SelectableTableCell","SortableTableHeading","SortableActionsTableCell","SortableTableRow","moveCard","dropItem","findRow","originalIndex","refRow","handlerId","getHandlerId","hover","_refRow$current","dragIndex","hoverIndex","hoverBoundingRect","hoverMiddleY","hoverClientY","getClientOffset","y","_item","droppedId","didDrop","SortableTable","dropCallback","orderField","idField","_options$actions2$sav","_options$actions3","_options$actions3$sav","setRows","newRow","setNewRow","renderRow","moveRow","onDropItem","TableCell","sortRows","rows2Sort","x","prevRows","update","$splice","newOrder","sortedRows","shouldRenderNewRow","DndProvider","backend","HTML5Backend","renderNewRow","_options$actions$save","newRowTmp","TableHeading","TableRow","ActionsTableCell","colStyles","YoutubeVideoComponent","videoSrcURL","videoTitle","frameBorder","allow","allowFullScreen","LiveVideoPlayer","player","videojs","videoNode","dispose","VideoStream","layout","checkLiveVideo","isLiveVideo","match","videoJsOptions","autoplay","controls","fluid","sources","_event","_summit","getId","isPublished","getMinutesDuration","siblings","calculateNewDates","isValidEndDate","endDate","_endDate","summitEndDate","startDate","isValidStartDate","_startDate","durationInMinutes","summitStartDate","isValidTitle","createAction","fetchErrorHandler","msg","fetchResponseHandler","escapeFilterValue","crypto","msCrypto","spark","SparkMD5","fileReader","FileReader","readNextChunk","readAsArrayBuffer","strictEqual","Context","createContext","useStoreContext","context","useContext","valueRef","listenersRef","Set","subscribe","getSnapshot","listener","contextValue","reactUseMemo","useSyncExternalStore","compute","isEqual","useSyncExternalStoreWithSelector","atime","hour","parsedHour","origin","buildAPIBaseUrl","relativeUrl","API_BASE_URL","localStorage","setItem","removeIt","getItem","removeItem","clearing_session_state","getCurrentUserLanguage","language","languages","userLanguage","firstNode","getElementById","scrollTo","obj","curtop","offsetParent","offsetTop","findElementPos","object1","object2","keys1","keys2","cb","maxNumberOfRetries","TIMEINTERVALSINCE1970_API_URL","process","env","summitVenueCount","summitShowLocDate","_location$venue","_location$floor","shouldShowVenues","locationName","hosts","createElement","crossOrigin","loadImage","svgUrl","newWidth","naturalHeight","naturalWidth","canvas","getContext","drawImage","toDataURL","callDelay","_fetchPublic","endpoint","_fetch","addQuery","debounce","per_page","excludedIds","eventTypeClassName","ComboBoxQuestionType","CheckBoxListQuestionType","RadioButtonListQuestionType","AllowedMultipleValueQuestionType","AnswerValuesOperator_And","VisibilityCondition_Equal","questionByName","questionById","rules","_parseQuestion","av","Number","isInteger","initialCondition","parentQuestionAnswer","_getAnswerFor","parent_question_id","answerValue","_answerContains","class","_hasValue","_allowsValues","_allowsValue","ruleId","parent_rules","_isSubQuestionVisible","_isAnswered","_checkQuestion","_this$originalAnswers","_question$values","userAnswer","originalAnswers","defaultVal","is_default","ansVal","res1","_formatQuestionAnswer","_parseQuestions","webpackContext","req","webpackContextResolve","__webpack_require__","o","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","defineProperty","enumerable","prop","toStringTag"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/access-levels-input.js b/lib/components/inputs/access-levels-input.js
new file mode 100644
index 00000000..75688f50
--- /dev/null
+++ b/lib/components/inputs/access-levels-input.js
@@ -0,0 +1,2 @@
+!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={5097:(e,r,t)=>{t(1116),t(6842),t(9087),t(9558),t(2183)},3195:(e,r,t)=>{t.d(r,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>n,AUTH_ERROR_MISSING_AUTH_INFO:()=>a,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>s,AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR:()=>d,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>i});const a="AUTH_ERROR_MISSING_AUTH_INFO",s="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",n="AUTH_ERROR_LOCK_ACQUIRE_ERROR",i="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR",d="AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR"},2183:(e,r,t)=>{t.d(r,{getAccessToken:()=>f});var a=t(9558),s=t(5812),o=t.n(s);t(806);const n=require("browser-tabs-lock");var i=t.n(n);const d=require("js-cookie");var l=t.n(d),u=(t(8041),t(9891),t(5097),t(8853),t(3195));const Lock=new(i()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",p="code",c="authInfo",y="idToken",_=async(e,r)=>{if(e===p&&w()){if(!r)throw O(),Error(u.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await(async(e,r=5,t=1e3)=>{for(let a=0;asetTimeout(e,s)))}})((()=>g(r))),{access_token:t,expires_in:a,refresh_token:s,id_token:o}=e;return void 0===s&&(s=null),E(t,a,s,o),t}throw O(),Error(u.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)},R=async()=>{console.log("openstack-uicore-foundation::Security::methods::_getAccessToken");let e=h();if(!e)throw console.log("openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO"),Error(u.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:r,expiresIn:t,accessTokenUpdatedAt:a,refreshToken:s}=e,n=T();const i=o()().unix();let d=i-a;return t-=60,console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${i} accessTokenUpdatedAt ${a} expiresIn ${t} timeElapsedSecs ${d}`),(d>=t||null==r)&&(console.log("openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ..."),r=await _(n,s)),r},m=Symbol.for("openstack-uicore-foundation.accessTokenResolver"),f=async()=>{const e=globalThis[m];if(e)return e();if("undefined"!=typeof navigator&&navigator.locks)return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY,(async e=>(console.log("openstack-uicore-foundation::Security::methods::getAccessToken web lock api",e),await R())));if(!await(0,a.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))throw Error(u.AUTH_ERROR_LOCK_ACQUIRE_ERROR);try{return await R()}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}},g=async e=>{let r=S(),t=Q();const s={grant_type:"refresh_token",client_id:encodeURI(t),refresh_token:e},o=new AbortController,n=setTimeout((()=>o.abort()),1e4);let i,d;try{i=await fetch(`${r}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(s),signal:o.signal})}catch(e){throw console.log("refreshAccessToken network error:",e.message),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${e.message}`)}finally{clearTimeout(n)}if(!i.ok){if(console.log(`refreshAccessToken server error: ${i.status} - ${i.statusText}`),i.status>=500||408===i.status||429===i.status)throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${i.status} - ${i.statusText}`);throw(0,a.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${i.status} - ${i.statusText}`)}try{d=await i.json()}catch(e){throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`)}let{access_token:l,refresh_token:p,expires_in:c,id_token:y}=d;if(!l)throw(0,a.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);return{access_token:l,refresh_token:p,expires_in:c,id_token:y}},E=(e,r,t=null,s=null)=>{let o=h(),n={accessToken:e,expiresIn:r,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null==t&&o&&(t=o.refreshToken),null==s&&o&&(s=o.idToken),t&&(n.refreshToken=t),s?(n[y]=s,l().set(y,s,{secure:!0,sameSite:"Lax"})):l().remove(y),(0,a.putOnLocalStorage)(c,JSON.stringify(n))},h=()=>{try{let e=(0,a.getFromLocalStorage)(c,!1);return e?JSON.parse(e):null}catch(e){return null}},O=()=>{"undefined"!=typeof window&&((0,a.removeFromLocalStorage)(c),l().remove(y))},Q=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,T=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),S=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},9087:(e,r,t)=>{t.d(r,{escapeFilterValue:()=>c,fetchErrorHandler:()=>u,fetchResponseHandler:()=>p});t(2462),t(806);var a=t(8041),s=t.n(a),o=t(9236),n=t.n(o),i=t(6842),d=t.n(i);t(9558),t(5097),t(2183);s().escapeQuerySpace=!1;const l=e=>r=>({type:e,payload:r}),u=(l("RESET_LOADING"),l("START_LOADING"),l("STOP_LOADING"),e=>{let r=e.status,t=e.statusText;switch(r){case 403:n().fire("ERROR",d().translate("errors.user_not_authz"),"warning");break;case 401:n().fire("ERROR",d().translate("errors.session_expired"),"error");break;case 412:n().fire("ERROR",t,"warning");case 500:n().fire("ERROR",d().translate("errors.server_error"),"error")}}),p=e=>{if(e.ok)return e.json();throw e},c=e=>e=(e=(e=(e=(e=String(e)).replace(/\\/g,"\\\\")).replace(/,/g,"\\,")).replace(/;/g,"\\;")).replace(/\+/g,"%2B")},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,r,t)=>{t.d(r,{buildAPIBaseUrl:()=>a,getFromLocalStorage:()=>o,putOnLocalStorage:()=>s,removeFromLocalStorage:()=>n,retryPromise:()=>d,setSessionClearingState:()=>i});t(5812),t(8041);const a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,s=(e,r)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,r)},o=(e,r)=>{if("undefined"!=typeof window){let t=window.localStorage.getItem(e);return r&&(console.log(`getFromLocalStorage removing key ${e}`),n(e)),t}return null},n=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},d=async(e,r=3)=>{for(let t=0;t{t.d(r,{queryAccessLevels:()=>y});var a=t(9087),s=t(2183),o=t(9558);const n=require("lodash/debounce");var i=t.n(n),d=t(8041),l=t.n(d);const u=500;l().escapeQuerySpace=!1;const p=async(e,r,t={})=>fetch((0,o.buildAPIBaseUrl)(e.toString()),t).then(a.fetchResponseHandler).then((e=>{"function"==typeof r&&r(e.data)})).catch((e=>(404===(e&&e.status)&&"function"==typeof r&&r([]),e))).catch(a.fetchErrorHandler),c=async(e,r,t={})=>{let a;try{a=await(0,s.getAccessToken)()}catch(e){return void("function"==typeof r&&r(e))}return e.addQuery("access_token",a),p(e,r,t)},y=(i()((async(e,r,t=10)=>{let s=l()("/api/v1/members");s.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),s.addQuery("order","first_name,last_name"),s.addQuery("page",1),s.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),s.addQuery("filter[]",`full_name@@${e},first_name@@${e},last_name@@${e},email@@${e}`)),c(s,r)}),u),i()((async(e,r,t,s=10)=>{let o=l()(`/api/v1/summits/${e}/attendees`);o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",s),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`full_name=@${r},email=@${r}`)),c(o,t)}),u),i()((async(e,r,t=10)=>{let s=l()("/api/v1/summits/all");s.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),s.addQuery("filter[]",`name@@${e}`)),c(s,r)}),u),i()((async(e,r,t,s=10)=>{let o=l()("/api/v1/"+(e?`summits/${e}/speakers`:"speakers"));o.addQuery("expand","member,registration_request"),o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",s),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`full_name@@${r},first_name@@${r},last_name@@${r},email@@${r}`)),c(o,t)}),u),i()((async(e,r,t,s=50)=>{let o=l()("/api/v1/"+(e?`summits/${e}/track-tag-groups/all/allowed-tags`:"tags"));e&&o.addQuery("expand","tag,track_tag_group"),o.addQuery("order","tag"),o.addQuery("page",1),o.addQuery("per_page",s),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`tag@@${r}`)),c(o,t)}),u),i()((async(e,r,t,s=[],o=10)=>{let n=l()(`/api/v1/summits/${e}/tracks`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),(null==s?void 0:s.length)>0&&n.addQuery("filter[]",`not_id==${s.join("||")}`),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),c(n,t)}),u),i()((async(e,r,t,s=10)=>{let o=l()(`/api/v1/summits/${e}/track-groups`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",s),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),c(o,t)}),u),i()((async(e,r,t=!1,s,o=10)=>{let n=l()(`/api/v1/summits/${e}/events`+(t?"/published":""));n.addQuery("order","title"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`title@@${r}`)),c(n,s)}),u),i()((async(e,r,t,s=null,o=10)=>{let n=l()(`/api/v1/summits/${e}/event-types`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),s&&(s=(0,a.escapeFilterValue)(s),n.addQuery("filter[]",`class_name==${s}`)),c(n,t)}),u),i()((async(e,r,t=10)=>{let s=l()("/api/v1/groups");s.addQuery("order","title,code"),s.addQuery("page",1),s.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),s.addQuery("filter[]",`title@@${e},code@@${e}`)),c(s,r)}),u),i()((async(e,r,t=10)=>{let s=l()("/api/v1/companies");s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),s.addQuery("filter[]",`name@@${e}`)),c(s,r)}),u),i()((async(e,r,t,s=10)=>{let o=l()(`/api/v1/summits/${e}/registration-companies`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",s),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),c(o,t)}),u),i()((async(e,r,t,s=10)=>{let o=l()(`/api/v1/summits/${e}/sponsors`);o.addQuery("expand","company,sponsorship,sponsorship.type"),o.addQuery("order","id"),o.addQuery("page",1),o.addQuery("per_page",s),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`company_name@@${r}`)),c(o,t)}),u),i()((async(e,r,t,s=10)=>{let o=l()(`/api/v1/summits/${e}/sponsors`);o.addQuery("expand","company,sponsorship,sponsorship.type"),o.addQuery("fields","id,company.name,sponsorship.type.name"),o.addQuery("relations","none,company.none,sponsorship.type.none"),o.addQuery("filter[]","badge_scans_count>0"),o.addQuery("order","+company_name"),o.addQuery("page",1),o.addQuery("per_page",s),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`company_name@@${r}`)),c(o,t)}),u),i()((async(e,r,t,s=10)=>{let o=l()(`/api/v1/summits/${e}/access-level-types`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",s),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),c(o,t)}),u));i()((async(e,r,t=10)=>{let s=l()("/api/v1/organizations");s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),s.addQuery("filter[]",`name@@${e}`)),c(s,r)}),u);i()((async(e,r={},t,s="v1",o=10)=>{let n=l()(`/api/${s}/summits/${e}/ticket-types`);if(n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r.hasOwnProperty("name")){const e=(0,a.escapeFilterValue)(r.name);e&&""!=e&&n.addQuery("filter[]",`name@@${e}`)}if(r.hasOwnProperty("audience")){const e=(0,a.escapeFilterValue)(r.audience);e&&""!=e&&n.addQuery("filter[]",`audience==${e}`)}c(n,t)}),u),i()((async(e,r,t=10)=>{const s=l()("/api/v1/sponsored-projects");s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),s.addQuery("filter[]",`name@@${e}`)),c(s,r)}),u),i()((async(e,r,t,s=10,o=[])=>{let n=l()(`/api/v1/summits/${e}/promo-codes`);n.addQuery("order","code"),n.addQuery("page",1),n.addQuery("per_page",s),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`code@@${r}`));for(const e of o)n.addQuery("filter[]",e);c(n,t)}),u)},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},5812:e=>{e.exports=require("moment-timezone")},2015:e=>{e.exports=require("react")},2113:e=>{e.exports=require("react-select/lib/Async")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},r={};function t(a){var s=r[a];if(void 0!==s)return s.exports;var o=r[a]={exports:{}};return e[a](o,o.exports,t),o.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};t.r(a),t.d(a,{default:()=>_});var s=t(6031),o=t.n(s),n=t(2462),i=t.n(n),d=t(2015),l=t.n(d),u=t(2113),p=t.n(u),c=t(5301);const y=["value","error","onChange","id","multi"];class _ extends l().Component{constructor(e){super(e),this.state={value:e.value},this.handleChange=this.handleChange.bind(this),this.getAccessLevels=this.getAccessLevels.bind(this),this.getOptionValue=this.getOptionValue.bind(this),this.getOptionLabel=this.getOptionLabel.bind(this)}getOptionValue(e){return this.props.hasOwnProperty("getOptionValue")?this.props.getOptionValue(e):e.id}getOptionLabel(e){return this.props.hasOwnProperty("getOptionLabel")?this.props.getOptionLabel(e):`${e.name}`}handleChange(e){let r={target:{id:this.props.id,value:e,type:"accesslevelinput"}};this.props.onChange(r)}getAccessLevels(e,r){let{summitId:t,defaultOptions:a}=this.props;if(!e&&!a)return Promise.resolve({options:[]});(0,c.queryAccessLevels)(t,e,r)}render(){let e=this.props,{value:r,error:t,onChange:a,id:s,multi:n}=e,d=i()(e,y),u=this.props.hasOwnProperty("multi"),c=this.props.hasOwnProperty("error")&&""!=t;return l().createElement("div",null,l().createElement(p(),o()({value:r,onChange:this.handleChange,loadOptions:this.getAccessLevels,getOptionValue:e=>this.getOptionValue(e),getOptionLabel:e=>this.getOptionLabel(e),isMulti:u},d)),c&&l().createElement("p",{className:"error-label"},t))}}return a})()));
+//# sourceMappingURL=access-levels-input.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/access-levels-input.js.map b/lib/components/inputs/access-levels-input.js.map
new file mode 100644
index 00000000..b0146f9f
--- /dev/null
+++ b/lib/components/inputs/access-levels-input.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/access-levels-input.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,wVCTF,MAAMC,EAA+B,+BAC/BC,E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,EAAAK,GAC3CC,EAAW1N,KAAKqM,MAAM/B,eAAe,SACrCqD,EAAc3N,KAAKqM,MAAM/B,eAAe,UAAqB,IAAT+C,EAExD,OACIlB,IAAAA,cAAA,WACIA,IAAAA,cAACyB,IAAWC,IAAA,CACRnG,MAAOA,EACPuF,SAAUjN,KAAKwM,aACfsB,YAAa9N,KAAK0M,gBAClBC,eAAgBoB,GAAK/N,KAAK2M,eAAeoB,GACzCnB,eAAgBmB,GAAK/N,KAAK4M,eAAemB,GACzCL,QAASA,GACLH,IAEPI,GACDxB,IAAAA,cAAA,KAAG6B,UAAU,eAAeX,GAMxC,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/security/constants.js","webpack://openstack-uicore-foundation/external commonjs \"browser-tabs-lock\"","webpack://openstack-uicore-foundation/external commonjs \"js-cookie\"","webpack://openstack-uicore-foundation/./src/components/security/methods.js","webpack://openstack-uicore-foundation/./src/utils/actions.js","webpack://openstack-uicore-foundation/external commonjs \"spark-md5\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/sha256\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-base64url\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-hex\"","webpack://openstack-uicore-foundation/./src/utils/crypto.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"lodash/debounce\"","webpack://openstack-uicore-foundation/./src/utils/query-actions.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"idtoken-verifier\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-select/lib/Async\"","webpack://openstack-uicore-foundation/external commonjs \"superagent/lib/client\"","webpack://openstack-uicore-foundation/external commonjs \"sweetalert2\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/inputs/access-levels-input.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","export const AUTH_ERROR_MISSING_AUTH_INFO = 'AUTH_ERROR_MISSING_AUTH_INFO';\nexport const AUTH_ERROR_MISSING_REFRESH_TOKEN = 'AUTH_ERROR_MISSING_REFRESH_TOKEN';\nexport const AUTH_ERROR_ACCESS_TOKEN_EXPIRED = 'AUTH_ERROR_ACCESS_TOKEN_EXPIRED';\nexport const AUTH_ERROR_LOCK_ACQUIRE_ERROR = 'AUTH_ERROR_LOCK_ACQUIRE_ERROR'\nexport const AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR';\nexport const AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR';\nexport const AUTH_ERROR_ID_TOKEN_INVALID = 'AUTH_ERROR_ID_TOKEN_INVALID';\nexport const AUTH_ERROR_MISSING_OTP_PARAM = 'AUTH_ERROR_MISSING_OTP_PARAM';\nexport const AUTH_ERROR_MISSING_PKCE_PARAM = 'AUTH_ERROR_MISSING_PKCE_PARAM';\nexport const AUTH_ERROR_MISSING_NONCE_PARAM = 'AUTH_ERROR_MISSING_NONCE_PARAM';\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"browser-tabs-lock\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"js-cookie\");","import {\n base64URLEncode,\n getAuthCallback,\n getCurrentLocation,\n getFromLocalStorage,\n removeFromLocalStorage,\n getOrigin,\n putOnLocalStorage,\n retryPromise,\n setSessionClearingState,\n} from \"../../utils/methods\";\nimport moment from \"moment-timezone\";\nimport request from 'superagent/lib/client';\nimport SuperTokensLock from 'browser-tabs-lock';\nimport Cookies from 'js-cookie'\nlet http = request;\nimport URI from \"urijs\";\nimport IdTokenVerifier from \"idtoken-verifier\";\nimport {SET_LOGGED_USER} from \"./actions\";\nimport {getRandomBytes, getSHA256} from \"../../utils/crypto\";\n\nimport {\n AUTH_ERROR_ACCESS_TOKEN_EXPIRED,\n AUTH_ERROR_MISSING_AUTH_INFO,\n AUTH_ERROR_MISSING_REFRESH_TOKEN,\n AUTH_ERROR_LOCK_ACQUIRE_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR,\n AUTH_ERROR_ID_TOKEN_INVALID,\n AUTH_ERROR_MISSING_OTP_PARAM,\n AUTH_ERROR_MISSING_PKCE_PARAM,\n AUTH_ERROR_MISSING_NONCE_PARAM,\n} from \"./constants\";\n\n/**\n * @ignore\n */\nconst Lock = new SuperTokensLock();\n/**\n * @ignore\n */\nconst GET_TOKEN_SILENTLY_LOCK_KEY = 'openstackuicore.lock.getTokenSilently';\nconst GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT = 6000;\nconst NONCE_LEN = 16;\nexport const ACCESS_TOKEN_SKEW_TIME = 60;\nexport const RESPONSE_TYPE_IMPLICIT = \"token id_token\";\nexport const RESPONSE_TYPE_CODE = 'code';\nconst AUTH_INFO = 'authInfo';\nconst NONCE = 'nonce';\nconst PKCE = 'pkce';\nconst ID_TOKEN = 'idToken';\nconst BACK_ULR_PARAM_NAME = 'BackUrl';\n\n\n/**\n *\n * @param backUrl\n * @param prompt\n * @param tokenIdHint\n * @param provider\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n * @param backUrlParamName\n * @returns {*}\n */\nexport const getAuthUrl = (\n backUrl = null,\n prompt = null,\n tokenIdHint = null,\n provider = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null,\n backUrlParamName = BACK_ULR_PARAM_NAME\n ) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let baseUrl = getOAuth2IDPBaseUrl();\n let scopes = getOAuth2Scopes();\n let flow = getOAuth2Flow();\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n let nonce = createNonce(NONCE_LEN);\n\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let query = {\n \"response_type\": encodeURI(flow),\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"response_mode\": 'fragment',\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n if (flow === RESPONSE_TYPE_CODE) {\n const pkce = createPKCECodes()\n putOnLocalStorage(PKCE, JSON.stringify(pkce));\n query['code_challenge'] = pkce.codeChallenge;\n query['code_challenge_method'] = 'S256';\n query['approval_prompt'] = 'force';\n }\n\n if (prompt) {\n query['prompt'] = prompt;\n }\n\n if (scopes && scopes.includes('offline_access')) {\n // then we need to force prompt=consent bc we are requesting an offline access\n // and we need to let the user know\n query['prompt'] = 'consent';\n }\n\n if (tokenIdHint) {\n query['id_token_hint'] = tokenIdHint;\n }\n\n if (provider) {\n query['provider'] = provider;\n }\n\n if (otpLoginHint) {\n query['otp_login_hint'] = otpLoginHint;\n }\n\n if (loginHint) {\n query['login_hint'] = encodeURI(loginHint);\n }\n\n if (tenant) {\n query['tenant'] = tenant;\n }\n\n url = url.query(query);\n //console.log(`getAuthUrl ${url.toString()}`);\n return url;\n}\n\n/**\n * @param idToken\n * @returns {*}\n */\nexport const getLogoutUrl = (idToken = null) => {\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let url = URI(`${baseUrl}/oauth2/end-session`);\n let state = createNonce(NONCE_LEN);\n let postLogOutUri = `${getOrigin()}/auth/logout`;\n // store nonce to check it later\n putOnLocalStorage('post_logout_state', state);\n /**\n * post_logout_redirect_uri should be listed on oauth2 client settings\n * on IDP\n * \"Security Settings\" Tab -> Logout Options -> Post Logout Uris\n */\n const queryParams = {\n \"post_logout_redirect_uri\": encodeURI(postLogOutUri),\n \"client_id\": encodeURI(oauth2ClientId),\n \"state\": state,\n }\n\n if (idToken)\n queryParams.id_token_hint = idToken;\n\n return url.query(queryParams);\n}\n\nconst createNonce = (len) => {\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let nonce = '';\n for (let i = 0; i < len; i++) {\n nonce += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return nonce;\n}\n\n/**\n *\n * @param backUrl\n * @param provider\n * @param prompt\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n */\nexport const doLogin = (\n backUrl = null,\n provider = null,\n prompt = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null\n) => {\n let url = getAuthUrl(backUrl, prompt, null, provider, loginHint, otpLoginHint, tenant);\n let location = getCurrentLocation()\n location.replace(url.toString());\n}\n\n/**\n *\n * @param backUrl\n * @param loginHint\n * @param otpLoginHint\n */\nexport const doLoginBasicLogin = (backUrl = null, loginHint = null, otpLoginHint = null) => {\n doLogin(backUrl, null, null, loginHint, otpLoginHint);\n}\n\nconst createPKCECodes = () => {\n const codeVerifier = base64URLEncode(getRandomBytes(64))\n const codeChallenge = getSHA256(codeVerifier, 'Base64url')\n const createdAt = new Date()\n const codePair = {\n codeVerifier,\n codeChallenge,\n createdAt\n }\n return codePair\n}\n\n/**\n\n * @param code\n * @param backUrl\n * @param backUrlParamName\n * @returns {Promise<{access_token: *, refresh_token: *, id_token: *, expires_in: *, error: *, error_description: *}>}\n */\nexport const emitAccessToken = async (code, backUrl = null, backUrlParamName = BACK_ULR_PARAM_NAME) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let pkce = JSON.parse(getFromLocalStorage(PKCE, true));\n\n if (!pkce)\n throw Error(AUTH_ERROR_MISSING_PKCE_PARAM);\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n const payload = {\n 'code': code,\n 'grant_type': 'authorization_code',\n 'code_verifier': pkce.codeVerifier,\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n try {\n //const response = await http.post(`${baseUrl}/oauth2/token`, payload);\n //const {body: {access_token, refresh_token, id_token, expires_in}} = response;\n const response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }).catch(function (error) {\n console.log('Request failed:', error.message);\n });\n const json = await response.json();\n let {access_token, refresh_token, id_token, expires_in, error, error_description} = json;\n return {access_token, refresh_token, id_token, expires_in, error, error_description}\n } catch (err) {\n console.log(err);\n }\n};\n\nexport const MAX_RETRIES = 5;\nexport const BACKOFF_BASE_MS = 1000;\nexport const REFRESH_TOKEN_FETCH_TIMEOUT_MS = 10000;\n\nexport const retryWithBackoff = async (fn, maxRetries = MAX_RETRIES, baseDelayMs = BACKOFF_BASE_MS) => {\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n return await fn();\n } catch (err) {\n // only retry transient network/server errors — everything else fails fast\n const isRetryable = err.message && err.message.startsWith(AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR);\n if (!isRetryable || attempt === maxRetries - 1) {\n throw err;\n }\n const delay = baseDelayMs * Math.pow(2, attempt);\n console.log(`retryWithBackoff retry ${attempt + 1}/${maxRetries} in ${delay}ms`);\n await new Promise(resolve => setTimeout(resolve, delay));\n }\n }\n};\n\nconst processRefreshToken = async (flow, refreshToken) => {\n\n if (flow === RESPONSE_TYPE_CODE && useOAuth2RefreshToken()) {\n if (!refreshToken) {\n clearAuthInfo();\n throw Error(AUTH_ERROR_MISSING_REFRESH_TOKEN);\n }\n\n let response = await retryWithBackoff(() => refreshAccessToken(refreshToken));\n let {access_token, expires_in, refresh_token, id_token} = response;\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n return access_token;\n }\n clearAuthInfo();\n throw Error(AUTH_ERROR_ACCESS_TOKEN_EXPIRED);\n}\n\n/**\n * @returns {Promise<*>}\n * @private\n */\nconst _getAccessToken = async () => {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken`);\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n let flow = getOAuth2Flow();\n // check lifetime\n const now = moment().unix();\n let timeElapsedSecs = (now - accessTokenUpdatedAt);\n\n expiresIn = (expiresIn - ACCESS_TOKEN_SKEW_TIME);\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${now} accessTokenUpdatedAt ${accessTokenUpdatedAt} expiresIn ${expiresIn} timeElapsedSecs ${timeElapsedSecs}`)\n if (timeElapsedSecs >= expiresIn || accessToken == null) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ...`);\n accessToken = await processRefreshToken(flow, refreshToken);\n }\n return accessToken;\n}\n\n/**\n * Optional resolver for getAccessToken, set via setAccessTokenResolver. When\n * present, getAccessToken delegates to it; otherwise the built-in flow runs.\n * Pass a non-function (or nothing) to reset to the built-in.\n *\n * The slot lives on globalThis under a Symbol.for key so every copy of this\n * module shares it: bundles that inlined methods.js, nested installs of the\n * package, and symlinked dev installs all read the same registry entry.\n */\nconst ACCESS_TOKEN_RESOLVER_KEY = Symbol.for('openstack-uicore-foundation.accessTokenResolver');\n\nexport const setAccessTokenResolver = (resolver) => {\n globalThis[ACCESS_TOKEN_RESOLVER_KEY] = typeof resolver === 'function' ? resolver : null;\n};\n\n/**\n * @returns {Promise<*|undefined>}\n */\nexport const getAccessToken = async () => {\n const resolveAccessToken = globalThis[ACCESS_TOKEN_RESOLVER_KEY];\n if (resolveAccessToken) return resolveAccessToken();\n\n if (typeof navigator !== 'undefined' && navigator.locks) {\n return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::getAccessToken web lock api`, lock);\n return await _getAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n return await _getAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n/**\n * @private\n */\nconst _clearAccessToken = () => {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken`);\n\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n\n storeAuthInfo(null, 0, refreshToken)\n}\n\nexport const clearAccessToken = async () => {\n // see https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n if (typeof navigator !== 'undefined' && navigator.locks) {\n await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::clearAccessToken web lock api`, lock);\n _clearAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n _clearAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n\nexport const refreshAccessToken = async (refresh_token) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n\n const payload = {\n 'grant_type': 'refresh_token',\n \"client_id\": encodeURI(oauth2ClientId),\n \"refresh_token\": refresh_token\n };\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), REFRESH_TOKEN_FETCH_TIMEOUT_MS);\n\n let response;\n try {\n response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload),\n signal: controller.signal\n });\n } catch (networkError) {\n // fetch rejects on network failures (DNS, timeout, no connectivity, abort)\n console.log('refreshAccessToken network error:', networkError.message);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${networkError.message}`);\n } finally {\n clearTimeout(timeoutId);\n }\n\n if (!response.ok) {\n console.log(`refreshAccessToken server error: ${response.status} - ${response.statusText}`);\n if (response.status >= 500 || response.status === 408 || response.status === 429) {\n // transient error (server error, request timeout, rate limit) — should be retried\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${response.status} - ${response.statusText}`);\n }\n // token is genuinely revoked — this is a real auth error\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${response.status} - ${response.statusText}`);\n }\n\n let json;\n try {\n json = await response.json();\n } catch (parseError) {\n // IDP returned non-JSON (HTML error page, empty body, etc.) — treat as transient\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`);\n }\n let {access_token, refresh_token: new_refresh_token, expires_in, id_token} = json;\n // Defensively ensure we never propagate an undefined access token.\n if (!access_token) {\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);\n }\n return {access_token, refresh_token: new_refresh_token, expires_in, id_token}\n}\n\nexport const storeAuthInfo = (accessToken, expiresIn, refreshToken = null, idToken = null) => {\n\n let formerAuthInfo = getAuthInfo();\n\n let authInfo = {\n accessToken: accessToken,\n expiresIn: expiresIn,\n accessTokenUpdatedAt: Math.floor(Date.now() / 1000),\n };\n\n if (refreshToken == null && formerAuthInfo) {\n refreshToken = formerAuthInfo.refreshToken;\n }\n\n if (idToken == null && formerAuthInfo) {\n idToken = formerAuthInfo.idToken;\n }\n\n if (refreshToken) {\n authInfo['refreshToken'] = refreshToken;\n }\n\n if (idToken) {\n authInfo[ID_TOKEN] = idToken;\n Cookies.set(ID_TOKEN, idToken, {secure: true, sameSite: 'Lax'});\n } else {\n Cookies.remove(ID_TOKEN);\n }\n\n putOnLocalStorage(AUTH_INFO, JSON.stringify(authInfo));\n}\n\nexport const getAuthInfo = () => {\n try {\n let res = getFromLocalStorage(AUTH_INFO, false)\n if (!res) return null;\n return JSON.parse(res);\n } catch (err) {\n return null;\n }\n}\n\nexport const clearAuthInfo = () => {\n if (typeof window !== 'undefined') {\n removeFromLocalStorage(AUTH_INFO);\n Cookies.remove(ID_TOKEN);\n }\n};\n\nexport const getIdToken = () => {\n if (typeof window !== 'undefined') {\n const authInfo = getAuthInfo();\n if (authInfo) {\n return authInfo.idToken;\n }\n return null;\n }\n return null;\n};\n\nexport const getOAuth2ClientId = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_CLIENT_ID;\n }\n return null;\n};\n\nexport const getOAuth2Flow = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_FLOW || \"token id_token\";\n }\n return \"token id_token\";\n}\n\nexport const useOAuth2RefreshToken = () => {\n if (typeof window !== 'undefined') {\n return new Boolean(window.OAUTH2_USE_REFRESH_TOKEN || true);\n }\n return true;\n}\n\nexport const getOAuth2IDPBaseUrl = () => {\n if (typeof window !== 'undefined') {\n return window.IDP_BASE_URL;\n }\n return null;\n};\n\nexport const getOAuth2Scopes = () => {\n if (typeof window !== 'undefined') {\n return window.SCOPES;\n }\n return null;\n};\n\nexport const initLogOut = () => {\n let location = getCurrentLocation();\n location.replace(getLogoutUrl(getIdToken()).toString());\n}\n\nexport const validateIdToken = (idToken, issuer, audience) => {\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n let storedNonce = getFromLocalStorage(NONCE, true);\n if (!storedNonce)\n throw Error(AUTH_ERROR_MISSING_NONCE_PARAM);\n\n let jwt = verifier.decode(idToken);\n let alg = jwt.header.alg;\n let kid = jwt.header.kid;\n let aud = jwt.payload.aud;\n let iss = jwt.payload.iss;\n let exp = jwt.payload.exp;\n let nbf = jwt.payload.nbf;\n let tnonce = jwt.payload.nonce || null;\n\n return tnonce == storedNonce && aud == audience && iss == issuer;\n}\n\nexport const passwordlessStart = (params) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let nonce = createNonce(NONCE_LEN);\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let payload = {\n \"response_type\": \"otp\",\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"client_id\": encodeURI(oauth2ClientId),\n \"connection\": params.connection || \"email\",\n \"send\": params.send || \"code\",\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n if (params.hasOwnProperty('redirect_uri')) {\n payload[\"redirect_uri\"] = encodeURIComponent(params.redirect_uri);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n let json = res.body;\n return Promise.resolve({response: json});\n }).catch((err) => {\n return Promise.reject(err);\n });\n\n}\n\nexport const passwordlessLogin = (params) => (dispatch) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/token`);\n\n if (!params.hasOwnProperty(\"otp\")) {\n throw Error(AUTH_ERROR_MISSING_OTP_PARAM);\n }\n\n let payload = {\n \"grant_type\": \"passwordless\",\n \"connection\": params.connection || \"email\",\n \"scope\": encodeURI(scopes),\n \"client_id\": encodeURI(oauth2ClientId),\n \"otp\": params.otp\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n try {\n // now we got token\n let json = res.body;\n let {access_token, expires_in, refresh_token, id_token} = json;\n\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n\n if (typeof id_token === 'undefined') {\n id_token = null; // not using rotate policy\n }\n\n // verify id token\n\n if (id_token) {\n if (!validateIdToken(id_token, baseUrl, oauth2ClientId)) {\n throw Error(AUTH_ERROR_ID_TOKEN_INVALID);\n }\n }\n\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n\n if (dispatch) {\n dispatch({\n type: SET_LOGGED_USER,\n payload: {sessionState: null}\n });\n }\n\n return Promise.resolve({response: json});\n } catch (e) {\n console.log(e);\n return Promise.reject(e);\n }\n }).catch((err) => {\n return Promise.reject(err);\n });\n}\n\nexport const isIdTokenAlive = (nowEpoch = null) => () => {\n\n if (!nowEpoch) {\n nowEpoch = Math.floor(Date.now() / 1000);\n }\n\n const idToken = getIdToken();\n if (!idToken)\n throw Error('Id Token not set.');\n\n const issuer = getOAuth2IDPBaseUrl();\n const audience = getOAuth2ClientId();\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n const jwt = verifier.decode(idToken);\n const exp = jwt.payload.exp;\n\n // check life time\n return exp - (nowEpoch + ACCESS_TOKEN_SKEW_TIME) > 0;\n}\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific flanguage governing permissions and\n * limitations under the License.\n **/\n\nimport request from 'superagent/lib/client';\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\n\nlet http = request;\nimport Swal from 'sweetalert2';\nimport T from \"i18n-react/dist/i18n-react\";\nimport { isClearingSessionState, setSessionClearingState, getCurrentPathName } from './methods';\nimport { CLEAR_SESSION_STATE } from '../components/security/actions';\nimport { doLogin, initLogOut } from '../components/security/methods';\n\nexport const GENERIC_ERROR = \"Yikes. Something seems to be broken. Our web team has been notified, and we apologize for the inconvenience.\";\nexport const RESET_LOADING = 'RESET_LOADING';\nexport const START_LOADING = 'START_LOADING';\nexport const STOP_LOADING = 'STOP_LOADING';\nexport const VALIDATE = 'VALIDATE';\nexport const CLEAR_MESSAGE = 'CLEAR_MESSAGE';\nexport const SHOW_MESSAGE = 'SHOW_MESSAGE';\n\nexport const createAction = type => payload => ({\n type,\n payload\n});\n\nexport const resetLoading = createAction(RESET_LOADING);\nexport const startLoading = createAction(START_LOADING);\nexport const stopLoading = createAction(STOP_LOADING);\n\nconst xhrs = {};\nconst etagCache = {};\n\nconst cancel = (key) => {\n if(xhrs[key]) {\n xhrs[key].abort();\n console.log(`aborted request ${key}`);\n delete xhrs[key];\n }\n}\n\nconst schedule = (key, req) => {\n // console.log(`scheduling ${key}`);\n xhrs[key] = req;\n};\n\nconst isObjectEmpty = (obj) => {\n return Object.keys(obj).length === 0 && obj.constructor === Object ;\n}\n\nconst buildNotifyHandlerPayload = (httpCode, title, content, type) => ({ httpCode, title, html: content, type });\nconst buildNotifyHandlerErrorPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"error\");\nconst buildNotifyHandlerWarningPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"warning\");\n\nconst initLogin = () => (dispatch) => {\n const currentLocation = getCurrentPathName();\n const clearingSessionState = isClearingSessionState();\n dispatch({\n type: CLEAR_SESSION_STATE,\n payload: {}\n });\n if (!clearingSessionState) {\n setSessionClearingState(true);\n console.log(\"authErrorHandler 401 - re login\");\n doLogin(currentLocation);\n }\n};\n\nconst normalizeFormDataPayload = (req, formData) => {\n if(!isObjectEmpty(formData)) {\n Object.keys(formData).forEach(function (key) {\n let value = formData[key];\n if (Array.isArray(value)) {\n value.forEach(item => {\n req.field(`${key}[]`, item);\n });\n } else {\n req.field(key, value);\n }\n });\n }\n};\n\nexport const authErrorHandler = (\n err,\n res,\n notifyErrorHandler = showMessage\n) => (dispatch) => {\n\n const code = err.status;\n let msg = \"\";\n let payload, callback;\n\n dispatch(stopLoading());\n\n switch (code) {\n case 401:\n if (notifyErrorHandler !== showMessage) {\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_auth\"));\n callback = () => dispatch(initLogin());\n } else {\n dispatch(initLogin());\n }\n break;\n case 403:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_authz\"));\n callback = initLogOut;\n break;\n case 404:\n msg = err.response.body?.message || err.response.error?.message || err.message;\n if (err.response.body?.errors?.length) {\n msg += ` ${err.response.body.errors.join(\" \")}`;\n }\n payload = buildNotifyHandlerWarningPayload(code, \"Not Found\", msg);\n break;\n case 412:\n for (const [key, value] of Object.entries(err.response.body.errors)) {\n msg += isNaN(key) ? `${key}: ` : \"\";\n msg += `${value} `;\n }\n dispatch({\n type: VALIDATE,\n payload: { errors: err.response.body.errors }\n });\n payload = buildNotifyHandlerWarningPayload(code, \"Validation error\", msg);\n break;\n default:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.server_error\"));\n }\n\n if (payload)\n dispatch(notifyErrorHandler(payload, callback));\n}\n\nexport const getRequest =(\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {},\n useEtag = false\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n let key = url.toString();\n\n if(!isObjectEmpty(params)) {\n // remove the access token\n const { access_token: _, ...newParams} = params;\n // and generate new key\n key = url.query(newParams).toString();\n url = url.query(params);\n }\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n cancel(key);\n\n return new Promise((resolve, reject) => {\n let req = http.get(url.toString());\n if(useEtag && etagCache.hasOwnProperty(key)){\n const { etag } = etagCache[key];\n if(etag){\n req.set('If-None-Match', etag)\n }\n }\n\n req.timeout({\n response: 60000,\n deadline: 60000,\n })\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key, useEtag))\n\n schedule(key, req);\n });\n};\n\nexport const putRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => ( dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n http.put(url.toString())\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject))\n });\n};\n\nexport const deleteRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params) => (dispatch, state) => {\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n\n http.delete(url)\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n let request = http.post(url);\n\n if(payload != null)\n request.send(payload);\n else // to be a simple CORS request\n request.set('Content-Type', 'text/plain');\n\n request.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.post(url)\n .attach('file', file);\n\n normalizeFormDataPayload(req, fileMetadata);\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const putFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file = null,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.put(url);\n\n if(file != null){\n req.attach('file', file);\n }\n\n normalizeFormDataPayload(req, fileMetadata)\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const defaultErrorHandler = (err, res) => (dispatch) => {\n let body = res.body;\n let text = '';\n if(body instanceof Object){\n if(body.hasOwnProperty('message'))\n text = body.message;\n }\n Swal.fire(res.statusText, text, \"error\");\n}\n\nconst byLowerCase = toFind => value => toLowerCase(value) === toFind;\nconst toLowerCase = value => value.toLowerCase();\nconst getKeys = headers => Object.keys(headers);\n\nexport const getHeaderCaseInsensitive = (headerName, headers = {}) => {\n const key = getKeys(headers).find(byLowerCase(headerName));\n return key ? headers[key] : undefined;\n};\n\nexport const responseHandler = ( dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key = null, useEtag= false ) =>\n\n (err, res) => {\n\n if (err || !res.ok) {\n let code = err.status;\n\n if(code === 304 && etagCache.hasOwnProperty(key) && useEtag){\n const { body } = etagCache[key];\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: body}));\n return resolve({response: body});\n }\n\n dispatch(receiveActionCreator);\n return resolve({response: body});\n }\n if(errorHandler) {\n errorHandler(err, res)(dispatch, state);\n }\n return reject({ err, res, dispatch, state })\n }\n\n let json = res.body;\n\n if(useEtag) {\n const responseETAG = getHeaderCaseInsensitive('etag', res.headers);\n if (responseETAG) {\n etagCache[key] = { etag: responseETAG, body: json};\n }\n }\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: json}));\n return resolve({response: json});\n }\n dispatch(receiveActionCreator);\n return resolve({response: json});\n}\n\n\nexport const fetchErrorHandler = (response) => {\n let code = response.status;\n let msg = response.statusText;\n\n switch (code) {\n case 403:\n Swal.fire(\"ERROR\", T.translate(\"errors.user_not_authz\"), \"warning\");\n break;\n case 401:\n Swal.fire(\"ERROR\", T.translate(\"errors.session_expired\"), \"error\");\n break;\n case 412:\n Swal.fire(\"ERROR\", msg, \"warning\");\n case 500:\n Swal.fire(\"ERROR\", T.translate(\"errors.server_error\"), \"error\");\n }\n}\n\nexport const fetchResponseHandler = (response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.json();\n }\n}\n\nexport const showMessage = (settings, callback = null) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire(settings).then((result) => {\n if (result.value && typeof callback === 'function') {\n callback();\n }\n });\n}\n\nexport const showSuccessMessage = (html) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire({\n title: T.translate(\"general.done\"),\n html: html,\n type: 'success'\n });\n}\n\nexport const downloadFileByContent = (filename, content, mime) => {\n let link = document.createElement('a');\n link.textContent = 'download';\n link.download = filename;\n link.href = `data:${mime},${encodeURIComponent(content)}`\n document.body.appendChild(link); // Required for FF\n link.click();\n document.body.removeChild(link);\n}\n\nexport const getCSV = (endpoint, params, filename, header = null) => (dispatch) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n dispatch(startLoading());\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n dispatch(stopLoading());\n\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n downloadFileByContent(filename, csv, 'text/csv;charset=utf-8');\n })\n .catch(fetchErrorHandler);\n};\n\nexport const getRawCSV = (endpoint, params, header = null) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n\n return csv;\n })\n .catch(fetchErrorHandler);\n};\n\nexport const escapeFilterValue = (value) => {\n value = String(value);\n // escape backslash first so you don't accidentally break your own escapes\n value = value.replace(/\\\\/g, \"\\\\\\\\\");\n value = value.replace(/,/g, \"\\\\,\");\n value = value.replace(/;/g, \"\\\\;\");\n // especial case for literal +\n value = value.replace(/\\+/g, \"%2B\");\n return value;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"spark-md5\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/sha256\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-base64url\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-hex\");","import SparkMD5 from \"spark-md5\";\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nconst MAX_BYTES = 65536\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nconst MAX_UINT32 = 4294967295\nconst crypto = typeof window !== 'undefined' ? (window.crypto || window.msCrypto) : null;\nimport sha256 from 'crypto-js/sha256';\nimport Base64url from 'crypto-js/enc-base64url'\nimport Hex from 'crypto-js/enc-hex'\nexport const getRandomBytes = (size) => {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n const bytes = Buffer.allocUnsafe(size)\n if(!crypto) return a;\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (let generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n return bytes\n}\n\nexport const getSHA256 = (message, format = 'hex') => {\n\n let f = Hex;\n if(format === 'Base64url')\n f = Base64url;\n\n return sha256(message).toString(f);\n}\n\nexport const getMD5 = (file) => {\n return new Promise((resolve, reject) => {\n const chunkSize = 2 * 1024 * 1024; // 2 MB by chunk\n const spark = new SparkMD5.ArrayBuffer();\n const fileReader = new FileReader();\n let cursor = 0;\n\n fileReader.onload = e => {\n spark.append(e.target.result); \n cursor += chunkSize;\n\n if (cursor < file.size) {\n readNextChunk();\n } else {\n resolve(spark.end()); // final MD5\n }\n };\n\n fileReader.onerror = () => reject(\"Error reading the file\");\n\n function readNextChunk() {\n const slice = file.slice(cursor, cursor + chunkSize);\n fileReader.readAsArrayBuffer(slice);\n }\n\n readNextChunk();\n });\n}","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"lodash/debounce\");","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport { fetchErrorHandler, fetchResponseHandler, escapeFilterValue } from \"./actions\";\nimport { getAccessToken } from '../components/security/methods';\nimport { buildAPIBaseUrl } from \"./methods\";\nimport debounce from 'lodash/debounce';\nexport const RECEIVE_COUNTRIES = 'RECEIVE_COUNTRIES';\nconst callDelay = 500; // milliseconds\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\nexport const DEFAULT_PAGE_SIZE = 10;\n\nconst _fetchPublic = async (endpoint, callback, options = {}) => {\n return fetch(buildAPIBaseUrl(endpoint.toString()), options)\n .then(fetchResponseHandler)\n .then((json) => {\n if(typeof callback === 'function')\n callback(json.data);\n })\n .catch(response => {\n const code = response && response.status;\n if (code === 404 && typeof callback === 'function') callback([]);\n return response;\n })\n .catch(fetchErrorHandler);\n}\n\n/**\n * @param endpoint\n * @param callback\n * @param options\n * @returns {Promise}\n * @private\n */\nconst _fetch = async (endpoint, callback, options = {}) => {\n\n let accessToken;\n\n try {\n accessToken = await getAccessToken();\n } catch (e) {\n // The caller is told through its callback; the query* functions do not\n // await this promise, so rejecting here would only surface as an\n // unhandled rejection.\n if(typeof callback === 'function')\n callback(e);\n return;\n }\n\n endpoint.addQuery('access_token', accessToken);\n\n return _fetchPublic(endpoint, callback, options);\n}\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryMembers = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/members`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryAttendees = debounce(async (summitId, input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n \n let endpoint = URI(`/api/v1/summits/${summitId}/attendees`);\n \n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n \n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name=@${input},email=@${input}`);\n }\n \n _fetch(endpoint, callback);\n \n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySummits = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/all`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySpeakers = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE ) => {\n\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/speakers`:`speakers`}`);\n\n endpoint.addQuery('expand', `member,registration_request`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTags = debounce(async (summitId, input, callback, per_page = 50) => {\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/track-tag-groups/all/allowed-tags`:`tags`}`);\n\n if(summitId)\n endpoint.addQuery('expand', `tag,track_tag_group`);\n\n endpoint.addQuery('order','tag');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `tag@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTracks = debounce(async (summitId, input, callback, excludedIds = [], per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/tracks`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if (excludedIds?.length > 0) {\n endpoint.addQuery('filter[]', `not_id==${excludedIds.join(\"||\")}`);\n }\n\n if (input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTrackGroups = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/track-groups`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=, *): Promise)|*>}\n */\nexport const queryEvents = debounce(async (summitId, input, onlyPublished = false, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/events` + (onlyPublished ? '/published' : ''));\n\n endpoint.addQuery('order','title');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=, *=): Promise)|*>}\n */\nexport const queryEventTypes = debounce(async (summitId, input, callback, eventTypeClassName = null, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/event-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n if (eventTypeClassName) {\n eventTypeClassName = escapeFilterValue(eventTypeClassName);\n endpoint.addQuery('filter[]', `class_name==${eventTypeClassName}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryGroups = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/groups`);\n\n endpoint.addQuery('order','title,code');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input},code@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryCompanies = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/companies`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryRegistrationCompanies = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/registration-companies`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsors = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type')\n endpoint.addQuery('order','id')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsorsWithBadgeScans = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type');\n endpoint.addQuery('fields','id,company.name,sponsorship.type.name');\n endpoint.addQuery('relations','none,company.none,sponsorship.type.none');\n endpoint.addQuery('filter[]','badge_scans_count>0');\n endpoint.addQuery('order','+company_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryAccessLevels = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/access-level-types`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryOrganizations = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/organizations`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\nexport const getLanguageList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/languages`), callback, { signal });\n};\n\nexport const getCountryList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/countries`), callback, { signal });\n};\n\nlet geocoder;\n\nexport const geoCodeAddress = (address) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\nexport const geoCodeLatLng = (lat, lng) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n let latlng = {lat: parseFloat(lat), lng: parseFloat(lng)};\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'location': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\n/**\n * @type {DebouncedFunc<(function(*, *=, *, *=, *=): Promise)|*>}\n */\nexport const queryTicketTypes = debounce(async (summitId, filters = {}, callback, version = 'v1', per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/${version}/summits/${summitId}/ticket-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(filters.hasOwnProperty('name')) {\n const name = escapeFilterValue(filters.name);\n if(name && name != '')\n endpoint.addQuery('filter[]', `name@@${name}`);\n }\n\n if(filters.hasOwnProperty('audience')){\n const audience = escapeFilterValue(filters.audience);\n if(audience && audience != '')\n endpoint.addQuery('filter[]', `audience==${audience}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySponsoredProjects = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n\n const endpoint = URI(`/api/v1/sponsored-projects`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryPromocodes = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE, extraFilters = []) => {\n\n\n let endpoint = URI(`/api/v1/summits/${summitId}/promo-codes`);\n\n endpoint.addQuery('order','code')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `code@@${input}`);\n }\n\n //eg: filter = 'class_name==SummitRegistrationPromoCode'\n for (const filter of extraFilters) {\n endpoint.addQuery('filter[]', filter);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"idtoken-verifier\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"react-select/lib/Async\");","module.exports = require(\"superagent/lib/client\");","module.exports = require(\"sweetalert2\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport {queryAccessLevels} from '../../utils/query-actions';\n\nexport default class AccessLevelsInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.getAccessLevels = this.getAccessLevels.bind(this);\n this.getOptionValue = this.getOptionValue.bind(this);\n this.getOptionLabel = this.getOptionLabel.bind(this);\n }\n\n getOptionValue(accessLevel){\n if(this.props.hasOwnProperty(\"getOptionValue\")){\n return this.props.getOptionValue(accessLevel);\n }\n //default\n return accessLevel.id;\n }\n\n getOptionLabel(accessLevel){\n if(this.props.hasOwnProperty(\"getOptionLabel\")){\n return this.props.getOptionLabel(accessLevel);\n }\n //default\n return `${accessLevel.name}`;\n }\n\n handleChange(value) {\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'accesslevelinput'\n }};\n\n this.props.onChange(ev);\n }\n\n getAccessLevels (input, callback) {\n let {summitId, defaultOptions} = this.props;\n\n if (!input && !defaultOptions) {\n return Promise.resolve({ options: [] });\n }\n\n queryAccessLevels(summitId,input, callback);\n }\n\n render() {\n let {value, error, onChange, id, multi, ...rest} = this.props;\n let isMulti = (this.props.hasOwnProperty('multi'));\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n\n return (\n \n
this.getOptionValue(m)}\n getOptionLabel={m => this.getOptionLabel(m)}\n isMulti={isMulti}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n\n \n );\n\n }\n}\n\n"],"names":["root","factory","exports","module","define","amd","this","AUTH_ERROR_MISSING_AUTH_INFO","AUTH_ERROR_MISSING_REFRESH_TOKEN","AUTH_ERROR_ACCESS_TOKEN_EXPIRED","AUTH_ERROR_LOCK_ACQUIRE_ERROR","AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR","AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR","require","Lock","SuperTokensLock","GET_TOKEN_SILENTLY_LOCK_KEY","RESPONSE_TYPE_CODE","AUTH_INFO","ID_TOKEN","processRefreshToken","async","flow","refreshToken","useOAuth2RefreshToken","clearAuthInfo","Error","response","fn","maxRetries","baseDelayMs","attempt","err","message","startsWith","delay","Math","pow","console","log","Promise","resolve","setTimeout","retryWithBackoff","refreshAccessToken","access_token","expires_in","refresh_token","id_token","storeAuthInfo","_getAccessToken","authInfo","getAuthInfo","accessToken","expiresIn","accessTokenUpdatedAt","getOAuth2Flow","now","moment","unix","timeElapsedSecs","ACCESS_TOKEN_RESOLVER_KEY","Symbol","for","getAccessToken","resolveAccessToken","globalThis","navigator","locks","request","lock","retryPromise","acquireLock","releaseLock","baseUrl","getOAuth2IDPBaseUrl","oauth2ClientId","getOAuth2ClientId","payload","encodeURI","controller","AbortController","timeoutId","abort","json","fetch","method","headers","body","JSON","stringify","signal","networkError","clearTimeout","ok","status","statusText","setSessionClearingState","parseError","new_refresh_token","idToken","formerAuthInfo","floor","Date","Cookies","secure","sameSite","putOnLocalStorage","res","getFromLocalStorage","parse","window","removeFromLocalStorage","OAUTH2_CLIENT_ID","OAUTH2_FLOW","Boolean","OAUTH2_USE_REFRESH_TOKEN","IDP_BASE_URL","URI","createAction","type","fetchErrorHandler","code","msg","Swal","T","fetchResponseHandler","escapeFilterValue","value","String","replace","crypto","msCrypto","buildAPIBaseUrl","relativeUrl","API_BASE_URL","key","localStorage","setItem","removeIt","val","getItem","removeItem","clearing_session_state","cb","maxNumberOfRetries","i","callDelay","_fetchPublic","endpoint","callback","options","toString","then","data","catch","_fetch","e","addQuery","queryAccessLevels","debounce","input","per_page","DEFAULT_PAGE_SIZE","summitId","excludedIds","length","join","onlyPublished","eventTypeClassName","filters","version","hasOwnProperty","name","audience","extraFilters","filter","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","toStringTag","AccessLevelsInput","React","constructor","props","super","state","handleChange","bind","getAccessLevels","getOptionValue","getOptionLabel","accessLevel","id","ev","target","onChange","defaultOptions","render","_this$props","error","multi","rest","_objectWithoutProperties","_excluded","isMulti","has_error","AsyncSelect","_extends","loadOptions","m","className"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/action-dropdown.js b/lib/components/inputs/action-dropdown.js
new file mode 100644
index 00000000..c88b8e86
--- /dev/null
+++ b/lib/components/inputs/action-dropdown.js
@@ -0,0 +1,2 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},2015:e=>{e.exports=require("react")},8466:e=>{e.exports=require("react-select")}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,o),a.exports}(()=>{o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t}})(),(()=>{o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(()=>{o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};o.r(n),o.d(n,{default:()=>c});var r=o(2462),a=o.n(r),l=o(2015),s=o.n(l),i=o(8466),p=o.n(i);const u=["options","actionLabel","placeholder"];class c extends s().Component{constructor(e){super(e),this.state={value:e.value||null},this.handleChange=this.handleChange.bind(this),this.handleClick=this.handleClick.bind(this)}handleChange(e){this.setState({value:e})}handleClick(e){e.preventDefault(),this.props.onClick(this.state.value.value)}render(){let e=this.props,{options:t,actionLabel:o,placeholder:n}=e,{value:r}=(a()(e,u),this.state),l=this.props.hasOwnProperty("small")?"small":"",i=this.props.hasOwnProperty("small")?"btn-group-sm":"normal",c=r instanceof Object||null==r?r:t.find((e=>e.value==r));return s().createElement("div",{className:"action-dropdown btn-group "+i},s().createElement(p(),{value:c,onChange:this.handleChange,options:t,placeholder:n,className:"btn-group action-select text-left"+l,isClearable:!1}),s().createElement("button",{type:"button",className:"btn btn-default action-button",onClick:this.handleClick},o))}}return n})()));
+//# sourceMappingURL=action-dropdown.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/action-dropdown.js.map b/lib/components/inputs/action-dropdown.js.map
new file mode 100644
index 00000000..7d170a24
--- /dev/null
+++ b/lib/components/inputs/action-dropdown.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/action-dropdown.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,mCCTTH,EAAOD,QAAUK,QAAQ,iD,WCAzBJ,EAAOD,QAAUK,QAAQ,Q,WCAzBJ,EAAOD,QAAUK,QAAQ,e,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,C,MCrBAO,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACf,EAASiB,KACjC,I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AAOuB,EACPK,SAAUxD,KAAKmC,aACfS,QAASA,EACTE,YAAaA,EACbQ,UAAW,oCAAsCL,EACjDQ,aAAa,IAEjB3B,IAAAA,cAAA,UAAQ4B,KAAK,SAASJ,UAAU,gCAAgCb,QAASzC,KAAKqC,aACzEQ,GAKjB,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-select\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/inputs/action-dropdown/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"react\");","module.exports = require(\"react-select\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport './action-dropdown.less';\nimport Select from 'react-select';\n\nexport default class ActionDropdown extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value || null,\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.handleClick = this.handleClick.bind(this);\n }\n\n handleChange(value) {\n this.setState({value: value});\n }\n\n handleClick(ev) {\n ev.preventDefault();\n this.props.onClick(this.state.value.value);\n }\n\n render() {\n\n let {options, actionLabel, placeholder, ...rest} = this.props;\n let {value} = this.state;\n\n let smallDdl = this.props.hasOwnProperty('small') ? 'small' : '';\n let smallBtn = this.props.hasOwnProperty('small') ? 'btn-group-sm' : 'normal';\n\n let theValue = (value instanceof Object || value == null) ? value : options.find(opt => opt.value == value);\n\n\n return (\n \n \n \n {actionLabel}\n \n
\n );\n\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","ActionDropdown","React","constructor","props","super","state","handleChange","bind","handleClick","setState","ev","preventDefault","onClick","render","_this$props","options","actionLabel","placeholder","_objectWithoutProperties","_excluded","smallDdl","smallBtn","theValue","find","opt","className","Select","onChange","isClearable","type"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/attendee-input.js b/lib/components/inputs/attendee-input.js
new file mode 100644
index 00000000..5c9b8b61
--- /dev/null
+++ b/lib/components/inputs/attendee-input.js
@@ -0,0 +1,2 @@
+!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={5097:(e,r,a)=>{a(1116),a(6842),a(9087),a(9558),a(2183)},3195:(e,r,a)=>{a.d(r,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>n,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>t,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>o,AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR:()=>d,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>i});const t="AUTH_ERROR_MISSING_AUTH_INFO",o="AUTH_ERROR_MISSING_REFRESH_TOKEN",n="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",i="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR",d="AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR"},2183:(e,r,a)=>{a.d(r,{getAccessToken:()=>f});var t=a(9558),o=a(5812),n=a.n(o);a(806);const s=require("browser-tabs-lock");var i=a.n(s);const d=require("js-cookie");var u=a.n(d),l=(a(8041),a(9891),a(5097),a(8853),a(3195));const Lock=new(i()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",c="code",p="authInfo",y="idToken",_=async(e,r)=>{if(e===c&&S()){if(!r)throw Q(),Error(l.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await(async(e,r=5,a=1e3)=>{for(let t=0;tsetTimeout(e,o)))}})((()=>E(r))),{access_token:a,expires_in:t,refresh_token:o,id_token:n}=e;return void 0===o&&(o=null),g(a,t,o,n),a}throw Q(),Error(l.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)},R=async()=>{console.log("openstack-uicore-foundation::Security::methods::_getAccessToken");let e=O();if(!e)throw console.log("openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO"),Error(l.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:r,expiresIn:a,accessTokenUpdatedAt:t,refreshToken:o}=e,s=w();const i=n()().unix();let d=i-t;return a-=60,console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${i} accessTokenUpdatedAt ${t} expiresIn ${a} timeElapsedSecs ${d}`),(d>=a||null==r)&&(console.log("openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ..."),r=await _(s,o)),r},m=Symbol.for("openstack-uicore-foundation.accessTokenResolver"),f=async()=>{const e=globalThis[m];if(e)return e();if("undefined"!=typeof navigator&&navigator.locks)return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY,(async e=>(console.log("openstack-uicore-foundation::Security::methods::getAccessToken web lock api",e),await R())));if(!await(0,t.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))throw Error(l.AUTH_ERROR_LOCK_ACQUIRE_ERROR);try{return await R()}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}},E=async e=>{let r=h(),a=T();const o={grant_type:"refresh_token",client_id:encodeURI(a),refresh_token:e},n=new AbortController,s=setTimeout((()=>n.abort()),1e4);let i,d;try{i=await fetch(`${r}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o),signal:n.signal})}catch(e){throw console.log("refreshAccessToken network error:",e.message),Error(`${l.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${e.message}`)}finally{clearTimeout(s)}if(!i.ok){if(console.log(`refreshAccessToken server error: ${i.status} - ${i.statusText}`),i.status>=500||408===i.status||429===i.status)throw Error(`${l.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${i.status} - ${i.statusText}`);throw(0,t.setSessionClearingState)(!0),Error(`${l.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${i.status} - ${i.statusText}`)}try{d=await i.json()}catch(e){throw Error(`${l.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`)}let{access_token:u,refresh_token:c,expires_in:p,id_token:y}=d;if(!u)throw(0,t.setSessionClearingState)(!0),Error(`${l.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);return{access_token:u,refresh_token:c,expires_in:p,id_token:y}},g=(e,r,a=null,o=null)=>{let n=O(),s={accessToken:e,expiresIn:r,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null==a&&n&&(a=n.refreshToken),null==o&&n&&(o=n.idToken),a&&(s.refreshToken=a),o?(s[y]=o,u().set(y,o,{secure:!0,sameSite:"Lax"})):u().remove(y),(0,t.putOnLocalStorage)(p,JSON.stringify(s))},O=()=>{try{let e=(0,t.getFromLocalStorage)(p,!1);return e?JSON.parse(e):null}catch(e){return null}},Q=()=>{"undefined"!=typeof window&&((0,t.removeFromLocalStorage)(p),u().remove(y))},T=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,w=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",S=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),h=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},9087:(e,r,a)=>{a.d(r,{escapeFilterValue:()=>p,fetchErrorHandler:()=>l,fetchResponseHandler:()=>c});a(2462),a(806);var t=a(8041),o=a.n(t),n=a(9236),s=a.n(n),i=a(6842),d=a.n(i);a(9558),a(5097),a(2183);o().escapeQuerySpace=!1;const u=e=>r=>({type:e,payload:r}),l=(u("RESET_LOADING"),u("START_LOADING"),u("STOP_LOADING"),e=>{let r=e.status,a=e.statusText;switch(r){case 403:s().fire("ERROR",d().translate("errors.user_not_authz"),"warning");break;case 401:s().fire("ERROR",d().translate("errors.session_expired"),"error");break;case 412:s().fire("ERROR",a,"warning");case 500:s().fire("ERROR",d().translate("errors.server_error"),"error")}}),c=e=>{if(e.ok)return e.json();throw e},p=e=>e=(e=(e=(e=(e=String(e)).replace(/\\/g,"\\\\")).replace(/,/g,"\\,")).replace(/;/g,"\\;")).replace(/\+/g,"%2B")},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,r,a)=>{a.d(r,{buildAPIBaseUrl:()=>t,getFromLocalStorage:()=>n,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>s,retryPromise:()=>d,setSessionClearingState:()=>i});a(5812),a(8041);const t=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,r)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,r)},n=(e,r)=>{if("undefined"!=typeof window){let a=window.localStorage.getItem(e);return r&&(console.log(`getFromLocalStorage removing key ${e}`),s(e)),a}return null},s=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},d=async(e,r=3)=>{for(let a=0;a{a.d(r,{queryAttendees:()=>y});var t=a(9087),o=a(2183),n=a(9558);const s=require("lodash/debounce");var i=a.n(s),d=a(8041),u=a.n(d);const l=500;u().escapeQuerySpace=!1;const c=async(e,r,a={})=>fetch((0,n.buildAPIBaseUrl)(e.toString()),a).then(t.fetchResponseHandler).then((e=>{"function"==typeof r&&r(e.data)})).catch((e=>(404===(e&&e.status)&&"function"==typeof r&&r([]),e))).catch(t.fetchErrorHandler),p=async(e,r,a={})=>{let t;try{t=await(0,o.getAccessToken)()}catch(e){return void("function"==typeof r&&r(e))}return e.addQuery("access_token",t),c(e,r,a)},y=(i()((async(e,r,a=10)=>{let o=u()("/api/v1/members");o.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),o.addQuery("filter[]",`full_name@@${e},first_name@@${e},last_name@@${e},email@@${e}`)),p(o,r)}),l),i()((async(e,r,a,o=10)=>{let n=u()(`/api/v1/summits/${e}/attendees`);n.addQuery("order","first_name,last_name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),n.addQuery("filter[]",`full_name=@${r},email=@${r}`)),p(n,a)}),l));i()((async(e,r,a=10)=>{let o=u()("/api/v1/summits/all");o.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),p(o,r)}),l),i()((async(e,r,a,o=10)=>{let n=u()("/api/v1/"+(e?`summits/${e}/speakers`:"speakers"));n.addQuery("expand","member,registration_request"),n.addQuery("order","first_name,last_name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),n.addQuery("filter[]",`full_name@@${r},first_name@@${r},last_name@@${r},email@@${r}`)),p(n,a)}),l),i()((async(e,r,a,o=50)=>{let n=u()("/api/v1/"+(e?`summits/${e}/track-tag-groups/all/allowed-tags`:"tags"));e&&n.addQuery("expand","tag,track_tag_group"),n.addQuery("order","tag"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),n.addQuery("filter[]",`tag@@${r}`)),p(n,a)}),l),i()((async(e,r,a,o=[],n=10)=>{let s=u()(`/api/v1/summits/${e}/tracks`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",n),(null==o?void 0:o.length)>0&&s.addQuery("filter[]",`not_id==${o.join("||")}`),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),p(s,a)}),l),i()((async(e,r,a,o=10)=>{let n=u()(`/api/v1/summits/${e}/track-groups`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),p(n,a)}),l),i()((async(e,r,a=!1,o,n=10)=>{let s=u()(`/api/v1/summits/${e}/events`+(a?"/published":""));s.addQuery("order","title"),s.addQuery("page",1),s.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`title@@${r}`)),p(s,o)}),l),i()((async(e,r,a,o=null,n=10)=>{let s=u()(`/api/v1/summits/${e}/event-types`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),o&&(o=(0,t.escapeFilterValue)(o),s.addQuery("filter[]",`class_name==${o}`)),p(s,a)}),l),i()((async(e,r,a=10)=>{let o=u()("/api/v1/groups");o.addQuery("order","title,code"),o.addQuery("page",1),o.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),o.addQuery("filter[]",`title@@${e},code@@${e}`)),p(o,r)}),l),i()((async(e,r,a=10)=>{let o=u()("/api/v1/companies");o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),p(o,r)}),l),i()((async(e,r,a,o=10)=>{let n=u()(`/api/v1/summits/${e}/registration-companies`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),p(n,a)}),l),i()((async(e,r,a,o=10)=>{let n=u()(`/api/v1/summits/${e}/sponsors`);n.addQuery("expand","company,sponsorship,sponsorship.type"),n.addQuery("order","id"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),n.addQuery("filter[]",`company_name@@${r}`)),p(n,a)}),l),i()((async(e,r,a,o=10)=>{let n=u()(`/api/v1/summits/${e}/sponsors`);n.addQuery("expand","company,sponsorship,sponsorship.type"),n.addQuery("fields","id,company.name,sponsorship.type.name"),n.addQuery("relations","none,company.none,sponsorship.type.none"),n.addQuery("filter[]","badge_scans_count>0"),n.addQuery("order","+company_name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),n.addQuery("filter[]",`company_name@@${r}`)),p(n,a)}),l),i()((async(e,r,a,o=10)=>{let n=u()(`/api/v1/summits/${e}/access-level-types`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),p(n,a)}),l),i()((async(e,r,a=10)=>{let o=u()("/api/v1/organizations");o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),p(o,r)}),l);i()((async(e,r={},a,o="v1",n=10)=>{let s=u()(`/api/${o}/summits/${e}/ticket-types`);if(s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",n),r.hasOwnProperty("name")){const e=(0,t.escapeFilterValue)(r.name);e&&""!=e&&s.addQuery("filter[]",`name@@${e}`)}if(r.hasOwnProperty("audience")){const e=(0,t.escapeFilterValue)(r.audience);e&&""!=e&&s.addQuery("filter[]",`audience==${e}`)}p(s,a)}),l),i()((async(e,r,a=10)=>{const o=u()("/api/v1/sponsored-projects");o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),p(o,r)}),l),i()((async(e,r,a,o=10,n=[])=>{let s=u()(`/api/v1/summits/${e}/promo-codes`);s.addQuery("order","code"),s.addQuery("page",1),s.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`code@@${r}`));for(const e of n)s.addQuery("filter[]",e);p(s,a)}),l)},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},5812:e=>{e.exports=require("moment-timezone")},2015:e=>{e.exports=require("react")},2113:e=>{e.exports=require("react-select/lib/Async")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},r={};function a(t){var o=r[t];if(void 0!==o)return o.exports;var n=r[t]={exports:{}};return e[t](n,n.exports,a),n.exports}(()=>{a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r}})(),(()=>{a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}})(),(()=>{a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var t={};a.r(t),a.d(t,{default:()=>_});var o=a(6031),n=a.n(o),s=a(2462),i=a.n(s),d=a(2015),u=a.n(d),l=a(2113),c=a.n(l),p=a(5301);const y=["id","value","summitId","error","multi","onChange","getOptionValue","getOptionLabel","queryFunction"],_=e=>{let{id:r,value:a,summitId:t,error:o,multi:s,onChange:l,getOptionValue:_,getOptionLabel:R,queryFunction:m}=e,f=i()(e,y);const E=m||p.queryAttendees,[g,O]=(0,d.useState)(a),Q=""!==o;return u().createElement("div",null,u().createElement(c(),n()({value:a,onChange:e=>{l({target:{id:r,value:e,type:"attendeeinput"}})},loadOptions:(e,r)=>{if(!e)return Promise.resolve({options:[]});E(t,e,r)},getOptionValue:e=>(e=>_?_(e):e.id)(e),getOptionLabel:e=>(e=>R?R(e):`${e.first_name} ${e.last_name} (${e.id})`)(e)},f)),Q&&u().createElement("p",{className:"error-label"},o))};return t})()));
+//# sourceMappingURL=attendee-input.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/attendee-input.js.map b/lib/components/inputs/attendee-input.js.map
new file mode 100644
index 00000000..b060fd72
--- /dev/null
+++ b/lib/components/inputs/attendee-input.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/attendee-input.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,wVCTF,MAAMC,EAA+B,+BAC/BC,EAAmC,mCACnCC,EAAkC,kCAClCC,EAAgC,gCAChCC,EAAyC,yCACzCC,EAAyC,wC,uFCLtD,MAAM,EAA+BC,QAAQ,qB,aCA7C,MAAM,EAA+BA,QAAQ,a,yDCqC7C,MAAMC,KAAO,IAAIC,KAIXC,4BAA8B,wCAKvBC,EAA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,IAA2G,IAA1G,GAACC,EAAE,MAAEzE,EAAK,SAAEoC,EAAQ,MAAEsC,EAAK,MAAEC,EAAK,SAAEC,EAAQ,eAAEC,EAAc,eAAEC,EAAc,cAAEC,GAAuBP,EAALQ,EAAIC,IAAAT,EAAAU,GACvH,MAAMC,EAAUJ,GAAiBhD,EAAAA,gBAC1BqD,EAAQC,IAAaC,EAAAA,EAAAA,UAAStF,GAC/BuF,EAAwB,KAAVb,EAmCpB,OACIc,IAAAA,cAAA,WACIA,IAAAA,cAACC,IAAWC,IAAA,CACR1F,MAAOA,EACP4E,SArBU5E,IAOlB4E,EANS,CAACe,OAAQ,CACdlB,GAAIA,EACJzE,MAAOA,EACPR,KAAM,kBAGE,EAeJoG,YAZSC,CAAC5D,EAAOX,KACzB,IAAKW,EACD,OAAOzH,QAAQC,QAAQ,CAAE8G,QAAS,KAEtC4D,EAAQ/C,EAAUH,EAAOX,EAAS,EAS1BuD,eAAgBiB,GAvCHC,IACjBlB,EACOA,EAAekB,GAGnBA,EAAStB,GAkCauB,CAAgBF,GACrChB,eAAgBgB,GAhCHC,IACjBjB,EACOA,EAAeiB,GAGnB,GAAGA,EAASE,cAAcF,EAASG,cAAcH,EAAStB,MA2BpC0B,CAAgBL,IACjCd,IAEPO,GACGC,IAAAA,cAAA,KAAGY,UAAU,eAAe1B,GAG9B,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/security/constants.js","webpack://openstack-uicore-foundation/external commonjs \"browser-tabs-lock\"","webpack://openstack-uicore-foundation/external commonjs \"js-cookie\"","webpack://openstack-uicore-foundation/./src/components/security/methods.js","webpack://openstack-uicore-foundation/./src/utils/actions.js","webpack://openstack-uicore-foundation/external commonjs \"spark-md5\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/sha256\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-base64url\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-hex\"","webpack://openstack-uicore-foundation/./src/utils/crypto.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"lodash/debounce\"","webpack://openstack-uicore-foundation/./src/utils/query-actions.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"idtoken-verifier\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-select/lib/Async\"","webpack://openstack-uicore-foundation/external commonjs \"superagent/lib/client\"","webpack://openstack-uicore-foundation/external commonjs \"sweetalert2\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/inputs/attendee-input.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","export const AUTH_ERROR_MISSING_AUTH_INFO = 'AUTH_ERROR_MISSING_AUTH_INFO';\nexport const AUTH_ERROR_MISSING_REFRESH_TOKEN = 'AUTH_ERROR_MISSING_REFRESH_TOKEN';\nexport const AUTH_ERROR_ACCESS_TOKEN_EXPIRED = 'AUTH_ERROR_ACCESS_TOKEN_EXPIRED';\nexport const AUTH_ERROR_LOCK_ACQUIRE_ERROR = 'AUTH_ERROR_LOCK_ACQUIRE_ERROR'\nexport const AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR';\nexport const AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR';\nexport const AUTH_ERROR_ID_TOKEN_INVALID = 'AUTH_ERROR_ID_TOKEN_INVALID';\nexport const AUTH_ERROR_MISSING_OTP_PARAM = 'AUTH_ERROR_MISSING_OTP_PARAM';\nexport const AUTH_ERROR_MISSING_PKCE_PARAM = 'AUTH_ERROR_MISSING_PKCE_PARAM';\nexport const AUTH_ERROR_MISSING_NONCE_PARAM = 'AUTH_ERROR_MISSING_NONCE_PARAM';\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"browser-tabs-lock\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"js-cookie\");","import {\n base64URLEncode,\n getAuthCallback,\n getCurrentLocation,\n getFromLocalStorage,\n removeFromLocalStorage,\n getOrigin,\n putOnLocalStorage,\n retryPromise,\n setSessionClearingState,\n} from \"../../utils/methods\";\nimport moment from \"moment-timezone\";\nimport request from 'superagent/lib/client';\nimport SuperTokensLock from 'browser-tabs-lock';\nimport Cookies from 'js-cookie'\nlet http = request;\nimport URI from \"urijs\";\nimport IdTokenVerifier from \"idtoken-verifier\";\nimport {SET_LOGGED_USER} from \"./actions\";\nimport {getRandomBytes, getSHA256} from \"../../utils/crypto\";\n\nimport {\n AUTH_ERROR_ACCESS_TOKEN_EXPIRED,\n AUTH_ERROR_MISSING_AUTH_INFO,\n AUTH_ERROR_MISSING_REFRESH_TOKEN,\n AUTH_ERROR_LOCK_ACQUIRE_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR,\n AUTH_ERROR_ID_TOKEN_INVALID,\n AUTH_ERROR_MISSING_OTP_PARAM,\n AUTH_ERROR_MISSING_PKCE_PARAM,\n AUTH_ERROR_MISSING_NONCE_PARAM,\n} from \"./constants\";\n\n/**\n * @ignore\n */\nconst Lock = new SuperTokensLock();\n/**\n * @ignore\n */\nconst GET_TOKEN_SILENTLY_LOCK_KEY = 'openstackuicore.lock.getTokenSilently';\nconst GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT = 6000;\nconst NONCE_LEN = 16;\nexport const ACCESS_TOKEN_SKEW_TIME = 60;\nexport const RESPONSE_TYPE_IMPLICIT = \"token id_token\";\nexport const RESPONSE_TYPE_CODE = 'code';\nconst AUTH_INFO = 'authInfo';\nconst NONCE = 'nonce';\nconst PKCE = 'pkce';\nconst ID_TOKEN = 'idToken';\nconst BACK_ULR_PARAM_NAME = 'BackUrl';\n\n\n/**\n *\n * @param backUrl\n * @param prompt\n * @param tokenIdHint\n * @param provider\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n * @param backUrlParamName\n * @returns {*}\n */\nexport const getAuthUrl = (\n backUrl = null,\n prompt = null,\n tokenIdHint = null,\n provider = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null,\n backUrlParamName = BACK_ULR_PARAM_NAME\n ) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let baseUrl = getOAuth2IDPBaseUrl();\n let scopes = getOAuth2Scopes();\n let flow = getOAuth2Flow();\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n let nonce = createNonce(NONCE_LEN);\n\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let query = {\n \"response_type\": encodeURI(flow),\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"response_mode\": 'fragment',\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n if (flow === RESPONSE_TYPE_CODE) {\n const pkce = createPKCECodes()\n putOnLocalStorage(PKCE, JSON.stringify(pkce));\n query['code_challenge'] = pkce.codeChallenge;\n query['code_challenge_method'] = 'S256';\n query['approval_prompt'] = 'force';\n }\n\n if (prompt) {\n query['prompt'] = prompt;\n }\n\n if (scopes && scopes.includes('offline_access')) {\n // then we need to force prompt=consent bc we are requesting an offline access\n // and we need to let the user know\n query['prompt'] = 'consent';\n }\n\n if (tokenIdHint) {\n query['id_token_hint'] = tokenIdHint;\n }\n\n if (provider) {\n query['provider'] = provider;\n }\n\n if (otpLoginHint) {\n query['otp_login_hint'] = otpLoginHint;\n }\n\n if (loginHint) {\n query['login_hint'] = encodeURI(loginHint);\n }\n\n if (tenant) {\n query['tenant'] = tenant;\n }\n\n url = url.query(query);\n //console.log(`getAuthUrl ${url.toString()}`);\n return url;\n}\n\n/**\n * @param idToken\n * @returns {*}\n */\nexport const getLogoutUrl = (idToken = null) => {\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let url = URI(`${baseUrl}/oauth2/end-session`);\n let state = createNonce(NONCE_LEN);\n let postLogOutUri = `${getOrigin()}/auth/logout`;\n // store nonce to check it later\n putOnLocalStorage('post_logout_state', state);\n /**\n * post_logout_redirect_uri should be listed on oauth2 client settings\n * on IDP\n * \"Security Settings\" Tab -> Logout Options -> Post Logout Uris\n */\n const queryParams = {\n \"post_logout_redirect_uri\": encodeURI(postLogOutUri),\n \"client_id\": encodeURI(oauth2ClientId),\n \"state\": state,\n }\n\n if (idToken)\n queryParams.id_token_hint = idToken;\n\n return url.query(queryParams);\n}\n\nconst createNonce = (len) => {\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let nonce = '';\n for (let i = 0; i < len; i++) {\n nonce += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return nonce;\n}\n\n/**\n *\n * @param backUrl\n * @param provider\n * @param prompt\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n */\nexport const doLogin = (\n backUrl = null,\n provider = null,\n prompt = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null\n) => {\n let url = getAuthUrl(backUrl, prompt, null, provider, loginHint, otpLoginHint, tenant);\n let location = getCurrentLocation()\n location.replace(url.toString());\n}\n\n/**\n *\n * @param backUrl\n * @param loginHint\n * @param otpLoginHint\n */\nexport const doLoginBasicLogin = (backUrl = null, loginHint = null, otpLoginHint = null) => {\n doLogin(backUrl, null, null, loginHint, otpLoginHint);\n}\n\nconst createPKCECodes = () => {\n const codeVerifier = base64URLEncode(getRandomBytes(64))\n const codeChallenge = getSHA256(codeVerifier, 'Base64url')\n const createdAt = new Date()\n const codePair = {\n codeVerifier,\n codeChallenge,\n createdAt\n }\n return codePair\n}\n\n/**\n\n * @param code\n * @param backUrl\n * @param backUrlParamName\n * @returns {Promise<{access_token: *, refresh_token: *, id_token: *, expires_in: *, error: *, error_description: *}>}\n */\nexport const emitAccessToken = async (code, backUrl = null, backUrlParamName = BACK_ULR_PARAM_NAME) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let pkce = JSON.parse(getFromLocalStorage(PKCE, true));\n\n if (!pkce)\n throw Error(AUTH_ERROR_MISSING_PKCE_PARAM);\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n const payload = {\n 'code': code,\n 'grant_type': 'authorization_code',\n 'code_verifier': pkce.codeVerifier,\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n try {\n //const response = await http.post(`${baseUrl}/oauth2/token`, payload);\n //const {body: {access_token, refresh_token, id_token, expires_in}} = response;\n const response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }).catch(function (error) {\n console.log('Request failed:', error.message);\n });\n const json = await response.json();\n let {access_token, refresh_token, id_token, expires_in, error, error_description} = json;\n return {access_token, refresh_token, id_token, expires_in, error, error_description}\n } catch (err) {\n console.log(err);\n }\n};\n\nexport const MAX_RETRIES = 5;\nexport const BACKOFF_BASE_MS = 1000;\nexport const REFRESH_TOKEN_FETCH_TIMEOUT_MS = 10000;\n\nexport const retryWithBackoff = async (fn, maxRetries = MAX_RETRIES, baseDelayMs = BACKOFF_BASE_MS) => {\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n return await fn();\n } catch (err) {\n // only retry transient network/server errors — everything else fails fast\n const isRetryable = err.message && err.message.startsWith(AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR);\n if (!isRetryable || attempt === maxRetries - 1) {\n throw err;\n }\n const delay = baseDelayMs * Math.pow(2, attempt);\n console.log(`retryWithBackoff retry ${attempt + 1}/${maxRetries} in ${delay}ms`);\n await new Promise(resolve => setTimeout(resolve, delay));\n }\n }\n};\n\nconst processRefreshToken = async (flow, refreshToken) => {\n\n if (flow === RESPONSE_TYPE_CODE && useOAuth2RefreshToken()) {\n if (!refreshToken) {\n clearAuthInfo();\n throw Error(AUTH_ERROR_MISSING_REFRESH_TOKEN);\n }\n\n let response = await retryWithBackoff(() => refreshAccessToken(refreshToken));\n let {access_token, expires_in, refresh_token, id_token} = response;\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n return access_token;\n }\n clearAuthInfo();\n throw Error(AUTH_ERROR_ACCESS_TOKEN_EXPIRED);\n}\n\n/**\n * @returns {Promise<*>}\n * @private\n */\nconst _getAccessToken = async () => {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken`);\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n let flow = getOAuth2Flow();\n // check lifetime\n const now = moment().unix();\n let timeElapsedSecs = (now - accessTokenUpdatedAt);\n\n expiresIn = (expiresIn - ACCESS_TOKEN_SKEW_TIME);\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${now} accessTokenUpdatedAt ${accessTokenUpdatedAt} expiresIn ${expiresIn} timeElapsedSecs ${timeElapsedSecs}`)\n if (timeElapsedSecs >= expiresIn || accessToken == null) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ...`);\n accessToken = await processRefreshToken(flow, refreshToken);\n }\n return accessToken;\n}\n\n/**\n * Optional resolver for getAccessToken, set via setAccessTokenResolver. When\n * present, getAccessToken delegates to it; otherwise the built-in flow runs.\n * Pass a non-function (or nothing) to reset to the built-in.\n *\n * The slot lives on globalThis under a Symbol.for key so every copy of this\n * module shares it: bundles that inlined methods.js, nested installs of the\n * package, and symlinked dev installs all read the same registry entry.\n */\nconst ACCESS_TOKEN_RESOLVER_KEY = Symbol.for('openstack-uicore-foundation.accessTokenResolver');\n\nexport const setAccessTokenResolver = (resolver) => {\n globalThis[ACCESS_TOKEN_RESOLVER_KEY] = typeof resolver === 'function' ? resolver : null;\n};\n\n/**\n * @returns {Promise<*|undefined>}\n */\nexport const getAccessToken = async () => {\n const resolveAccessToken = globalThis[ACCESS_TOKEN_RESOLVER_KEY];\n if (resolveAccessToken) return resolveAccessToken();\n\n if (typeof navigator !== 'undefined' && navigator.locks) {\n return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::getAccessToken web lock api`, lock);\n return await _getAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n return await _getAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n/**\n * @private\n */\nconst _clearAccessToken = () => {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken`);\n\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n\n storeAuthInfo(null, 0, refreshToken)\n}\n\nexport const clearAccessToken = async () => {\n // see https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n if (typeof navigator !== 'undefined' && navigator.locks) {\n await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::clearAccessToken web lock api`, lock);\n _clearAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n _clearAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n\nexport const refreshAccessToken = async (refresh_token) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n\n const payload = {\n 'grant_type': 'refresh_token',\n \"client_id\": encodeURI(oauth2ClientId),\n \"refresh_token\": refresh_token\n };\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), REFRESH_TOKEN_FETCH_TIMEOUT_MS);\n\n let response;\n try {\n response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload),\n signal: controller.signal\n });\n } catch (networkError) {\n // fetch rejects on network failures (DNS, timeout, no connectivity, abort)\n console.log('refreshAccessToken network error:', networkError.message);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${networkError.message}`);\n } finally {\n clearTimeout(timeoutId);\n }\n\n if (!response.ok) {\n console.log(`refreshAccessToken server error: ${response.status} - ${response.statusText}`);\n if (response.status >= 500 || response.status === 408 || response.status === 429) {\n // transient error (server error, request timeout, rate limit) — should be retried\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${response.status} - ${response.statusText}`);\n }\n // token is genuinely revoked — this is a real auth error\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${response.status} - ${response.statusText}`);\n }\n\n let json;\n try {\n json = await response.json();\n } catch (parseError) {\n // IDP returned non-JSON (HTML error page, empty body, etc.) — treat as transient\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`);\n }\n let {access_token, refresh_token: new_refresh_token, expires_in, id_token} = json;\n // Defensively ensure we never propagate an undefined access token.\n if (!access_token) {\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);\n }\n return {access_token, refresh_token: new_refresh_token, expires_in, id_token}\n}\n\nexport const storeAuthInfo = (accessToken, expiresIn, refreshToken = null, idToken = null) => {\n\n let formerAuthInfo = getAuthInfo();\n\n let authInfo = {\n accessToken: accessToken,\n expiresIn: expiresIn,\n accessTokenUpdatedAt: Math.floor(Date.now() / 1000),\n };\n\n if (refreshToken == null && formerAuthInfo) {\n refreshToken = formerAuthInfo.refreshToken;\n }\n\n if (idToken == null && formerAuthInfo) {\n idToken = formerAuthInfo.idToken;\n }\n\n if (refreshToken) {\n authInfo['refreshToken'] = refreshToken;\n }\n\n if (idToken) {\n authInfo[ID_TOKEN] = idToken;\n Cookies.set(ID_TOKEN, idToken, {secure: true, sameSite: 'Lax'});\n } else {\n Cookies.remove(ID_TOKEN);\n }\n\n putOnLocalStorage(AUTH_INFO, JSON.stringify(authInfo));\n}\n\nexport const getAuthInfo = () => {\n try {\n let res = getFromLocalStorage(AUTH_INFO, false)\n if (!res) return null;\n return JSON.parse(res);\n } catch (err) {\n return null;\n }\n}\n\nexport const clearAuthInfo = () => {\n if (typeof window !== 'undefined') {\n removeFromLocalStorage(AUTH_INFO);\n Cookies.remove(ID_TOKEN);\n }\n};\n\nexport const getIdToken = () => {\n if (typeof window !== 'undefined') {\n const authInfo = getAuthInfo();\n if (authInfo) {\n return authInfo.idToken;\n }\n return null;\n }\n return null;\n};\n\nexport const getOAuth2ClientId = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_CLIENT_ID;\n }\n return null;\n};\n\nexport const getOAuth2Flow = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_FLOW || \"token id_token\";\n }\n return \"token id_token\";\n}\n\nexport const useOAuth2RefreshToken = () => {\n if (typeof window !== 'undefined') {\n return new Boolean(window.OAUTH2_USE_REFRESH_TOKEN || true);\n }\n return true;\n}\n\nexport const getOAuth2IDPBaseUrl = () => {\n if (typeof window !== 'undefined') {\n return window.IDP_BASE_URL;\n }\n return null;\n};\n\nexport const getOAuth2Scopes = () => {\n if (typeof window !== 'undefined') {\n return window.SCOPES;\n }\n return null;\n};\n\nexport const initLogOut = () => {\n let location = getCurrentLocation();\n location.replace(getLogoutUrl(getIdToken()).toString());\n}\n\nexport const validateIdToken = (idToken, issuer, audience) => {\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n let storedNonce = getFromLocalStorage(NONCE, true);\n if (!storedNonce)\n throw Error(AUTH_ERROR_MISSING_NONCE_PARAM);\n\n let jwt = verifier.decode(idToken);\n let alg = jwt.header.alg;\n let kid = jwt.header.kid;\n let aud = jwt.payload.aud;\n let iss = jwt.payload.iss;\n let exp = jwt.payload.exp;\n let nbf = jwt.payload.nbf;\n let tnonce = jwt.payload.nonce || null;\n\n return tnonce == storedNonce && aud == audience && iss == issuer;\n}\n\nexport const passwordlessStart = (params) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let nonce = createNonce(NONCE_LEN);\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let payload = {\n \"response_type\": \"otp\",\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"client_id\": encodeURI(oauth2ClientId),\n \"connection\": params.connection || \"email\",\n \"send\": params.send || \"code\",\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n if (params.hasOwnProperty('redirect_uri')) {\n payload[\"redirect_uri\"] = encodeURIComponent(params.redirect_uri);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n let json = res.body;\n return Promise.resolve({response: json});\n }).catch((err) => {\n return Promise.reject(err);\n });\n\n}\n\nexport const passwordlessLogin = (params) => (dispatch) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/token`);\n\n if (!params.hasOwnProperty(\"otp\")) {\n throw Error(AUTH_ERROR_MISSING_OTP_PARAM);\n }\n\n let payload = {\n \"grant_type\": \"passwordless\",\n \"connection\": params.connection || \"email\",\n \"scope\": encodeURI(scopes),\n \"client_id\": encodeURI(oauth2ClientId),\n \"otp\": params.otp\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n try {\n // now we got token\n let json = res.body;\n let {access_token, expires_in, refresh_token, id_token} = json;\n\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n\n if (typeof id_token === 'undefined') {\n id_token = null; // not using rotate policy\n }\n\n // verify id token\n\n if (id_token) {\n if (!validateIdToken(id_token, baseUrl, oauth2ClientId)) {\n throw Error(AUTH_ERROR_ID_TOKEN_INVALID);\n }\n }\n\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n\n if (dispatch) {\n dispatch({\n type: SET_LOGGED_USER,\n payload: {sessionState: null}\n });\n }\n\n return Promise.resolve({response: json});\n } catch (e) {\n console.log(e);\n return Promise.reject(e);\n }\n }).catch((err) => {\n return Promise.reject(err);\n });\n}\n\nexport const isIdTokenAlive = (nowEpoch = null) => () => {\n\n if (!nowEpoch) {\n nowEpoch = Math.floor(Date.now() / 1000);\n }\n\n const idToken = getIdToken();\n if (!idToken)\n throw Error('Id Token not set.');\n\n const issuer = getOAuth2IDPBaseUrl();\n const audience = getOAuth2ClientId();\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n const jwt = verifier.decode(idToken);\n const exp = jwt.payload.exp;\n\n // check life time\n return exp - (nowEpoch + ACCESS_TOKEN_SKEW_TIME) > 0;\n}\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific flanguage governing permissions and\n * limitations under the License.\n **/\n\nimport request from 'superagent/lib/client';\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\n\nlet http = request;\nimport Swal from 'sweetalert2';\nimport T from \"i18n-react/dist/i18n-react\";\nimport { isClearingSessionState, setSessionClearingState, getCurrentPathName } from './methods';\nimport { CLEAR_SESSION_STATE } from '../components/security/actions';\nimport { doLogin, initLogOut } from '../components/security/methods';\n\nexport const GENERIC_ERROR = \"Yikes. Something seems to be broken. Our web team has been notified, and we apologize for the inconvenience.\";\nexport const RESET_LOADING = 'RESET_LOADING';\nexport const START_LOADING = 'START_LOADING';\nexport const STOP_LOADING = 'STOP_LOADING';\nexport const VALIDATE = 'VALIDATE';\nexport const CLEAR_MESSAGE = 'CLEAR_MESSAGE';\nexport const SHOW_MESSAGE = 'SHOW_MESSAGE';\n\nexport const createAction = type => payload => ({\n type,\n payload\n});\n\nexport const resetLoading = createAction(RESET_LOADING);\nexport const startLoading = createAction(START_LOADING);\nexport const stopLoading = createAction(STOP_LOADING);\n\nconst xhrs = {};\nconst etagCache = {};\n\nconst cancel = (key) => {\n if(xhrs[key]) {\n xhrs[key].abort();\n console.log(`aborted request ${key}`);\n delete xhrs[key];\n }\n}\n\nconst schedule = (key, req) => {\n // console.log(`scheduling ${key}`);\n xhrs[key] = req;\n};\n\nconst isObjectEmpty = (obj) => {\n return Object.keys(obj).length === 0 && obj.constructor === Object ;\n}\n\nconst buildNotifyHandlerPayload = (httpCode, title, content, type) => ({ httpCode, title, html: content, type });\nconst buildNotifyHandlerErrorPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"error\");\nconst buildNotifyHandlerWarningPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"warning\");\n\nconst initLogin = () => (dispatch) => {\n const currentLocation = getCurrentPathName();\n const clearingSessionState = isClearingSessionState();\n dispatch({\n type: CLEAR_SESSION_STATE,\n payload: {}\n });\n if (!clearingSessionState) {\n setSessionClearingState(true);\n console.log(\"authErrorHandler 401 - re login\");\n doLogin(currentLocation);\n }\n};\n\nconst normalizeFormDataPayload = (req, formData) => {\n if(!isObjectEmpty(formData)) {\n Object.keys(formData).forEach(function (key) {\n let value = formData[key];\n if (Array.isArray(value)) {\n value.forEach(item => {\n req.field(`${key}[]`, item);\n });\n } else {\n req.field(key, value);\n }\n });\n }\n};\n\nexport const authErrorHandler = (\n err,\n res,\n notifyErrorHandler = showMessage\n) => (dispatch) => {\n\n const code = err.status;\n let msg = \"\";\n let payload, callback;\n\n dispatch(stopLoading());\n\n switch (code) {\n case 401:\n if (notifyErrorHandler !== showMessage) {\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_auth\"));\n callback = () => dispatch(initLogin());\n } else {\n dispatch(initLogin());\n }\n break;\n case 403:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_authz\"));\n callback = initLogOut;\n break;\n case 404:\n msg = err.response.body?.message || err.response.error?.message || err.message;\n if (err.response.body?.errors?.length) {\n msg += ` ${err.response.body.errors.join(\" \")}`;\n }\n payload = buildNotifyHandlerWarningPayload(code, \"Not Found\", msg);\n break;\n case 412:\n for (const [key, value] of Object.entries(err.response.body.errors)) {\n msg += isNaN(key) ? `${key}: ` : \"\";\n msg += `${value} `;\n }\n dispatch({\n type: VALIDATE,\n payload: { errors: err.response.body.errors }\n });\n payload = buildNotifyHandlerWarningPayload(code, \"Validation error\", msg);\n break;\n default:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.server_error\"));\n }\n\n if (payload)\n dispatch(notifyErrorHandler(payload, callback));\n}\n\nexport const getRequest =(\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {},\n useEtag = false\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n let key = url.toString();\n\n if(!isObjectEmpty(params)) {\n // remove the access token\n const { access_token: _, ...newParams} = params;\n // and generate new key\n key = url.query(newParams).toString();\n url = url.query(params);\n }\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n cancel(key);\n\n return new Promise((resolve, reject) => {\n let req = http.get(url.toString());\n if(useEtag && etagCache.hasOwnProperty(key)){\n const { etag } = etagCache[key];\n if(etag){\n req.set('If-None-Match', etag)\n }\n }\n\n req.timeout({\n response: 60000,\n deadline: 60000,\n })\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key, useEtag))\n\n schedule(key, req);\n });\n};\n\nexport const putRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => ( dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n http.put(url.toString())\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject))\n });\n};\n\nexport const deleteRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params) => (dispatch, state) => {\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n\n http.delete(url)\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n let request = http.post(url);\n\n if(payload != null)\n request.send(payload);\n else // to be a simple CORS request\n request.set('Content-Type', 'text/plain');\n\n request.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.post(url)\n .attach('file', file);\n\n normalizeFormDataPayload(req, fileMetadata);\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const putFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file = null,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.put(url);\n\n if(file != null){\n req.attach('file', file);\n }\n\n normalizeFormDataPayload(req, fileMetadata)\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const defaultErrorHandler = (err, res) => (dispatch) => {\n let body = res.body;\n let text = '';\n if(body instanceof Object){\n if(body.hasOwnProperty('message'))\n text = body.message;\n }\n Swal.fire(res.statusText, text, \"error\");\n}\n\nconst byLowerCase = toFind => value => toLowerCase(value) === toFind;\nconst toLowerCase = value => value.toLowerCase();\nconst getKeys = headers => Object.keys(headers);\n\nexport const getHeaderCaseInsensitive = (headerName, headers = {}) => {\n const key = getKeys(headers).find(byLowerCase(headerName));\n return key ? headers[key] : undefined;\n};\n\nexport const responseHandler = ( dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key = null, useEtag= false ) =>\n\n (err, res) => {\n\n if (err || !res.ok) {\n let code = err.status;\n\n if(code === 304 && etagCache.hasOwnProperty(key) && useEtag){\n const { body } = etagCache[key];\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: body}));\n return resolve({response: body});\n }\n\n dispatch(receiveActionCreator);\n return resolve({response: body});\n }\n if(errorHandler) {\n errorHandler(err, res)(dispatch, state);\n }\n return reject({ err, res, dispatch, state })\n }\n\n let json = res.body;\n\n if(useEtag) {\n const responseETAG = getHeaderCaseInsensitive('etag', res.headers);\n if (responseETAG) {\n etagCache[key] = { etag: responseETAG, body: json};\n }\n }\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: json}));\n return resolve({response: json});\n }\n dispatch(receiveActionCreator);\n return resolve({response: json});\n}\n\n\nexport const fetchErrorHandler = (response) => {\n let code = response.status;\n let msg = response.statusText;\n\n switch (code) {\n case 403:\n Swal.fire(\"ERROR\", T.translate(\"errors.user_not_authz\"), \"warning\");\n break;\n case 401:\n Swal.fire(\"ERROR\", T.translate(\"errors.session_expired\"), \"error\");\n break;\n case 412:\n Swal.fire(\"ERROR\", msg, \"warning\");\n case 500:\n Swal.fire(\"ERROR\", T.translate(\"errors.server_error\"), \"error\");\n }\n}\n\nexport const fetchResponseHandler = (response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.json();\n }\n}\n\nexport const showMessage = (settings, callback = null) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire(settings).then((result) => {\n if (result.value && typeof callback === 'function') {\n callback();\n }\n });\n}\n\nexport const showSuccessMessage = (html) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire({\n title: T.translate(\"general.done\"),\n html: html,\n type: 'success'\n });\n}\n\nexport const downloadFileByContent = (filename, content, mime) => {\n let link = document.createElement('a');\n link.textContent = 'download';\n link.download = filename;\n link.href = `data:${mime},${encodeURIComponent(content)}`\n document.body.appendChild(link); // Required for FF\n link.click();\n document.body.removeChild(link);\n}\n\nexport const getCSV = (endpoint, params, filename, header = null) => (dispatch) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n dispatch(startLoading());\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n dispatch(stopLoading());\n\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n downloadFileByContent(filename, csv, 'text/csv;charset=utf-8');\n })\n .catch(fetchErrorHandler);\n};\n\nexport const getRawCSV = (endpoint, params, header = null) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n\n return csv;\n })\n .catch(fetchErrorHandler);\n};\n\nexport const escapeFilterValue = (value) => {\n value = String(value);\n // escape backslash first so you don't accidentally break your own escapes\n value = value.replace(/\\\\/g, \"\\\\\\\\\");\n value = value.replace(/,/g, \"\\\\,\");\n value = value.replace(/;/g, \"\\\\;\");\n // especial case for literal +\n value = value.replace(/\\+/g, \"%2B\");\n return value;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"spark-md5\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/sha256\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-base64url\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-hex\");","import SparkMD5 from \"spark-md5\";\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nconst MAX_BYTES = 65536\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nconst MAX_UINT32 = 4294967295\nconst crypto = typeof window !== 'undefined' ? (window.crypto || window.msCrypto) : null;\nimport sha256 from 'crypto-js/sha256';\nimport Base64url from 'crypto-js/enc-base64url'\nimport Hex from 'crypto-js/enc-hex'\nexport const getRandomBytes = (size) => {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n const bytes = Buffer.allocUnsafe(size)\n if(!crypto) return a;\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (let generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n return bytes\n}\n\nexport const getSHA256 = (message, format = 'hex') => {\n\n let f = Hex;\n if(format === 'Base64url')\n f = Base64url;\n\n return sha256(message).toString(f);\n}\n\nexport const getMD5 = (file) => {\n return new Promise((resolve, reject) => {\n const chunkSize = 2 * 1024 * 1024; // 2 MB by chunk\n const spark = new SparkMD5.ArrayBuffer();\n const fileReader = new FileReader();\n let cursor = 0;\n\n fileReader.onload = e => {\n spark.append(e.target.result); \n cursor += chunkSize;\n\n if (cursor < file.size) {\n readNextChunk();\n } else {\n resolve(spark.end()); // final MD5\n }\n };\n\n fileReader.onerror = () => reject(\"Error reading the file\");\n\n function readNextChunk() {\n const slice = file.slice(cursor, cursor + chunkSize);\n fileReader.readAsArrayBuffer(slice);\n }\n\n readNextChunk();\n });\n}","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"lodash/debounce\");","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport { fetchErrorHandler, fetchResponseHandler, escapeFilterValue } from \"./actions\";\nimport { getAccessToken } from '../components/security/methods';\nimport { buildAPIBaseUrl } from \"./methods\";\nimport debounce from 'lodash/debounce';\nexport const RECEIVE_COUNTRIES = 'RECEIVE_COUNTRIES';\nconst callDelay = 500; // milliseconds\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\nexport const DEFAULT_PAGE_SIZE = 10;\n\nconst _fetchPublic = async (endpoint, callback, options = {}) => {\n return fetch(buildAPIBaseUrl(endpoint.toString()), options)\n .then(fetchResponseHandler)\n .then((json) => {\n if(typeof callback === 'function')\n callback(json.data);\n })\n .catch(response => {\n const code = response && response.status;\n if (code === 404 && typeof callback === 'function') callback([]);\n return response;\n })\n .catch(fetchErrorHandler);\n}\n\n/**\n * @param endpoint\n * @param callback\n * @param options\n * @returns {Promise}\n * @private\n */\nconst _fetch = async (endpoint, callback, options = {}) => {\n\n let accessToken;\n\n try {\n accessToken = await getAccessToken();\n } catch (e) {\n // The caller is told through its callback; the query* functions do not\n // await this promise, so rejecting here would only surface as an\n // unhandled rejection.\n if(typeof callback === 'function')\n callback(e);\n return;\n }\n\n endpoint.addQuery('access_token', accessToken);\n\n return _fetchPublic(endpoint, callback, options);\n}\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryMembers = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/members`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryAttendees = debounce(async (summitId, input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n \n let endpoint = URI(`/api/v1/summits/${summitId}/attendees`);\n \n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n \n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name=@${input},email=@${input}`);\n }\n \n _fetch(endpoint, callback);\n \n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySummits = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/all`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySpeakers = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE ) => {\n\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/speakers`:`speakers`}`);\n\n endpoint.addQuery('expand', `member,registration_request`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTags = debounce(async (summitId, input, callback, per_page = 50) => {\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/track-tag-groups/all/allowed-tags`:`tags`}`);\n\n if(summitId)\n endpoint.addQuery('expand', `tag,track_tag_group`);\n\n endpoint.addQuery('order','tag');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `tag@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTracks = debounce(async (summitId, input, callback, excludedIds = [], per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/tracks`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if (excludedIds?.length > 0) {\n endpoint.addQuery('filter[]', `not_id==${excludedIds.join(\"||\")}`);\n }\n\n if (input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTrackGroups = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/track-groups`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=, *): Promise)|*>}\n */\nexport const queryEvents = debounce(async (summitId, input, onlyPublished = false, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/events` + (onlyPublished ? '/published' : ''));\n\n endpoint.addQuery('order','title');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=, *=): Promise)|*>}\n */\nexport const queryEventTypes = debounce(async (summitId, input, callback, eventTypeClassName = null, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/event-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n if (eventTypeClassName) {\n eventTypeClassName = escapeFilterValue(eventTypeClassName);\n endpoint.addQuery('filter[]', `class_name==${eventTypeClassName}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryGroups = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/groups`);\n\n endpoint.addQuery('order','title,code');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input},code@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryCompanies = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/companies`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryRegistrationCompanies = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/registration-companies`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsors = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type')\n endpoint.addQuery('order','id')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsorsWithBadgeScans = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type');\n endpoint.addQuery('fields','id,company.name,sponsorship.type.name');\n endpoint.addQuery('relations','none,company.none,sponsorship.type.none');\n endpoint.addQuery('filter[]','badge_scans_count>0');\n endpoint.addQuery('order','+company_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryAccessLevels = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/access-level-types`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryOrganizations = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/organizations`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\nexport const getLanguageList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/languages`), callback, { signal });\n};\n\nexport const getCountryList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/countries`), callback, { signal });\n};\n\nlet geocoder;\n\nexport const geoCodeAddress = (address) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\nexport const geoCodeLatLng = (lat, lng) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n let latlng = {lat: parseFloat(lat), lng: parseFloat(lng)};\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'location': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\n/**\n * @type {DebouncedFunc<(function(*, *=, *, *=, *=): Promise)|*>}\n */\nexport const queryTicketTypes = debounce(async (summitId, filters = {}, callback, version = 'v1', per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/${version}/summits/${summitId}/ticket-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(filters.hasOwnProperty('name')) {\n const name = escapeFilterValue(filters.name);\n if(name && name != '')\n endpoint.addQuery('filter[]', `name@@${name}`);\n }\n\n if(filters.hasOwnProperty('audience')){\n const audience = escapeFilterValue(filters.audience);\n if(audience && audience != '')\n endpoint.addQuery('filter[]', `audience==${audience}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySponsoredProjects = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n\n const endpoint = URI(`/api/v1/sponsored-projects`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryPromocodes = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE, extraFilters = []) => {\n\n\n let endpoint = URI(`/api/v1/summits/${summitId}/promo-codes`);\n\n endpoint.addQuery('order','code')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `code@@${input}`);\n }\n\n //eg: filter = 'class_name==SummitRegistrationPromoCode'\n for (const filter of extraFilters) {\n endpoint.addQuery('filter[]', filter);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"idtoken-verifier\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"react-select/lib/Async\");","module.exports = require(\"superagent/lib/client\");","module.exports = require(\"sweetalert2\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React, {useState} from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport {queryAttendees} from '../../utils/query-actions';\n\nconst AttendeeInput = ({id, value, summitId, error, multi, onChange, getOptionValue, getOptionLabel, queryFunction, ...rest}) => {\n const queryFn = queryFunction || queryAttendees;\n const [_value, _setValue] = useState(value);\n const has_error = ( error !== '' );\n\n const _getOptionValue = (attendee) => {\n if (getOptionValue){\n return getOptionValue(attendee);\n }\n //default\n return attendee.id;\n }\n\n const _getOptionLabel = (attendee) => {\n if (getOptionLabel){\n return getOptionLabel(attendee);\n }\n //default\n return `${attendee.first_name} ${attendee.last_name} (${attendee.id})`;\n }\n\n const handleChange = (value) => {\n let ev = {target: {\n id: id,\n value: value,\n type: 'attendeeinput'\n }};\n\n onChange(ev);\n }\n\n const getAttendees = (input, callback) => {\n if (!input) {\n return Promise.resolve({ options: [] });\n }\n queryFn(summitId, input, callback);\n }\n \n return (\n \n
_getOptionValue(m)}\n getOptionLabel={m => _getOptionLabel(m)}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n \n \n );\n}\n\nexport default AttendeeInput;\n\n"],"names":["root","factory","exports","module","define","amd","this","AUTH_ERROR_MISSING_AUTH_INFO","AUTH_ERROR_MISSING_REFRESH_TOKEN","AUTH_ERROR_ACCESS_TOKEN_EXPIRED","AUTH_ERROR_LOCK_ACQUIRE_ERROR","AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR","AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR","require","Lock","SuperTokensLock","GET_TOKEN_SILENTLY_LOCK_KEY","RESPONSE_TYPE_CODE","AUTH_INFO","ID_TOKEN","processRefreshToken","async","flow","refreshToken","useOAuth2RefreshToken","clearAuthInfo","Error","response","fn","maxRetries","baseDelayMs","attempt","err","message","startsWith","delay","Math","pow","console","log","Promise","resolve","setTimeout","retryWithBackoff","refreshAccessToken","access_token","expires_in","refresh_token","id_token","storeAuthInfo","_getAccessToken","authInfo","getAuthInfo","accessToken","expiresIn","accessTokenUpdatedAt","getOAuth2Flow","now","moment","unix","timeElapsedSecs","ACCESS_TOKEN_RESOLVER_KEY","Symbol","for","getAccessToken","resolveAccessToken","globalThis","navigator","locks","request","lock","retryPromise","acquireLock","releaseLock","baseUrl","getOAuth2IDPBaseUrl","oauth2ClientId","getOAuth2ClientId","payload","encodeURI","controller","AbortController","timeoutId","abort","json","fetch","method","headers","body","JSON","stringify","signal","networkError","clearTimeout","ok","status","statusText","setSessionClearingState","parseError","new_refresh_token","idToken","formerAuthInfo","floor","Date","Cookies","secure","sameSite","putOnLocalStorage","res","getFromLocalStorage","parse","window","removeFromLocalStorage","OAUTH2_CLIENT_ID","OAUTH2_FLOW","Boolean","OAUTH2_USE_REFRESH_TOKEN","IDP_BASE_URL","URI","createAction","type","fetchErrorHandler","code","msg","Swal","T","fetchResponseHandler","escapeFilterValue","value","String","replace","crypto","msCrypto","buildAPIBaseUrl","relativeUrl","API_BASE_URL","key","localStorage","setItem","removeIt","val","getItem","removeItem","clearing_session_state","cb","maxNumberOfRetries","i","callDelay","_fetchPublic","endpoint","callback","options","toString","then","data","catch","_fetch","e","addQuery","queryAttendees","debounce","input","per_page","DEFAULT_PAGE_SIZE","summitId","excludedIds","length","join","onlyPublished","eventTypeClassName","filters","version","hasOwnProperty","name","audience","extraFilters","filter","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","toStringTag","_ref","id","error","multi","onChange","getOptionValue","getOptionLabel","queryFunction","rest","_objectWithoutProperties","_excluded","queryFn","_value","_setValue","useState","has_error","React","AsyncSelect","_extends","target","loadOptions","getAttendees","m","attendee","_getOptionValue","first_name","last_name","_getOptionLabel","className"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/checkbox-list.js b/lib/components/inputs/checkbox-list.js
new file mode 100644
index 00000000..01b16421
--- /dev/null
+++ b/lib/components/inputs/checkbox-list.js
@@ -0,0 +1,2 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={5028:(e,t,a)=>{a.d(t,{default:()=>p});var r=a(6031),l=a.n(r),n=a(2462),o=a.n(n),s=a(2015),i=a.n(s);const c=["children","replaceNewLine","className"],p=e=>{let{children:t,replaceNewLine:a=!1,className:r=""}=e,n=o()(e,c);return i().createElement("span",l()({className:r,dangerouslySetInnerHTML:{__html:a?null==t?void 0:t.replace(/\n/g," "):t}},n))}},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},1536:e=>{e.exports=require("awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9825:e=>{e.exports=require("prop-types")},2015:e=>{e.exports=require("react")}},t={};function a(r){var l=t[r];if(void 0!==l)return l.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,a),n.exports}(()=>{a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t}})(),(()=>{a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}})(),(()=>{a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var r={};a.r(r),a.d(r,{default:()=>m});var l=a(2462),n=a.n(l),o=a(9825),s=a.n(o),i=a(2015),c=a.n(i),p=a(6842),d=a.n(p),h=a(5028);a(1536);const u=["onChange","value","className","options","id","children","error","disabled","name","ariaLabelledBy"];class m extends c().Component{constructor(e){super(e);let t=!!e.value&&e.value.find((t=>!e.options.map((e=>e.value)).includes(t)));this.state={otherChecked:!!t},this.handleChange=this.handleChange.bind(this),this.handleOtherCBChange=this.handleOtherCBChange.bind(this)}handleChange(e){let t=this.props.options.map((e=>e.value)),a=this.props.value?[...this.props.value]:[];if("checkbox"===e.target.type)if(e.target.checked){const t=isNaN(e.target.value)?e.target.value:parseInt(e.target.value);a.push(t)}else a=a.filter((t=>t!=e.target.value));else a=a.filter((e=>t.includes(e))),a.push(e.target.value);let r={target:{id:this.props.id,value:a,type:"checkboxlist"}};this.props.onChange(r)}handleOtherCBChange(e){this.setState({otherChecked:e.target.checked})}render(){let e,t=this.props,{onChange:a,value:r,className:l,options:o,id:s,children:i,error:p,disabled:m,name:b,ariaLabelledBy:f}=t,{otherChecked:v}=(n()(t,u),this.state),g=this.props.hasOwnProperty("inline"),y=this.props.hasOwnProperty("allowOther"),x=!!r&&r.find((e=>!o.map((e=>e.value)).includes(e))),k=this.props.hasOwnProperty("error")&&""!==p,C=this.props.hasOwnProperty("disabled")&&1==m;return e=g?{paddingLeft:"22px",marginLeft:"20px",float:"left"}:{paddingLeft:"22px",marginTop:"7px"},c().createElement("div",{id:`chl_wrapper_${s}`,"aria-labelledby":f},c().createElement("div",{className:"checkboxes-div"+(k?" error":"")},o.map((t=>{let a=!!r&&r.includes(t.value);return c().createElement("div",{className:"form-check abc-checkbox",key:"radio_key_"+t.value,style:e},c().createElement("input",{type:"checkbox",id:`cb_${s}_${t.value}`,name:b||s,checked:a,disabled:C,onChange:this.handleChange,className:"form-check-input",value:t.value}),c().createElement("label",{className:"form-check-label",htmlFor:`cb_${s}_${t.value}`},c().createElement(h.default,null,t.label)))})),y&&c().createElement("div",{className:"form-check abc-checkbox",style:e},c().createElement("input",{type:"checkbox",id:"cb_other"+s,checked:v,disabled:C,onChange:this.handleOtherCBChange,className:"form-check-input",value:"other"}),c().createElement("label",{className:"form-check-label",htmlFor:"cb_other"+s},d().translate("general.other"))),y&&v&&c().createElement("div",{style:{paddingLeft:"22px",width:"50%"}},c().createElement("input",{className:"form-control",disabled:C,onChange:this.handleChange,value:x}))),k&&c().createElement("p",{className:"error-label"},p))}}return m.defaultProps={ariaLabelledBy:null},m.propTypes={id:s().string.isRequired},r})()));
+//# sourceMappingURL=checkbox-list.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/checkbox-list.js.map b/lib/components/inputs/checkbox-list.js.map
new file mode 100644
index 00000000..0610d65e
--- /dev/null
+++ b/lib/components/inputs/checkbox-list.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/checkbox-list.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,+KCHT,EAJgBC,IAAA,IAAC,SAACC,EAAQ,eAAEC,GAAiB,EAAK,UAAEC,EAAY,IAAYH,EAALI,EAAIC,IAAAL,EAAAM,GAAA,OACvEC,IAAAA,cAAA,OAAAC,IAAA,CAAML,UAAWA,EACXM,wBAAyB,CAAEC,OAAQR,EAAiBD,aAAQ,EAARA,EAAUU,QAAQ,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,GAAc1B,GACf7C,IAAAA,cAAA,OAAKgE,MAAO,CAACU,YAAa,OAAQQ,MAAO,QACrClF,IAAAA,cAAA,SAAOJ,UAAU,eAAeuE,SAAUM,EAAYZ,SAAUrE,KAAKsD,aAAcd,MAAOK,MAKjGmC,GACDxE,IAAAA,cAAA,KAAGJ,UAAU,eAAesE,GAKxC,E,OAGJjC,EAAakD,aAAe,CACxBd,eAAiB,MAIrBpC,EAAamD,UAAY,CACrBxB,GAAIyB,IAAAA,OAAiBC,Y","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/raw-html/index.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/inputs/checkbox-list.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","import React from 'react';\n\nconst RawHTML = ({children, replaceNewLine = false, className = \"\", ...rest}) =>\n ') : children}} {...rest}/>\n\nexport default RawHTML;","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"prop-types\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\nimport PropTypes from 'prop-types'\nimport React from 'react';\nimport T from 'i18n-react/dist/i18n-react';\nimport RawHTML from '../raw-html';\n\nimport \"awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css\";\n\nexport default class CheckboxList extends React.Component {\n\n constructor(props) {\n super(props);\n\n let otherValue = props.value ? props.value.find( v => !props.options.map(op => op.value).includes(v) ) : false;\n\n this.state = {\n otherChecked: !!otherValue\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.handleOtherCBChange = this.handleOtherCBChange.bind(this);\n }\n\n handleChange(event) {\n let optionValues = this.props.options.map(op => op.value);\n let value = this.props.value ? [...this.props.value] : [];\n\n if (event.target.type === 'checkbox') {\n if (event.target.checked) {\n const theVal = isNaN(event.target.value) ? event.target.value : parseInt(event.target.value);\n value.push(theVal);\n } else {\n value = value.filter( v => v != event.target.value )\n }\n } else {\n value = value.filter(v => optionValues.includes(v));\n value.push(event.target.value);\n }\n\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'checkboxlist'\n }};\n\n this.props.onChange(ev);\n }\n\n handleOtherCBChange(event) {\n this.setState({otherChecked: event.target.checked});\n }\n\n render() {\n\n let {onChange, value, className, options, id, children, error, disabled,name, ariaLabelledBy, ...rest} = this.props;\n let { otherChecked } = this.state;\n\n let inline = ( this.props.hasOwnProperty('inline') );\n let allowOther = ( this.props.hasOwnProperty('allowOther') );\n let otherValue = value ? value.find( v => !options.map(op => op.value).includes(v) ) : false ;\n let has_error = ( this.props.hasOwnProperty('error') && error !== '' );\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n\n\n let style, label;\n\n if (inline) {\n style = {\n paddingLeft: '22px',\n marginLeft: '20px',\n float: 'left'\n };\n } else {\n style = {\n paddingLeft: '22px',\n marginTop: '7px'\n }\n }\n\n return (\n \n
\n {has_error &&\n
{error}
\n }\n
\n );\n\n }\n}\n\nCheckboxList.defaultProps = {\n ariaLabelledBy : null,\n}\n\n\nCheckboxList.propTypes = {\n id: PropTypes.string.isRequired\n};\n"],"names":["root","factory","exports","module","define","amd","this","_ref","children","replaceNewLine","className","rest","_objectWithoutProperties","_excluded","React","_extends","dangerouslySetInnerHTML","__html","replace","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","CheckboxList","constructor","props","super","otherValue","find","v","options","map","op","includes","state","otherChecked","handleChange","bind","handleOtherCBChange","event","optionValues","target","type","checked","theVal","isNaN","parseInt","push","filter","ev","id","onChange","setState","render","style","_this$props","error","disabled","name","ariaLabelledBy","inline","allowOther","has_error","isDisabled","paddingLeft","marginLeft","float","marginTop","htmlFor","RawHTML","label","T","width","defaultProps","propTypes","PropTypes","isRequired"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/company-input-v2.js b/lib/components/inputs/company-input-v2.js
new file mode 100644
index 00000000..d461023c
--- /dev/null
+++ b/lib/components/inputs/company-input-v2.js
@@ -0,0 +1,2 @@
+!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={5097:(e,r,t)=>{t(1116),t(6842),t(9087),t(9558),t(2183)},3195:(e,r,t)=>{t.d(r,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>a,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>n,AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR:()=>d,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>i});const a="AUTH_ERROR_MISSING_AUTH_INFO",n="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",i="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR",d="AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR"},2183:(e,r,t)=>{t.d(r,{getAccessToken:()=>f});var a=t(9558),n=t(5812),o=t.n(n);t(806);const s=require("browser-tabs-lock");var i=t.n(s);const d=require("js-cookie");var l=t.n(d),u=(t(8041),t(9891),t(5097),t(8853),t(3195));const Lock=new(i()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",p="code",c="authInfo",y="idToken",m=async(e,r)=>{if(e===p&&S()){if(!r)throw O(),Error(u.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await(async(e,r=5,t=1e3)=>{for(let a=0;asetTimeout(e,n)))}})((()=>g(r))),{access_token:t,expires_in:a,refresh_token:n,id_token:o}=e;return void 0===n&&(n=null),E(t,a,n,o),t}throw O(),Error(u.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)},_=async()=>{console.log("openstack-uicore-foundation::Security::methods::_getAccessToken");let e=T();if(!e)throw console.log("openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO"),Error(u.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:r,expiresIn:t,accessTokenUpdatedAt:a,refreshToken:n}=e,s=Q();const i=o()().unix();let d=i-a;return t-=60,console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${i} accessTokenUpdatedAt ${a} expiresIn ${t} timeElapsedSecs ${d}`),(d>=t||null==r)&&(console.log("openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ..."),r=await m(s,n)),r},R=Symbol.for("openstack-uicore-foundation.accessTokenResolver"),f=async()=>{const e=globalThis[R];if(e)return e();if("undefined"!=typeof navigator&&navigator.locks)return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY,(async e=>(console.log("openstack-uicore-foundation::Security::methods::getAccessToken web lock api",e),await _())));if(!await(0,a.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))throw Error(u.AUTH_ERROR_LOCK_ACQUIRE_ERROR);try{return await _()}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}},g=async e=>{let r=w(),t=h();const n={grant_type:"refresh_token",client_id:encodeURI(t),refresh_token:e},o=new AbortController,s=setTimeout((()=>o.abort()),1e4);let i,d;try{i=await fetch(`${r}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n),signal:o.signal})}catch(e){throw console.log("refreshAccessToken network error:",e.message),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${e.message}`)}finally{clearTimeout(s)}if(!i.ok){if(console.log(`refreshAccessToken server error: ${i.status} - ${i.statusText}`),i.status>=500||408===i.status||429===i.status)throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${i.status} - ${i.statusText}`);throw(0,a.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${i.status} - ${i.statusText}`)}try{d=await i.json()}catch(e){throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`)}let{access_token:l,refresh_token:p,expires_in:c,id_token:y}=d;if(!l)throw(0,a.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);return{access_token:l,refresh_token:p,expires_in:c,id_token:y}},E=(e,r,t=null,n=null)=>{let o=T(),s={accessToken:e,expiresIn:r,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null==t&&o&&(t=o.refreshToken),null==n&&o&&(n=o.idToken),t&&(s.refreshToken=t),n?(s[y]=n,l().set(y,n,{secure:!0,sameSite:"Lax"})):l().remove(y),(0,a.putOnLocalStorage)(c,JSON.stringify(s))},T=()=>{try{let e=(0,a.getFromLocalStorage)(c,!1);return e?JSON.parse(e):null}catch(e){return null}},O=()=>{"undefined"!=typeof window&&((0,a.removeFromLocalStorage)(c),l().remove(y))},h=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,Q=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",S=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),w=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},9087:(e,r,t)=>{t.d(r,{escapeFilterValue:()=>c,fetchErrorHandler:()=>u,fetchResponseHandler:()=>p});t(2462),t(806);var a=t(8041),n=t.n(a),o=t(9236),s=t.n(o),i=t(6842),d=t.n(i);t(9558),t(5097),t(2183);n().escapeQuerySpace=!1;const l=e=>r=>({type:e,payload:r}),u=(l("RESET_LOADING"),l("START_LOADING"),l("STOP_LOADING"),e=>{let r=e.status,t=e.statusText;switch(r){case 403:s().fire("ERROR",d().translate("errors.user_not_authz"),"warning");break;case 401:s().fire("ERROR",d().translate("errors.session_expired"),"error");break;case 412:s().fire("ERROR",t,"warning");case 500:s().fire("ERROR",d().translate("errors.server_error"),"error")}}),p=e=>{if(e.ok)return e.json();throw e},c=e=>e=(e=(e=(e=(e=String(e)).replace(/\\/g,"\\\\")).replace(/,/g,"\\,")).replace(/;/g,"\\;")).replace(/\+/g,"%2B")},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,r,t)=>{t.d(r,{buildAPIBaseUrl:()=>a,getFromLocalStorage:()=>o,putOnLocalStorage:()=>n,removeFromLocalStorage:()=>s,retryPromise:()=>d,setSessionClearingState:()=>i});t(5812),t(8041);const a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,n=(e,r)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,r)},o=(e,r)=>{if("undefined"!=typeof window){let t=window.localStorage.getItem(e);return r&&(console.log(`getFromLocalStorage removing key ${e}`),s(e)),t}return null},s=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},d=async(e,r=3)=>{for(let t=0;t{t.d(r,{queryRegistrationCompanies:()=>y});var a=t(9087),n=t(2183),o=t(9558);const s=require("lodash/debounce");var i=t.n(s),d=t(8041),l=t.n(d);const u=500;l().escapeQuerySpace=!1;const p=async(e,r,t={})=>fetch((0,o.buildAPIBaseUrl)(e.toString()),t).then(a.fetchResponseHandler).then((e=>{"function"==typeof r&&r(e.data)})).catch((e=>(404===(e&&e.status)&&"function"==typeof r&&r([]),e))).catch(a.fetchErrorHandler),c=async(e,r,t={})=>{let a;try{a=await(0,n.getAccessToken)()}catch(e){return void("function"==typeof r&&r(e))}return e.addQuery("access_token",a),p(e,r,t)},y=(i()((async(e,r,t=10)=>{let n=l()("/api/v1/members");n.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),n.addQuery("order","first_name,last_name"),n.addQuery("page",1),n.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),n.addQuery("filter[]",`full_name@@${e},first_name@@${e},last_name@@${e},email@@${e}`)),c(n,r)}),u),i()((async(e,r,t,n=10)=>{let o=l()(`/api/v1/summits/${e}/attendees`);o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`full_name=@${r},email=@${r}`)),c(o,t)}),u),i()((async(e,r,t=10)=>{let n=l()("/api/v1/summits/all");n.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),c(n,r)}),u),i()((async(e,r,t,n=10)=>{let o=l()("/api/v1/"+(e?`summits/${e}/speakers`:"speakers"));o.addQuery("expand","member,registration_request"),o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`full_name@@${r},first_name@@${r},last_name@@${r},email@@${r}`)),c(o,t)}),u),i()((async(e,r,t,n=50)=>{let o=l()("/api/v1/"+(e?`summits/${e}/track-tag-groups/all/allowed-tags`:"tags"));e&&o.addQuery("expand","tag,track_tag_group"),o.addQuery("order","tag"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`tag@@${r}`)),c(o,t)}),u),i()((async(e,r,t,n=[],o=10)=>{let s=l()(`/api/v1/summits/${e}/tracks`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",o),(null==n?void 0:n.length)>0&&s.addQuery("filter[]",`not_id==${n.join("||")}`),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),c(s,t)}),u),i()((async(e,r,t,n=10)=>{let o=l()(`/api/v1/summits/${e}/track-groups`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),c(o,t)}),u),i()((async(e,r,t=!1,n,o=10)=>{let s=l()(`/api/v1/summits/${e}/events`+(t?"/published":""));s.addQuery("order","title"),s.addQuery("page",1),s.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`title@@${r}`)),c(s,n)}),u),i()((async(e,r,t,n=null,o=10)=>{let s=l()(`/api/v1/summits/${e}/event-types`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),n&&(n=(0,a.escapeFilterValue)(n),s.addQuery("filter[]",`class_name==${n}`)),c(s,t)}),u),i()((async(e,r,t=10)=>{let n=l()("/api/v1/groups");n.addQuery("order","title,code"),n.addQuery("page",1),n.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),n.addQuery("filter[]",`title@@${e},code@@${e}`)),c(n,r)}),u),i()((async(e,r,t=10)=>{let n=l()("/api/v1/companies");n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),c(n,r)}),u),i()((async(e,r,t,n=10)=>{let o=l()(`/api/v1/summits/${e}/registration-companies`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),c(o,t)}),u));i()((async(e,r,t,n=10)=>{let o=l()(`/api/v1/summits/${e}/sponsors`);o.addQuery("expand","company,sponsorship,sponsorship.type"),o.addQuery("order","id"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`company_name@@${r}`)),c(o,t)}),u),i()((async(e,r,t,n=10)=>{let o=l()(`/api/v1/summits/${e}/sponsors`);o.addQuery("expand","company,sponsorship,sponsorship.type"),o.addQuery("fields","id,company.name,sponsorship.type.name"),o.addQuery("relations","none,company.none,sponsorship.type.none"),o.addQuery("filter[]","badge_scans_count>0"),o.addQuery("order","+company_name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`company_name@@${r}`)),c(o,t)}),u),i()((async(e,r,t,n=10)=>{let o=l()(`/api/v1/summits/${e}/access-level-types`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),c(o,t)}),u),i()((async(e,r,t=10)=>{let n=l()("/api/v1/organizations");n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),c(n,r)}),u);i()((async(e,r={},t,n="v1",o=10)=>{let s=l()(`/api/${n}/summits/${e}/ticket-types`);if(s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",o),r.hasOwnProperty("name")){const e=(0,a.escapeFilterValue)(r.name);e&&""!=e&&s.addQuery("filter[]",`name@@${e}`)}if(r.hasOwnProperty("audience")){const e=(0,a.escapeFilterValue)(r.audience);e&&""!=e&&s.addQuery("filter[]",`audience==${e}`)}c(s,t)}),u),i()((async(e,r,t=10)=>{const n=l()("/api/v1/sponsored-projects");n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),c(n,r)}),u),i()((async(e,r,t,n=10,o=[])=>{let s=l()(`/api/v1/summits/${e}/promo-codes`);s.addQuery("order","code"),s.addQuery("page",1),s.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`code@@${r}`));for(const e of o)s.addQuery("filter[]",e);c(s,t)}),u)},1896:(e,r,t)=>{t.d(r,{default:()=>o});var a=t(2015),n=t.n(a);const o=e=>{const r=n().useRef(e);return n().useLayoutEffect((()=>{r.current=e})),n().useCallback(((...e)=>r.current(...e)),[])}},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},5812:e=>{e.exports=require("moment-timezone")},2015:e=>{e.exports=require("react")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},r={};function t(a){var n=r[a];if(void 0!==n)return n.exports;var o=r[a]={exports:{}};return e[a](o,o.exports,t),o.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};t.r(a),t.d(a,{default:()=>H,findCanonicalUpgrade:()=>I,findExistingCompany:()=>k,getOptionName:()=>$,getUseRowText:()=>x,isCompanyObject:()=>Q,isExistingCompany:()=>S,isNewCompany:()=>w,namesMatch:()=>h,normalizeCompanyValue:()=>v,resolveCommittedCompany:()=>F,resolveTypedCompany:()=>A,shouldOfferUseRow:()=>b});const n=require("@babel/runtime/helpers/extends");var o=t.n(n),s=t(2462),i=t.n(s),d=t(2015),l=t.n(d);const u=require("prop-types");var p=t.n(u);const c=require("@mui/material/TextField");var y=t.n(c);const m=require("@mui/material/Autocomplete");var _=t.n(m);const R=require("@mui/material/Typography");var f=t.n(R),g=t(5301),E=t(1896);const T=["summitId","isRequired","sx","onChange","id","name","label","value","error","helperText","onBlur","placeholder","options2Show","disableShrink"],O=["key"],h=(e,r)=>(e||"").trim().toLowerCase()===(r||"").trim().toLowerCase(),Q=e=>!!e&&"object"==typeof e&&"string"==typeof e.name,S=e=>Q(e)&&e.id>0,w=e=>Q(e)&&0===e.id&&!!e.name.trim(),k=(e,r)=>null!=r&&r.trim()&&(e||[]).find((e=>S(e)&&h(e.name,r)))||null,v=e=>e?"string"==typeof e?e.trim()?e:null:"object"==typeof e&&"string"==typeof e.name&&e.name.trim()?e:null:null,$=e=>"string"==typeof e?e:Q(e)?e.name:"",b=(e,r)=>!!e&&!r.some((r=>S(r)&&h(r.name,e))),A=(e,r)=>k(e,r)||{id:0,name:r.trim()},x=(e,r)=>{const t=e.inputValue.trim();return t||(w(r)?r.name.trim():"")},F=(e,r)=>"string"==typeof e&&e.trim()?A(r,e):null!=e&&e.isFreeTextOption?{id:0,name:e.name}:e,I=(e,r)=>w(e)?k(r,e.name):null,U=e=>{let{summitId:r,isRequired:t,sx:a,onChange:n,id:s,name:d,label:u,value:p,error:c,helperText:m,onBlur:R,placeholder:Q,options2Show:w,disableShrink:k}=e,U=i()(e,T);const[H,N]=l().useState(""),[C,q]=l().useState([]),L=l().useMemo((()=>v(p)),[p]),K=(0,E.default)((e=>{n({target:{id:d,value:e,type:"companyinput"}})}));return l().useEffect((()=>{if(""===H)return void q(L?[L]:[]);q((e=>{const r=e.filter(S);return L?[L,...r]:r}));let e=!1;return(0,g.queryRegistrationCompanies)(r,H,(r=>{if(e)return;q([...L?[L]:[],...r||[]]);const t=I(L,r);t&&K(t)}),w),()=>{e=!0}}),[L,H,r,w,K]),l().createElement(_(),o()({sx:a,id:s,name:d,options:C,autoComplete:!0,freeSolo:!0,disableClearable:!0,includeInputInList:!0,filterSelectedOptions:!0,value:L,onBlur:e=>{var r;const t=((null==e||null===(r=e.target)||void 0===r?void 0:r.value)??H).trim(),a=$(L);t?h(t,a)||K(A(C,t)):L&&K(null),R&&R(d)},getOptionLabel:$,onChange:(e,r)=>{const t=F(r,C);q(t?[t,...C.filter((e=>(null==e?void 0:e.id)!==(null==t?void 0:t.id)))]:C),K(t)},onInputChange:(e,r)=>{N(r)},filterOptions:(e,r)=>{const t=x(r,L);return b(t,e)?[{id:0,name:t,isFreeTextOption:!0},...e]:e},renderInput:e=>l().createElement(y(),o()({},e,{label:u,placeholder:Q,fullWidth:!0,required:t,helperText:m,error:c,margin:"normal",InputLabelProps:k?{shrink:!1}:void 0})),renderOption:(e,r)=>{const{key:t}=e,a=i()(e,O),n=$(r),s=null!=r&&r.isFreeTextOption?`Use "${n}"`:n;return l().createElement("li",o()({key:t},a),l().createElement(f(),{variant:"body2",sx:{fontSize:"1em",color:"text.secondary",padding:"5px 0"}},s))}},U))};U.defaultProps={name:"GENERAL",label:"Company",options2Show:20,disableShrink:!1},U.propTypes={summitId:p().number.isRequired,value:p().oneOfType([p().string,p().object]),onChange:p().func.isRequired,isRequired:p().bool,name:p().string,error:p().bool,helperText:p().string,onBlur:p().func,options2Show:p().number,placeholder:p().string,label:p().string,disableShrink:p().bool};const H=U;return a})()));
+//# sourceMappingURL=company-input-v2.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/company-input-v2.js.map b/lib/components/inputs/company-input-v2.js.map
new file mode 100644
index 00000000..1c6970e8
--- /dev/null
+++ b/lib/components/inputs/company-input-v2.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/company-input-v2.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,wVCTF,MAAMC,EAA+B,+BAC/BC,EAAmC,mCACnCC,EAAkC,kCAClCC,EAAgC,gCAChCC,EAAyC,yCACzCC,EAAyC,wC,uFCLtD,MAAM,EAA+BC,QAAQ,qB,aCA7C,MAAM,EAA+BA,QAAQ,a,yDCqC7C,MAAMC,KAAO,IAAIC,KAIXC,4BAA8B,wCAKvBC,EAAqB,OAC5BC,EAAY,WAGZC,EAAW,UAsPXC,EAAsBC,MAAOC,EAAMC,KAErC,GAAID,IAASL,GAAsBO,IAAyB,CACxD,IAAKD,EAED,MADAE,IACMC,MAAMlB,EAAAA,kCAGhB,IAAImB,OAzBoBN,OAAOO,EAAIC,EAJhB,EAI0CC,EAHtC,OAI3B,IAAK,IAAIC,EAAU,EAAGA,EAAUF,EAAYE,IACxC,IACI,aAAaH,GACjB,CAAE,MAAOI,GAGL,IADoBA,EAAIC,UAAWD,EAAIC,QAAQC,WAAWtB,EAAAA,yCACtCmB,IAA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AC1BzH,KAAM,UACNkE,MAAO,UACPK,aAAc,GACdC,eAAe,GAGnBX,EAAe6D,UAAY,CACvBnI,SAAUoI,IAAAA,OAAiB5D,WAC3B5G,MAAOwK,IAAAA,UAAoB,CAACA,IAAAA,OAAkBA,IAAAA,SAC9C1D,SAAU0D,IAAAA,KAAe5D,WACzBA,WAAY4D,IAAAA,KACZ3H,KAAM2H,IAAAA,OACNxD,MAAOwD,IAAAA,KACPvD,WAAYuD,IAAAA,OACZtD,OAAQsD,IAAAA,KACRpD,aAAcoD,IAAAA,OACdrD,YAAaqD,IAAAA,OACbzD,MAAOyD,IAAAA,OACPnD,cAAemD,IAAAA,MAGnB,U","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/security/constants.js","webpack://openstack-uicore-foundation/external commonjs \"browser-tabs-lock\"","webpack://openstack-uicore-foundation/external commonjs \"js-cookie\"","webpack://openstack-uicore-foundation/./src/components/security/methods.js","webpack://openstack-uicore-foundation/./src/utils/actions.js","webpack://openstack-uicore-foundation/external commonjs \"spark-md5\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/sha256\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-base64url\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-hex\"","webpack://openstack-uicore-foundation/./src/utils/crypto.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"lodash/debounce\"","webpack://openstack-uicore-foundation/./src/utils/query-actions.js","webpack://openstack-uicore-foundation/./src/utils/use-event-callback.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"idtoken-verifier\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"superagent/lib/client\"","webpack://openstack-uicore-foundation/external commonjs \"sweetalert2\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"prop-types\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/TextField\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Autocomplete\"","webpack://openstack-uicore-foundation/external commonjs \"@mui/material/Typography\"","webpack://openstack-uicore-foundation/./src/components/inputs/company-input-v2.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","export const AUTH_ERROR_MISSING_AUTH_INFO = 'AUTH_ERROR_MISSING_AUTH_INFO';\nexport const AUTH_ERROR_MISSING_REFRESH_TOKEN = 'AUTH_ERROR_MISSING_REFRESH_TOKEN';\nexport const AUTH_ERROR_ACCESS_TOKEN_EXPIRED = 'AUTH_ERROR_ACCESS_TOKEN_EXPIRED';\nexport const AUTH_ERROR_LOCK_ACQUIRE_ERROR = 'AUTH_ERROR_LOCK_ACQUIRE_ERROR'\nexport const AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR';\nexport const AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR';\nexport const AUTH_ERROR_ID_TOKEN_INVALID = 'AUTH_ERROR_ID_TOKEN_INVALID';\nexport const AUTH_ERROR_MISSING_OTP_PARAM = 'AUTH_ERROR_MISSING_OTP_PARAM';\nexport const AUTH_ERROR_MISSING_PKCE_PARAM = 'AUTH_ERROR_MISSING_PKCE_PARAM';\nexport const AUTH_ERROR_MISSING_NONCE_PARAM = 'AUTH_ERROR_MISSING_NONCE_PARAM';\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"browser-tabs-lock\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"js-cookie\");","import {\n base64URLEncode,\n getAuthCallback,\n getCurrentLocation,\n getFromLocalStorage,\n removeFromLocalStorage,\n getOrigin,\n putOnLocalStorage,\n retryPromise,\n setSessionClearingState,\n} from \"../../utils/methods\";\nimport moment from \"moment-timezone\";\nimport request from 'superagent/lib/client';\nimport SuperTokensLock from 'browser-tabs-lock';\nimport Cookies from 'js-cookie'\nlet http = request;\nimport URI from \"urijs\";\nimport IdTokenVerifier from \"idtoken-verifier\";\nimport {SET_LOGGED_USER} from \"./actions\";\nimport {getRandomBytes, getSHA256} from \"../../utils/crypto\";\n\nimport {\n AUTH_ERROR_ACCESS_TOKEN_EXPIRED,\n AUTH_ERROR_MISSING_AUTH_INFO,\n AUTH_ERROR_MISSING_REFRESH_TOKEN,\n AUTH_ERROR_LOCK_ACQUIRE_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR,\n AUTH_ERROR_ID_TOKEN_INVALID,\n AUTH_ERROR_MISSING_OTP_PARAM,\n AUTH_ERROR_MISSING_PKCE_PARAM,\n AUTH_ERROR_MISSING_NONCE_PARAM,\n} from \"./constants\";\n\n/**\n * @ignore\n */\nconst Lock = new SuperTokensLock();\n/**\n * @ignore\n */\nconst GET_TOKEN_SILENTLY_LOCK_KEY = 'openstackuicore.lock.getTokenSilently';\nconst GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT = 6000;\nconst NONCE_LEN = 16;\nexport const ACCESS_TOKEN_SKEW_TIME = 60;\nexport const RESPONSE_TYPE_IMPLICIT = \"token id_token\";\nexport const RESPONSE_TYPE_CODE = 'code';\nconst AUTH_INFO = 'authInfo';\nconst NONCE = 'nonce';\nconst PKCE = 'pkce';\nconst ID_TOKEN = 'idToken';\nconst BACK_ULR_PARAM_NAME = 'BackUrl';\n\n\n/**\n *\n * @param backUrl\n * @param prompt\n * @param tokenIdHint\n * @param provider\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n * @param backUrlParamName\n * @returns {*}\n */\nexport const getAuthUrl = (\n backUrl = null,\n prompt = null,\n tokenIdHint = null,\n provider = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null,\n backUrlParamName = BACK_ULR_PARAM_NAME\n ) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let baseUrl = getOAuth2IDPBaseUrl();\n let scopes = getOAuth2Scopes();\n let flow = getOAuth2Flow();\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n let nonce = createNonce(NONCE_LEN);\n\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let query = {\n \"response_type\": encodeURI(flow),\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"response_mode\": 'fragment',\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n if (flow === RESPONSE_TYPE_CODE) {\n const pkce = createPKCECodes()\n putOnLocalStorage(PKCE, JSON.stringify(pkce));\n query['code_challenge'] = pkce.codeChallenge;\n query['code_challenge_method'] = 'S256';\n query['approval_prompt'] = 'force';\n }\n\n if (prompt) {\n query['prompt'] = prompt;\n }\n\n if (scopes && scopes.includes('offline_access')) {\n // then we need to force prompt=consent bc we are requesting an offline access\n // and we need to let the user know\n query['prompt'] = 'consent';\n }\n\n if (tokenIdHint) {\n query['id_token_hint'] = tokenIdHint;\n }\n\n if (provider) {\n query['provider'] = provider;\n }\n\n if (otpLoginHint) {\n query['otp_login_hint'] = otpLoginHint;\n }\n\n if (loginHint) {\n query['login_hint'] = encodeURI(loginHint);\n }\n\n if (tenant) {\n query['tenant'] = tenant;\n }\n\n url = url.query(query);\n //console.log(`getAuthUrl ${url.toString()}`);\n return url;\n}\n\n/**\n * @param idToken\n * @returns {*}\n */\nexport const getLogoutUrl = (idToken = null) => {\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let url = URI(`${baseUrl}/oauth2/end-session`);\n let state = createNonce(NONCE_LEN);\n let postLogOutUri = `${getOrigin()}/auth/logout`;\n // store nonce to check it later\n putOnLocalStorage('post_logout_state', state);\n /**\n * post_logout_redirect_uri should be listed on oauth2 client settings\n * on IDP\n * \"Security Settings\" Tab -> Logout Options -> Post Logout Uris\n */\n const queryParams = {\n \"post_logout_redirect_uri\": encodeURI(postLogOutUri),\n \"client_id\": encodeURI(oauth2ClientId),\n \"state\": state,\n }\n\n if (idToken)\n queryParams.id_token_hint = idToken;\n\n return url.query(queryParams);\n}\n\nconst createNonce = (len) => {\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let nonce = '';\n for (let i = 0; i < len; i++) {\n nonce += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return nonce;\n}\n\n/**\n *\n * @param backUrl\n * @param provider\n * @param prompt\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n */\nexport const doLogin = (\n backUrl = null,\n provider = null,\n prompt = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null\n) => {\n let url = getAuthUrl(backUrl, prompt, null, provider, loginHint, otpLoginHint, tenant);\n let location = getCurrentLocation()\n location.replace(url.toString());\n}\n\n/**\n *\n * @param backUrl\n * @param loginHint\n * @param otpLoginHint\n */\nexport const doLoginBasicLogin = (backUrl = null, loginHint = null, otpLoginHint = null) => {\n doLogin(backUrl, null, null, loginHint, otpLoginHint);\n}\n\nconst createPKCECodes = () => {\n const codeVerifier = base64URLEncode(getRandomBytes(64))\n const codeChallenge = getSHA256(codeVerifier, 'Base64url')\n const createdAt = new Date()\n const codePair = {\n codeVerifier,\n codeChallenge,\n createdAt\n }\n return codePair\n}\n\n/**\n\n * @param code\n * @param backUrl\n * @param backUrlParamName\n * @returns {Promise<{access_token: *, refresh_token: *, id_token: *, expires_in: *, error: *, error_description: *}>}\n */\nexport const emitAccessToken = async (code, backUrl = null, backUrlParamName = BACK_ULR_PARAM_NAME) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let pkce = JSON.parse(getFromLocalStorage(PKCE, true));\n\n if (!pkce)\n throw Error(AUTH_ERROR_MISSING_PKCE_PARAM);\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n const payload = {\n 'code': code,\n 'grant_type': 'authorization_code',\n 'code_verifier': pkce.codeVerifier,\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n try {\n //const response = await http.post(`${baseUrl}/oauth2/token`, payload);\n //const {body: {access_token, refresh_token, id_token, expires_in}} = response;\n const response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }).catch(function (error) {\n console.log('Request failed:', error.message);\n });\n const json = await response.json();\n let {access_token, refresh_token, id_token, expires_in, error, error_description} = json;\n return {access_token, refresh_token, id_token, expires_in, error, error_description}\n } catch (err) {\n console.log(err);\n }\n};\n\nexport const MAX_RETRIES = 5;\nexport const BACKOFF_BASE_MS = 1000;\nexport const REFRESH_TOKEN_FETCH_TIMEOUT_MS = 10000;\n\nexport const retryWithBackoff = async (fn, maxRetries = MAX_RETRIES, baseDelayMs = BACKOFF_BASE_MS) => {\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n return await fn();\n } catch (err) {\n // only retry transient network/server errors — everything else fails fast\n const isRetryable = err.message && err.message.startsWith(AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR);\n if (!isRetryable || attempt === maxRetries - 1) {\n throw err;\n }\n const delay = baseDelayMs * Math.pow(2, attempt);\n console.log(`retryWithBackoff retry ${attempt + 1}/${maxRetries} in ${delay}ms`);\n await new Promise(resolve => setTimeout(resolve, delay));\n }\n }\n};\n\nconst processRefreshToken = async (flow, refreshToken) => {\n\n if (flow === RESPONSE_TYPE_CODE && useOAuth2RefreshToken()) {\n if (!refreshToken) {\n clearAuthInfo();\n throw Error(AUTH_ERROR_MISSING_REFRESH_TOKEN);\n }\n\n let response = await retryWithBackoff(() => refreshAccessToken(refreshToken));\n let {access_token, expires_in, refresh_token, id_token} = response;\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n return access_token;\n }\n clearAuthInfo();\n throw Error(AUTH_ERROR_ACCESS_TOKEN_EXPIRED);\n}\n\n/**\n * @returns {Promise<*>}\n * @private\n */\nconst _getAccessToken = async () => {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken`);\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n let flow = getOAuth2Flow();\n // check lifetime\n const now = moment().unix();\n let timeElapsedSecs = (now - accessTokenUpdatedAt);\n\n expiresIn = (expiresIn - ACCESS_TOKEN_SKEW_TIME);\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${now} accessTokenUpdatedAt ${accessTokenUpdatedAt} expiresIn ${expiresIn} timeElapsedSecs ${timeElapsedSecs}`)\n if (timeElapsedSecs >= expiresIn || accessToken == null) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ...`);\n accessToken = await processRefreshToken(flow, refreshToken);\n }\n return accessToken;\n}\n\n/**\n * Optional resolver for getAccessToken, set via setAccessTokenResolver. When\n * present, getAccessToken delegates to it; otherwise the built-in flow runs.\n * Pass a non-function (or nothing) to reset to the built-in.\n *\n * The slot lives on globalThis under a Symbol.for key so every copy of this\n * module shares it: bundles that inlined methods.js, nested installs of the\n * package, and symlinked dev installs all read the same registry entry.\n */\nconst ACCESS_TOKEN_RESOLVER_KEY = Symbol.for('openstack-uicore-foundation.accessTokenResolver');\n\nexport const setAccessTokenResolver = (resolver) => {\n globalThis[ACCESS_TOKEN_RESOLVER_KEY] = typeof resolver === 'function' ? resolver : null;\n};\n\n/**\n * @returns {Promise<*|undefined>}\n */\nexport const getAccessToken = async () => {\n const resolveAccessToken = globalThis[ACCESS_TOKEN_RESOLVER_KEY];\n if (resolveAccessToken) return resolveAccessToken();\n\n if (typeof navigator !== 'undefined' && navigator.locks) {\n return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::getAccessToken web lock api`, lock);\n return await _getAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n return await _getAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n/**\n * @private\n */\nconst _clearAccessToken = () => {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken`);\n\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n\n storeAuthInfo(null, 0, refreshToken)\n}\n\nexport const clearAccessToken = async () => {\n // see https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n if (typeof navigator !== 'undefined' && navigator.locks) {\n await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::clearAccessToken web lock api`, lock);\n _clearAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n _clearAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n\nexport const refreshAccessToken = async (refresh_token) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n\n const payload = {\n 'grant_type': 'refresh_token',\n \"client_id\": encodeURI(oauth2ClientId),\n \"refresh_token\": refresh_token\n };\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), REFRESH_TOKEN_FETCH_TIMEOUT_MS);\n\n let response;\n try {\n response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload),\n signal: controller.signal\n });\n } catch (networkError) {\n // fetch rejects on network failures (DNS, timeout, no connectivity, abort)\n console.log('refreshAccessToken network error:', networkError.message);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${networkError.message}`);\n } finally {\n clearTimeout(timeoutId);\n }\n\n if (!response.ok) {\n console.log(`refreshAccessToken server error: ${response.status} - ${response.statusText}`);\n if (response.status >= 500 || response.status === 408 || response.status === 429) {\n // transient error (server error, request timeout, rate limit) — should be retried\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${response.status} - ${response.statusText}`);\n }\n // token is genuinely revoked — this is a real auth error\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${response.status} - ${response.statusText}`);\n }\n\n let json;\n try {\n json = await response.json();\n } catch (parseError) {\n // IDP returned non-JSON (HTML error page, empty body, etc.) — treat as transient\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`);\n }\n let {access_token, refresh_token: new_refresh_token, expires_in, id_token} = json;\n // Defensively ensure we never propagate an undefined access token.\n if (!access_token) {\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);\n }\n return {access_token, refresh_token: new_refresh_token, expires_in, id_token}\n}\n\nexport const storeAuthInfo = (accessToken, expiresIn, refreshToken = null, idToken = null) => {\n\n let formerAuthInfo = getAuthInfo();\n\n let authInfo = {\n accessToken: accessToken,\n expiresIn: expiresIn,\n accessTokenUpdatedAt: Math.floor(Date.now() / 1000),\n };\n\n if (refreshToken == null && formerAuthInfo) {\n refreshToken = formerAuthInfo.refreshToken;\n }\n\n if (idToken == null && formerAuthInfo) {\n idToken = formerAuthInfo.idToken;\n }\n\n if (refreshToken) {\n authInfo['refreshToken'] = refreshToken;\n }\n\n if (idToken) {\n authInfo[ID_TOKEN] = idToken;\n Cookies.set(ID_TOKEN, idToken, {secure: true, sameSite: 'Lax'});\n } else {\n Cookies.remove(ID_TOKEN);\n }\n\n putOnLocalStorage(AUTH_INFO, JSON.stringify(authInfo));\n}\n\nexport const getAuthInfo = () => {\n try {\n let res = getFromLocalStorage(AUTH_INFO, false)\n if (!res) return null;\n return JSON.parse(res);\n } catch (err) {\n return null;\n }\n}\n\nexport const clearAuthInfo = () => {\n if (typeof window !== 'undefined') {\n removeFromLocalStorage(AUTH_INFO);\n Cookies.remove(ID_TOKEN);\n }\n};\n\nexport const getIdToken = () => {\n if (typeof window !== 'undefined') {\n const authInfo = getAuthInfo();\n if (authInfo) {\n return authInfo.idToken;\n }\n return null;\n }\n return null;\n};\n\nexport const getOAuth2ClientId = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_CLIENT_ID;\n }\n return null;\n};\n\nexport const getOAuth2Flow = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_FLOW || \"token id_token\";\n }\n return \"token id_token\";\n}\n\nexport const useOAuth2RefreshToken = () => {\n if (typeof window !== 'undefined') {\n return new Boolean(window.OAUTH2_USE_REFRESH_TOKEN || true);\n }\n return true;\n}\n\nexport const getOAuth2IDPBaseUrl = () => {\n if (typeof window !== 'undefined') {\n return window.IDP_BASE_URL;\n }\n return null;\n};\n\nexport const getOAuth2Scopes = () => {\n if (typeof window !== 'undefined') {\n return window.SCOPES;\n }\n return null;\n};\n\nexport const initLogOut = () => {\n let location = getCurrentLocation();\n location.replace(getLogoutUrl(getIdToken()).toString());\n}\n\nexport const validateIdToken = (idToken, issuer, audience) => {\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n let storedNonce = getFromLocalStorage(NONCE, true);\n if (!storedNonce)\n throw Error(AUTH_ERROR_MISSING_NONCE_PARAM);\n\n let jwt = verifier.decode(idToken);\n let alg = jwt.header.alg;\n let kid = jwt.header.kid;\n let aud = jwt.payload.aud;\n let iss = jwt.payload.iss;\n let exp = jwt.payload.exp;\n let nbf = jwt.payload.nbf;\n let tnonce = jwt.payload.nonce || null;\n\n return tnonce == storedNonce && aud == audience && iss == issuer;\n}\n\nexport const passwordlessStart = (params) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let nonce = createNonce(NONCE_LEN);\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let payload = {\n \"response_type\": \"otp\",\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"client_id\": encodeURI(oauth2ClientId),\n \"connection\": params.connection || \"email\",\n \"send\": params.send || \"code\",\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n if (params.hasOwnProperty('redirect_uri')) {\n payload[\"redirect_uri\"] = encodeURIComponent(params.redirect_uri);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n let json = res.body;\n return Promise.resolve({response: json});\n }).catch((err) => {\n return Promise.reject(err);\n });\n\n}\n\nexport const passwordlessLogin = (params) => (dispatch) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/token`);\n\n if (!params.hasOwnProperty(\"otp\")) {\n throw Error(AUTH_ERROR_MISSING_OTP_PARAM);\n }\n\n let payload = {\n \"grant_type\": \"passwordless\",\n \"connection\": params.connection || \"email\",\n \"scope\": encodeURI(scopes),\n \"client_id\": encodeURI(oauth2ClientId),\n \"otp\": params.otp\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n try {\n // now we got token\n let json = res.body;\n let {access_token, expires_in, refresh_token, id_token} = json;\n\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n\n if (typeof id_token === 'undefined') {\n id_token = null; // not using rotate policy\n }\n\n // verify id token\n\n if (id_token) {\n if (!validateIdToken(id_token, baseUrl, oauth2ClientId)) {\n throw Error(AUTH_ERROR_ID_TOKEN_INVALID);\n }\n }\n\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n\n if (dispatch) {\n dispatch({\n type: SET_LOGGED_USER,\n payload: {sessionState: null}\n });\n }\n\n return Promise.resolve({response: json});\n } catch (e) {\n console.log(e);\n return Promise.reject(e);\n }\n }).catch((err) => {\n return Promise.reject(err);\n });\n}\n\nexport const isIdTokenAlive = (nowEpoch = null) => () => {\n\n if (!nowEpoch) {\n nowEpoch = Math.floor(Date.now() / 1000);\n }\n\n const idToken = getIdToken();\n if (!idToken)\n throw Error('Id Token not set.');\n\n const issuer = getOAuth2IDPBaseUrl();\n const audience = getOAuth2ClientId();\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n const jwt = verifier.decode(idToken);\n const exp = jwt.payload.exp;\n\n // check life time\n return exp - (nowEpoch + ACCESS_TOKEN_SKEW_TIME) > 0;\n}\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific flanguage governing permissions and\n * limitations under the License.\n **/\n\nimport request from 'superagent/lib/client';\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\n\nlet http = request;\nimport Swal from 'sweetalert2';\nimport T from \"i18n-react/dist/i18n-react\";\nimport { isClearingSessionState, setSessionClearingState, getCurrentPathName } from './methods';\nimport { CLEAR_SESSION_STATE } from '../components/security/actions';\nimport { doLogin, initLogOut } from '../components/security/methods';\n\nexport const GENERIC_ERROR = \"Yikes. Something seems to be broken. Our web team has been notified, and we apologize for the inconvenience.\";\nexport const RESET_LOADING = 'RESET_LOADING';\nexport const START_LOADING = 'START_LOADING';\nexport const STOP_LOADING = 'STOP_LOADING';\nexport const VALIDATE = 'VALIDATE';\nexport const CLEAR_MESSAGE = 'CLEAR_MESSAGE';\nexport const SHOW_MESSAGE = 'SHOW_MESSAGE';\n\nexport const createAction = type => payload => ({\n type,\n payload\n});\n\nexport const resetLoading = createAction(RESET_LOADING);\nexport const startLoading = createAction(START_LOADING);\nexport const stopLoading = createAction(STOP_LOADING);\n\nconst xhrs = {};\nconst etagCache = {};\n\nconst cancel = (key) => {\n if(xhrs[key]) {\n xhrs[key].abort();\n console.log(`aborted request ${key}`);\n delete xhrs[key];\n }\n}\n\nconst schedule = (key, req) => {\n // console.log(`scheduling ${key}`);\n xhrs[key] = req;\n};\n\nconst isObjectEmpty = (obj) => {\n return Object.keys(obj).length === 0 && obj.constructor === Object ;\n}\n\nconst buildNotifyHandlerPayload = (httpCode, title, content, type) => ({ httpCode, title, html: content, type });\nconst buildNotifyHandlerErrorPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"error\");\nconst buildNotifyHandlerWarningPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"warning\");\n\nconst initLogin = () => (dispatch) => {\n const currentLocation = getCurrentPathName();\n const clearingSessionState = isClearingSessionState();\n dispatch({\n type: CLEAR_SESSION_STATE,\n payload: {}\n });\n if (!clearingSessionState) {\n setSessionClearingState(true);\n console.log(\"authErrorHandler 401 - re login\");\n doLogin(currentLocation);\n }\n};\n\nconst normalizeFormDataPayload = (req, formData) => {\n if(!isObjectEmpty(formData)) {\n Object.keys(formData).forEach(function (key) {\n let value = formData[key];\n if (Array.isArray(value)) {\n value.forEach(item => {\n req.field(`${key}[]`, item);\n });\n } else {\n req.field(key, value);\n }\n });\n }\n};\n\nexport const authErrorHandler = (\n err,\n res,\n notifyErrorHandler = showMessage\n) => (dispatch) => {\n\n const code = err.status;\n let msg = \"\";\n let payload, callback;\n\n dispatch(stopLoading());\n\n switch (code) {\n case 401:\n if (notifyErrorHandler !== showMessage) {\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_auth\"));\n callback = () => dispatch(initLogin());\n } else {\n dispatch(initLogin());\n }\n break;\n case 403:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_authz\"));\n callback = initLogOut;\n break;\n case 404:\n msg = err.response.body?.message || err.response.error?.message || err.message;\n if (err.response.body?.errors?.length) {\n msg += ` ${err.response.body.errors.join(\" \")}`;\n }\n payload = buildNotifyHandlerWarningPayload(code, \"Not Found\", msg);\n break;\n case 412:\n for (const [key, value] of Object.entries(err.response.body.errors)) {\n msg += isNaN(key) ? `${key}: ` : \"\";\n msg += `${value} `;\n }\n dispatch({\n type: VALIDATE,\n payload: { errors: err.response.body.errors }\n });\n payload = buildNotifyHandlerWarningPayload(code, \"Validation error\", msg);\n break;\n default:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.server_error\"));\n }\n\n if (payload)\n dispatch(notifyErrorHandler(payload, callback));\n}\n\nexport const getRequest =(\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {},\n useEtag = false\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n let key = url.toString();\n\n if(!isObjectEmpty(params)) {\n // remove the access token\n const { access_token: _, ...newParams} = params;\n // and generate new key\n key = url.query(newParams).toString();\n url = url.query(params);\n }\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n cancel(key);\n\n return new Promise((resolve, reject) => {\n let req = http.get(url.toString());\n if(useEtag && etagCache.hasOwnProperty(key)){\n const { etag } = etagCache[key];\n if(etag){\n req.set('If-None-Match', etag)\n }\n }\n\n req.timeout({\n response: 60000,\n deadline: 60000,\n })\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key, useEtag))\n\n schedule(key, req);\n });\n};\n\nexport const putRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => ( dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n http.put(url.toString())\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject))\n });\n};\n\nexport const deleteRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params) => (dispatch, state) => {\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n\n http.delete(url)\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n let request = http.post(url);\n\n if(payload != null)\n request.send(payload);\n else // to be a simple CORS request\n request.set('Content-Type', 'text/plain');\n\n request.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.post(url)\n .attach('file', file);\n\n normalizeFormDataPayload(req, fileMetadata);\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const putFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file = null,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.put(url);\n\n if(file != null){\n req.attach('file', file);\n }\n\n normalizeFormDataPayload(req, fileMetadata)\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const defaultErrorHandler = (err, res) => (dispatch) => {\n let body = res.body;\n let text = '';\n if(body instanceof Object){\n if(body.hasOwnProperty('message'))\n text = body.message;\n }\n Swal.fire(res.statusText, text, \"error\");\n}\n\nconst byLowerCase = toFind => value => toLowerCase(value) === toFind;\nconst toLowerCase = value => value.toLowerCase();\nconst getKeys = headers => Object.keys(headers);\n\nexport const getHeaderCaseInsensitive = (headerName, headers = {}) => {\n const key = getKeys(headers).find(byLowerCase(headerName));\n return key ? headers[key] : undefined;\n};\n\nexport const responseHandler = ( dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key = null, useEtag= false ) =>\n\n (err, res) => {\n\n if (err || !res.ok) {\n let code = err.status;\n\n if(code === 304 && etagCache.hasOwnProperty(key) && useEtag){\n const { body } = etagCache[key];\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: body}));\n return resolve({response: body});\n }\n\n dispatch(receiveActionCreator);\n return resolve({response: body});\n }\n if(errorHandler) {\n errorHandler(err, res)(dispatch, state);\n }\n return reject({ err, res, dispatch, state })\n }\n\n let json = res.body;\n\n if(useEtag) {\n const responseETAG = getHeaderCaseInsensitive('etag', res.headers);\n if (responseETAG) {\n etagCache[key] = { etag: responseETAG, body: json};\n }\n }\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: json}));\n return resolve({response: json});\n }\n dispatch(receiveActionCreator);\n return resolve({response: json});\n}\n\n\nexport const fetchErrorHandler = (response) => {\n let code = response.status;\n let msg = response.statusText;\n\n switch (code) {\n case 403:\n Swal.fire(\"ERROR\", T.translate(\"errors.user_not_authz\"), \"warning\");\n break;\n case 401:\n Swal.fire(\"ERROR\", T.translate(\"errors.session_expired\"), \"error\");\n break;\n case 412:\n Swal.fire(\"ERROR\", msg, \"warning\");\n case 500:\n Swal.fire(\"ERROR\", T.translate(\"errors.server_error\"), \"error\");\n }\n}\n\nexport const fetchResponseHandler = (response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.json();\n }\n}\n\nexport const showMessage = (settings, callback = null) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire(settings).then((result) => {\n if (result.value && typeof callback === 'function') {\n callback();\n }\n });\n}\n\nexport const showSuccessMessage = (html) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire({\n title: T.translate(\"general.done\"),\n html: html,\n type: 'success'\n });\n}\n\nexport const downloadFileByContent = (filename, content, mime) => {\n let link = document.createElement('a');\n link.textContent = 'download';\n link.download = filename;\n link.href = `data:${mime},${encodeURIComponent(content)}`\n document.body.appendChild(link); // Required for FF\n link.click();\n document.body.removeChild(link);\n}\n\nexport const getCSV = (endpoint, params, filename, header = null) => (dispatch) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n dispatch(startLoading());\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n dispatch(stopLoading());\n\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n downloadFileByContent(filename, csv, 'text/csv;charset=utf-8');\n })\n .catch(fetchErrorHandler);\n};\n\nexport const getRawCSV = (endpoint, params, header = null) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n\n return csv;\n })\n .catch(fetchErrorHandler);\n};\n\nexport const escapeFilterValue = (value) => {\n value = String(value);\n // escape backslash first so you don't accidentally break your own escapes\n value = value.replace(/\\\\/g, \"\\\\\\\\\");\n value = value.replace(/,/g, \"\\\\,\");\n value = value.replace(/;/g, \"\\\\;\");\n // especial case for literal +\n value = value.replace(/\\+/g, \"%2B\");\n return value;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"spark-md5\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/sha256\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-base64url\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-hex\");","import SparkMD5 from \"spark-md5\";\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nconst MAX_BYTES = 65536\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nconst MAX_UINT32 = 4294967295\nconst crypto = typeof window !== 'undefined' ? (window.crypto || window.msCrypto) : null;\nimport sha256 from 'crypto-js/sha256';\nimport Base64url from 'crypto-js/enc-base64url'\nimport Hex from 'crypto-js/enc-hex'\nexport const getRandomBytes = (size) => {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n const bytes = Buffer.allocUnsafe(size)\n if(!crypto) return a;\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (let generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n return bytes\n}\n\nexport const getSHA256 = (message, format = 'hex') => {\n\n let f = Hex;\n if(format === 'Base64url')\n f = Base64url;\n\n return sha256(message).toString(f);\n}\n\nexport const getMD5 = (file) => {\n return new Promise((resolve, reject) => {\n const chunkSize = 2 * 1024 * 1024; // 2 MB by chunk\n const spark = new SparkMD5.ArrayBuffer();\n const fileReader = new FileReader();\n let cursor = 0;\n\n fileReader.onload = e => {\n spark.append(e.target.result); \n cursor += chunkSize;\n\n if (cursor < file.size) {\n readNextChunk();\n } else {\n resolve(spark.end()); // final MD5\n }\n };\n\n fileReader.onerror = () => reject(\"Error reading the file\");\n\n function readNextChunk() {\n const slice = file.slice(cursor, cursor + chunkSize);\n fileReader.readAsArrayBuffer(slice);\n }\n\n readNextChunk();\n });\n}","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"lodash/debounce\");","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport { fetchErrorHandler, fetchResponseHandler, escapeFilterValue } from \"./actions\";\nimport { getAccessToken } from '../components/security/methods';\nimport { buildAPIBaseUrl } from \"./methods\";\nimport debounce from 'lodash/debounce';\nexport const RECEIVE_COUNTRIES = 'RECEIVE_COUNTRIES';\nconst callDelay = 500; // milliseconds\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\nexport const DEFAULT_PAGE_SIZE = 10;\n\nconst _fetchPublic = async (endpoint, callback, options = {}) => {\n return fetch(buildAPIBaseUrl(endpoint.toString()), options)\n .then(fetchResponseHandler)\n .then((json) => {\n if(typeof callback === 'function')\n callback(json.data);\n })\n .catch(response => {\n const code = response && response.status;\n if (code === 404 && typeof callback === 'function') callback([]);\n return response;\n })\n .catch(fetchErrorHandler);\n}\n\n/**\n * @param endpoint\n * @param callback\n * @param options\n * @returns {Promise}\n * @private\n */\nconst _fetch = async (endpoint, callback, options = {}) => {\n\n let accessToken;\n\n try {\n accessToken = await getAccessToken();\n } catch (e) {\n // The caller is told through its callback; the query* functions do not\n // await this promise, so rejecting here would only surface as an\n // unhandled rejection.\n if(typeof callback === 'function')\n callback(e);\n return;\n }\n\n endpoint.addQuery('access_token', accessToken);\n\n return _fetchPublic(endpoint, callback, options);\n}\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryMembers = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/members`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryAttendees = debounce(async (summitId, input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n \n let endpoint = URI(`/api/v1/summits/${summitId}/attendees`);\n \n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n \n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name=@${input},email=@${input}`);\n }\n \n _fetch(endpoint, callback);\n \n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySummits = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/all`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySpeakers = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE ) => {\n\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/speakers`:`speakers`}`);\n\n endpoint.addQuery('expand', `member,registration_request`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTags = debounce(async (summitId, input, callback, per_page = 50) => {\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/track-tag-groups/all/allowed-tags`:`tags`}`);\n\n if(summitId)\n endpoint.addQuery('expand', `tag,track_tag_group`);\n\n endpoint.addQuery('order','tag');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `tag@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTracks = debounce(async (summitId, input, callback, excludedIds = [], per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/tracks`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if (excludedIds?.length > 0) {\n endpoint.addQuery('filter[]', `not_id==${excludedIds.join(\"||\")}`);\n }\n\n if (input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTrackGroups = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/track-groups`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=, *): Promise)|*>}\n */\nexport const queryEvents = debounce(async (summitId, input, onlyPublished = false, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/events` + (onlyPublished ? '/published' : ''));\n\n endpoint.addQuery('order','title');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=, *=): Promise)|*>}\n */\nexport const queryEventTypes = debounce(async (summitId, input, callback, eventTypeClassName = null, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/event-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n if (eventTypeClassName) {\n eventTypeClassName = escapeFilterValue(eventTypeClassName);\n endpoint.addQuery('filter[]', `class_name==${eventTypeClassName}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryGroups = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/groups`);\n\n endpoint.addQuery('order','title,code');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input},code@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryCompanies = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/companies`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryRegistrationCompanies = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/registration-companies`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsors = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type')\n endpoint.addQuery('order','id')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsorsWithBadgeScans = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type');\n endpoint.addQuery('fields','id,company.name,sponsorship.type.name');\n endpoint.addQuery('relations','none,company.none,sponsorship.type.none');\n endpoint.addQuery('filter[]','badge_scans_count>0');\n endpoint.addQuery('order','+company_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryAccessLevels = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/access-level-types`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryOrganizations = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/organizations`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\nexport const getLanguageList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/languages`), callback, { signal });\n};\n\nexport const getCountryList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/countries`), callback, { signal });\n};\n\nlet geocoder;\n\nexport const geoCodeAddress = (address) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\nexport const geoCodeLatLng = (lat, lng) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n let latlng = {lat: parseFloat(lat), lng: parseFloat(lng)};\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'location': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\n/**\n * @type {DebouncedFunc<(function(*, *=, *, *=, *=): Promise)|*>}\n */\nexport const queryTicketTypes = debounce(async (summitId, filters = {}, callback, version = 'v1', per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/${version}/summits/${summitId}/ticket-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(filters.hasOwnProperty('name')) {\n const name = escapeFilterValue(filters.name);\n if(name && name != '')\n endpoint.addQuery('filter[]', `name@@${name}`);\n }\n\n if(filters.hasOwnProperty('audience')){\n const audience = escapeFilterValue(filters.audience);\n if(audience && audience != '')\n endpoint.addQuery('filter[]', `audience==${audience}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySponsoredProjects = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n\n const endpoint = URI(`/api/v1/sponsored-projects`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryPromocodes = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE, extraFilters = []) => {\n\n\n let endpoint = URI(`/api/v1/summits/${summitId}/promo-codes`);\n\n endpoint.addQuery('order','code')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `code@@${input}`);\n }\n\n //eg: filter = 'class_name==SummitRegistrationPromoCode'\n for (const filter of extraFilters) {\n endpoint.addQuery('filter[]', filter);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n","/**\n * Copyright 2026 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from \"react\";\n\n// Returns a callback with a stable identity that always invokes the latest\n// version of `fn`. Useful for calling props (like a parent's onChange) from\n// inside an effect without listing them as deps, which would re-run the effect\n// every time the consumer passes a new inline arrow function.\n//\n// Stable-identity wrapper over the latest-ref pattern; equivalent to React's\n// still-experimental useEffectEvent. Replace with the native hook when it\n// ships in a stable release.\nconst useEventCallback = (fn) => {\n const ref = React.useRef(fn);\n React.useLayoutEffect(() => {\n ref.current = fn;\n });\n return React.useCallback((...args) => ref.current(...args), []);\n};\n\nexport default useEventCallback;\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"idtoken-verifier\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"superagent/lib/client\");","module.exports = require(\"sweetalert2\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/extends\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"prop-types\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/TextField\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Autocomplete\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@mui/material/Typography\");","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * */\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport TextField from \"@mui/material/TextField\";\nimport Autocomplete from \"@mui/material/Autocomplete\";\nimport Typography from \"@mui/material/Typography\";\nimport { queryRegistrationCompanies } from \"../../utils/query-actions\";\nimport useEventCallback from \"../../utils/use-event-callback\";\n\n// Case-insensitive, whitespace-tolerant name comparison. Used everywhere\n// we treat two names as referring to the same company.\nexport const namesMatch = (a, b) =>\n (a || \"\").trim().toLowerCase() === (b || \"\").trim().toLowerCase();\n\n// Any well-formed company object (has a name string).\nexport const isCompanyObject = (o) =>\n !!o && typeof o === \"object\" && typeof o.name === \"string\";\n\n// A company already in the database (positive id assigned by the API).\nexport const isExistingCompany = (o) => isCompanyObject(o) && o.id > 0;\n\n// A company name the user typed that isn't in the database yet\n// (id === 0 is the sentinel used for free-text values).\nexport const isNewCompany = (o) => isCompanyObject(o) && o.id === 0 && !!o.name.trim();\n\n// Find an existing company in `candidates` whose name matches `name`\n// case-insensitively. Returns null if `name` is empty or no match found.\nexport const findExistingCompany = (candidates, name) => {\n if (!name?.trim()) return null;\n return (candidates || []).find(\n (c) => isExistingCompany(c) && namesMatch(c.name, name)\n ) || null;\n};\n\n// Treat empty strings, null/undefined, and empty-name objects as no selection.\n// MUI's Autocomplete renders the clear (x) icon whenever value is truthy, so\n// without this an empty-name object would keep the clear icon visible on hover\n// of an apparently empty field.\nexport const normalizeCompanyValue = (v) => {\n if (!v) return null;\n if (typeof v === \"string\") return v.trim() ? v : null;\n if (typeof v === \"object\" && typeof v.name === \"string\" && v.name.trim()) return v;\n return null;\n};\n\n// Extract the display name from an option. String options come through when\n// the consumer passes value as a plain string; object options carry `name`.\n// Returns \"\" for null/undefined/malformed shapes so callers can chain string\n// ops without null guards.\nexport const getOptionName = (option) => {\n if (typeof option === \"string\") return option;\n if (isCompanyObject(option)) return option.name;\n return \"\";\n};\n\n// Should the synthetic Use \"\" row be prepended to the dropdown?\n// Only *real* (id > 0) companies count as \"already listed\" — a previously-\n// committed free-text option ({id: 0}) shouldn't suppress a fresh Use row\n// for the same typed text.\nexport const shouldOfferUseRow = (trimmed, opts) => {\n if (!trimmed) return false;\n return !opts.some(\n (o) => isExistingCompany(o) && namesMatch(o.name, trimmed)\n );\n};\n\n// Resolve the user's typed string to either the canonical existing company\n// (case-insensitive match against `opts`) or a fresh free-text entry\n// ({id: 0, name}). Used by onBlur and onChange when the user commits raw\n// text — same intent, both sites should agree on what the value becomes.\nexport const resolveTypedCompany = (opts, typed) =>\n findExistingCompany(opts, typed) || { id: 0, name: typed.trim() };\n\n// Text the synthetic Use row should reflect. Prefers what the user is\n// actively typing (MUI's params.inputValue), falling back to the committed\n// free-text value's name so the Use row survives a passive refocus (tab\n// away, click back in without typing) — in that state params.inputValue\n// is empty even though the field still displays the committed text.\nexport const getUseRowText = (params, normalizedValue) => {\n const typed = params.inputValue.trim();\n if (typed) return typed;\n return isNewCompany(normalizedValue) ? normalizedValue.name.trim() : \"\";\n};\n\n// Resolve whatever MUI hands us in onChange into a canonical Company entry.\n// - String (freeSolo Enter with raw text) → existing match, else free-text\n// - Synthetic Use row (isFreeTextOption) → clean free-text (marker stripped)\n// - Anything else (picked option, null) → passed through unchanged\nexport const resolveCommittedCompany = (input, opts) => {\n if (typeof input === \"string\" && input.trim()) {\n return resolveTypedCompany(opts, input);\n }\n if (input?.isFreeTextOption) {\n return { id: 0, name: input.name };\n }\n return input;\n};\n\n// After the API responds, if the user's already-committed free-text has a\n// canonical match in the results, return that so the value can be upgraded\n// to the existing company. Returns null when there's nothing to upgrade.\nexport const findCanonicalUpgrade = (value, results) => {\n if (!isNewCompany(value)) return null;\n return findExistingCompany(results, value.name);\n};\n\nconst CompanyInputV2 = ({ summitId, isRequired, sx, onChange, id, name, label, value, error, helperText, onBlur, placeholder, options2Show, disableShrink, ...rest }) => {\n const [inputValue, setInputValue] = React.useState(\"\");\n const [options, setOptions] = React.useState([]);\n\n // Memoised so the effect below doesn't re-run on every render.\n const normalizedValue = React.useMemo(() => normalizeCompanyValue(value), [value]);\n\n // Stable wrapper around the parent's onChange. Consumers commonly pass an\n // inline arrow function (new identity each render), so depending on\n // `onChange` directly in the effect below would re-run it every render and\n // cause an infinite loop of network calls.\n const fireChange = useEventCallback((nextValue) => {\n onChange({ target: { id: name, value: nextValue, type: \"companyinput\" } });\n });\n\n React.useEffect(() => {\n if (inputValue === \"\") {\n setOptions(normalizedValue ? [normalizedValue] : []);\n return undefined;\n }\n\n // Purge stale free-text (id: 0) options from a prior blur/commit before\n // the API responds. Prevents a just-committed free-text (\"ti\") from\n // flashing in the dropdown once the user starts a new query (\"tip\"),\n // and stops the \"already listed\" check in filterOptions from being\n // fooled by its own previous entry.\n setOptions((prev) => {\n const real = prev.filter(isExistingCompany);\n return normalizedValue ? [normalizedValue, ...real] : real;\n });\n\n // Guard against the in-flight callback firing after the user clears the\n // field (or types something else): without this, a late response would\n // call onChange with the previous typed value and clobber the clear.\n let cancelled = false;\n queryRegistrationCompanies(summitId, inputValue, (results) => {\n if (cancelled) return;\n setOptions([\n ...(normalizedValue ? [normalizedValue] : []),\n ...(results || [])\n ]);\n // If the user typed and blurred faster than the API responded, the\n // free-text commit already happened. Once the response arrives, if\n // there is a case-insensitive existing match, upgrade the value to\n // the canonical option.\n const upgrade = findCanonicalUpgrade(normalizedValue, results);\n if (upgrade) fireChange(upgrade);\n }, options2Show);\n return () => { cancelled = true; };\n }, [normalizedValue, inputValue, summitId, options2Show, fireChange]);\n\n return (\n {\n // On blur with no explicit selection, commit the field's value as-is.\n // Read the *DOM* value (event.target.value), NOT React input state:\n // browser autofill (notably iOS Chrome) can populate the field without\n // firing onInputChange, so the React state would be stale. Reading the\n // DOM value is what MUI's `autoSelect` did internally — this preserves\n // the typed/autofilled-value-on-blur fix (#241) — but we commit the\n // field *text*, never a highlighted option, so hovering a suggestion and\n // tabbing away no longer selects the wrong company (why autoSelect was\n // removed). Resolve to an existing company only on an exact\n // (case-insensitive) name match, else free-text { id: 0, name }. Skip\n // when the text already matches the committed value (e.g. right after an\n // explicit selection).\n const typed = (event?.target?.value ?? inputValue).trim();\n const currentName = getOptionName(normalizedValue);\n if (!typed) {\n // Field emptied (delete-all-text). With disableClearable there's no\n // (x), so this is the only way to clear — propagate null. Skip if\n // already cleared to avoid a redundant change.\n if (normalizedValue) fireChange(null);\n } else if (!namesMatch(typed, currentName)) {\n fireChange(resolveTypedCompany(options, typed));\n }\n if (onBlur) onBlur(name);\n }}\n getOptionLabel={getOptionName}\n onChange={(_, newValue) => {\n const nextValue = resolveCommittedCompany(newValue, options);\n // Prepend the committed value but drop any existing entry with\n // the same id; otherwise resolving to an existing company would\n // produce a duplicate row when the dropdown next opens.\n setOptions(nextValue\n ? [nextValue, ...options.filter((o) => o?.id !== nextValue?.id)]\n : options);\n fireChange(nextValue);\n }}\n onInputChange={(_, newInputValue) => {\n setInputValue(newInputValue);\n }}\n // The API already filters server-side, so all returned matches stay\n // visible (no client-side substring filtering). We *prepend* a synthetic\n // \"Use \"\"\" row so the user can explicitly commit their free text\n // when it isn't already listed. First position makes the typed text the\n // primary action (arrow-down + Enter commits without scrolling past\n // suggestions) and matches the user's intent that they took the trouble\n // to type.\n filterOptions={(opts, params) => {\n const text = getUseRowText(params, normalizedValue);\n return shouldOfferUseRow(text, opts)\n ? [{ id: 0, name: text, isFreeTextOption: true }, ...opts]\n : opts;\n }}\n renderInput={(params) => (\n \n )}\n renderOption={(props, option) => {\n const { key, ...optionProps } = props;\n const optionName = getOptionName(option);\n // The synthetic free-text row reads Use \"\" so it's clearly a\n // commit-what-I-typed action, not a matched company.\n const displayLabel = option?.isFreeTextOption ? `Use \"${optionName}\"` : optionName;\n return (\n // eslint-disable-next-line react/jsx-props-no-spreading\n \n \n {displayLabel}\n \n \n );\n }}\n {...rest}\n />\n );\n};\n\nCompanyInputV2.defaultProps = {\n name: \"GENERAL\",\n label: \"Company\",\n options2Show: 20,\n disableShrink: false\n};\n\nCompanyInputV2.propTypes = {\n summitId: PropTypes.number.isRequired,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n onChange: PropTypes.func.isRequired,\n isRequired: PropTypes.bool,\n name: PropTypes.string,\n error: PropTypes.bool,\n helperText: PropTypes.string,\n onBlur: PropTypes.func,\n options2Show: PropTypes.number,\n placeholder: PropTypes.string,\n label: PropTypes.string,\n disableShrink: PropTypes.bool\n};\n\nexport default CompanyInputV2;\n"],"names":["root","factory","exports","module","define","amd","this","AUTH_ERROR_MISSING_AUTH_INFO","AUTH_ERROR_MISSING_REFRESH_TOKEN","AUTH_ERROR_ACCESS_TOKEN_EXPIRED","AUTH_ERROR_LOCK_ACQUIRE_ERROR","AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR","AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR","require","Lock","SuperTokensLock","GET_TOKEN_SILENTLY_LOCK_KEY","RESPONSE_TYPE_CODE","AUTH_INFO","ID_TOKEN","processRefreshToken","async","flow","refreshToken","useOAuth2RefreshToken","clearAuthInfo","Error","response","fn","maxRetries","baseDelayMs","attempt","err","message","startsWith","delay","Math","pow","console","log","Promise","resolve","setTimeout","retryWithBackoff","refreshAccessToken","access_token","expires_in","refresh_token","id_token","storeAuthInfo","_getAccessToken","authInfo","getAuthInfo","accessToken","expiresIn","accessTokenUpdatedAt","getOAuth2Flow","now","moment","unix","timeElapsedSecs","ACCESS_TOKEN_RESOLVER_KEY","Symbol","for","getAccessToken","resolveAccessToken","globalThis","navigator","locks","request","lock","retryPromise","acquireLock","releaseLock","baseUrl","getOAuth2IDPBaseUrl","oauth2ClientId","getOAuth2ClientId","payload","encodeURI","controller","AbortController","timeoutId","abort","json","fetch","method","headers","body","JSON","stringify","signal","networkError","clearTimeout","ok","status","statusText","setSessionClearingState","parseError","new_refresh_token","idToken","formerAuthInfo","floor","Date","Cookies","secure","sameSite","putOnLocalStorage","res","getFromLocalStorage","parse","window","removeFromLocalStorage","OAUTH2_CLIENT_ID","OAUTH2_FLOW","Boolean","OAUTH2_USE_REFRESH_TOKEN","IDP_BASE_URL","URI","createAction","type","fetchErrorHandler","code","msg","Swal","T","fetchResponseHandler","escapeFilterValue","value","String","replace","crypto","msCrypto","buildAPIBaseUrl","relativeUrl","API_BASE_URL","key","localStorage","setItem","removeIt","val","getItem","removeItem","clearing_session_state","cb","maxNumberOfRetries","i","callDelay","_fetchPublic","endpoint","callback","options","toString","then","data","catch","_fetch","e","addQuery","queryRegistrationCompanies","debounce","input","per_page","DEFAULT_PAGE_SIZE","summitId","excludedIds","length","join","onlyPublished","eventTypeClassName","filters","version","hasOwnProperty","name","audience","extraFilters","filter","ref","React","current","args","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","toStringTag","namesMatch","b","trim","toLowerCase","isCompanyObject","isExistingCompany","id","isNewCompany","findExistingCompany","candidates","find","c","normalizeCompanyValue","v","getOptionName","option","shouldOfferUseRow","trimmed","opts","some","resolveTypedCompany","typed","getUseRowText","params","normalizedValue","inputValue","resolveCommittedCompany","isFreeTextOption","findCanonicalUpgrade","results","CompanyInputV2","_ref","isRequired","sx","onChange","label","error","helperText","onBlur","placeholder","options2Show","disableShrink","rest","_objectWithoutProperties","_excluded","setInputValue","setOptions","fireChange","useEventCallback","nextValue","target","prev","real","cancelled","upgrade","Autocomplete","_extends","autoComplete","freeSolo","disableClearable","includeInputInList","filterSelectedOptions","event","_event$target","currentName","getOptionLabel","_","newValue","onInputChange","newInputValue","filterOptions","text","renderInput","TextField","fullWidth","required","margin","InputLabelProps","shrink","renderOption","props","optionProps","_excluded2","optionName","displayLabel","Typography","variant","fontSize","color","padding","defaultProps","propTypes","PropTypes"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/company-input.js b/lib/components/inputs/company-input.js
new file mode 100644
index 00000000..dfc2f82c
--- /dev/null
+++ b/lib/components/inputs/company-input.js
@@ -0,0 +1,2 @@
+!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={5097:(e,r,a)=>{a(1116),a(6842),a(9087),a(9558),a(2183)},3195:(e,r,a)=>{a.d(r,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>o,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>t,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>n,AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR:()=>d,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>i});const t="AUTH_ERROR_MISSING_AUTH_INFO",n="AUTH_ERROR_MISSING_REFRESH_TOKEN",o="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",i="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR",d="AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR"},2183:(e,r,a)=>{a.d(r,{getAccessToken:()=>f});var t=a(9558),n=a(5812),o=a.n(n);a(806);const s=require("browser-tabs-lock");var i=a.n(s);const d=require("js-cookie");var l=a.n(d),u=(a(8041),a(9891),a(5097),a(8853),a(3195));const Lock=new(i()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",p="code",c="authInfo",y="idToken",_=async(e,r)=>{if(e===p&&T()){if(!r)throw O(),Error(u.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await(async(e,r=5,a=1e3)=>{for(let t=0;tsetTimeout(e,n)))}})((()=>g(r))),{access_token:a,expires_in:t,refresh_token:n,id_token:o}=e;return void 0===n&&(n=null),E(a,t,n,o),a}throw O(),Error(u.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)},R=async()=>{console.log("openstack-uicore-foundation::Security::methods::_getAccessToken");let e=h();if(!e)throw console.log("openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO"),Error(u.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:r,expiresIn:a,accessTokenUpdatedAt:t,refreshToken:n}=e,s=w();const i=o()().unix();let d=i-t;return a-=60,console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${i} accessTokenUpdatedAt ${t} expiresIn ${a} timeElapsedSecs ${d}`),(d>=a||null==r)&&(console.log("openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ..."),r=await _(s,n)),r},m=Symbol.for("openstack-uicore-foundation.accessTokenResolver"),f=async()=>{const e=globalThis[m];if(e)return e();if("undefined"!=typeof navigator&&navigator.locks)return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY,(async e=>(console.log("openstack-uicore-foundation::Security::methods::getAccessToken web lock api",e),await R())));if(!await(0,t.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))throw Error(u.AUTH_ERROR_LOCK_ACQUIRE_ERROR);try{return await R()}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}},g=async e=>{let r=S(),a=Q();const n={grant_type:"refresh_token",client_id:encodeURI(a),refresh_token:e},o=new AbortController,s=setTimeout((()=>o.abort()),1e4);let i,d;try{i=await fetch(`${r}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n),signal:o.signal})}catch(e){throw console.log("refreshAccessToken network error:",e.message),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${e.message}`)}finally{clearTimeout(s)}if(!i.ok){if(console.log(`refreshAccessToken server error: ${i.status} - ${i.statusText}`),i.status>=500||408===i.status||429===i.status)throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${i.status} - ${i.statusText}`);throw(0,t.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${i.status} - ${i.statusText}`)}try{d=await i.json()}catch(e){throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`)}let{access_token:l,refresh_token:p,expires_in:c,id_token:y}=d;if(!l)throw(0,t.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);return{access_token:l,refresh_token:p,expires_in:c,id_token:y}},E=(e,r,a=null,n=null)=>{let o=h(),s={accessToken:e,expiresIn:r,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null==a&&o&&(a=o.refreshToken),null==n&&o&&(n=o.idToken),a&&(s.refreshToken=a),n?(s[y]=n,l().set(y,n,{secure:!0,sameSite:"Lax"})):l().remove(y),(0,t.putOnLocalStorage)(c,JSON.stringify(s))},h=()=>{try{let e=(0,t.getFromLocalStorage)(c,!1);return e?JSON.parse(e):null}catch(e){return null}},O=()=>{"undefined"!=typeof window&&((0,t.removeFromLocalStorage)(c),l().remove(y))},Q=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,w=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",T=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),S=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},9087:(e,r,a)=>{a.d(r,{escapeFilterValue:()=>c,fetchErrorHandler:()=>u,fetchResponseHandler:()=>p});a(2462),a(806);var t=a(8041),n=a.n(t),o=a(9236),s=a.n(o),i=a(6842),d=a.n(i);a(9558),a(5097),a(2183);n().escapeQuerySpace=!1;const l=e=>r=>({type:e,payload:r}),u=(l("RESET_LOADING"),l("START_LOADING"),l("STOP_LOADING"),e=>{let r=e.status,a=e.statusText;switch(r){case 403:s().fire("ERROR",d().translate("errors.user_not_authz"),"warning");break;case 401:s().fire("ERROR",d().translate("errors.session_expired"),"error");break;case 412:s().fire("ERROR",a,"warning");case 500:s().fire("ERROR",d().translate("errors.server_error"),"error")}}),p=e=>{if(e.ok)return e.json();throw e},c=e=>e=(e=(e=(e=(e=String(e)).replace(/\\/g,"\\\\")).replace(/,/g,"\\,")).replace(/;/g,"\\;")).replace(/\+/g,"%2B")},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,r,a)=>{a.d(r,{buildAPIBaseUrl:()=>t,getFromLocalStorage:()=>o,putOnLocalStorage:()=>n,removeFromLocalStorage:()=>s,retryPromise:()=>d,setSessionClearingState:()=>i});a(5812),a(8041);const t=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,n=(e,r)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,r)},o=(e,r)=>{if("undefined"!=typeof window){let a=window.localStorage.getItem(e);return r&&(console.log(`getFromLocalStorage removing key ${e}`),s(e)),a}return null},s=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},d=async(e,r=3)=>{for(let a=0;a{a.d(r,{queryCompanies:()=>y});var t=a(9087),n=a(2183),o=a(9558);const s=require("lodash/debounce");var i=a.n(s),d=a(8041),l=a.n(d);const u=500;l().escapeQuerySpace=!1;const p=async(e,r,a={})=>fetch((0,o.buildAPIBaseUrl)(e.toString()),a).then(t.fetchResponseHandler).then((e=>{"function"==typeof r&&r(e.data)})).catch((e=>(404===(e&&e.status)&&"function"==typeof r&&r([]),e))).catch(t.fetchErrorHandler),c=async(e,r,a={})=>{let t;try{t=await(0,n.getAccessToken)()}catch(e){return void("function"==typeof r&&r(e))}return e.addQuery("access_token",t),p(e,r,a)},y=(i()((async(e,r,a=10)=>{let n=l()("/api/v1/members");n.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),n.addQuery("order","first_name,last_name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`full_name@@${e},first_name@@${e},last_name@@${e},email@@${e}`)),c(n,r)}),u),i()((async(e,r,a,n=10)=>{let o=l()(`/api/v1/summits/${e}/attendees`);o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`full_name=@${r},email=@${r}`)),c(o,a)}),u),i()((async(e,r,a=10)=>{let n=l()("/api/v1/summits/all");n.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),c(n,r)}),u),i()((async(e,r,a,n=10)=>{let o=l()("/api/v1/"+(e?`summits/${e}/speakers`:"speakers"));o.addQuery("expand","member,registration_request"),o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`full_name@@${r},first_name@@${r},last_name@@${r},email@@${r}`)),c(o,a)}),u),i()((async(e,r,a,n=50)=>{let o=l()("/api/v1/"+(e?`summits/${e}/track-tag-groups/all/allowed-tags`:"tags"));e&&o.addQuery("expand","tag,track_tag_group"),o.addQuery("order","tag"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`tag@@${r}`)),c(o,a)}),u),i()((async(e,r,a,n=[],o=10)=>{let s=l()(`/api/v1/summits/${e}/tracks`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",o),(null==n?void 0:n.length)>0&&s.addQuery("filter[]",`not_id==${n.join("||")}`),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),c(s,a)}),u),i()((async(e,r,a,n=10)=>{let o=l()(`/api/v1/summits/${e}/track-groups`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),c(o,a)}),u),i()((async(e,r,a=!1,n,o=10)=>{let s=l()(`/api/v1/summits/${e}/events`+(a?"/published":""));s.addQuery("order","title"),s.addQuery("page",1),s.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`title@@${r}`)),c(s,n)}),u),i()((async(e,r,a,n=null,o=10)=>{let s=l()(`/api/v1/summits/${e}/event-types`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",o),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),n&&(n=(0,t.escapeFilterValue)(n),s.addQuery("filter[]",`class_name==${n}`)),c(s,a)}),u),i()((async(e,r,a=10)=>{let n=l()("/api/v1/groups");n.addQuery("order","title,code"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`title@@${e},code@@${e}`)),c(n,r)}),u),i()((async(e,r,a=10)=>{let n=l()("/api/v1/companies");n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),c(n,r)}),u));i()((async(e,r,a,n=10)=>{let o=l()(`/api/v1/summits/${e}/registration-companies`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),c(o,a)}),u),i()((async(e,r,a,n=10)=>{let o=l()(`/api/v1/summits/${e}/sponsors`);o.addQuery("expand","company,sponsorship,sponsorship.type"),o.addQuery("order","id"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`company_name@@${r}`)),c(o,a)}),u),i()((async(e,r,a,n=10)=>{let o=l()(`/api/v1/summits/${e}/sponsors`);o.addQuery("expand","company,sponsorship,sponsorship.type"),o.addQuery("fields","id,company.name,sponsorship.type.name"),o.addQuery("relations","none,company.none,sponsorship.type.none"),o.addQuery("filter[]","badge_scans_count>0"),o.addQuery("order","+company_name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`company_name@@${r}`)),c(o,a)}),u),i()((async(e,r,a,n=10)=>{let o=l()(`/api/v1/summits/${e}/access-level-types`);o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),o.addQuery("filter[]",`name@@${r}`)),c(o,a)}),u),i()((async(e,r,a=10)=>{let n=l()("/api/v1/organizations");n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),c(n,r)}),u);i()((async(e,r={},a,n="v1",o=10)=>{let s=l()(`/api/${n}/summits/${e}/ticket-types`);if(s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",o),r.hasOwnProperty("name")){const e=(0,t.escapeFilterValue)(r.name);e&&""!=e&&s.addQuery("filter[]",`name@@${e}`)}if(r.hasOwnProperty("audience")){const e=(0,t.escapeFilterValue)(r.audience);e&&""!=e&&s.addQuery("filter[]",`audience==${e}`)}c(s,a)}),u),i()((async(e,r,a=10)=>{const n=l()("/api/v1/sponsored-projects");n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",a),e&&(e=(0,t.escapeFilterValue)(e),n.addQuery("filter[]",`name@@${e}`)),c(n,r)}),u),i()((async(e,r,a,n=10,o=[])=>{let s=l()(`/api/v1/summits/${e}/promo-codes`);s.addQuery("order","code"),s.addQuery("page",1),s.addQuery("per_page",n),r&&(r=(0,t.escapeFilterValue)(r),s.addQuery("filter[]",`code@@${r}`));for(const e of o)s.addQuery("filter[]",e);c(s,a)}),u)},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},5812:e=>{e.exports=require("moment-timezone")},2015:e=>{e.exports=require("react")},2113:e=>{e.exports=require("react-select/lib/Async")},2934:e=>{e.exports=require("react-select/lib/AsyncCreatable")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},r={};function a(t){var n=r[t];if(void 0!==n)return n.exports;var o=r[t]={exports:{}};return e[t](o,o.exports,a),o.exports}(()=>{a.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return a.d(r,{a:r}),r}})(),(()=>{a.d=(e,r)=>{for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}})(),(()=>{a.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var t={};a.r(t),a.d(t,{default:()=>m});var n=a(6031),o=a.n(n),s=a(2462),i=a.n(s),d=a(2015),l=a.n(d),u=a(2113),p=a.n(u),c=a(5301),y=a(2934),_=a.n(y);const R=["error","value","onChange","id","multi"];class m extends l().Component{constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.handleNew=this.handleNew.bind(this),this.getCompanies=this.getCompanies.bind(this)}handleChange(e){const r=this.props.hasOwnProperty("multi")||this.props.hasOwnProperty("isMulti")?e.map((e=>({id:e.value,name:e.label}))):{id:e.value,name:e.label};let a={target:{id:this.props.id,value:r,type:"companyinput"}};this.props.onChange(a)}handleNew(e){this.props.onCreate(e,(e=>{this.handleChange({value:e.id,label:e.name})}))}getCompanies(e,r){const{extraOptions:a}=this.props;if(!e)return Promise.resolve({options:[]});(this.props.queryFunction||c.queryCompanies)(e,(e=>{let t=e.map((e=>({value:e.id.toString(),label:e.name})));(null==a?void 0:a.length)>0&&(t=[...a,...t]),r(t)}))}render(){let e=this.props,{error:r,value:a,onChange:t,id:n,multi:s}=e,d=i()(e,R),u=this.props.hasOwnProperty("error")&&""!=r,c=this.props.hasOwnProperty("multi")||this.props.hasOwnProperty("isMulti"),y=this.props.hasOwnProperty("allowCreate"),m=null;c&&a.length>0?m=a.map((e=>({value:e.id.toString(),label:e.name}))):!c&&a&&(m={value:a.id.toString(),label:a.name});const f=y?_():p();return l().createElement("div",null,l().createElement(f,o()({value:m,onChange:this.handleChange,loadOptions:this.getCompanies,onCreateOption:this.handleNew,isMulti:c},d)),u&&l().createElement("p",{className:"error-label"},r))}}return t})()));
+//# sourceMappingURL=company-input.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/company-input.js.map b/lib/components/inputs/company-input.js.map
new file mode 100644
index 00000000..b5fe43b9
--- /dev/null
+++ b/lib/components/inputs/company-input.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/company-input.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,wVCTF,MAAMC,EAA+B,+BAC/BC,EAAmC,mCACnCC,EAAkC,kCAClCC,EAAgC,gCAChCC,EAAyC,yCACzCC,EAAyC,wC,uFCLtD,MAAM,EAA+BC,QAAQ,qB,aCA7C,MAAM,EAA+BA,QAAQ,a,yDCqC7C,MAAMC,KAAO,IAAIC,KAIXC,4BAA8B,wCAKvBC,EAAqB,OAC5BC,EAAY,WAGZC,EAAW,UAsPXC,EAAsBC,MAAOC,EAAMC,KAErC,GAAID,IAASL,GAAsBO,IAAyB,CACxD,IAAKD,EAED,MADAE,IACMC,MAAMlB,EAAAA,kCAGhB,IAAImB,OAzBoBN,OAAOO,EAAIC,EAJhB,EAI0CC,EAHtC,OAI3B,IAAK,IAAIC,EAAU,EAAGA,EAAUF,EAAYE,IACxC,IACI,aAAaH,GACjB,CAAE,MAAOI,GAGL,IADoBA,EAAIC,UAAWD,EAAIC,QAAQC,WAAWtB,EAAAA,yCACtCmB,IAAYF,EAAa,EACzC,MAAMG,EAEV,MAAMG,EAAQL,EAAcM,KAAKC,IAAI,EAAGN,GAC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C,OAIzD,MAAM4D,EAAiBD,EACjBE,IACAC,IAEN,OACIlC,IAAAA,cAAA,WACIA,IAAAA,cAACgC,EAAcG,IAAA,CACX5G,MAAOiF,EACPO,SAAUlN,KAAKuM,aACfgC,YAAavO,KAAK0M,aAClB8B,eAAgBxO,KAAKyM,UACrBwB,QAASA,GACLJ,IAEPG,GACD7B,IAAAA,cAAA,KAAGsC,UAAU,eAAed,GAKxC,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/security/constants.js","webpack://openstack-uicore-foundation/external commonjs \"browser-tabs-lock\"","webpack://openstack-uicore-foundation/external commonjs \"js-cookie\"","webpack://openstack-uicore-foundation/./src/components/security/methods.js","webpack://openstack-uicore-foundation/./src/utils/actions.js","webpack://openstack-uicore-foundation/external commonjs \"spark-md5\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/sha256\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-base64url\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-hex\"","webpack://openstack-uicore-foundation/./src/utils/crypto.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"lodash/debounce\"","webpack://openstack-uicore-foundation/./src/utils/query-actions.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"idtoken-verifier\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-select/lib/Async\"","webpack://openstack-uicore-foundation/external commonjs \"react-select/lib/AsyncCreatable\"","webpack://openstack-uicore-foundation/external commonjs \"superagent/lib/client\"","webpack://openstack-uicore-foundation/external commonjs \"sweetalert2\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/inputs/company-input.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","export const AUTH_ERROR_MISSING_AUTH_INFO = 'AUTH_ERROR_MISSING_AUTH_INFO';\nexport const AUTH_ERROR_MISSING_REFRESH_TOKEN = 'AUTH_ERROR_MISSING_REFRESH_TOKEN';\nexport const AUTH_ERROR_ACCESS_TOKEN_EXPIRED = 'AUTH_ERROR_ACCESS_TOKEN_EXPIRED';\nexport const AUTH_ERROR_LOCK_ACQUIRE_ERROR = 'AUTH_ERROR_LOCK_ACQUIRE_ERROR'\nexport const AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR';\nexport const AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR';\nexport const AUTH_ERROR_ID_TOKEN_INVALID = 'AUTH_ERROR_ID_TOKEN_INVALID';\nexport const AUTH_ERROR_MISSING_OTP_PARAM = 'AUTH_ERROR_MISSING_OTP_PARAM';\nexport const AUTH_ERROR_MISSING_PKCE_PARAM = 'AUTH_ERROR_MISSING_PKCE_PARAM';\nexport const AUTH_ERROR_MISSING_NONCE_PARAM = 'AUTH_ERROR_MISSING_NONCE_PARAM';\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"browser-tabs-lock\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"js-cookie\");","import {\n base64URLEncode,\n getAuthCallback,\n getCurrentLocation,\n getFromLocalStorage,\n removeFromLocalStorage,\n getOrigin,\n putOnLocalStorage,\n retryPromise,\n setSessionClearingState,\n} from \"../../utils/methods\";\nimport moment from \"moment-timezone\";\nimport request from 'superagent/lib/client';\nimport SuperTokensLock from 'browser-tabs-lock';\nimport Cookies from 'js-cookie'\nlet http = request;\nimport URI from \"urijs\";\nimport IdTokenVerifier from \"idtoken-verifier\";\nimport {SET_LOGGED_USER} from \"./actions\";\nimport {getRandomBytes, getSHA256} from \"../../utils/crypto\";\n\nimport {\n AUTH_ERROR_ACCESS_TOKEN_EXPIRED,\n AUTH_ERROR_MISSING_AUTH_INFO,\n AUTH_ERROR_MISSING_REFRESH_TOKEN,\n AUTH_ERROR_LOCK_ACQUIRE_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR,\n AUTH_ERROR_ID_TOKEN_INVALID,\n AUTH_ERROR_MISSING_OTP_PARAM,\n AUTH_ERROR_MISSING_PKCE_PARAM,\n AUTH_ERROR_MISSING_NONCE_PARAM,\n} from \"./constants\";\n\n/**\n * @ignore\n */\nconst Lock = new SuperTokensLock();\n/**\n * @ignore\n */\nconst GET_TOKEN_SILENTLY_LOCK_KEY = 'openstackuicore.lock.getTokenSilently';\nconst GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT = 6000;\nconst NONCE_LEN = 16;\nexport const ACCESS_TOKEN_SKEW_TIME = 60;\nexport const RESPONSE_TYPE_IMPLICIT = \"token id_token\";\nexport const RESPONSE_TYPE_CODE = 'code';\nconst AUTH_INFO = 'authInfo';\nconst NONCE = 'nonce';\nconst PKCE = 'pkce';\nconst ID_TOKEN = 'idToken';\nconst BACK_ULR_PARAM_NAME = 'BackUrl';\n\n\n/**\n *\n * @param backUrl\n * @param prompt\n * @param tokenIdHint\n * @param provider\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n * @param backUrlParamName\n * @returns {*}\n */\nexport const getAuthUrl = (\n backUrl = null,\n prompt = null,\n tokenIdHint = null,\n provider = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null,\n backUrlParamName = BACK_ULR_PARAM_NAME\n ) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let baseUrl = getOAuth2IDPBaseUrl();\n let scopes = getOAuth2Scopes();\n let flow = getOAuth2Flow();\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n let nonce = createNonce(NONCE_LEN);\n\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let query = {\n \"response_type\": encodeURI(flow),\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"response_mode\": 'fragment',\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n if (flow === RESPONSE_TYPE_CODE) {\n const pkce = createPKCECodes()\n putOnLocalStorage(PKCE, JSON.stringify(pkce));\n query['code_challenge'] = pkce.codeChallenge;\n query['code_challenge_method'] = 'S256';\n query['approval_prompt'] = 'force';\n }\n\n if (prompt) {\n query['prompt'] = prompt;\n }\n\n if (scopes && scopes.includes('offline_access')) {\n // then we need to force prompt=consent bc we are requesting an offline access\n // and we need to let the user know\n query['prompt'] = 'consent';\n }\n\n if (tokenIdHint) {\n query['id_token_hint'] = tokenIdHint;\n }\n\n if (provider) {\n query['provider'] = provider;\n }\n\n if (otpLoginHint) {\n query['otp_login_hint'] = otpLoginHint;\n }\n\n if (loginHint) {\n query['login_hint'] = encodeURI(loginHint);\n }\n\n if (tenant) {\n query['tenant'] = tenant;\n }\n\n url = url.query(query);\n //console.log(`getAuthUrl ${url.toString()}`);\n return url;\n}\n\n/**\n * @param idToken\n * @returns {*}\n */\nexport const getLogoutUrl = (idToken = null) => {\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let url = URI(`${baseUrl}/oauth2/end-session`);\n let state = createNonce(NONCE_LEN);\n let postLogOutUri = `${getOrigin()}/auth/logout`;\n // store nonce to check it later\n putOnLocalStorage('post_logout_state', state);\n /**\n * post_logout_redirect_uri should be listed on oauth2 client settings\n * on IDP\n * \"Security Settings\" Tab -> Logout Options -> Post Logout Uris\n */\n const queryParams = {\n \"post_logout_redirect_uri\": encodeURI(postLogOutUri),\n \"client_id\": encodeURI(oauth2ClientId),\n \"state\": state,\n }\n\n if (idToken)\n queryParams.id_token_hint = idToken;\n\n return url.query(queryParams);\n}\n\nconst createNonce = (len) => {\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let nonce = '';\n for (let i = 0; i < len; i++) {\n nonce += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return nonce;\n}\n\n/**\n *\n * @param backUrl\n * @param provider\n * @param prompt\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n */\nexport const doLogin = (\n backUrl = null,\n provider = null,\n prompt = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null\n) => {\n let url = getAuthUrl(backUrl, prompt, null, provider, loginHint, otpLoginHint, tenant);\n let location = getCurrentLocation()\n location.replace(url.toString());\n}\n\n/**\n *\n * @param backUrl\n * @param loginHint\n * @param otpLoginHint\n */\nexport const doLoginBasicLogin = (backUrl = null, loginHint = null, otpLoginHint = null) => {\n doLogin(backUrl, null, null, loginHint, otpLoginHint);\n}\n\nconst createPKCECodes = () => {\n const codeVerifier = base64URLEncode(getRandomBytes(64))\n const codeChallenge = getSHA256(codeVerifier, 'Base64url')\n const createdAt = new Date()\n const codePair = {\n codeVerifier,\n codeChallenge,\n createdAt\n }\n return codePair\n}\n\n/**\n\n * @param code\n * @param backUrl\n * @param backUrlParamName\n * @returns {Promise<{access_token: *, refresh_token: *, id_token: *, expires_in: *, error: *, error_description: *}>}\n */\nexport const emitAccessToken = async (code, backUrl = null, backUrlParamName = BACK_ULR_PARAM_NAME) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let pkce = JSON.parse(getFromLocalStorage(PKCE, true));\n\n if (!pkce)\n throw Error(AUTH_ERROR_MISSING_PKCE_PARAM);\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n const payload = {\n 'code': code,\n 'grant_type': 'authorization_code',\n 'code_verifier': pkce.codeVerifier,\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n try {\n //const response = await http.post(`${baseUrl}/oauth2/token`, payload);\n //const {body: {access_token, refresh_token, id_token, expires_in}} = response;\n const response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }).catch(function (error) {\n console.log('Request failed:', error.message);\n });\n const json = await response.json();\n let {access_token, refresh_token, id_token, expires_in, error, error_description} = json;\n return {access_token, refresh_token, id_token, expires_in, error, error_description}\n } catch (err) {\n console.log(err);\n }\n};\n\nexport const MAX_RETRIES = 5;\nexport const BACKOFF_BASE_MS = 1000;\nexport const REFRESH_TOKEN_FETCH_TIMEOUT_MS = 10000;\n\nexport const retryWithBackoff = async (fn, maxRetries = MAX_RETRIES, baseDelayMs = BACKOFF_BASE_MS) => {\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n return await fn();\n } catch (err) {\n // only retry transient network/server errors — everything else fails fast\n const isRetryable = err.message && err.message.startsWith(AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR);\n if (!isRetryable || attempt === maxRetries - 1) {\n throw err;\n }\n const delay = baseDelayMs * Math.pow(2, attempt);\n console.log(`retryWithBackoff retry ${attempt + 1}/${maxRetries} in ${delay}ms`);\n await new Promise(resolve => setTimeout(resolve, delay));\n }\n }\n};\n\nconst processRefreshToken = async (flow, refreshToken) => {\n\n if (flow === RESPONSE_TYPE_CODE && useOAuth2RefreshToken()) {\n if (!refreshToken) {\n clearAuthInfo();\n throw Error(AUTH_ERROR_MISSING_REFRESH_TOKEN);\n }\n\n let response = await retryWithBackoff(() => refreshAccessToken(refreshToken));\n let {access_token, expires_in, refresh_token, id_token} = response;\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n return access_token;\n }\n clearAuthInfo();\n throw Error(AUTH_ERROR_ACCESS_TOKEN_EXPIRED);\n}\n\n/**\n * @returns {Promise<*>}\n * @private\n */\nconst _getAccessToken = async () => {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken`);\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n let flow = getOAuth2Flow();\n // check lifetime\n const now = moment().unix();\n let timeElapsedSecs = (now - accessTokenUpdatedAt);\n\n expiresIn = (expiresIn - ACCESS_TOKEN_SKEW_TIME);\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${now} accessTokenUpdatedAt ${accessTokenUpdatedAt} expiresIn ${expiresIn} timeElapsedSecs ${timeElapsedSecs}`)\n if (timeElapsedSecs >= expiresIn || accessToken == null) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ...`);\n accessToken = await processRefreshToken(flow, refreshToken);\n }\n return accessToken;\n}\n\n/**\n * Optional resolver for getAccessToken, set via setAccessTokenResolver. When\n * present, getAccessToken delegates to it; otherwise the built-in flow runs.\n * Pass a non-function (or nothing) to reset to the built-in.\n *\n * The slot lives on globalThis under a Symbol.for key so every copy of this\n * module shares it: bundles that inlined methods.js, nested installs of the\n * package, and symlinked dev installs all read the same registry entry.\n */\nconst ACCESS_TOKEN_RESOLVER_KEY = Symbol.for('openstack-uicore-foundation.accessTokenResolver');\n\nexport const setAccessTokenResolver = (resolver) => {\n globalThis[ACCESS_TOKEN_RESOLVER_KEY] = typeof resolver === 'function' ? resolver : null;\n};\n\n/**\n * @returns {Promise<*|undefined>}\n */\nexport const getAccessToken = async () => {\n const resolveAccessToken = globalThis[ACCESS_TOKEN_RESOLVER_KEY];\n if (resolveAccessToken) return resolveAccessToken();\n\n if (typeof navigator !== 'undefined' && navigator.locks) {\n return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::getAccessToken web lock api`, lock);\n return await _getAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n return await _getAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n/**\n * @private\n */\nconst _clearAccessToken = () => {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken`);\n\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n\n storeAuthInfo(null, 0, refreshToken)\n}\n\nexport const clearAccessToken = async () => {\n // see https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n if (typeof navigator !== 'undefined' && navigator.locks) {\n await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::clearAccessToken web lock api`, lock);\n _clearAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n _clearAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n\nexport const refreshAccessToken = async (refresh_token) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n\n const payload = {\n 'grant_type': 'refresh_token',\n \"client_id\": encodeURI(oauth2ClientId),\n \"refresh_token\": refresh_token\n };\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), REFRESH_TOKEN_FETCH_TIMEOUT_MS);\n\n let response;\n try {\n response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload),\n signal: controller.signal\n });\n } catch (networkError) {\n // fetch rejects on network failures (DNS, timeout, no connectivity, abort)\n console.log('refreshAccessToken network error:', networkError.message);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${networkError.message}`);\n } finally {\n clearTimeout(timeoutId);\n }\n\n if (!response.ok) {\n console.log(`refreshAccessToken server error: ${response.status} - ${response.statusText}`);\n if (response.status >= 500 || response.status === 408 || response.status === 429) {\n // transient error (server error, request timeout, rate limit) — should be retried\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${response.status} - ${response.statusText}`);\n }\n // token is genuinely revoked — this is a real auth error\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${response.status} - ${response.statusText}`);\n }\n\n let json;\n try {\n json = await response.json();\n } catch (parseError) {\n // IDP returned non-JSON (HTML error page, empty body, etc.) — treat as transient\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`);\n }\n let {access_token, refresh_token: new_refresh_token, expires_in, id_token} = json;\n // Defensively ensure we never propagate an undefined access token.\n if (!access_token) {\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);\n }\n return {access_token, refresh_token: new_refresh_token, expires_in, id_token}\n}\n\nexport const storeAuthInfo = (accessToken, expiresIn, refreshToken = null, idToken = null) => {\n\n let formerAuthInfo = getAuthInfo();\n\n let authInfo = {\n accessToken: accessToken,\n expiresIn: expiresIn,\n accessTokenUpdatedAt: Math.floor(Date.now() / 1000),\n };\n\n if (refreshToken == null && formerAuthInfo) {\n refreshToken = formerAuthInfo.refreshToken;\n }\n\n if (idToken == null && formerAuthInfo) {\n idToken = formerAuthInfo.idToken;\n }\n\n if (refreshToken) {\n authInfo['refreshToken'] = refreshToken;\n }\n\n if (idToken) {\n authInfo[ID_TOKEN] = idToken;\n Cookies.set(ID_TOKEN, idToken, {secure: true, sameSite: 'Lax'});\n } else {\n Cookies.remove(ID_TOKEN);\n }\n\n putOnLocalStorage(AUTH_INFO, JSON.stringify(authInfo));\n}\n\nexport const getAuthInfo = () => {\n try {\n let res = getFromLocalStorage(AUTH_INFO, false)\n if (!res) return null;\n return JSON.parse(res);\n } catch (err) {\n return null;\n }\n}\n\nexport const clearAuthInfo = () => {\n if (typeof window !== 'undefined') {\n removeFromLocalStorage(AUTH_INFO);\n Cookies.remove(ID_TOKEN);\n }\n};\n\nexport const getIdToken = () => {\n if (typeof window !== 'undefined') {\n const authInfo = getAuthInfo();\n if (authInfo) {\n return authInfo.idToken;\n }\n return null;\n }\n return null;\n};\n\nexport const getOAuth2ClientId = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_CLIENT_ID;\n }\n return null;\n};\n\nexport const getOAuth2Flow = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_FLOW || \"token id_token\";\n }\n return \"token id_token\";\n}\n\nexport const useOAuth2RefreshToken = () => {\n if (typeof window !== 'undefined') {\n return new Boolean(window.OAUTH2_USE_REFRESH_TOKEN || true);\n }\n return true;\n}\n\nexport const getOAuth2IDPBaseUrl = () => {\n if (typeof window !== 'undefined') {\n return window.IDP_BASE_URL;\n }\n return null;\n};\n\nexport const getOAuth2Scopes = () => {\n if (typeof window !== 'undefined') {\n return window.SCOPES;\n }\n return null;\n};\n\nexport const initLogOut = () => {\n let location = getCurrentLocation();\n location.replace(getLogoutUrl(getIdToken()).toString());\n}\n\nexport const validateIdToken = (idToken, issuer, audience) => {\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n let storedNonce = getFromLocalStorage(NONCE, true);\n if (!storedNonce)\n throw Error(AUTH_ERROR_MISSING_NONCE_PARAM);\n\n let jwt = verifier.decode(idToken);\n let alg = jwt.header.alg;\n let kid = jwt.header.kid;\n let aud = jwt.payload.aud;\n let iss = jwt.payload.iss;\n let exp = jwt.payload.exp;\n let nbf = jwt.payload.nbf;\n let tnonce = jwt.payload.nonce || null;\n\n return tnonce == storedNonce && aud == audience && iss == issuer;\n}\n\nexport const passwordlessStart = (params) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let nonce = createNonce(NONCE_LEN);\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let payload = {\n \"response_type\": \"otp\",\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"client_id\": encodeURI(oauth2ClientId),\n \"connection\": params.connection || \"email\",\n \"send\": params.send || \"code\",\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n if (params.hasOwnProperty('redirect_uri')) {\n payload[\"redirect_uri\"] = encodeURIComponent(params.redirect_uri);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n let json = res.body;\n return Promise.resolve({response: json});\n }).catch((err) => {\n return Promise.reject(err);\n });\n\n}\n\nexport const passwordlessLogin = (params) => (dispatch) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/token`);\n\n if (!params.hasOwnProperty(\"otp\")) {\n throw Error(AUTH_ERROR_MISSING_OTP_PARAM);\n }\n\n let payload = {\n \"grant_type\": \"passwordless\",\n \"connection\": params.connection || \"email\",\n \"scope\": encodeURI(scopes),\n \"client_id\": encodeURI(oauth2ClientId),\n \"otp\": params.otp\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n try {\n // now we got token\n let json = res.body;\n let {access_token, expires_in, refresh_token, id_token} = json;\n\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n\n if (typeof id_token === 'undefined') {\n id_token = null; // not using rotate policy\n }\n\n // verify id token\n\n if (id_token) {\n if (!validateIdToken(id_token, baseUrl, oauth2ClientId)) {\n throw Error(AUTH_ERROR_ID_TOKEN_INVALID);\n }\n }\n\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n\n if (dispatch) {\n dispatch({\n type: SET_LOGGED_USER,\n payload: {sessionState: null}\n });\n }\n\n return Promise.resolve({response: json});\n } catch (e) {\n console.log(e);\n return Promise.reject(e);\n }\n }).catch((err) => {\n return Promise.reject(err);\n });\n}\n\nexport const isIdTokenAlive = (nowEpoch = null) => () => {\n\n if (!nowEpoch) {\n nowEpoch = Math.floor(Date.now() / 1000);\n }\n\n const idToken = getIdToken();\n if (!idToken)\n throw Error('Id Token not set.');\n\n const issuer = getOAuth2IDPBaseUrl();\n const audience = getOAuth2ClientId();\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n const jwt = verifier.decode(idToken);\n const exp = jwt.payload.exp;\n\n // check life time\n return exp - (nowEpoch + ACCESS_TOKEN_SKEW_TIME) > 0;\n}\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific flanguage governing permissions and\n * limitations under the License.\n **/\n\nimport request from 'superagent/lib/client';\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\n\nlet http = request;\nimport Swal from 'sweetalert2';\nimport T from \"i18n-react/dist/i18n-react\";\nimport { isClearingSessionState, setSessionClearingState, getCurrentPathName } from './methods';\nimport { CLEAR_SESSION_STATE } from '../components/security/actions';\nimport { doLogin, initLogOut } from '../components/security/methods';\n\nexport const GENERIC_ERROR = \"Yikes. Something seems to be broken. Our web team has been notified, and we apologize for the inconvenience.\";\nexport const RESET_LOADING = 'RESET_LOADING';\nexport const START_LOADING = 'START_LOADING';\nexport const STOP_LOADING = 'STOP_LOADING';\nexport const VALIDATE = 'VALIDATE';\nexport const CLEAR_MESSAGE = 'CLEAR_MESSAGE';\nexport const SHOW_MESSAGE = 'SHOW_MESSAGE';\n\nexport const createAction = type => payload => ({\n type,\n payload\n});\n\nexport const resetLoading = createAction(RESET_LOADING);\nexport const startLoading = createAction(START_LOADING);\nexport const stopLoading = createAction(STOP_LOADING);\n\nconst xhrs = {};\nconst etagCache = {};\n\nconst cancel = (key) => {\n if(xhrs[key]) {\n xhrs[key].abort();\n console.log(`aborted request ${key}`);\n delete xhrs[key];\n }\n}\n\nconst schedule = (key, req) => {\n // console.log(`scheduling ${key}`);\n xhrs[key] = req;\n};\n\nconst isObjectEmpty = (obj) => {\n return Object.keys(obj).length === 0 && obj.constructor === Object ;\n}\n\nconst buildNotifyHandlerPayload = (httpCode, title, content, type) => ({ httpCode, title, html: content, type });\nconst buildNotifyHandlerErrorPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"error\");\nconst buildNotifyHandlerWarningPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"warning\");\n\nconst initLogin = () => (dispatch) => {\n const currentLocation = getCurrentPathName();\n const clearingSessionState = isClearingSessionState();\n dispatch({\n type: CLEAR_SESSION_STATE,\n payload: {}\n });\n if (!clearingSessionState) {\n setSessionClearingState(true);\n console.log(\"authErrorHandler 401 - re login\");\n doLogin(currentLocation);\n }\n};\n\nconst normalizeFormDataPayload = (req, formData) => {\n if(!isObjectEmpty(formData)) {\n Object.keys(formData).forEach(function (key) {\n let value = formData[key];\n if (Array.isArray(value)) {\n value.forEach(item => {\n req.field(`${key}[]`, item);\n });\n } else {\n req.field(key, value);\n }\n });\n }\n};\n\nexport const authErrorHandler = (\n err,\n res,\n notifyErrorHandler = showMessage\n) => (dispatch) => {\n\n const code = err.status;\n let msg = \"\";\n let payload, callback;\n\n dispatch(stopLoading());\n\n switch (code) {\n case 401:\n if (notifyErrorHandler !== showMessage) {\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_auth\"));\n callback = () => dispatch(initLogin());\n } else {\n dispatch(initLogin());\n }\n break;\n case 403:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_authz\"));\n callback = initLogOut;\n break;\n case 404:\n msg = err.response.body?.message || err.response.error?.message || err.message;\n if (err.response.body?.errors?.length) {\n msg += ` ${err.response.body.errors.join(\" \")}`;\n }\n payload = buildNotifyHandlerWarningPayload(code, \"Not Found\", msg);\n break;\n case 412:\n for (const [key, value] of Object.entries(err.response.body.errors)) {\n msg += isNaN(key) ? `${key}: ` : \"\";\n msg += `${value} `;\n }\n dispatch({\n type: VALIDATE,\n payload: { errors: err.response.body.errors }\n });\n payload = buildNotifyHandlerWarningPayload(code, \"Validation error\", msg);\n break;\n default:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.server_error\"));\n }\n\n if (payload)\n dispatch(notifyErrorHandler(payload, callback));\n}\n\nexport const getRequest =(\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {},\n useEtag = false\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n let key = url.toString();\n\n if(!isObjectEmpty(params)) {\n // remove the access token\n const { access_token: _, ...newParams} = params;\n // and generate new key\n key = url.query(newParams).toString();\n url = url.query(params);\n }\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n cancel(key);\n\n return new Promise((resolve, reject) => {\n let req = http.get(url.toString());\n if(useEtag && etagCache.hasOwnProperty(key)){\n const { etag } = etagCache[key];\n if(etag){\n req.set('If-None-Match', etag)\n }\n }\n\n req.timeout({\n response: 60000,\n deadline: 60000,\n })\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key, useEtag))\n\n schedule(key, req);\n });\n};\n\nexport const putRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => ( dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n http.put(url.toString())\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject))\n });\n};\n\nexport const deleteRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params) => (dispatch, state) => {\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n\n http.delete(url)\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n let request = http.post(url);\n\n if(payload != null)\n request.send(payload);\n else // to be a simple CORS request\n request.set('Content-Type', 'text/plain');\n\n request.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.post(url)\n .attach('file', file);\n\n normalizeFormDataPayload(req, fileMetadata);\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const putFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file = null,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.put(url);\n\n if(file != null){\n req.attach('file', file);\n }\n\n normalizeFormDataPayload(req, fileMetadata)\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const defaultErrorHandler = (err, res) => (dispatch) => {\n let body = res.body;\n let text = '';\n if(body instanceof Object){\n if(body.hasOwnProperty('message'))\n text = body.message;\n }\n Swal.fire(res.statusText, text, \"error\");\n}\n\nconst byLowerCase = toFind => value => toLowerCase(value) === toFind;\nconst toLowerCase = value => value.toLowerCase();\nconst getKeys = headers => Object.keys(headers);\n\nexport const getHeaderCaseInsensitive = (headerName, headers = {}) => {\n const key = getKeys(headers).find(byLowerCase(headerName));\n return key ? headers[key] : undefined;\n};\n\nexport const responseHandler = ( dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key = null, useEtag= false ) =>\n\n (err, res) => {\n\n if (err || !res.ok) {\n let code = err.status;\n\n if(code === 304 && etagCache.hasOwnProperty(key) && useEtag){\n const { body } = etagCache[key];\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: body}));\n return resolve({response: body});\n }\n\n dispatch(receiveActionCreator);\n return resolve({response: body});\n }\n if(errorHandler) {\n errorHandler(err, res)(dispatch, state);\n }\n return reject({ err, res, dispatch, state })\n }\n\n let json = res.body;\n\n if(useEtag) {\n const responseETAG = getHeaderCaseInsensitive('etag', res.headers);\n if (responseETAG) {\n etagCache[key] = { etag: responseETAG, body: json};\n }\n }\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: json}));\n return resolve({response: json});\n }\n dispatch(receiveActionCreator);\n return resolve({response: json});\n}\n\n\nexport const fetchErrorHandler = (response) => {\n let code = response.status;\n let msg = response.statusText;\n\n switch (code) {\n case 403:\n Swal.fire(\"ERROR\", T.translate(\"errors.user_not_authz\"), \"warning\");\n break;\n case 401:\n Swal.fire(\"ERROR\", T.translate(\"errors.session_expired\"), \"error\");\n break;\n case 412:\n Swal.fire(\"ERROR\", msg, \"warning\");\n case 500:\n Swal.fire(\"ERROR\", T.translate(\"errors.server_error\"), \"error\");\n }\n}\n\nexport const fetchResponseHandler = (response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.json();\n }\n}\n\nexport const showMessage = (settings, callback = null) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire(settings).then((result) => {\n if (result.value && typeof callback === 'function') {\n callback();\n }\n });\n}\n\nexport const showSuccessMessage = (html) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire({\n title: T.translate(\"general.done\"),\n html: html,\n type: 'success'\n });\n}\n\nexport const downloadFileByContent = (filename, content, mime) => {\n let link = document.createElement('a');\n link.textContent = 'download';\n link.download = filename;\n link.href = `data:${mime},${encodeURIComponent(content)}`\n document.body.appendChild(link); // Required for FF\n link.click();\n document.body.removeChild(link);\n}\n\nexport const getCSV = (endpoint, params, filename, header = null) => (dispatch) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n dispatch(startLoading());\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n dispatch(stopLoading());\n\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n downloadFileByContent(filename, csv, 'text/csv;charset=utf-8');\n })\n .catch(fetchErrorHandler);\n};\n\nexport const getRawCSV = (endpoint, params, header = null) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n\n return csv;\n })\n .catch(fetchErrorHandler);\n};\n\nexport const escapeFilterValue = (value) => {\n value = String(value);\n // escape backslash first so you don't accidentally break your own escapes\n value = value.replace(/\\\\/g, \"\\\\\\\\\");\n value = value.replace(/,/g, \"\\\\,\");\n value = value.replace(/;/g, \"\\\\;\");\n // especial case for literal +\n value = value.replace(/\\+/g, \"%2B\");\n return value;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"spark-md5\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/sha256\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-base64url\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-hex\");","import SparkMD5 from \"spark-md5\";\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nconst MAX_BYTES = 65536\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nconst MAX_UINT32 = 4294967295\nconst crypto = typeof window !== 'undefined' ? (window.crypto || window.msCrypto) : null;\nimport sha256 from 'crypto-js/sha256';\nimport Base64url from 'crypto-js/enc-base64url'\nimport Hex from 'crypto-js/enc-hex'\nexport const getRandomBytes = (size) => {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n const bytes = Buffer.allocUnsafe(size)\n if(!crypto) return a;\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (let generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n return bytes\n}\n\nexport const getSHA256 = (message, format = 'hex') => {\n\n let f = Hex;\n if(format === 'Base64url')\n f = Base64url;\n\n return sha256(message).toString(f);\n}\n\nexport const getMD5 = (file) => {\n return new Promise((resolve, reject) => {\n const chunkSize = 2 * 1024 * 1024; // 2 MB by chunk\n const spark = new SparkMD5.ArrayBuffer();\n const fileReader = new FileReader();\n let cursor = 0;\n\n fileReader.onload = e => {\n spark.append(e.target.result); \n cursor += chunkSize;\n\n if (cursor < file.size) {\n readNextChunk();\n } else {\n resolve(spark.end()); // final MD5\n }\n };\n\n fileReader.onerror = () => reject(\"Error reading the file\");\n\n function readNextChunk() {\n const slice = file.slice(cursor, cursor + chunkSize);\n fileReader.readAsArrayBuffer(slice);\n }\n\n readNextChunk();\n });\n}","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"lodash/debounce\");","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport { fetchErrorHandler, fetchResponseHandler, escapeFilterValue } from \"./actions\";\nimport { getAccessToken } from '../components/security/methods';\nimport { buildAPIBaseUrl } from \"./methods\";\nimport debounce from 'lodash/debounce';\nexport const RECEIVE_COUNTRIES = 'RECEIVE_COUNTRIES';\nconst callDelay = 500; // milliseconds\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\nexport const DEFAULT_PAGE_SIZE = 10;\n\nconst _fetchPublic = async (endpoint, callback, options = {}) => {\n return fetch(buildAPIBaseUrl(endpoint.toString()), options)\n .then(fetchResponseHandler)\n .then((json) => {\n if(typeof callback === 'function')\n callback(json.data);\n })\n .catch(response => {\n const code = response && response.status;\n if (code === 404 && typeof callback === 'function') callback([]);\n return response;\n })\n .catch(fetchErrorHandler);\n}\n\n/**\n * @param endpoint\n * @param callback\n * @param options\n * @returns {Promise}\n * @private\n */\nconst _fetch = async (endpoint, callback, options = {}) => {\n\n let accessToken;\n\n try {\n accessToken = await getAccessToken();\n } catch (e) {\n // The caller is told through its callback; the query* functions do not\n // await this promise, so rejecting here would only surface as an\n // unhandled rejection.\n if(typeof callback === 'function')\n callback(e);\n return;\n }\n\n endpoint.addQuery('access_token', accessToken);\n\n return _fetchPublic(endpoint, callback, options);\n}\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryMembers = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/members`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryAttendees = debounce(async (summitId, input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n \n let endpoint = URI(`/api/v1/summits/${summitId}/attendees`);\n \n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n \n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name=@${input},email=@${input}`);\n }\n \n _fetch(endpoint, callback);\n \n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySummits = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/all`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySpeakers = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE ) => {\n\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/speakers`:`speakers`}`);\n\n endpoint.addQuery('expand', `member,registration_request`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTags = debounce(async (summitId, input, callback, per_page = 50) => {\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/track-tag-groups/all/allowed-tags`:`tags`}`);\n\n if(summitId)\n endpoint.addQuery('expand', `tag,track_tag_group`);\n\n endpoint.addQuery('order','tag');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `tag@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTracks = debounce(async (summitId, input, callback, excludedIds = [], per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/tracks`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if (excludedIds?.length > 0) {\n endpoint.addQuery('filter[]', `not_id==${excludedIds.join(\"||\")}`);\n }\n\n if (input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTrackGroups = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/track-groups`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=, *): Promise)|*>}\n */\nexport const queryEvents = debounce(async (summitId, input, onlyPublished = false, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/events` + (onlyPublished ? '/published' : ''));\n\n endpoint.addQuery('order','title');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=, *=): Promise)|*>}\n */\nexport const queryEventTypes = debounce(async (summitId, input, callback, eventTypeClassName = null, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/event-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n if (eventTypeClassName) {\n eventTypeClassName = escapeFilterValue(eventTypeClassName);\n endpoint.addQuery('filter[]', `class_name==${eventTypeClassName}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryGroups = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/groups`);\n\n endpoint.addQuery('order','title,code');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input},code@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryCompanies = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/companies`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryRegistrationCompanies = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/registration-companies`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsors = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type')\n endpoint.addQuery('order','id')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsorsWithBadgeScans = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type');\n endpoint.addQuery('fields','id,company.name,sponsorship.type.name');\n endpoint.addQuery('relations','none,company.none,sponsorship.type.none');\n endpoint.addQuery('filter[]','badge_scans_count>0');\n endpoint.addQuery('order','+company_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryAccessLevels = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/access-level-types`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryOrganizations = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/organizations`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\nexport const getLanguageList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/languages`), callback, { signal });\n};\n\nexport const getCountryList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/countries`), callback, { signal });\n};\n\nlet geocoder;\n\nexport const geoCodeAddress = (address) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\nexport const geoCodeLatLng = (lat, lng) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n let latlng = {lat: parseFloat(lat), lng: parseFloat(lng)};\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'location': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\n/**\n * @type {DebouncedFunc<(function(*, *=, *, *=, *=): Promise)|*>}\n */\nexport const queryTicketTypes = debounce(async (summitId, filters = {}, callback, version = 'v1', per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/${version}/summits/${summitId}/ticket-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(filters.hasOwnProperty('name')) {\n const name = escapeFilterValue(filters.name);\n if(name && name != '')\n endpoint.addQuery('filter[]', `name@@${name}`);\n }\n\n if(filters.hasOwnProperty('audience')){\n const audience = escapeFilterValue(filters.audience);\n if(audience && audience != '')\n endpoint.addQuery('filter[]', `audience==${audience}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySponsoredProjects = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n\n const endpoint = URI(`/api/v1/sponsored-projects`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryPromocodes = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE, extraFilters = []) => {\n\n\n let endpoint = URI(`/api/v1/summits/${summitId}/promo-codes`);\n\n endpoint.addQuery('order','code')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `code@@${input}`);\n }\n\n //eg: filter = 'class_name==SummitRegistrationPromoCode'\n for (const filter of extraFilters) {\n endpoint.addQuery('filter[]', filter);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"idtoken-verifier\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"react-select/lib/Async\");","module.exports = require(\"react-select/lib/AsyncCreatable\");","module.exports = require(\"superagent/lib/client\");","module.exports = require(\"sweetalert2\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport AsyncSelect from 'react-select/lib/Async';\nimport {queryCompanies} from '../../utils/query-actions';\nimport AsyncCreatableSelect from \"react-select/lib/AsyncCreatable\";\n\nexport default class CompanyInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n this.handleNew = this.handleNew.bind(this);\n this.getCompanies = this.getCompanies.bind(this);\n }\n\n handleChange(value) {\n const isMulti = (this.props.hasOwnProperty('multi') || this.props.hasOwnProperty('isMulti'));\n const theValue = isMulti ? value.map(v => ({id: v.value, name: v.label})) : {id: value.value, name: value.label};\n\n let ev = {target: {\n id: this.props.id,\n value: theValue,\n type: 'companyinput'\n }};\n\n this.props.onChange(ev);\n }\n\n handleNew(value) {\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n\n const translateValue = (newValue) => {\n this.handleChange({value: newValue.id, label: newValue.name});\n }\n\n this.props.onCreate(value, translateValue);\n }\n\n getCompanies (input, callback) {\n const {extraOptions} = this.props;\n\n if (!input) {\n return Promise.resolve({ options: [] });\n }\n\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n\n const translateOptions = (options) => {\n let newOptions = options.map(c => ({value: c.id.toString(), label: c.name}));\n\n if (extraOptions?.length > 0) {\n newOptions = [...extraOptions, ...newOptions];\n }\n\n callback(newOptions);\n };\n\n const queryFn = this.props.queryFunction || queryCompanies;\n\n queryFn(input, translateOptions);\n } \n\n render() {\n let {error, value, onChange, id, multi, ...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let isMulti = (this.props.hasOwnProperty('multi') || this.props.hasOwnProperty('isMulti'));\n let allowCreate = this.props.hasOwnProperty('allowCreate');\n\n // we need to map into value/label because of a bug in react-select 2\n // https://github.com/JedWatson/react-select/issues/2998\n\n let theValue = null;\n\n if (isMulti && value.length > 0) {\n theValue = value.map(v => ({value: v.id.toString(), label: v.name} ));\n } else if (!isMulti && value) {\n theValue = {value: value.id.toString(), label: value.name};\n }\n\n\n const AsyncComponent = allowCreate\n ? AsyncCreatableSelect\n : AsyncSelect;\n\n return (\n \n
\n {has_error &&\n
{error}
\n }\n
\n );\n\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","AUTH_ERROR_MISSING_AUTH_INFO","AUTH_ERROR_MISSING_REFRESH_TOKEN","AUTH_ERROR_ACCESS_TOKEN_EXPIRED","AUTH_ERROR_LOCK_ACQUIRE_ERROR","AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR","AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR","require","Lock","SuperTokensLock","GET_TOKEN_SILENTLY_LOCK_KEY","RESPONSE_TYPE_CODE","AUTH_INFO","ID_TOKEN","processRefreshToken","async","flow","refreshToken","useOAuth2RefreshToken","clearAuthInfo","Error","response","fn","maxRetries","baseDelayMs","attempt","err","message","startsWith","delay","Math","pow","console","log","Promise","resolve","setTimeout","retryWithBackoff","refreshAccessToken","access_token","expires_in","refresh_token","id_token","storeAuthInfo","_getAccessToken","authInfo","getAuthInfo","accessToken","expiresIn","accessTokenUpdatedAt","getOAuth2Flow","now","moment","unix","timeElapsedSecs","ACCESS_TOKEN_RESOLVER_KEY","Symbol","for","getAccessToken","resolveAccessToken","globalThis","navigator","locks","request","lock","retryPromise","acquireLock","releaseLock","baseUrl","getOAuth2IDPBaseUrl","oauth2ClientId","getOAuth2ClientId","payload","encodeURI","controller","AbortController","timeoutId","abort","json","fetch","method","headers","body","JSON","stringify","signal","networkError","clearTimeout","ok","status","statusText","setSessionClearingState","parseError","new_refresh_token","idToken","formerAuthInfo","floor","Date","Cookies","secure","sameSite","putOnLocalStorage","res","getFromLocalStorage","parse","window","removeFromLocalStorage","OAUTH2_CLIENT_ID","OAUTH2_FLOW","Boolean","OAUTH2_USE_REFRESH_TOKEN","IDP_BASE_URL","URI","createAction","type","fetchErrorHandler","code","msg","Swal","T","fetchResponseHandler","escapeFilterValue","value","String","replace","crypto","msCrypto","buildAPIBaseUrl","relativeUrl","API_BASE_URL","key","localStorage","setItem","removeIt","val","getItem","removeItem","clearing_session_state","cb","maxNumberOfRetries","i","callDelay","_fetchPublic","endpoint","callback","options","toString","then","data","catch","_fetch","e","addQuery","queryCompanies","debounce","input","per_page","DEFAULT_PAGE_SIZE","summitId","excludedIds","length","join","onlyPublished","eventTypeClassName","filters","version","hasOwnProperty","name","audience","extraFilters","filter","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","toStringTag","CompanyInput","React","constructor","props","super","handleChange","bind","handleNew","getCompanies","theValue","map","v","id","label","ev","target","onChange","onCreate","newValue","extraOptions","queryFunction","newOptions","c","render","_this$props","error","multi","rest","_objectWithoutProperties","_excluded","has_error","isMulti","allowCreate","AsyncComponent","AsyncCreatableSelect","AsyncSelect","_extends","loadOptions","onCreateOption","className"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/country-dropdown.js b/lib/components/inputs/country-dropdown.js
new file mode 100644
index 00000000..d41c459e
--- /dev/null
+++ b/lib/components/inputs/country-dropdown.js
@@ -0,0 +1,2 @@
+!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={6604:(e,r,t)=>{t.d(r,{default:()=>f});var a=t(6031),o=t.n(a),n=t(1116),s=t.n(n),i=t(2462),d=t.n(i),l=t(2015),u=t.n(l),p=t(8466),c=t.n(p);const y=["onChange","value","className","error","clearable","disabled","overrideCSS","ariaLabelledBy"];function _(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,a)}return t}function R(e){for(var r=1;re.value)):null:e?e.value:null;let t={target:{id:this.props.id,value:r,type:"dropdown"}};this.props.onChange(t)}render(){let e=this.props,{onChange:r,value:t,className:a,error:n,clearable:s,disabled:i,overrideCSS:l,ariaLabelledBy:p}=e,_=d()(e,y),f=this.props.hasOwnProperty("error")&&""!=n,m=this.props.hasOwnProperty("clearable"),g=this.props.hasOwnProperty("disabled")&&1==i,h=null,E=a;this.props.hasOwnProperty("overrideCSS")&&0!=l||(E="dropdown "+a+" "+(f?"error":"")),h=this.props.isMulti?this.props.options.filter((e=>t.includes(e.value))):t instanceof Object||null==t?t:this.props.options.find((e=>e.value==t));const O={menu:e=>R(R({},e),{},{zIndex:999})};return u().createElement("div",null,u().createElement(c(),o()({className:E,value:h,onChange:this.handleChange,isClearable:m,isDisabled:g,styles:O,"aria-labelledby":p,formatOptionLabel:e=>u().createElement("span",{dangerouslySetInnerHTML:{__html:e.label}})},_)),f&&u().createElement("p",{className:"error-label"},n))}}f.defaultProps={ariaLabelledBy:null}},5097:(e,r,t)=>{t(1116),t(6842),t(9087),t(9558),t(2183)},3195:(e,r,t)=>{t.d(r,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>n,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>a,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>o,AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR:()=>d,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>i});const a="AUTH_ERROR_MISSING_AUTH_INFO",o="AUTH_ERROR_MISSING_REFRESH_TOKEN",n="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",i="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR",d="AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR"},2183:(e,r,t)=>{t.d(r,{getAccessToken:()=>m});var a=t(9558),o=t(5812),n=t.n(o);t(806);const s=require("browser-tabs-lock");var i=t.n(s);const d=require("js-cookie");var l=t.n(d),u=(t(8041),t(9891),t(5097),t(8853),t(3195));const Lock=new(i()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",p="code",c="authInfo",y="idToken",_=async(e,r)=>{if(e===p&&T()){if(!r)throw O(),Error(u.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await(async(e,r=5,t=1e3)=>{for(let a=0;asetTimeout(e,o)))}})((()=>g(r))),{access_token:t,expires_in:a,refresh_token:o,id_token:n}=e;return void 0===o&&(o=null),h(t,a,o,n),t}throw O(),Error(u.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)},R=async()=>{console.log("openstack-uicore-foundation::Security::methods::_getAccessToken");let e=E();if(!e)throw console.log("openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO"),Error(u.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:r,expiresIn:t,accessTokenUpdatedAt:a,refreshToken:o}=e,s=Q();const i=n()().unix();let d=i-a;return t-=60,console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${i} accessTokenUpdatedAt ${a} expiresIn ${t} timeElapsedSecs ${d}`),(d>=t||null==r)&&(console.log("openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ..."),r=await _(s,o)),r},f=Symbol.for("openstack-uicore-foundation.accessTokenResolver"),m=async()=>{const e=globalThis[f];if(e)return e();if("undefined"!=typeof navigator&&navigator.locks)return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY,(async e=>(console.log("openstack-uicore-foundation::Security::methods::getAccessToken web lock api",e),await R())));if(!await(0,a.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))throw Error(u.AUTH_ERROR_LOCK_ACQUIRE_ERROR);try{return await R()}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}},g=async e=>{let r=S(),t=w();const o={grant_type:"refresh_token",client_id:encodeURI(t),refresh_token:e},n=new AbortController,s=setTimeout((()=>n.abort()),1e4);let i,d;try{i=await fetch(`${r}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o),signal:n.signal})}catch(e){throw console.log("refreshAccessToken network error:",e.message),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${e.message}`)}finally{clearTimeout(s)}if(!i.ok){if(console.log(`refreshAccessToken server error: ${i.status} - ${i.statusText}`),i.status>=500||408===i.status||429===i.status)throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${i.status} - ${i.statusText}`);throw(0,a.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${i.status} - ${i.statusText}`)}try{d=await i.json()}catch(e){throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`)}let{access_token:l,refresh_token:p,expires_in:c,id_token:y}=d;if(!l)throw(0,a.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);return{access_token:l,refresh_token:p,expires_in:c,id_token:y}},h=(e,r,t=null,o=null)=>{let n=E(),s={accessToken:e,expiresIn:r,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null==t&&n&&(t=n.refreshToken),null==o&&n&&(o=n.idToken),t&&(s.refreshToken=t),o?(s[y]=o,l().set(y,o,{secure:!0,sameSite:"Lax"})):l().remove(y),(0,a.putOnLocalStorage)(c,JSON.stringify(s))},E=()=>{try{let e=(0,a.getFromLocalStorage)(c,!1);return e?JSON.parse(e):null}catch(e){return null}},O=()=>{"undefined"!=typeof window&&((0,a.removeFromLocalStorage)(c),l().remove(y))},w=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,Q=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",T=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),S=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},9087:(e,r,t)=>{t.d(r,{escapeFilterValue:()=>c,fetchErrorHandler:()=>u,fetchResponseHandler:()=>p});t(2462),t(806);var a=t(8041),o=t.n(a),n=t(9236),s=t.n(n),i=t(6842),d=t.n(i);t(9558),t(5097),t(2183);o().escapeQuerySpace=!1;const l=e=>r=>({type:e,payload:r}),u=(l("RESET_LOADING"),l("START_LOADING"),l("STOP_LOADING"),e=>{let r=e.status,t=e.statusText;switch(r){case 403:s().fire("ERROR",d().translate("errors.user_not_authz"),"warning");break;case 401:s().fire("ERROR",d().translate("errors.session_expired"),"error");break;case 412:s().fire("ERROR",t,"warning");case 500:s().fire("ERROR",d().translate("errors.server_error"),"error")}}),p=e=>{if(e.ok)return e.json();throw e},c=e=>e=(e=(e=(e=(e=String(e)).replace(/\\/g,"\\\\")).replace(/,/g,"\\,")).replace(/;/g,"\\;")).replace(/\+/g,"%2B")},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,r,t)=>{t.d(r,{buildAPIBaseUrl:()=>a,getFromLocalStorage:()=>n,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>s,retryPromise:()=>d,setSessionClearingState:()=>i});t(5812),t(8041);const a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,r)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,r)},n=(e,r)=>{if("undefined"!=typeof window){let t=window.localStorage.getItem(e);return r&&(console.log(`getFromLocalStorage removing key ${e}`),s(e)),t}return null},s=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},d=async(e,r=3)=>{for(let t=0;t{t.d(r,{getCountryList:()=>y});var a=t(9087),o=t(2183),n=t(9558);const s=require("lodash/debounce");var i=t.n(s),d=t(8041),l=t.n(d);const u=500;l().escapeQuerySpace=!1;const p=async(e,r,t={})=>fetch((0,n.buildAPIBaseUrl)(e.toString()),t).then(a.fetchResponseHandler).then((e=>{"function"==typeof r&&r(e.data)})).catch((e=>(404===(e&&e.status)&&"function"==typeof r&&r([]),e))).catch(a.fetchErrorHandler),c=async(e,r,t={})=>{let a;try{a=await(0,o.getAccessToken)()}catch(e){return void("function"==typeof r&&r(e))}return e.addQuery("access_token",a),p(e,r,t)},y=(i()((async(e,r,t=10)=>{let o=l()("/api/v1/members");o.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`full_name@@${e},first_name@@${e},last_name@@${e},email@@${e}`)),c(o,r)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/attendees`);n.addQuery("order","first_name,last_name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`full_name=@${r},email=@${r}`)),c(n,t)}),u),i()((async(e,r,t=10)=>{let o=l()("/api/v1/summits/all");o.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),c(o,r)}),u),i()((async(e,r,t,o=10)=>{let n=l()("/api/v1/"+(e?`summits/${e}/speakers`:"speakers"));n.addQuery("expand","member,registration_request"),n.addQuery("order","first_name,last_name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`full_name@@${r},first_name@@${r},last_name@@${r},email@@${r}`)),c(n,t)}),u),i()((async(e,r,t,o=50)=>{let n=l()("/api/v1/"+(e?`summits/${e}/track-tag-groups/all/allowed-tags`:"tags"));e&&n.addQuery("expand","tag,track_tag_group"),n.addQuery("order","tag"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`tag@@${r}`)),c(n,t)}),u),i()((async(e,r,t,o=[],n=10)=>{let s=l()(`/api/v1/summits/${e}/tracks`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",n),(null==o?void 0:o.length)>0&&s.addQuery("filter[]",`not_id==${o.join("||")}`),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),c(s,t)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/track-groups`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),c(n,t)}),u),i()((async(e,r,t=!1,o,n=10)=>{let s=l()(`/api/v1/summits/${e}/events`+(t?"/published":""));s.addQuery("order","title"),s.addQuery("page",1),s.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`title@@${r}`)),c(s,o)}),u),i()((async(e,r,t,o=null,n=10)=>{let s=l()(`/api/v1/summits/${e}/event-types`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),o&&(o=(0,a.escapeFilterValue)(o),s.addQuery("filter[]",`class_name==${o}`)),c(s,t)}),u),i()((async(e,r,t=10)=>{let o=l()("/api/v1/groups");o.addQuery("order","title,code"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`title@@${e},code@@${e}`)),c(o,r)}),u),i()((async(e,r,t=10)=>{let o=l()("/api/v1/companies");o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),c(o,r)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/registration-companies`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),c(n,t)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/sponsors`);n.addQuery("expand","company,sponsorship,sponsorship.type"),n.addQuery("order","id"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`company_name@@${r}`)),c(n,t)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/sponsors`);n.addQuery("expand","company,sponsorship,sponsorship.type"),n.addQuery("fields","id,company.name,sponsorship.type.name"),n.addQuery("relations","none,company.none,sponsorship.type.none"),n.addQuery("filter[]","badge_scans_count>0"),n.addQuery("order","+company_name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`company_name@@${r}`)),c(n,t)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/access-level-types`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),c(n,t)}),u),i()((async(e,r,t=10)=>{let o=l()("/api/v1/organizations");o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),c(o,r)}),u),(e,r)=>p(new(l())("/api/public/v1/countries"),e,{signal:r}));i()((async(e,r={},t,o="v1",n=10)=>{let s=l()(`/api/${o}/summits/${e}/ticket-types`);if(s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",n),r.hasOwnProperty("name")){const e=(0,a.escapeFilterValue)(r.name);e&&""!=e&&s.addQuery("filter[]",`name@@${e}`)}if(r.hasOwnProperty("audience")){const e=(0,a.escapeFilterValue)(r.audience);e&&""!=e&&s.addQuery("filter[]",`audience==${e}`)}c(s,t)}),u),i()((async(e,r,t=10)=>{const o=l()("/api/v1/sponsored-projects");o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),c(o,r)}),u),i()((async(e,r,t,o=10,n=[])=>{let s=l()(`/api/v1/summits/${e}/promo-codes`);s.addQuery("order","code"),s.addQuery("page",1),s.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`code@@${r}`));for(const e of n)s.addQuery("filter[]",e);c(s,t)}),u)},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},5812:e=>{e.exports=require("moment-timezone")},2015:e=>{e.exports=require("react")},8466:e=>{e.exports=require("react-select")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},r={};function t(a){var o=r[a];if(void 0!==o)return o.exports;var n=r[a]={exports:{}};return e[a](n,n.exports,t),n.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};t.r(a),t.d(a,{default:()=>u});var o=t(6031),n=t.n(o),s=t(2015),i=t.n(s),d=t(6604),l=t(5301);class u extends i().Component{constructor(e){super(e),this.state={options:[]},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this),this.abortController=new AbortController}componentDidMount(){let{options:e}=this.state;0==e.length&&(0,l.getCountryList)(this.setOptions,this.abortController.signal)}componentWillUnmount(){this.abortController.abort()}handleChange(e){let r={target:{id:this.props.id,value:e,type:"countryddl"}};this.props.onChange(r)}setOptions(e){let r=e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:r})}render(){let{options:e}=this.state;return i().createElement(d.default,n()({options:e},this.props))}}return a})()));
+//# sourceMappingURL=country-dropdown.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/country-dropdown.js.map b/lib/components/inputs/country-dropdown.js.map
new file mode 100644
index 00000000..50e2e496
--- /dev/null
+++ b/lib/components/inputs/country-dropdown.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/country-dropdown.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,20BCOM,MAAMC,UAAiBC,IAAAA,UAElCC,WAAAA,CAAYC,GACRC,MAAMD,GAENJ,KAAKM,aAAeN,KAAKM,aAAaC,KAAKP,KAC/C,CAEAM,YAAAA,CAAaE,GAET,IAAIC,EAAQ,KAERA,EADAT,KAAKI,MAAMM,QACHF,EAAYA,EAAUG,KAAIC,GAAOA,EAAIH,QAAS,KAE9CD,EAAYA,EAAUC,MAAQ,KAG1C,IAAII,EAAK,CAACC,OAAQ,CACVC,GAAIf,KAAKI,MAAMW,GACfN,MAAOA,EACPO,KAAM,aAGdhB,KAAKI,MAAMa,SAASJ,EACxB,CAEAK,MAAAA,GAEI,IAAAC,EAAqGnB,KAAKI,OAAtG,SAACa,EAAQ,MAAER,EAAK,UAAEW,EAAS,MAAEC,EAAK,UAAEC,EAAS,SAAEC,EAAQ,YAAEC,EAAW,eAAEC,G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AAOgM,eAAe3O,EAAS,aAAc,CAAEa,OAAO,GAAO,C,0GCY/C,MAAMuO,UAAwB9O,IAAAA,UAEzCC,WAAAA,CAAYC,GACRC,MAAMD,GAENJ,KAAKiP,MAAQ,CACT9M,QAAS,IAGbnC,KAAKM,aAAeN,KAAKM,aAAaC,KAAKP,MAC3CA,KAAKkP,WAAalP,KAAKkP,WAAW3O,KAAKP,MACvCA,KAAKmP,gBAAkB,IAAIlH,eAC/B,CAEAmH,iBAAAA,GACI,IAAI,QAACjN,GAAWnC,KAAKiP,MAEA,GAAlB9M,EAAQ8K,SACPP,EAAAA,EAAAA,gBAAe1M,KAAKkP,WAAYlP,KAAKmP,gBAAgBxG,OAE7D,CAEA0G,oBAAAA,GACIrP,KAAKmP,gBAAgBhH,OACzB,CAEA7H,YAAAA,CAAaG,GAET,IAAII,EAAK,CAACC,OAAQ,CACVC,GAAIf,KAAKI,MAAMW,GACfN,MAAOA,EACPO,KAAM,eAGdhB,KAAKI,MAAMa,SAASJ,EACxB,CAEAqO,UAAAA,CAAWvK,GACP,IAAI2K,EAAc3K,EAAShE,KAAI4O,IAAK,CAAElM,MAAOkM,EAAEhC,KAAM9M,MAAO8O,EAAEC,aAC9DxP,KAAKyP,SAAS,CAACtN,QAASmN,GAC5B,CAEApO,MAAAA,GAEI,IAAI,QAACiB,GAAWnC,KAAKiP,MAErB,OACI/O,IAAAA,cAACD,EAAAA,QAAQ+C,IAAA,CAACb,QAASA,GAAanC,KAAKI,OAG7C,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/inputs/dropdown.js","webpack://openstack-uicore-foundation/./src/components/security/constants.js","webpack://openstack-uicore-foundation/external commonjs \"browser-tabs-lock\"","webpack://openstack-uicore-foundation/external commonjs \"js-cookie\"","webpack://openstack-uicore-foundation/./src/components/security/methods.js","webpack://openstack-uicore-foundation/./src/utils/actions.js","webpack://openstack-uicore-foundation/external commonjs \"spark-md5\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/sha256\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-base64url\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-hex\"","webpack://openstack-uicore-foundation/./src/utils/crypto.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"lodash/debounce\"","webpack://openstack-uicore-foundation/./src/utils/query-actions.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"idtoken-verifier\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-select\"","webpack://openstack-uicore-foundation/external commonjs \"superagent/lib/client\"","webpack://openstack-uicore-foundation/external commonjs \"sweetalert2\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/inputs/country-dropdown.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport Select from 'react-select';\n\nexport default class Dropdown extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(selection) {\n\n let value = null;\n if (this.props.isMulti) {\n value = selection ? selection.map(val => val.value) : null;\n } else {\n value = selection ? selection.value : null;\n }\n\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'dropdown'\n }};\n\n this.props.onChange(ev);\n }\n\n render() {\n\n let {onChange, value, className, error, clearable, disabled, overrideCSS, ariaLabelledBy, ...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let isClearable = (this.props.hasOwnProperty('clearable'));\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n let theValue = null;\n\n let selectClassName = className;\n\n if (!this.props.hasOwnProperty('overrideCSS') || overrideCSS == false) {\n selectClassName = 'dropdown ' + className + ' ' + (has_error ? 'error' : '');\n }\n\n if (this.props.isMulti) {\n theValue = this.props.options.filter(op => value.includes(op.value));\n } else {\n theValue = (value instanceof Object || value == null) ? value : this.props.options.find(opt => opt.value == value);\n }\n\n const selectStyles = { menu: styles => ({ ...styles, zIndex: 999 }) };\n\n return (\n \n
}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n \n );\n\n }\n}\n\nDropdown.defaultProps = {\n ariaLabelledBy : null,\n}\n","export const AUTH_ERROR_MISSING_AUTH_INFO = 'AUTH_ERROR_MISSING_AUTH_INFO';\nexport const AUTH_ERROR_MISSING_REFRESH_TOKEN = 'AUTH_ERROR_MISSING_REFRESH_TOKEN';\nexport const AUTH_ERROR_ACCESS_TOKEN_EXPIRED = 'AUTH_ERROR_ACCESS_TOKEN_EXPIRED';\nexport const AUTH_ERROR_LOCK_ACQUIRE_ERROR = 'AUTH_ERROR_LOCK_ACQUIRE_ERROR'\nexport const AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR';\nexport const AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR';\nexport const AUTH_ERROR_ID_TOKEN_INVALID = 'AUTH_ERROR_ID_TOKEN_INVALID';\nexport const AUTH_ERROR_MISSING_OTP_PARAM = 'AUTH_ERROR_MISSING_OTP_PARAM';\nexport const AUTH_ERROR_MISSING_PKCE_PARAM = 'AUTH_ERROR_MISSING_PKCE_PARAM';\nexport const AUTH_ERROR_MISSING_NONCE_PARAM = 'AUTH_ERROR_MISSING_NONCE_PARAM';\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"browser-tabs-lock\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"js-cookie\");","import {\n base64URLEncode,\n getAuthCallback,\n getCurrentLocation,\n getFromLocalStorage,\n removeFromLocalStorage,\n getOrigin,\n putOnLocalStorage,\n retryPromise,\n setSessionClearingState,\n} from \"../../utils/methods\";\nimport moment from \"moment-timezone\";\nimport request from 'superagent/lib/client';\nimport SuperTokensLock from 'browser-tabs-lock';\nimport Cookies from 'js-cookie'\nlet http = request;\nimport URI from \"urijs\";\nimport IdTokenVerifier from \"idtoken-verifier\";\nimport {SET_LOGGED_USER} from \"./actions\";\nimport {getRandomBytes, getSHA256} from \"../../utils/crypto\";\n\nimport {\n AUTH_ERROR_ACCESS_TOKEN_EXPIRED,\n AUTH_ERROR_MISSING_AUTH_INFO,\n AUTH_ERROR_MISSING_REFRESH_TOKEN,\n AUTH_ERROR_LOCK_ACQUIRE_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR,\n AUTH_ERROR_ID_TOKEN_INVALID,\n AUTH_ERROR_MISSING_OTP_PARAM,\n AUTH_ERROR_MISSING_PKCE_PARAM,\n AUTH_ERROR_MISSING_NONCE_PARAM,\n} from \"./constants\";\n\n/**\n * @ignore\n */\nconst Lock = new SuperTokensLock();\n/**\n * @ignore\n */\nconst GET_TOKEN_SILENTLY_LOCK_KEY = 'openstackuicore.lock.getTokenSilently';\nconst GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT = 6000;\nconst NONCE_LEN = 16;\nexport const ACCESS_TOKEN_SKEW_TIME = 60;\nexport const RESPONSE_TYPE_IMPLICIT = \"token id_token\";\nexport const RESPONSE_TYPE_CODE = 'code';\nconst AUTH_INFO = 'authInfo';\nconst NONCE = 'nonce';\nconst PKCE = 'pkce';\nconst ID_TOKEN = 'idToken';\nconst BACK_ULR_PARAM_NAME = 'BackUrl';\n\n\n/**\n *\n * @param backUrl\n * @param prompt\n * @param tokenIdHint\n * @param provider\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n * @param backUrlParamName\n * @returns {*}\n */\nexport const getAuthUrl = (\n backUrl = null,\n prompt = null,\n tokenIdHint = null,\n provider = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null,\n backUrlParamName = BACK_ULR_PARAM_NAME\n ) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let baseUrl = getOAuth2IDPBaseUrl();\n let scopes = getOAuth2Scopes();\n let flow = getOAuth2Flow();\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n let nonce = createNonce(NONCE_LEN);\n\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let query = {\n \"response_type\": encodeURI(flow),\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"response_mode\": 'fragment',\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n if (flow === RESPONSE_TYPE_CODE) {\n const pkce = createPKCECodes()\n putOnLocalStorage(PKCE, JSON.stringify(pkce));\n query['code_challenge'] = pkce.codeChallenge;\n query['code_challenge_method'] = 'S256';\n query['approval_prompt'] = 'force';\n }\n\n if (prompt) {\n query['prompt'] = prompt;\n }\n\n if (scopes && scopes.includes('offline_access')) {\n // then we need to force prompt=consent bc we are requesting an offline access\n // and we need to let the user know\n query['prompt'] = 'consent';\n }\n\n if (tokenIdHint) {\n query['id_token_hint'] = tokenIdHint;\n }\n\n if (provider) {\n query['provider'] = provider;\n }\n\n if (otpLoginHint) {\n query['otp_login_hint'] = otpLoginHint;\n }\n\n if (loginHint) {\n query['login_hint'] = encodeURI(loginHint);\n }\n\n if (tenant) {\n query['tenant'] = tenant;\n }\n\n url = url.query(query);\n //console.log(`getAuthUrl ${url.toString()}`);\n return url;\n}\n\n/**\n * @param idToken\n * @returns {*}\n */\nexport const getLogoutUrl = (idToken = null) => {\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let url = URI(`${baseUrl}/oauth2/end-session`);\n let state = createNonce(NONCE_LEN);\n let postLogOutUri = `${getOrigin()}/auth/logout`;\n // store nonce to check it later\n putOnLocalStorage('post_logout_state', state);\n /**\n * post_logout_redirect_uri should be listed on oauth2 client settings\n * on IDP\n * \"Security Settings\" Tab -> Logout Options -> Post Logout Uris\n */\n const queryParams = {\n \"post_logout_redirect_uri\": encodeURI(postLogOutUri),\n \"client_id\": encodeURI(oauth2ClientId),\n \"state\": state,\n }\n\n if (idToken)\n queryParams.id_token_hint = idToken;\n\n return url.query(queryParams);\n}\n\nconst createNonce = (len) => {\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let nonce = '';\n for (let i = 0; i < len; i++) {\n nonce += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return nonce;\n}\n\n/**\n *\n * @param backUrl\n * @param provider\n * @param prompt\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n */\nexport const doLogin = (\n backUrl = null,\n provider = null,\n prompt = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null\n) => {\n let url = getAuthUrl(backUrl, prompt, null, provider, loginHint, otpLoginHint, tenant);\n let location = getCurrentLocation()\n location.replace(url.toString());\n}\n\n/**\n *\n * @param backUrl\n * @param loginHint\n * @param otpLoginHint\n */\nexport const doLoginBasicLogin = (backUrl = null, loginHint = null, otpLoginHint = null) => {\n doLogin(backUrl, null, null, loginHint, otpLoginHint);\n}\n\nconst createPKCECodes = () => {\n const codeVerifier = base64URLEncode(getRandomBytes(64))\n const codeChallenge = getSHA256(codeVerifier, 'Base64url')\n const createdAt = new Date()\n const codePair = {\n codeVerifier,\n codeChallenge,\n createdAt\n }\n return codePair\n}\n\n/**\n\n * @param code\n * @param backUrl\n * @param backUrlParamName\n * @returns {Promise<{access_token: *, refresh_token: *, id_token: *, expires_in: *, error: *, error_description: *}>}\n */\nexport const emitAccessToken = async (code, backUrl = null, backUrlParamName = BACK_ULR_PARAM_NAME) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let pkce = JSON.parse(getFromLocalStorage(PKCE, true));\n\n if (!pkce)\n throw Error(AUTH_ERROR_MISSING_PKCE_PARAM);\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n const payload = {\n 'code': code,\n 'grant_type': 'authorization_code',\n 'code_verifier': pkce.codeVerifier,\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n try {\n //const response = await http.post(`${baseUrl}/oauth2/token`, payload);\n //const {body: {access_token, refresh_token, id_token, expires_in}} = response;\n const response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }).catch(function (error) {\n console.log('Request failed:', error.message);\n });\n const json = await response.json();\n let {access_token, refresh_token, id_token, expires_in, error, error_description} = json;\n return {access_token, refresh_token, id_token, expires_in, error, error_description}\n } catch (err) {\n console.log(err);\n }\n};\n\nexport const MAX_RETRIES = 5;\nexport const BACKOFF_BASE_MS = 1000;\nexport const REFRESH_TOKEN_FETCH_TIMEOUT_MS = 10000;\n\nexport const retryWithBackoff = async (fn, maxRetries = MAX_RETRIES, baseDelayMs = BACKOFF_BASE_MS) => {\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n return await fn();\n } catch (err) {\n // only retry transient network/server errors — everything else fails fast\n const isRetryable = err.message && err.message.startsWith(AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR);\n if (!isRetryable || attempt === maxRetries - 1) {\n throw err;\n }\n const delay = baseDelayMs * Math.pow(2, attempt);\n console.log(`retryWithBackoff retry ${attempt + 1}/${maxRetries} in ${delay}ms`);\n await new Promise(resolve => setTimeout(resolve, delay));\n }\n }\n};\n\nconst processRefreshToken = async (flow, refreshToken) => {\n\n if (flow === RESPONSE_TYPE_CODE && useOAuth2RefreshToken()) {\n if (!refreshToken) {\n clearAuthInfo();\n throw Error(AUTH_ERROR_MISSING_REFRESH_TOKEN);\n }\n\n let response = await retryWithBackoff(() => refreshAccessToken(refreshToken));\n let {access_token, expires_in, refresh_token, id_token} = response;\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n return access_token;\n }\n clearAuthInfo();\n throw Error(AUTH_ERROR_ACCESS_TOKEN_EXPIRED);\n}\n\n/**\n * @returns {Promise<*>}\n * @private\n */\nconst _getAccessToken = async () => {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken`);\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n let flow = getOAuth2Flow();\n // check lifetime\n const now = moment().unix();\n let timeElapsedSecs = (now - accessTokenUpdatedAt);\n\n expiresIn = (expiresIn - ACCESS_TOKEN_SKEW_TIME);\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${now} accessTokenUpdatedAt ${accessTokenUpdatedAt} expiresIn ${expiresIn} timeElapsedSecs ${timeElapsedSecs}`)\n if (timeElapsedSecs >= expiresIn || accessToken == null) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ...`);\n accessToken = await processRefreshToken(flow, refreshToken);\n }\n return accessToken;\n}\n\n/**\n * Optional resolver for getAccessToken, set via setAccessTokenResolver. When\n * present, getAccessToken delegates to it; otherwise the built-in flow runs.\n * Pass a non-function (or nothing) to reset to the built-in.\n *\n * The slot lives on globalThis under a Symbol.for key so every copy of this\n * module shares it: bundles that inlined methods.js, nested installs of the\n * package, and symlinked dev installs all read the same registry entry.\n */\nconst ACCESS_TOKEN_RESOLVER_KEY = Symbol.for('openstack-uicore-foundation.accessTokenResolver');\n\nexport const setAccessTokenResolver = (resolver) => {\n globalThis[ACCESS_TOKEN_RESOLVER_KEY] = typeof resolver === 'function' ? resolver : null;\n};\n\n/**\n * @returns {Promise<*|undefined>}\n */\nexport const getAccessToken = async () => {\n const resolveAccessToken = globalThis[ACCESS_TOKEN_RESOLVER_KEY];\n if (resolveAccessToken) return resolveAccessToken();\n\n if (typeof navigator !== 'undefined' && navigator.locks) {\n return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::getAccessToken web lock api`, lock);\n return await _getAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n return await _getAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n/**\n * @private\n */\nconst _clearAccessToken = () => {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken`);\n\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n\n storeAuthInfo(null, 0, refreshToken)\n}\n\nexport const clearAccessToken = async () => {\n // see https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n if (typeof navigator !== 'undefined' && navigator.locks) {\n await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::clearAccessToken web lock api`, lock);\n _clearAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n _clearAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n\nexport const refreshAccessToken = async (refresh_token) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n\n const payload = {\n 'grant_type': 'refresh_token',\n \"client_id\": encodeURI(oauth2ClientId),\n \"refresh_token\": refresh_token\n };\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), REFRESH_TOKEN_FETCH_TIMEOUT_MS);\n\n let response;\n try {\n response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload),\n signal: controller.signal\n });\n } catch (networkError) {\n // fetch rejects on network failures (DNS, timeout, no connectivity, abort)\n console.log('refreshAccessToken network error:', networkError.message);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${networkError.message}`);\n } finally {\n clearTimeout(timeoutId);\n }\n\n if (!response.ok) {\n console.log(`refreshAccessToken server error: ${response.status} - ${response.statusText}`);\n if (response.status >= 500 || response.status === 408 || response.status === 429) {\n // transient error (server error, request timeout, rate limit) — should be retried\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${response.status} - ${response.statusText}`);\n }\n // token is genuinely revoked — this is a real auth error\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${response.status} - ${response.statusText}`);\n }\n\n let json;\n try {\n json = await response.json();\n } catch (parseError) {\n // IDP returned non-JSON (HTML error page, empty body, etc.) — treat as transient\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`);\n }\n let {access_token, refresh_token: new_refresh_token, expires_in, id_token} = json;\n // Defensively ensure we never propagate an undefined access token.\n if (!access_token) {\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);\n }\n return {access_token, refresh_token: new_refresh_token, expires_in, id_token}\n}\n\nexport const storeAuthInfo = (accessToken, expiresIn, refreshToken = null, idToken = null) => {\n\n let formerAuthInfo = getAuthInfo();\n\n let authInfo = {\n accessToken: accessToken,\n expiresIn: expiresIn,\n accessTokenUpdatedAt: Math.floor(Date.now() / 1000),\n };\n\n if (refreshToken == null && formerAuthInfo) {\n refreshToken = formerAuthInfo.refreshToken;\n }\n\n if (idToken == null && formerAuthInfo) {\n idToken = formerAuthInfo.idToken;\n }\n\n if (refreshToken) {\n authInfo['refreshToken'] = refreshToken;\n }\n\n if (idToken) {\n authInfo[ID_TOKEN] = idToken;\n Cookies.set(ID_TOKEN, idToken, {secure: true, sameSite: 'Lax'});\n } else {\n Cookies.remove(ID_TOKEN);\n }\n\n putOnLocalStorage(AUTH_INFO, JSON.stringify(authInfo));\n}\n\nexport const getAuthInfo = () => {\n try {\n let res = getFromLocalStorage(AUTH_INFO, false)\n if (!res) return null;\n return JSON.parse(res);\n } catch (err) {\n return null;\n }\n}\n\nexport const clearAuthInfo = () => {\n if (typeof window !== 'undefined') {\n removeFromLocalStorage(AUTH_INFO);\n Cookies.remove(ID_TOKEN);\n }\n};\n\nexport const getIdToken = () => {\n if (typeof window !== 'undefined') {\n const authInfo = getAuthInfo();\n if (authInfo) {\n return authInfo.idToken;\n }\n return null;\n }\n return null;\n};\n\nexport const getOAuth2ClientId = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_CLIENT_ID;\n }\n return null;\n};\n\nexport const getOAuth2Flow = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_FLOW || \"token id_token\";\n }\n return \"token id_token\";\n}\n\nexport const useOAuth2RefreshToken = () => {\n if (typeof window !== 'undefined') {\n return new Boolean(window.OAUTH2_USE_REFRESH_TOKEN || true);\n }\n return true;\n}\n\nexport const getOAuth2IDPBaseUrl = () => {\n if (typeof window !== 'undefined') {\n return window.IDP_BASE_URL;\n }\n return null;\n};\n\nexport const getOAuth2Scopes = () => {\n if (typeof window !== 'undefined') {\n return window.SCOPES;\n }\n return null;\n};\n\nexport const initLogOut = () => {\n let location = getCurrentLocation();\n location.replace(getLogoutUrl(getIdToken()).toString());\n}\n\nexport const validateIdToken = (idToken, issuer, audience) => {\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n let storedNonce = getFromLocalStorage(NONCE, true);\n if (!storedNonce)\n throw Error(AUTH_ERROR_MISSING_NONCE_PARAM);\n\n let jwt = verifier.decode(idToken);\n let alg = jwt.header.alg;\n let kid = jwt.header.kid;\n let aud = jwt.payload.aud;\n let iss = jwt.payload.iss;\n let exp = jwt.payload.exp;\n let nbf = jwt.payload.nbf;\n let tnonce = jwt.payload.nonce || null;\n\n return tnonce == storedNonce && aud == audience && iss == issuer;\n}\n\nexport const passwordlessStart = (params) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let nonce = createNonce(NONCE_LEN);\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let payload = {\n \"response_type\": \"otp\",\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"client_id\": encodeURI(oauth2ClientId),\n \"connection\": params.connection || \"email\",\n \"send\": params.send || \"code\",\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n if (params.hasOwnProperty('redirect_uri')) {\n payload[\"redirect_uri\"] = encodeURIComponent(params.redirect_uri);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n let json = res.body;\n return Promise.resolve({response: json});\n }).catch((err) => {\n return Promise.reject(err);\n });\n\n}\n\nexport const passwordlessLogin = (params) => (dispatch) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/token`);\n\n if (!params.hasOwnProperty(\"otp\")) {\n throw Error(AUTH_ERROR_MISSING_OTP_PARAM);\n }\n\n let payload = {\n \"grant_type\": \"passwordless\",\n \"connection\": params.connection || \"email\",\n \"scope\": encodeURI(scopes),\n \"client_id\": encodeURI(oauth2ClientId),\n \"otp\": params.otp\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n try {\n // now we got token\n let json = res.body;\n let {access_token, expires_in, refresh_token, id_token} = json;\n\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n\n if (typeof id_token === 'undefined') {\n id_token = null; // not using rotate policy\n }\n\n // verify id token\n\n if (id_token) {\n if (!validateIdToken(id_token, baseUrl, oauth2ClientId)) {\n throw Error(AUTH_ERROR_ID_TOKEN_INVALID);\n }\n }\n\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n\n if (dispatch) {\n dispatch({\n type: SET_LOGGED_USER,\n payload: {sessionState: null}\n });\n }\n\n return Promise.resolve({response: json});\n } catch (e) {\n console.log(e);\n return Promise.reject(e);\n }\n }).catch((err) => {\n return Promise.reject(err);\n });\n}\n\nexport const isIdTokenAlive = (nowEpoch = null) => () => {\n\n if (!nowEpoch) {\n nowEpoch = Math.floor(Date.now() / 1000);\n }\n\n const idToken = getIdToken();\n if (!idToken)\n throw Error('Id Token not set.');\n\n const issuer = getOAuth2IDPBaseUrl();\n const audience = getOAuth2ClientId();\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n const jwt = verifier.decode(idToken);\n const exp = jwt.payload.exp;\n\n // check life time\n return exp - (nowEpoch + ACCESS_TOKEN_SKEW_TIME) > 0;\n}\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific flanguage governing permissions and\n * limitations under the License.\n **/\n\nimport request from 'superagent/lib/client';\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\n\nlet http = request;\nimport Swal from 'sweetalert2';\nimport T from \"i18n-react/dist/i18n-react\";\nimport { isClearingSessionState, setSessionClearingState, getCurrentPathName } from './methods';\nimport { CLEAR_SESSION_STATE } from '../components/security/actions';\nimport { doLogin, initLogOut } from '../components/security/methods';\n\nexport const GENERIC_ERROR = \"Yikes. Something seems to be broken. Our web team has been notified, and we apologize for the inconvenience.\";\nexport const RESET_LOADING = 'RESET_LOADING';\nexport const START_LOADING = 'START_LOADING';\nexport const STOP_LOADING = 'STOP_LOADING';\nexport const VALIDATE = 'VALIDATE';\nexport const CLEAR_MESSAGE = 'CLEAR_MESSAGE';\nexport const SHOW_MESSAGE = 'SHOW_MESSAGE';\n\nexport const createAction = type => payload => ({\n type,\n payload\n});\n\nexport const resetLoading = createAction(RESET_LOADING);\nexport const startLoading = createAction(START_LOADING);\nexport const stopLoading = createAction(STOP_LOADING);\n\nconst xhrs = {};\nconst etagCache = {};\n\nconst cancel = (key) => {\n if(xhrs[key]) {\n xhrs[key].abort();\n console.log(`aborted request ${key}`);\n delete xhrs[key];\n }\n}\n\nconst schedule = (key, req) => {\n // console.log(`scheduling ${key}`);\n xhrs[key] = req;\n};\n\nconst isObjectEmpty = (obj) => {\n return Object.keys(obj).length === 0 && obj.constructor === Object ;\n}\n\nconst buildNotifyHandlerPayload = (httpCode, title, content, type) => ({ httpCode, title, html: content, type });\nconst buildNotifyHandlerErrorPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"error\");\nconst buildNotifyHandlerWarningPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"warning\");\n\nconst initLogin = () => (dispatch) => {\n const currentLocation = getCurrentPathName();\n const clearingSessionState = isClearingSessionState();\n dispatch({\n type: CLEAR_SESSION_STATE,\n payload: {}\n });\n if (!clearingSessionState) {\n setSessionClearingState(true);\n console.log(\"authErrorHandler 401 - re login\");\n doLogin(currentLocation);\n }\n};\n\nconst normalizeFormDataPayload = (req, formData) => {\n if(!isObjectEmpty(formData)) {\n Object.keys(formData).forEach(function (key) {\n let value = formData[key];\n if (Array.isArray(value)) {\n value.forEach(item => {\n req.field(`${key}[]`, item);\n });\n } else {\n req.field(key, value);\n }\n });\n }\n};\n\nexport const authErrorHandler = (\n err,\n res,\n notifyErrorHandler = showMessage\n) => (dispatch) => {\n\n const code = err.status;\n let msg = \"\";\n let payload, callback;\n\n dispatch(stopLoading());\n\n switch (code) {\n case 401:\n if (notifyErrorHandler !== showMessage) {\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_auth\"));\n callback = () => dispatch(initLogin());\n } else {\n dispatch(initLogin());\n }\n break;\n case 403:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_authz\"));\n callback = initLogOut;\n break;\n case 404:\n msg = err.response.body?.message || err.response.error?.message || err.message;\n if (err.response.body?.errors?.length) {\n msg += ` ${err.response.body.errors.join(\" \")}`;\n }\n payload = buildNotifyHandlerWarningPayload(code, \"Not Found\", msg);\n break;\n case 412:\n for (const [key, value] of Object.entries(err.response.body.errors)) {\n msg += isNaN(key) ? `${key}: ` : \"\";\n msg += `${value} `;\n }\n dispatch({\n type: VALIDATE,\n payload: { errors: err.response.body.errors }\n });\n payload = buildNotifyHandlerWarningPayload(code, \"Validation error\", msg);\n break;\n default:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.server_error\"));\n }\n\n if (payload)\n dispatch(notifyErrorHandler(payload, callback));\n}\n\nexport const getRequest =(\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {},\n useEtag = false\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n let key = url.toString();\n\n if(!isObjectEmpty(params)) {\n // remove the access token\n const { access_token: _, ...newParams} = params;\n // and generate new key\n key = url.query(newParams).toString();\n url = url.query(params);\n }\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n cancel(key);\n\n return new Promise((resolve, reject) => {\n let req = http.get(url.toString());\n if(useEtag && etagCache.hasOwnProperty(key)){\n const { etag } = etagCache[key];\n if(etag){\n req.set('If-None-Match', etag)\n }\n }\n\n req.timeout({\n response: 60000,\n deadline: 60000,\n })\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key, useEtag))\n\n schedule(key, req);\n });\n};\n\nexport const putRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => ( dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n http.put(url.toString())\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject))\n });\n};\n\nexport const deleteRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params) => (dispatch, state) => {\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n\n http.delete(url)\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n let request = http.post(url);\n\n if(payload != null)\n request.send(payload);\n else // to be a simple CORS request\n request.set('Content-Type', 'text/plain');\n\n request.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.post(url)\n .attach('file', file);\n\n normalizeFormDataPayload(req, fileMetadata);\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const putFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file = null,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.put(url);\n\n if(file != null){\n req.attach('file', file);\n }\n\n normalizeFormDataPayload(req, fileMetadata)\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const defaultErrorHandler = (err, res) => (dispatch) => {\n let body = res.body;\n let text = '';\n if(body instanceof Object){\n if(body.hasOwnProperty('message'))\n text = body.message;\n }\n Swal.fire(res.statusText, text, \"error\");\n}\n\nconst byLowerCase = toFind => value => toLowerCase(value) === toFind;\nconst toLowerCase = value => value.toLowerCase();\nconst getKeys = headers => Object.keys(headers);\n\nexport const getHeaderCaseInsensitive = (headerName, headers = {}) => {\n const key = getKeys(headers).find(byLowerCase(headerName));\n return key ? headers[key] : undefined;\n};\n\nexport const responseHandler = ( dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key = null, useEtag= false ) =>\n\n (err, res) => {\n\n if (err || !res.ok) {\n let code = err.status;\n\n if(code === 304 && etagCache.hasOwnProperty(key) && useEtag){\n const { body } = etagCache[key];\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: body}));\n return resolve({response: body});\n }\n\n dispatch(receiveActionCreator);\n return resolve({response: body});\n }\n if(errorHandler) {\n errorHandler(err, res)(dispatch, state);\n }\n return reject({ err, res, dispatch, state })\n }\n\n let json = res.body;\n\n if(useEtag) {\n const responseETAG = getHeaderCaseInsensitive('etag', res.headers);\n if (responseETAG) {\n etagCache[key] = { etag: responseETAG, body: json};\n }\n }\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: json}));\n return resolve({response: json});\n }\n dispatch(receiveActionCreator);\n return resolve({response: json});\n}\n\n\nexport const fetchErrorHandler = (response) => {\n let code = response.status;\n let msg = response.statusText;\n\n switch (code) {\n case 403:\n Swal.fire(\"ERROR\", T.translate(\"errors.user_not_authz\"), \"warning\");\n break;\n case 401:\n Swal.fire(\"ERROR\", T.translate(\"errors.session_expired\"), \"error\");\n break;\n case 412:\n Swal.fire(\"ERROR\", msg, \"warning\");\n case 500:\n Swal.fire(\"ERROR\", T.translate(\"errors.server_error\"), \"error\");\n }\n}\n\nexport const fetchResponseHandler = (response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.json();\n }\n}\n\nexport const showMessage = (settings, callback = null) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire(settings).then((result) => {\n if (result.value && typeof callback === 'function') {\n callback();\n }\n });\n}\n\nexport const showSuccessMessage = (html) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire({\n title: T.translate(\"general.done\"),\n html: html,\n type: 'success'\n });\n}\n\nexport const downloadFileByContent = (filename, content, mime) => {\n let link = document.createElement('a');\n link.textContent = 'download';\n link.download = filename;\n link.href = `data:${mime},${encodeURIComponent(content)}`\n document.body.appendChild(link); // Required for FF\n link.click();\n document.body.removeChild(link);\n}\n\nexport const getCSV = (endpoint, params, filename, header = null) => (dispatch) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n dispatch(startLoading());\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n dispatch(stopLoading());\n\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n downloadFileByContent(filename, csv, 'text/csv;charset=utf-8');\n })\n .catch(fetchErrorHandler);\n};\n\nexport const getRawCSV = (endpoint, params, header = null) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n\n return csv;\n })\n .catch(fetchErrorHandler);\n};\n\nexport const escapeFilterValue = (value) => {\n value = String(value);\n // escape backslash first so you don't accidentally break your own escapes\n value = value.replace(/\\\\/g, \"\\\\\\\\\");\n value = value.replace(/,/g, \"\\\\,\");\n value = value.replace(/;/g, \"\\\\;\");\n // especial case for literal +\n value = value.replace(/\\+/g, \"%2B\");\n return value;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"spark-md5\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/sha256\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-base64url\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-hex\");","import SparkMD5 from \"spark-md5\";\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nconst MAX_BYTES = 65536\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nconst MAX_UINT32 = 4294967295\nconst crypto = typeof window !== 'undefined' ? (window.crypto || window.msCrypto) : null;\nimport sha256 from 'crypto-js/sha256';\nimport Base64url from 'crypto-js/enc-base64url'\nimport Hex from 'crypto-js/enc-hex'\nexport const getRandomBytes = (size) => {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n const bytes = Buffer.allocUnsafe(size)\n if(!crypto) return a;\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (let generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n return bytes\n}\n\nexport const getSHA256 = (message, format = 'hex') => {\n\n let f = Hex;\n if(format === 'Base64url')\n f = Base64url;\n\n return sha256(message).toString(f);\n}\n\nexport const getMD5 = (file) => {\n return new Promise((resolve, reject) => {\n const chunkSize = 2 * 1024 * 1024; // 2 MB by chunk\n const spark = new SparkMD5.ArrayBuffer();\n const fileReader = new FileReader();\n let cursor = 0;\n\n fileReader.onload = e => {\n spark.append(e.target.result); \n cursor += chunkSize;\n\n if (cursor < file.size) {\n readNextChunk();\n } else {\n resolve(spark.end()); // final MD5\n }\n };\n\n fileReader.onerror = () => reject(\"Error reading the file\");\n\n function readNextChunk() {\n const slice = file.slice(cursor, cursor + chunkSize);\n fileReader.readAsArrayBuffer(slice);\n }\n\n readNextChunk();\n });\n}","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"lodash/debounce\");","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport { fetchErrorHandler, fetchResponseHandler, escapeFilterValue } from \"./actions\";\nimport { getAccessToken } from '../components/security/methods';\nimport { buildAPIBaseUrl } from \"./methods\";\nimport debounce from 'lodash/debounce';\nexport const RECEIVE_COUNTRIES = 'RECEIVE_COUNTRIES';\nconst callDelay = 500; // milliseconds\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\nexport const DEFAULT_PAGE_SIZE = 10;\n\nconst _fetchPublic = async (endpoint, callback, options = {}) => {\n return fetch(buildAPIBaseUrl(endpoint.toString()), options)\n .then(fetchResponseHandler)\n .then((json) => {\n if(typeof callback === 'function')\n callback(json.data);\n })\n .catch(response => {\n const code = response && response.status;\n if (code === 404 && typeof callback === 'function') callback([]);\n return response;\n })\n .catch(fetchErrorHandler);\n}\n\n/**\n * @param endpoint\n * @param callback\n * @param options\n * @returns {Promise}\n * @private\n */\nconst _fetch = async (endpoint, callback, options = {}) => {\n\n let accessToken;\n\n try {\n accessToken = await getAccessToken();\n } catch (e) {\n // The caller is told through its callback; the query* functions do not\n // await this promise, so rejecting here would only surface as an\n // unhandled rejection.\n if(typeof callback === 'function')\n callback(e);\n return;\n }\n\n endpoint.addQuery('access_token', accessToken);\n\n return _fetchPublic(endpoint, callback, options);\n}\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryMembers = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/members`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryAttendees = debounce(async (summitId, input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n \n let endpoint = URI(`/api/v1/summits/${summitId}/attendees`);\n \n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n \n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name=@${input},email=@${input}`);\n }\n \n _fetch(endpoint, callback);\n \n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySummits = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/all`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySpeakers = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE ) => {\n\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/speakers`:`speakers`}`);\n\n endpoint.addQuery('expand', `member,registration_request`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTags = debounce(async (summitId, input, callback, per_page = 50) => {\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/track-tag-groups/all/allowed-tags`:`tags`}`);\n\n if(summitId)\n endpoint.addQuery('expand', `tag,track_tag_group`);\n\n endpoint.addQuery('order','tag');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `tag@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTracks = debounce(async (summitId, input, callback, excludedIds = [], per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/tracks`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if (excludedIds?.length > 0) {\n endpoint.addQuery('filter[]', `not_id==${excludedIds.join(\"||\")}`);\n }\n\n if (input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTrackGroups = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/track-groups`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=, *): Promise)|*>}\n */\nexport const queryEvents = debounce(async (summitId, input, onlyPublished = false, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/events` + (onlyPublished ? '/published' : ''));\n\n endpoint.addQuery('order','title');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=, *=): Promise)|*>}\n */\nexport const queryEventTypes = debounce(async (summitId, input, callback, eventTypeClassName = null, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/event-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n if (eventTypeClassName) {\n eventTypeClassName = escapeFilterValue(eventTypeClassName);\n endpoint.addQuery('filter[]', `class_name==${eventTypeClassName}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryGroups = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/groups`);\n\n endpoint.addQuery('order','title,code');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input},code@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryCompanies = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/companies`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryRegistrationCompanies = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/registration-companies`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsors = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type')\n endpoint.addQuery('order','id')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsorsWithBadgeScans = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type');\n endpoint.addQuery('fields','id,company.name,sponsorship.type.name');\n endpoint.addQuery('relations','none,company.none,sponsorship.type.none');\n endpoint.addQuery('filter[]','badge_scans_count>0');\n endpoint.addQuery('order','+company_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryAccessLevels = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/access-level-types`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryOrganizations = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/organizations`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\nexport const getLanguageList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/languages`), callback, { signal });\n};\n\nexport const getCountryList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/countries`), callback, { signal });\n};\n\nlet geocoder;\n\nexport const geoCodeAddress = (address) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\nexport const geoCodeLatLng = (lat, lng) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n let latlng = {lat: parseFloat(lat), lng: parseFloat(lng)};\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'location': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\n/**\n * @type {DebouncedFunc<(function(*, *=, *, *=, *=): Promise)|*>}\n */\nexport const queryTicketTypes = debounce(async (summitId, filters = {}, callback, version = 'v1', per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/${version}/summits/${summitId}/ticket-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(filters.hasOwnProperty('name')) {\n const name = escapeFilterValue(filters.name);\n if(name && name != '')\n endpoint.addQuery('filter[]', `name@@${name}`);\n }\n\n if(filters.hasOwnProperty('audience')){\n const audience = escapeFilterValue(filters.audience);\n if(audience && audience != '')\n endpoint.addQuery('filter[]', `audience==${audience}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySponsoredProjects = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n\n const endpoint = URI(`/api/v1/sponsored-projects`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryPromocodes = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE, extraFilters = []) => {\n\n\n let endpoint = URI(`/api/v1/summits/${summitId}/promo-codes`);\n\n endpoint.addQuery('order','code')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `code@@${input}`);\n }\n\n //eg: filter = 'class_name==SummitRegistrationPromoCode'\n for (const filter of extraFilters) {\n endpoint.addQuery('filter[]', filter);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"idtoken-verifier\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"react-select\");","module.exports = require(\"superagent/lib/client\");","module.exports = require(\"sweetalert2\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport Dropdown from './dropdown';\nimport {getCountryList} from '../../utils/query-actions';\n\nexport default class CountryDropdown extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n options: []\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.setOptions = this.setOptions.bind(this);\n this.abortController = new AbortController();\n }\n\n componentDidMount () {\n let {options} = this.state;\n\n if(options.length == 0){\n getCountryList(this.setOptions, this.abortController.signal);\n }\n }\n\n componentWillUnmount(){\n this.abortController.abort();\n }\n\n handleChange(value) {\n\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'countryddl'\n }};\n\n this.props.onChange(ev);\n }\n\n setOptions(response) {\n let countryList = response.map(c => ({label: c.name, value: c.iso_code}));\n this.setState({options: countryList});\n }\n\n render() {\n\n let {options} = this.state;\n\n return (\n \n );\n\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","Dropdown","React","constructor","props","super","handleChange","bind","selection","value","isMulti","map","val","ev","target","id","type","onChange","render","_this$props","className","error","clearable","disabled","overrideCSS","ariaLabelledBy","rest","_objectWithoutProperties","_excluded","has_error","hasOwnProperty","isClearable","isDisabled","theValue","selectClassName","options","filter","op","includes","Object","find","opt","selectStyles","menu","styles","_objectSpread","zIndex","Select","_extends","formatOptionLabel","data","dangerouslySetInnerHTML","__html","label","defaultProps","AUTH_ERROR_MISSING_AUTH_INFO","AUTH_ERROR_MISSING_REFRESH_TOKEN","AUTH_ERROR_ACCESS_TOKEN_EXPIRED","AUTH_ERROR_LOCK_ACQUIRE_ERROR","AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR","AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR","require","Lock","SuperTokensLock","GET_TOKEN_SILENTLY_LOCK_KEY","RESPONSE_TYPE_CODE","AUTH_INFO","ID_TOKEN","processRefreshToken","async","flow","refreshToken","useOAuth2RefreshToken","clearAuthInfo","Error","response","fn","maxRetries","baseDelayMs","attempt","err","message","startsWith","delay","Math","pow","console","log","Promise","resolve","setTimeout","retryWithBackoff","refreshAccessToken","access_token","expires_in","refresh_token","id_token","storeAuthInfo","_getAccessToken","authInfo","getAuthInfo","accessToken","expiresIn","accessTokenUpdatedAt","getOAuth2Flow","now","moment","unix","timeElapsedSecs","ACCESS_TOKEN_RESOLVER_KEY","Symbol","for","getAccessToken","resolveAccessToken","globalThis","navigator","locks","request","lock","retryPromise","acquireLock","releaseLock","baseUrl","getOAuth2IDPBaseUrl","oauth2ClientId","getOAuth2ClientId","payload","encodeURI","controller","AbortController","timeoutId","abort","json","fetch","method","headers","body","JSON","stringify","signal","networkError","clearTimeout","ok","status","statusText","setSessionClearingState","parseError","new_refresh_token","idToken","formerAuthInfo","floor","Date","Cookies","secure","sameSite","putOnLocalStorage","res","getFromLocalStorage","parse","window","removeFromLocalStorage","OAUTH2_CLIENT_ID","OAUTH2_FLOW","Boolean","OAUTH2_USE_REFRESH_TOKEN","IDP_BASE_URL","URI","createAction","fetchErrorHandler","code","msg","Swal","T","fetchResponseHandler","escapeFilterValue","String","replace","crypto","msCrypto","buildAPIBaseUrl","relativeUrl","API_BASE_URL","key","localStorage","setItem","removeIt","getItem","removeItem","clearing_session_state","cb","maxNumberOfRetries","i","callDelay","_fetchPublic","endpoint","callback","toString","then","catch","_fetch","e","addQuery","getCountryList","debounce","input","per_page","DEFAULT_PAGE_SIZE","summitId","excludedIds","length","join","onlyPublished","eventTypeClassName","filters","version","name","audience","extraFilters","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","obj","prop","prototype","call","r","toStringTag","CountryDropdown","state","setOptions","abortController","componentDidMount","componentWillUnmount","countryList","c","iso_code","setState"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/country-input.js b/lib/components/inputs/country-input.js
new file mode 100644
index 00000000..8d993c8d
--- /dev/null
+++ b/lib/components/inputs/country-input.js
@@ -0,0 +1,2 @@
+!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={5097:(e,r,t)=>{t(1116),t(6842),t(9087),t(9558),t(2183)},3195:(e,r,t)=>{t.d(r,{AUTH_ERROR_ACCESS_TOKEN_EXPIRED:()=>n,AUTH_ERROR_LOCK_ACQUIRE_ERROR:()=>s,AUTH_ERROR_MISSING_AUTH_INFO:()=>a,AUTH_ERROR_MISSING_REFRESH_TOKEN:()=>o,AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR:()=>d,AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR:()=>i});const a="AUTH_ERROR_MISSING_AUTH_INFO",o="AUTH_ERROR_MISSING_REFRESH_TOKEN",n="AUTH_ERROR_ACCESS_TOKEN_EXPIRED",s="AUTH_ERROR_LOCK_ACQUIRE_ERROR",i="AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR",d="AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR"},2183:(e,r,t)=>{t.d(r,{getAccessToken:()=>f});var a=t(9558),o=t(5812),n=t.n(o);t(806);const s=require("browser-tabs-lock");var i=t.n(s);const d=require("js-cookie");var l=t.n(d),u=(t(8041),t(9891),t(5097),t(8853),t(3195));const Lock=new(i()),GET_TOKEN_SILENTLY_LOCK_KEY="openstackuicore.lock.getTokenSilently",c="code",p="authInfo",y="idToken",_=async(e,r)=>{if(e===c&&w()){if(!r)throw O(),Error(u.AUTH_ERROR_MISSING_REFRESH_TOKEN);let e=await(async(e,r=5,t=1e3)=>{for(let a=0;asetTimeout(e,o)))}})((()=>g(r))),{access_token:t,expires_in:a,refresh_token:o,id_token:n}=e;return void 0===o&&(o=null),E(t,a,o,n),t}throw O(),Error(u.AUTH_ERROR_ACCESS_TOKEN_EXPIRED)},R=async()=>{console.log("openstack-uicore-foundation::Security::methods::_getAccessToken");let e=h();if(!e)throw console.log("openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO"),Error(u.AUTH_ERROR_MISSING_AUTH_INFO);let{accessToken:r,expiresIn:t,accessTokenUpdatedAt:a,refreshToken:o}=e,s=T();const i=n()().unix();let d=i-a;return t-=60,console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${i} accessTokenUpdatedAt ${a} expiresIn ${t} timeElapsedSecs ${d}`),(d>=t||null==r)&&(console.log("openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ..."),r=await _(s,o)),r},m=Symbol.for("openstack-uicore-foundation.accessTokenResolver"),f=async()=>{const e=globalThis[m];if(e)return e();if("undefined"!=typeof navigator&&navigator.locks)return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY,(async e=>(console.log("openstack-uicore-foundation::Security::methods::getAccessToken web lock api",e),await R())));if(!await(0,a.retryPromise)((()=>Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY,6e3)),10))throw Error(u.AUTH_ERROR_LOCK_ACQUIRE_ERROR);try{return await R()}finally{await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY)}},g=async e=>{let r=S(),t=Q();const o={grant_type:"refresh_token",client_id:encodeURI(t),refresh_token:e},n=new AbortController,s=setTimeout((()=>n.abort()),1e4);let i,d;try{i=await fetch(`${r}/oauth2/token`,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(o),signal:n.signal})}catch(e){throw console.log("refreshAccessToken network error:",e.message),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${e.message}`)}finally{clearTimeout(s)}if(!i.ok){if(console.log(`refreshAccessToken server error: ${i.status} - ${i.statusText}`),i.status>=500||408===i.status||429===i.status)throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${i.status} - ${i.statusText}`);throw(0,a.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${i.status} - ${i.statusText}`)}try{d=await i.json()}catch(e){throw Error(`${u.AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`)}let{access_token:l,refresh_token:c,expires_in:p,id_token:y}=d;if(!l)throw(0,a.setSessionClearingState)(!0),Error(`${u.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);return{access_token:l,refresh_token:c,expires_in:p,id_token:y}},E=(e,r,t=null,o=null)=>{let n=h(),s={accessToken:e,expiresIn:r,accessTokenUpdatedAt:Math.floor(Date.now()/1e3)};null==t&&n&&(t=n.refreshToken),null==o&&n&&(o=n.idToken),t&&(s.refreshToken=t),o?(s[y]=o,l().set(y,o,{secure:!0,sameSite:"Lax"})):l().remove(y),(0,a.putOnLocalStorage)(p,JSON.stringify(s))},h=()=>{try{let e=(0,a.getFromLocalStorage)(p,!1);return e?JSON.parse(e):null}catch(e){return null}},O=()=>{"undefined"!=typeof window&&((0,a.removeFromLocalStorage)(p),l().remove(y))},Q=()=>"undefined"!=typeof window?window.OAUTH2_CLIENT_ID:null,T=()=>"undefined"!=typeof window&&window.OAUTH2_FLOW||"token id_token",w=()=>"undefined"==typeof window||new Boolean(window.OAUTH2_USE_REFRESH_TOKEN||!0),S=()=>"undefined"!=typeof window?window.IDP_BASE_URL:null},9087:(e,r,t)=>{t.d(r,{escapeFilterValue:()=>p,fetchErrorHandler:()=>u,fetchResponseHandler:()=>c});t(2462),t(806);var a=t(8041),o=t.n(a),n=t(9236),s=t.n(n),i=t(6842),d=t.n(i);t(9558),t(5097),t(2183);o().escapeQuerySpace=!1;const l=e=>r=>({type:e,payload:r}),u=(l("RESET_LOADING"),l("START_LOADING"),l("STOP_LOADING"),e=>{let r=e.status,t=e.statusText;switch(r){case 403:s().fire("ERROR",d().translate("errors.user_not_authz"),"warning");break;case 401:s().fire("ERROR",d().translate("errors.session_expired"),"error");break;case 412:s().fire("ERROR",t,"warning");case 500:s().fire("ERROR",d().translate("errors.server_error"),"error")}}),c=e=>{if(e.ok)return e.json();throw e},p=e=>e=(e=(e=(e=(e=String(e)).replace(/\\/g,"\\\\")).replace(/,/g,"\\,")).replace(/;/g,"\\;")).replace(/\+/g,"%2B")},8853:()=>{require("spark-md5"),require("crypto-js/sha256"),require("crypto-js/enc-base64url"),require("crypto-js/enc-hex"),"undefined"!=typeof window&&(window.crypto||window.msCrypto)},9558:(e,r,t)=>{t.d(r,{buildAPIBaseUrl:()=>a,getFromLocalStorage:()=>n,putOnLocalStorage:()=>o,removeFromLocalStorage:()=>s,retryPromise:()=>d,setSessionClearingState:()=>i});t(5812),t(8041);const a=e=>"undefined"!=typeof window?`${window.API_BASE_URL}${e}`:null``,o=(e,r)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,r)},n=(e,r)=>{if("undefined"!=typeof window){let t=window.localStorage.getItem(e);return r&&(console.log(`getFromLocalStorage removing key ${e}`),s(e)),t}return null},s=e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},i=e=>{"undefined"!=typeof window&&(window.clearing_session_state=e)},d=async(e,r=3)=>{for(let t=0;t{t.d(r,{getCountryList:()=>y});var a=t(9087),o=t(2183),n=t(9558);const s=require("lodash/debounce");var i=t.n(s),d=t(8041),l=t.n(d);const u=500;l().escapeQuerySpace=!1;const c=async(e,r,t={})=>fetch((0,n.buildAPIBaseUrl)(e.toString()),t).then(a.fetchResponseHandler).then((e=>{"function"==typeof r&&r(e.data)})).catch((e=>(404===(e&&e.status)&&"function"==typeof r&&r([]),e))).catch(a.fetchErrorHandler),p=async(e,r,t={})=>{let a;try{a=await(0,o.getAccessToken)()}catch(e){return void("function"==typeof r&&r(e))}return e.addQuery("access_token",a),c(e,r,t)},y=(i()((async(e,r,t=10)=>{let o=l()("/api/v1/members");o.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),o.addQuery("order","first_name,last_name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`full_name@@${e},first_name@@${e},last_name@@${e},email@@${e}`)),p(o,r)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/attendees`);n.addQuery("order","first_name,last_name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`full_name=@${r},email=@${r}`)),p(n,t)}),u),i()((async(e,r,t=10)=>{let o=l()("/api/v1/summits/all");o.addQuery("expand","tickets,rsvp,schedule_summit_events,all_affiliations"),o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),p(o,r)}),u),i()((async(e,r,t,o=10)=>{let n=l()("/api/v1/"+(e?`summits/${e}/speakers`:"speakers"));n.addQuery("expand","member,registration_request"),n.addQuery("order","first_name,last_name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`full_name@@${r},first_name@@${r},last_name@@${r},email@@${r}`)),p(n,t)}),u),i()((async(e,r,t,o=50)=>{let n=l()("/api/v1/"+(e?`summits/${e}/track-tag-groups/all/allowed-tags`:"tags"));e&&n.addQuery("expand","tag,track_tag_group"),n.addQuery("order","tag"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`tag@@${r}`)),p(n,t)}),u),i()((async(e,r,t,o=[],n=10)=>{let s=l()(`/api/v1/summits/${e}/tracks`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",n),(null==o?void 0:o.length)>0&&s.addQuery("filter[]",`not_id==${o.join("||")}`),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),p(s,t)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/track-groups`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),p(n,t)}),u),i()((async(e,r,t=!1,o,n=10)=>{let s=l()(`/api/v1/summits/${e}/events`+(t?"/published":""));s.addQuery("order","title"),s.addQuery("page",1),s.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`title@@${r}`)),p(s,o)}),u),i()((async(e,r,t,o=null,n=10)=>{let s=l()(`/api/v1/summits/${e}/event-types`);s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",n),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`name@@${r}`)),o&&(o=(0,a.escapeFilterValue)(o),s.addQuery("filter[]",`class_name==${o}`)),p(s,t)}),u),i()((async(e,r,t=10)=>{let o=l()("/api/v1/groups");o.addQuery("order","title,code"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`title@@${e},code@@${e}`)),p(o,r)}),u),i()((async(e,r,t=10)=>{let o=l()("/api/v1/companies");o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),p(o,r)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/registration-companies`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),p(n,t)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/sponsors`);n.addQuery("expand","company,sponsorship,sponsorship.type"),n.addQuery("order","id"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`company_name@@${r}`)),p(n,t)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/sponsors`);n.addQuery("expand","company,sponsorship,sponsorship.type"),n.addQuery("fields","id,company.name,sponsorship.type.name"),n.addQuery("relations","none,company.none,sponsorship.type.none"),n.addQuery("filter[]","badge_scans_count>0"),n.addQuery("order","+company_name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`company_name@@${r}`)),p(n,t)}),u),i()((async(e,r,t,o=10)=>{let n=l()(`/api/v1/summits/${e}/access-level-types`);n.addQuery("order","name"),n.addQuery("page",1),n.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),n.addQuery("filter[]",`name@@${r}`)),p(n,t)}),u),i()((async(e,r,t=10)=>{let o=l()("/api/v1/organizations");o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),p(o,r)}),u),(e,r)=>c(new(l())("/api/public/v1/countries"),e,{signal:r}));i()((async(e,r={},t,o="v1",n=10)=>{let s=l()(`/api/${o}/summits/${e}/ticket-types`);if(s.addQuery("order","name"),s.addQuery("page",1),s.addQuery("per_page",n),r.hasOwnProperty("name")){const e=(0,a.escapeFilterValue)(r.name);e&&""!=e&&s.addQuery("filter[]",`name@@${e}`)}if(r.hasOwnProperty("audience")){const e=(0,a.escapeFilterValue)(r.audience);e&&""!=e&&s.addQuery("filter[]",`audience==${e}`)}p(s,t)}),u),i()((async(e,r,t=10)=>{const o=l()("/api/v1/sponsored-projects");o.addQuery("order","name"),o.addQuery("page",1),o.addQuery("per_page",t),e&&(e=(0,a.escapeFilterValue)(e),o.addQuery("filter[]",`name@@${e}`)),p(o,r)}),u),i()((async(e,r,t,o=10,n=[])=>{let s=l()(`/api/v1/summits/${e}/promo-codes`);s.addQuery("order","code"),s.addQuery("page",1),s.addQuery("per_page",o),r&&(r=(0,a.escapeFilterValue)(r),s.addQuery("filter[]",`code@@${r}`));for(const e of n)s.addQuery("filter[]",e);p(s,t)}),u)},1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},6842:e=>{e.exports=require("i18n-react/dist/i18n-react")},9891:e=>{e.exports=require("idtoken-verifier")},5812:e=>{e.exports=require("moment-timezone")},2015:e=>{e.exports=require("react")},8466:e=>{e.exports=require("react-select")},806:e=>{e.exports=require("superagent/lib/client")},9236:e=>{e.exports=require("sweetalert2")},8041:e=>{e.exports=require("urijs")}},r={};function t(a){var o=r[a];if(void 0!==o)return o.exports;var n=r[a]={exports:{}};return e[a](n,n.exports,t),n.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var a in r)t.o(r,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:r[a]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var a={};t.r(a),t.d(a,{default:()=>_});var o=t(6031),n=t.n(o),s=t(2462),i=t.n(s),d=t(2015),l=t.n(d),u=t(8466),c=t.n(u),p=t(5301);const y=["value","onChange","id","multi","error"];class _ extends l().Component{constructor(e){super(e),this.state={options:[]},this.handleChange=this.handleChange.bind(this),this.setOptions=this.setOptions.bind(this)}setOptions(e){let r=e.map((e=>({label:e.name,value:e.iso_code})));this.setState({options:r})}componentDidMount(){(0,p.getCountryList)(this.setOptions).catch((e=>{console.log("Error getting countries: ",e),this.setState({options:[]})}))}handleChange(e){let r=null;r=this.props.hasOwnProperty("multi")?e.map((e=>e.value)):e.value;let t={target:{id:this.props.id,value:r,type:"countryinput"}};this.props.onChange(t)}render(){let e=this.props,{value:r,onChange:t,id:a,multi:o,error:s}=e,d=i()(e,y),{options:u}=this.state,p=this.props.hasOwnProperty("multi"),_=null,R=this.props.hasOwnProperty("error")&&""!=s;return _=p?u.filter((e=>r.includes(e.value))):r instanceof Object||null==r?r:u.find((e=>e.value==r)),l().createElement("div",null,l().createElement(c(),n()({className:"dropdown"+(R?" error":""),onChange:this.handleChange,options:u,value:_,isMulti:p},d)),R&&l().createElement("p",{className:"error-label"},s))}}return a})()));
+//# sourceMappingURL=country-input.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/country-input.js.map b/lib/components/inputs/country-input.js.map
new file mode 100644
index 00000000..b6e509a3
--- /dev/null
+++ b/lib/components/inputs/country-input.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/country-input.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,wVCTF,MAAMC,EAA+B,+BAC/BC,EAAmC,mCACnCC,EAAkC,kCAClCC,EAAgC,gCAChCC,EAAyC,yCACzCC,EAAyC,wC,uFCLtD,MAAM,EAA+BC,QAAQ,qB,aCA7C,MAAM,EAA+BA,QAAQ,a,yDCqC7C,MAAMC,KAAO,IAAIC,KAIXC,4BAA8B,wCAKvBC,EAA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iB8D,QAAmB,MAAT9D,EAAiBA,EAAQuB,EAAQkF,MAAKC,GAAOA,EAAI1G,OAASA,IAIjGyE,IAAAA,cAAA,WACIA,IAAAA,cAACkC,IAAMC,IAAA,CACHC,UAAW,YAAcP,EAAY,SAAW,IAChDT,SAAUvN,KAAKwM,aACfvD,QAASA,EACTvB,MAAOwF,EACPa,QAASA,GACLH,IAEPI,GACG7B,IAAAA,cAAA,KAAGoC,UAAU,eAAeZ,GAI5C,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/./src/components/security/constants.js","webpack://openstack-uicore-foundation/external commonjs \"browser-tabs-lock\"","webpack://openstack-uicore-foundation/external commonjs \"js-cookie\"","webpack://openstack-uicore-foundation/./src/components/security/methods.js","webpack://openstack-uicore-foundation/./src/utils/actions.js","webpack://openstack-uicore-foundation/external commonjs \"spark-md5\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/sha256\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-base64url\"","webpack://openstack-uicore-foundation/external commonjs \"crypto-js/enc-hex\"","webpack://openstack-uicore-foundation/./src/utils/crypto.js","webpack://openstack-uicore-foundation/./src/utils/methods.js","webpack://openstack-uicore-foundation/external commonjs \"lodash/debounce\"","webpack://openstack-uicore-foundation/./src/utils/query-actions.js","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"i18n-react/dist/i18n-react\"","webpack://openstack-uicore-foundation/external commonjs \"idtoken-verifier\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-select\"","webpack://openstack-uicore-foundation/external commonjs \"superagent/lib/client\"","webpack://openstack-uicore-foundation/external commonjs \"sweetalert2\"","webpack://openstack-uicore-foundation/external commonjs \"urijs\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/inputs/country-input.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","export const AUTH_ERROR_MISSING_AUTH_INFO = 'AUTH_ERROR_MISSING_AUTH_INFO';\nexport const AUTH_ERROR_MISSING_REFRESH_TOKEN = 'AUTH_ERROR_MISSING_REFRESH_TOKEN';\nexport const AUTH_ERROR_ACCESS_TOKEN_EXPIRED = 'AUTH_ERROR_ACCESS_TOKEN_EXPIRED';\nexport const AUTH_ERROR_LOCK_ACQUIRE_ERROR = 'AUTH_ERROR_LOCK_ACQUIRE_ERROR'\nexport const AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR';\nexport const AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR = 'AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR';\nexport const AUTH_ERROR_ID_TOKEN_INVALID = 'AUTH_ERROR_ID_TOKEN_INVALID';\nexport const AUTH_ERROR_MISSING_OTP_PARAM = 'AUTH_ERROR_MISSING_OTP_PARAM';\nexport const AUTH_ERROR_MISSING_PKCE_PARAM = 'AUTH_ERROR_MISSING_PKCE_PARAM';\nexport const AUTH_ERROR_MISSING_NONCE_PARAM = 'AUTH_ERROR_MISSING_NONCE_PARAM';\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"browser-tabs-lock\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"js-cookie\");","import {\n base64URLEncode,\n getAuthCallback,\n getCurrentLocation,\n getFromLocalStorage,\n removeFromLocalStorage,\n getOrigin,\n putOnLocalStorage,\n retryPromise,\n setSessionClearingState,\n} from \"../../utils/methods\";\nimport moment from \"moment-timezone\";\nimport request from 'superagent/lib/client';\nimport SuperTokensLock from 'browser-tabs-lock';\nimport Cookies from 'js-cookie'\nlet http = request;\nimport URI from \"urijs\";\nimport IdTokenVerifier from \"idtoken-verifier\";\nimport {SET_LOGGED_USER} from \"./actions\";\nimport {getRandomBytes, getSHA256} from \"../../utils/crypto\";\n\nimport {\n AUTH_ERROR_ACCESS_TOKEN_EXPIRED,\n AUTH_ERROR_MISSING_AUTH_INFO,\n AUTH_ERROR_MISSING_REFRESH_TOKEN,\n AUTH_ERROR_LOCK_ACQUIRE_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR,\n AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR,\n AUTH_ERROR_ID_TOKEN_INVALID,\n AUTH_ERROR_MISSING_OTP_PARAM,\n AUTH_ERROR_MISSING_PKCE_PARAM,\n AUTH_ERROR_MISSING_NONCE_PARAM,\n} from \"./constants\";\n\n/**\n * @ignore\n */\nconst Lock = new SuperTokensLock();\n/**\n * @ignore\n */\nconst GET_TOKEN_SILENTLY_LOCK_KEY = 'openstackuicore.lock.getTokenSilently';\nconst GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT = 6000;\nconst NONCE_LEN = 16;\nexport const ACCESS_TOKEN_SKEW_TIME = 60;\nexport const RESPONSE_TYPE_IMPLICIT = \"token id_token\";\nexport const RESPONSE_TYPE_CODE = 'code';\nconst AUTH_INFO = 'authInfo';\nconst NONCE = 'nonce';\nconst PKCE = 'pkce';\nconst ID_TOKEN = 'idToken';\nconst BACK_ULR_PARAM_NAME = 'BackUrl';\n\n\n/**\n *\n * @param backUrl\n * @param prompt\n * @param tokenIdHint\n * @param provider\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n * @param backUrlParamName\n * @returns {*}\n */\nexport const getAuthUrl = (\n backUrl = null,\n prompt = null,\n tokenIdHint = null,\n provider = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null,\n backUrlParamName = BACK_ULR_PARAM_NAME\n ) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let baseUrl = getOAuth2IDPBaseUrl();\n let scopes = getOAuth2Scopes();\n let flow = getOAuth2Flow();\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n let nonce = createNonce(NONCE_LEN);\n\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let query = {\n \"response_type\": encodeURI(flow),\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"response_mode\": 'fragment',\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n if (flow === RESPONSE_TYPE_CODE) {\n const pkce = createPKCECodes()\n putOnLocalStorage(PKCE, JSON.stringify(pkce));\n query['code_challenge'] = pkce.codeChallenge;\n query['code_challenge_method'] = 'S256';\n query['approval_prompt'] = 'force';\n }\n\n if (prompt) {\n query['prompt'] = prompt;\n }\n\n if (scopes && scopes.includes('offline_access')) {\n // then we need to force prompt=consent bc we are requesting an offline access\n // and we need to let the user know\n query['prompt'] = 'consent';\n }\n\n if (tokenIdHint) {\n query['id_token_hint'] = tokenIdHint;\n }\n\n if (provider) {\n query['provider'] = provider;\n }\n\n if (otpLoginHint) {\n query['otp_login_hint'] = otpLoginHint;\n }\n\n if (loginHint) {\n query['login_hint'] = encodeURI(loginHint);\n }\n\n if (tenant) {\n query['tenant'] = tenant;\n }\n\n url = url.query(query);\n //console.log(`getAuthUrl ${url.toString()}`);\n return url;\n}\n\n/**\n * @param idToken\n * @returns {*}\n */\nexport const getLogoutUrl = (idToken = null) => {\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let url = URI(`${baseUrl}/oauth2/end-session`);\n let state = createNonce(NONCE_LEN);\n let postLogOutUri = `${getOrigin()}/auth/logout`;\n // store nonce to check it later\n putOnLocalStorage('post_logout_state', state);\n /**\n * post_logout_redirect_uri should be listed on oauth2 client settings\n * on IDP\n * \"Security Settings\" Tab -> Logout Options -> Post Logout Uris\n */\n const queryParams = {\n \"post_logout_redirect_uri\": encodeURI(postLogOutUri),\n \"client_id\": encodeURI(oauth2ClientId),\n \"state\": state,\n }\n\n if (idToken)\n queryParams.id_token_hint = idToken;\n\n return url.query(queryParams);\n}\n\nconst createNonce = (len) => {\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n let nonce = '';\n for (let i = 0; i < len; i++) {\n nonce += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return nonce;\n}\n\n/**\n *\n * @param backUrl\n * @param provider\n * @param prompt\n * @param loginHint\n * @param otpLoginHint\n * @param tenant\n */\nexport const doLogin = (\n backUrl = null,\n provider = null,\n prompt = null,\n loginHint = null,\n otpLoginHint = null,\n tenant = null\n) => {\n let url = getAuthUrl(backUrl, prompt, null, provider, loginHint, otpLoginHint, tenant);\n let location = getCurrentLocation()\n location.replace(url.toString());\n}\n\n/**\n *\n * @param backUrl\n * @param loginHint\n * @param otpLoginHint\n */\nexport const doLoginBasicLogin = (backUrl = null, loginHint = null, otpLoginHint = null) => {\n doLogin(backUrl, null, null, loginHint, otpLoginHint);\n}\n\nconst createPKCECodes = () => {\n const codeVerifier = base64URLEncode(getRandomBytes(64))\n const codeChallenge = getSHA256(codeVerifier, 'Base64url')\n const createdAt = new Date()\n const codePair = {\n codeVerifier,\n codeChallenge,\n createdAt\n }\n return codePair\n}\n\n/**\n\n * @param code\n * @param backUrl\n * @param backUrlParamName\n * @returns {Promise<{access_token: *, refresh_token: *, id_token: *, expires_in: *, error: *, error_description: *}>}\n */\nexport const emitAccessToken = async (code, backUrl = null, backUrlParamName = BACK_ULR_PARAM_NAME) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n let redirectUri = getAuthCallback();\n let pkce = JSON.parse(getFromLocalStorage(PKCE, true));\n\n if (!pkce)\n throw Error(AUTH_ERROR_MISSING_PKCE_PARAM);\n\n if (backUrl != null)\n redirectUri += `?${backUrlParamName}=${encodeURIComponent(backUrl)}`;\n\n const payload = {\n 'code': code,\n 'grant_type': 'authorization_code',\n 'code_verifier': pkce.codeVerifier,\n \"client_id\": encodeURI(oauth2ClientId),\n \"redirect_uri\": encodeURI(redirectUri)\n };\n\n try {\n //const response = await http.post(`${baseUrl}/oauth2/token`, payload);\n //const {body: {access_token, refresh_token, id_token, expires_in}} = response;\n const response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }).catch(function (error) {\n console.log('Request failed:', error.message);\n });\n const json = await response.json();\n let {access_token, refresh_token, id_token, expires_in, error, error_description} = json;\n return {access_token, refresh_token, id_token, expires_in, error, error_description}\n } catch (err) {\n console.log(err);\n }\n};\n\nexport const MAX_RETRIES = 5;\nexport const BACKOFF_BASE_MS = 1000;\nexport const REFRESH_TOKEN_FETCH_TIMEOUT_MS = 10000;\n\nexport const retryWithBackoff = async (fn, maxRetries = MAX_RETRIES, baseDelayMs = BACKOFF_BASE_MS) => {\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n return await fn();\n } catch (err) {\n // only retry transient network/server errors — everything else fails fast\n const isRetryable = err.message && err.message.startsWith(AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR);\n if (!isRetryable || attempt === maxRetries - 1) {\n throw err;\n }\n const delay = baseDelayMs * Math.pow(2, attempt);\n console.log(`retryWithBackoff retry ${attempt + 1}/${maxRetries} in ${delay}ms`);\n await new Promise(resolve => setTimeout(resolve, delay));\n }\n }\n};\n\nconst processRefreshToken = async (flow, refreshToken) => {\n\n if (flow === RESPONSE_TYPE_CODE && useOAuth2RefreshToken()) {\n if (!refreshToken) {\n clearAuthInfo();\n throw Error(AUTH_ERROR_MISSING_REFRESH_TOKEN);\n }\n\n let response = await retryWithBackoff(() => refreshAccessToken(refreshToken));\n let {access_token, expires_in, refresh_token, id_token} = response;\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n return access_token;\n }\n clearAuthInfo();\n throw Error(AUTH_ERROR_ACCESS_TOKEN_EXPIRED);\n}\n\n/**\n * @returns {Promise<*>}\n * @private\n */\nconst _getAccessToken = async () => {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken`);\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n let flow = getOAuth2Flow();\n // check lifetime\n const now = moment().unix();\n let timeElapsedSecs = (now - accessTokenUpdatedAt);\n\n expiresIn = (expiresIn - ACCESS_TOKEN_SKEW_TIME);\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken now ${now} accessTokenUpdatedAt ${accessTokenUpdatedAt} expiresIn ${expiresIn} timeElapsedSecs ${timeElapsedSecs}`)\n if (timeElapsedSecs >= expiresIn || accessToken == null) {\n console.log(`openstack-uicore-foundation::Security::methods::_getAccessToken access token expired, refreshing it ...`);\n accessToken = await processRefreshToken(flow, refreshToken);\n }\n return accessToken;\n}\n\n/**\n * Optional resolver for getAccessToken, set via setAccessTokenResolver. When\n * present, getAccessToken delegates to it; otherwise the built-in flow runs.\n * Pass a non-function (or nothing) to reset to the built-in.\n *\n * The slot lives on globalThis under a Symbol.for key so every copy of this\n * module shares it: bundles that inlined methods.js, nested installs of the\n * package, and symlinked dev installs all read the same registry entry.\n */\nconst ACCESS_TOKEN_RESOLVER_KEY = Symbol.for('openstack-uicore-foundation.accessTokenResolver');\n\nexport const setAccessTokenResolver = (resolver) => {\n globalThis[ACCESS_TOKEN_RESOLVER_KEY] = typeof resolver === 'function' ? resolver : null;\n};\n\n/**\n * @returns {Promise<*|undefined>}\n */\nexport const getAccessToken = async () => {\n const resolveAccessToken = globalThis[ACCESS_TOKEN_RESOLVER_KEY];\n if (resolveAccessToken) return resolveAccessToken();\n\n if (typeof navigator !== 'undefined' && navigator.locks) {\n return await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::getAccessToken web lock api`, lock);\n return await _getAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n return await _getAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n/**\n * @private\n */\nconst _clearAccessToken = () => {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken`);\n\n let authInfo = getAuthInfo();\n\n if (!authInfo) {\n console.log(`openstack-uicore-foundation::Security::methods::_clearAccessToken AUTH_ERROR_MISSING_AUTH_INFO`);\n throw Error(AUTH_ERROR_MISSING_AUTH_INFO);\n }\n\n let {accessToken, expiresIn, accessTokenUpdatedAt, refreshToken} = authInfo;\n\n storeAuthInfo(null, 0, refreshToken)\n}\n\nexport const clearAccessToken = async () => {\n // see https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API\n if (typeof navigator !== 'undefined' && navigator.locks) {\n await navigator.locks.request(GET_TOKEN_SILENTLY_LOCK_KEY, async lock => {\n console.log(`openstack-uicore-foundation::Security::methods::clearAccessToken web lock api`, lock);\n _clearAccessToken();\n });\n } else {\n if (\n await retryPromise(\n () => Lock.acquireLock(GET_TOKEN_SILENTLY_LOCK_KEY, GET_TOKEN_SILENTLY_LOCK_KEY_TIMEOUT),\n 10\n )\n ) {\n try {\n _clearAccessToken();\n } finally {\n await Lock.releaseLock(GET_TOKEN_SILENTLY_LOCK_KEY);\n }\n } else {\n // error on locking\n throw Error(AUTH_ERROR_LOCK_ACQUIRE_ERROR);\n }\n }\n}\n\n\nexport const refreshAccessToken = async (refresh_token) => {\n\n let baseUrl = getOAuth2IDPBaseUrl();\n let oauth2ClientId = getOAuth2ClientId();\n\n const payload = {\n 'grant_type': 'refresh_token',\n \"client_id\": encodeURI(oauth2ClientId),\n \"refresh_token\": refresh_token\n };\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), REFRESH_TOKEN_FETCH_TIMEOUT_MS);\n\n let response;\n try {\n response = await fetch(`${baseUrl}/oauth2/token`, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload),\n signal: controller.signal\n });\n } catch (networkError) {\n // fetch rejects on network failures (DNS, timeout, no connectivity, abort)\n console.log('refreshAccessToken network error:', networkError.message);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${networkError.message}`);\n } finally {\n clearTimeout(timeoutId);\n }\n\n if (!response.ok) {\n console.log(`refreshAccessToken server error: ${response.status} - ${response.statusText}`);\n if (response.status >= 500 || response.status === 408 || response.status === 429) {\n // transient error (server error, request timeout, rate limit) — should be retried\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: ${response.status} - ${response.statusText}`);\n }\n // token is genuinely revoked — this is a real auth error\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: ${response.status} - ${response.statusText}`);\n }\n\n let json;\n try {\n json = await response.json();\n } catch (parseError) {\n // IDP returned non-JSON (HTML error page, empty body, etc.) — treat as transient\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR}: invalid JSON response from IDP`);\n }\n let {access_token, refresh_token: new_refresh_token, expires_in, id_token} = json;\n // Defensively ensure we never propagate an undefined access token.\n if (!access_token) {\n setSessionClearingState(true);\n throw Error(`${AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR}: missing access_token in refresh response`);\n }\n return {access_token, refresh_token: new_refresh_token, expires_in, id_token}\n}\n\nexport const storeAuthInfo = (accessToken, expiresIn, refreshToken = null, idToken = null) => {\n\n let formerAuthInfo = getAuthInfo();\n\n let authInfo = {\n accessToken: accessToken,\n expiresIn: expiresIn,\n accessTokenUpdatedAt: Math.floor(Date.now() / 1000),\n };\n\n if (refreshToken == null && formerAuthInfo) {\n refreshToken = formerAuthInfo.refreshToken;\n }\n\n if (idToken == null && formerAuthInfo) {\n idToken = formerAuthInfo.idToken;\n }\n\n if (refreshToken) {\n authInfo['refreshToken'] = refreshToken;\n }\n\n if (idToken) {\n authInfo[ID_TOKEN] = idToken;\n Cookies.set(ID_TOKEN, idToken, {secure: true, sameSite: 'Lax'});\n } else {\n Cookies.remove(ID_TOKEN);\n }\n\n putOnLocalStorage(AUTH_INFO, JSON.stringify(authInfo));\n}\n\nexport const getAuthInfo = () => {\n try {\n let res = getFromLocalStorage(AUTH_INFO, false)\n if (!res) return null;\n return JSON.parse(res);\n } catch (err) {\n return null;\n }\n}\n\nexport const clearAuthInfo = () => {\n if (typeof window !== 'undefined') {\n removeFromLocalStorage(AUTH_INFO);\n Cookies.remove(ID_TOKEN);\n }\n};\n\nexport const getIdToken = () => {\n if (typeof window !== 'undefined') {\n const authInfo = getAuthInfo();\n if (authInfo) {\n return authInfo.idToken;\n }\n return null;\n }\n return null;\n};\n\nexport const getOAuth2ClientId = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_CLIENT_ID;\n }\n return null;\n};\n\nexport const getOAuth2Flow = () => {\n if (typeof window !== 'undefined') {\n return window.OAUTH2_FLOW || \"token id_token\";\n }\n return \"token id_token\";\n}\n\nexport const useOAuth2RefreshToken = () => {\n if (typeof window !== 'undefined') {\n return new Boolean(window.OAUTH2_USE_REFRESH_TOKEN || true);\n }\n return true;\n}\n\nexport const getOAuth2IDPBaseUrl = () => {\n if (typeof window !== 'undefined') {\n return window.IDP_BASE_URL;\n }\n return null;\n};\n\nexport const getOAuth2Scopes = () => {\n if (typeof window !== 'undefined') {\n return window.SCOPES;\n }\n return null;\n};\n\nexport const initLogOut = () => {\n let location = getCurrentLocation();\n location.replace(getLogoutUrl(getIdToken()).toString());\n}\n\nexport const validateIdToken = (idToken, issuer, audience) => {\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n let storedNonce = getFromLocalStorage(NONCE, true);\n if (!storedNonce)\n throw Error(AUTH_ERROR_MISSING_NONCE_PARAM);\n\n let jwt = verifier.decode(idToken);\n let alg = jwt.header.alg;\n let kid = jwt.header.kid;\n let aud = jwt.payload.aud;\n let iss = jwt.payload.iss;\n let exp = jwt.payload.exp;\n let nbf = jwt.payload.nbf;\n let tnonce = jwt.payload.nonce || null;\n\n return tnonce == storedNonce && aud == audience && iss == issuer;\n}\n\nexport const passwordlessStart = (params) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let nonce = createNonce(NONCE_LEN);\n // store nonce to check it later\n putOnLocalStorage(NONCE, nonce);\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/auth`);\n\n let payload = {\n \"response_type\": \"otp\",\n \"scope\": encodeURI(scopes),\n \"nonce\": nonce,\n \"client_id\": encodeURI(oauth2ClientId),\n \"connection\": params.connection || \"email\",\n \"send\": params.send || \"code\",\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n if (params.hasOwnProperty('redirect_uri')) {\n payload[\"redirect_uri\"] = encodeURIComponent(params.redirect_uri);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n let json = res.body;\n return Promise.resolve({response: json});\n }).catch((err) => {\n return Promise.reject(err);\n });\n\n}\n\nexport const passwordlessLogin = (params) => (dispatch) => {\n\n let oauth2ClientId = getOAuth2ClientId();\n let scopes = getOAuth2Scopes();\n let baseUrl = getOAuth2IDPBaseUrl();\n let url = URI(`${baseUrl}/oauth2/token`);\n\n if (!params.hasOwnProperty(\"otp\")) {\n throw Error(AUTH_ERROR_MISSING_OTP_PARAM);\n }\n\n let payload = {\n \"grant_type\": \"passwordless\",\n \"connection\": params.connection || \"email\",\n \"scope\": encodeURI(scopes),\n \"client_id\": encodeURI(oauth2ClientId),\n \"otp\": params.otp\n };\n\n if (params.hasOwnProperty('email')) {\n payload[\"email\"] = encodeURIComponent(params.email);\n }\n\n if (params.hasOwnProperty('phone_number')) {\n payload[\"phone_number\"] = encodeURIComponent(params.phone_number);\n }\n\n let req = http.post(url.toString());\n\n return req.send(payload).then((res) => {\n try {\n // now we got token\n let json = res.body;\n let {access_token, expires_in, refresh_token, id_token} = json;\n\n if (typeof refresh_token === 'undefined') {\n refresh_token = null; // not using rotate policy\n }\n\n if (typeof id_token === 'undefined') {\n id_token = null; // not using rotate policy\n }\n\n // verify id token\n\n if (id_token) {\n if (!validateIdToken(id_token, baseUrl, oauth2ClientId)) {\n throw Error(AUTH_ERROR_ID_TOKEN_INVALID);\n }\n }\n\n storeAuthInfo(access_token, expires_in, refresh_token, id_token);\n\n if (dispatch) {\n dispatch({\n type: SET_LOGGED_USER,\n payload: {sessionState: null}\n });\n }\n\n return Promise.resolve({response: json});\n } catch (e) {\n console.log(e);\n return Promise.reject(e);\n }\n }).catch((err) => {\n return Promise.reject(err);\n });\n}\n\nexport const isIdTokenAlive = (nowEpoch = null) => () => {\n\n if (!nowEpoch) {\n nowEpoch = Math.floor(Date.now() / 1000);\n }\n\n const idToken = getIdToken();\n if (!idToken)\n throw Error('Id Token not set.');\n\n const issuer = getOAuth2IDPBaseUrl();\n const audience = getOAuth2ClientId();\n\n let verifier = new IdTokenVerifier({\n issuer: issuer,\n audience: audience\n });\n\n const jwt = verifier.decode(idToken);\n const exp = jwt.payload.exp;\n\n // check life time\n return exp - (nowEpoch + ACCESS_TOKEN_SKEW_TIME) > 0;\n}\n","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific flanguage governing permissions and\n * limitations under the License.\n **/\n\nimport request from 'superagent/lib/client';\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\n\nlet http = request;\nimport Swal from 'sweetalert2';\nimport T from \"i18n-react/dist/i18n-react\";\nimport { isClearingSessionState, setSessionClearingState, getCurrentPathName } from './methods';\nimport { CLEAR_SESSION_STATE } from '../components/security/actions';\nimport { doLogin, initLogOut } from '../components/security/methods';\n\nexport const GENERIC_ERROR = \"Yikes. Something seems to be broken. Our web team has been notified, and we apologize for the inconvenience.\";\nexport const RESET_LOADING = 'RESET_LOADING';\nexport const START_LOADING = 'START_LOADING';\nexport const STOP_LOADING = 'STOP_LOADING';\nexport const VALIDATE = 'VALIDATE';\nexport const CLEAR_MESSAGE = 'CLEAR_MESSAGE';\nexport const SHOW_MESSAGE = 'SHOW_MESSAGE';\n\nexport const createAction = type => payload => ({\n type,\n payload\n});\n\nexport const resetLoading = createAction(RESET_LOADING);\nexport const startLoading = createAction(START_LOADING);\nexport const stopLoading = createAction(STOP_LOADING);\n\nconst xhrs = {};\nconst etagCache = {};\n\nconst cancel = (key) => {\n if(xhrs[key]) {\n xhrs[key].abort();\n console.log(`aborted request ${key}`);\n delete xhrs[key];\n }\n}\n\nconst schedule = (key, req) => {\n // console.log(`scheduling ${key}`);\n xhrs[key] = req;\n};\n\nconst isObjectEmpty = (obj) => {\n return Object.keys(obj).length === 0 && obj.constructor === Object ;\n}\n\nconst buildNotifyHandlerPayload = (httpCode, title, content, type) => ({ httpCode, title, html: content, type });\nconst buildNotifyHandlerErrorPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"error\");\nconst buildNotifyHandlerWarningPayload = (httpCode, title, content) => buildNotifyHandlerPayload(httpCode, title, content, \"warning\");\n\nconst initLogin = () => (dispatch) => {\n const currentLocation = getCurrentPathName();\n const clearingSessionState = isClearingSessionState();\n dispatch({\n type: CLEAR_SESSION_STATE,\n payload: {}\n });\n if (!clearingSessionState) {\n setSessionClearingState(true);\n console.log(\"authErrorHandler 401 - re login\");\n doLogin(currentLocation);\n }\n};\n\nconst normalizeFormDataPayload = (req, formData) => {\n if(!isObjectEmpty(formData)) {\n Object.keys(formData).forEach(function (key) {\n let value = formData[key];\n if (Array.isArray(value)) {\n value.forEach(item => {\n req.field(`${key}[]`, item);\n });\n } else {\n req.field(key, value);\n }\n });\n }\n};\n\nexport const authErrorHandler = (\n err,\n res,\n notifyErrorHandler = showMessage\n) => (dispatch) => {\n\n const code = err.status;\n let msg = \"\";\n let payload, callback;\n\n dispatch(stopLoading());\n\n switch (code) {\n case 401:\n if (notifyErrorHandler !== showMessage) {\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_auth\"));\n callback = () => dispatch(initLogin());\n } else {\n dispatch(initLogin());\n }\n break;\n case 403:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.user_not_authz\"));\n callback = initLogOut;\n break;\n case 404:\n msg = err.response.body?.message || err.response.error?.message || err.message;\n if (err.response.body?.errors?.length) {\n msg += ` ${err.response.body.errors.join(\" \")}`;\n }\n payload = buildNotifyHandlerWarningPayload(code, \"Not Found\", msg);\n break;\n case 412:\n for (const [key, value] of Object.entries(err.response.body.errors)) {\n msg += isNaN(key) ? `${key}: ` : \"\";\n msg += `${value} `;\n }\n dispatch({\n type: VALIDATE,\n payload: { errors: err.response.body.errors }\n });\n payload = buildNotifyHandlerWarningPayload(code, \"Validation error\", msg);\n break;\n default:\n payload = buildNotifyHandlerErrorPayload(code, \"ERROR\", T.translate(\"errors.server_error\"));\n }\n\n if (payload)\n dispatch(notifyErrorHandler(payload, callback));\n}\n\nexport const getRequest =(\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {},\n useEtag = false\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n let key = url.toString();\n\n if(!isObjectEmpty(params)) {\n // remove the access token\n const { access_token: _, ...newParams} = params;\n // and generate new key\n key = url.query(newParams).toString();\n url = url.query(params);\n }\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n cancel(key);\n\n return new Promise((resolve, reject) => {\n let req = http.get(url.toString());\n if(useEtag && etagCache.hasOwnProperty(key)){\n const { etag } = etagCache[key];\n if(etag){\n req.set('If-None-Match', etag)\n }\n }\n\n req.timeout({\n response: 60000,\n deadline: 60000,\n })\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key, useEtag))\n\n schedule(key, req);\n });\n};\n\nexport const putRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => ( dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n http.put(url.toString())\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject))\n });\n};\n\nexport const deleteRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params) => (dispatch, state) => {\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n if(payload == null)\n payload = {};\n\n http.delete(url)\n .send(payload)\n .end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postRequest = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n payload,\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n let request = http.post(url);\n\n if(payload != null)\n request.send(payload);\n else // to be a simple CORS request\n request.set('Content-Type', 'text/plain');\n\n request.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const postFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.post(url)\n .attach('file', file);\n\n normalizeFormDataPayload(req, fileMetadata);\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const putFile = (\n requestActionCreator,\n receiveActionCreator,\n endpoint,\n file = null,\n fileMetadata = {},\n errorHandler = defaultErrorHandler,\n requestActionPayload = {}\n) => (params = {}) => (dispatch, state) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n if(requestActionCreator && typeof requestActionCreator === 'function')\n dispatch(requestActionCreator(requestActionPayload));\n\n return new Promise((resolve, reject) => {\n\n const req = http.put(url);\n\n if(file != null){\n req.attach('file', file);\n }\n\n normalizeFormDataPayload(req, fileMetadata)\n\n req.end(responseHandler(dispatch, state, receiveActionCreator, errorHandler, resolve, reject));\n });\n};\n\nexport const defaultErrorHandler = (err, res) => (dispatch) => {\n let body = res.body;\n let text = '';\n if(body instanceof Object){\n if(body.hasOwnProperty('message'))\n text = body.message;\n }\n Swal.fire(res.statusText, text, \"error\");\n}\n\nconst byLowerCase = toFind => value => toLowerCase(value) === toFind;\nconst toLowerCase = value => value.toLowerCase();\nconst getKeys = headers => Object.keys(headers);\n\nexport const getHeaderCaseInsensitive = (headerName, headers = {}) => {\n const key = getKeys(headers).find(byLowerCase(headerName));\n return key ? headers[key] : undefined;\n};\n\nexport const responseHandler = ( dispatch, state, receiveActionCreator, errorHandler, resolve, reject, key = null, useEtag= false ) =>\n\n (err, res) => {\n\n if (err || !res.ok) {\n let code = err.status;\n\n if(code === 304 && etagCache.hasOwnProperty(key) && useEtag){\n const { body } = etagCache[key];\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: body}));\n return resolve({response: body});\n }\n\n dispatch(receiveActionCreator);\n return resolve({response: body});\n }\n if(errorHandler) {\n errorHandler(err, res)(dispatch, state);\n }\n return reject({ err, res, dispatch, state })\n }\n\n let json = res.body;\n\n if(useEtag) {\n const responseETAG = getHeaderCaseInsensitive('etag', res.headers);\n if (responseETAG) {\n etagCache[key] = { etag: responseETAG, body: json};\n }\n }\n\n if(typeof receiveActionCreator === 'function') {\n dispatch(receiveActionCreator({response: json}));\n return resolve({response: json});\n }\n dispatch(receiveActionCreator);\n return resolve({response: json});\n}\n\n\nexport const fetchErrorHandler = (response) => {\n let code = response.status;\n let msg = response.statusText;\n\n switch (code) {\n case 403:\n Swal.fire(\"ERROR\", T.translate(\"errors.user_not_authz\"), \"warning\");\n break;\n case 401:\n Swal.fire(\"ERROR\", T.translate(\"errors.session_expired\"), \"error\");\n break;\n case 412:\n Swal.fire(\"ERROR\", msg, \"warning\");\n case 500:\n Swal.fire(\"ERROR\", T.translate(\"errors.server_error\"), \"error\");\n }\n}\n\nexport const fetchResponseHandler = (response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.json();\n }\n}\n\nexport const showMessage = (settings, callback = null) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire(settings).then((result) => {\n if (result.value && typeof callback === 'function') {\n callback();\n }\n });\n}\n\nexport const showSuccessMessage = (html) => (dispatch) => {\n dispatch(stopLoading());\n Swal.fire({\n title: T.translate(\"general.done\"),\n html: html,\n type: 'success'\n });\n}\n\nexport const downloadFileByContent = (filename, content, mime) => {\n let link = document.createElement('a');\n link.textContent = 'download';\n link.download = filename;\n link.href = `data:${mime},${encodeURIComponent(content)}`\n document.body.appendChild(link); // Required for FF\n link.click();\n document.body.removeChild(link);\n}\n\nexport const getCSV = (endpoint, params, filename, header = null) => (dispatch) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n dispatch(startLoading());\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n dispatch(stopLoading());\n\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n downloadFileByContent(filename, csv, 'text/csv;charset=utf-8');\n })\n .catch(fetchErrorHandler);\n};\n\nexport const getRawCSV = (endpoint, params, header = null) => {\n\n let url = URI(endpoint);\n\n if(!isObjectEmpty(params))\n url = url.query(params);\n\n return fetch(url.toString())\n .then((response) => {\n if (!response.ok) {\n throw response;\n } else {\n return response.text();\n }\n })\n .then((csv) => {\n if (header) {\n csv = header + '\\r\\r' + csv;\n }\n\n return csv;\n })\n .catch(fetchErrorHandler);\n};\n\nexport const escapeFilterValue = (value) => {\n value = String(value);\n // escape backslash first so you don't accidentally break your own escapes\n value = value.replace(/\\\\/g, \"\\\\\\\\\");\n value = value.replace(/,/g, \"\\\\,\");\n value = value.replace(/;/g, \"\\\\;\");\n // especial case for literal +\n value = value.replace(/\\+/g, \"%2B\");\n return value;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"spark-md5\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/sha256\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-base64url\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"crypto-js/enc-hex\");","import SparkMD5 from \"spark-md5\";\n\n// limit of Crypto.getRandomValues()\n// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\nconst MAX_BYTES = 65536\n// Node supports requesting up to this number of bytes\n// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48\nconst MAX_UINT32 = 4294967295\nconst crypto = typeof window !== 'undefined' ? (window.crypto || window.msCrypto) : null;\nimport sha256 from 'crypto-js/sha256';\nimport Base64url from 'crypto-js/enc-base64url'\nimport Hex from 'crypto-js/enc-hex'\nexport const getRandomBytes = (size) => {\n // phantomjs needs to throw\n if (size > MAX_UINT32) throw new RangeError('requested too many random bytes')\n const bytes = Buffer.allocUnsafe(size)\n if(!crypto) return a;\n if (size > 0) { // getRandomValues fails on IE if size == 0\n if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues\n // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n for (let generated = 0; generated < size; generated += MAX_BYTES) {\n // buffer.slice automatically checks if the end is past the end of\n // the buffer so we don't have to here\n crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES))\n }\n } else {\n crypto.getRandomValues(bytes)\n }\n }\n return bytes\n}\n\nexport const getSHA256 = (message, format = 'hex') => {\n\n let f = Hex;\n if(format === 'Base64url')\n f = Base64url;\n\n return sha256(message).toString(f);\n}\n\nexport const getMD5 = (file) => {\n return new Promise((resolve, reject) => {\n const chunkSize = 2 * 1024 * 1024; // 2 MB by chunk\n const spark = new SparkMD5.ArrayBuffer();\n const fileReader = new FileReader();\n let cursor = 0;\n\n fileReader.onload = e => {\n spark.append(e.target.result); \n cursor += chunkSize;\n\n if (cursor < file.size) {\n readNextChunk();\n } else {\n resolve(spark.end()); // final MD5\n }\n };\n\n fileReader.onerror = () => reject(\"Error reading the file\");\n\n function readNextChunk() {\n const slice = file.slice(cursor, cursor + chunkSize);\n fileReader.readAsArrayBuffer(slice);\n }\n\n readNextChunk();\n });\n}","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport moment from 'moment-timezone';\nimport URI from \"urijs\";\n\nexport const findElementPos = (obj) => {\n var curtop = -70;\n if (obj.offsetParent) {\n do {\n curtop += obj.offsetTop;\n } while (obj = obj.offsetParent);\n return [curtop];\n }\n};\n\nexport const epochToMoment = (atime) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime);\n};\n\nexport const epochToMomentTimeZone = (atime, time_zone) => {\n if(!atime) return atime;\n atime = atime * 1000;\n return moment(atime).tz(time_zone);\n};\n\nexport const formatEpoch = (atime, format = 'M/D/YYYY h:mm a') => {\n if(!atime) return atime;\n return epochToMoment(atime).format(format);\n};\n\nexport const parseLocationHour = (hour) => {\n let parsedHour = hour.toString();\n if(parsedHour.length < 4) parsedHour = `0${parsedHour}`;\n parsedHour = parsedHour.match(/.{2}/g);\n parsedHour = parsedHour.join(':');\n return parsedHour;\n}\n\nexport const objectToQueryString = (obj) => {\n var str = \"\";\n for (var key in obj) {\n if (str != \"\") {\n str += \"&\";\n }\n str += key + \"=\" + encodeURIComponent(obj[key]);\n }\n\n return str;\n};\n\nexport const getBackURL = () => {\n let url = URI(window.location.href);\n let query = url.search(true);\n let fragment = url.fragment();\n let backUrl = query.hasOwnProperty('BackUrl') ? query['BackUrl'] : null;\n if(backUrl != null && fragment != null && fragment != ''){\n backUrl += `#${fragment}`;\n }\n return backUrl;\n};\n\nexport const toSlug = (text) =>{\n text = text.toLowerCase();\n return text.replace(/[^a-zA-Z0-9]+/g,'_');\n}\n\nexport const getAuthCallback = () => {\n if(typeof window !== 'undefined') {\n return `${window.location.origin}/auth/callback`;\n }\n return null;\n};\n\nexport const getCurrentLocation = () => {\n let location = '';\n if(typeof window !== 'undefined') {\n location = window.location;\n // check if we are on iframe\n if (window.top)\n location = window.top.location;\n }\n return location;\n};\n\nexport const getOrigin = () => {\n if(typeof window !== 'undefined') {\n return window.location.origin;\n }\n return null;\n};\n\nexport const getCurrentPathName = () => {\n if(typeof window !== 'undefined') {\n return window.location.pathname;\n }\n return null;\n};\n\nexport const getCurrentHref = () => {\n if(typeof window !== 'undefined') {\n return window.location.href;\n }\n return null;\n};\n\nexport const getAllowedUserGroups = () => {\n if(typeof window !== 'undefined') {\n return window.ALLOWED_USER_GROUPS || '';\n }\n return null;\n};\n\nexport const buildAPIBaseUrl = (relativeUrl) => {\n if(typeof window !== 'undefined'){\n return `${window.API_BASE_URL}${relativeUrl}`;\n }\n return null``;\n};\n\nexport const putOnLocalStorage = (key, value) => {\n if(typeof window !== 'undefined') {\n window.localStorage.setItem(key, value);\n }\n};\n\nexport const getFromLocalStorage = (key, removeIt) => {\n if(typeof window !== 'undefined') {\n let val = window.localStorage.getItem(key);\n if(removeIt){\n console.log(`getFromLocalStorage removing key ${key}`);\n removeFromLocalStorage(key);\n }\n return val;\n }\n return null;\n};\n\nexport const removeFromLocalStorage = (key) => {\n if(typeof window !== 'undefined') {\n window.localStorage.removeItem(key);\n }\n}\n\nexport const isClearingSessionState = () => {\n if(typeof window !== 'undefined') {\n return window.clearing_session_state;\n }\n return false;\n};\n\nexport const setSessionClearingState = (val) => {\n if(typeof window !== 'undefined') {\n window.clearing_session_state = val;\n }\n};\n\nexport const getCurrentUserLanguage = () => {\n let language = 'en';\n if(typeof navigator !== 'undefined') {\n language = (navigator.languages && navigator.languages[0]) || navigator.language || navigator.userLanguage;\n }\n return language;\n};\n\nexport const scrollToError = (errors) => {\n if(Object.keys(errors).length > 0) {\n const firstError = Object.keys(errors)[0];\n const firstNode = document.getElementById(firstError);\n if (firstNode) window.scrollTo(0, findElementPos(firstNode));\n }\n};\n\nexport const hasErrors = (field, errors) => {\n if(field in errors) {\n return errors[field];\n }\n return '';\n};\n\nexport const shallowEqual = (object1, object2) => {\n const keys1 = Object.keys(object1);\n const keys2 = Object.keys(object2);\n\n if (keys1.length !== keys2.length) {\n return false;\n }\n\n for (let key of keys1) {\n if (object1[key] !== object2[key]) {\n return false;\n }\n }\n\n return true;\n};\n\nexport const arraysEqual = (a1, a2) =>\n a1.length === a2.length && a1.every((o, idx) => shallowEqual(o, a2[idx]));\n\nexport const isEmpty = (obj) => {\n return Object.keys(obj).length === 0;\n};\n\n\nexport const base64URLEncode = (str) => {\n return str\n .toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '')\n}\n\nexport const retryPromise = async (\n cb,\n maxNumberOfRetries = 3\n) => {\n for (let i = 0; i < maxNumberOfRetries; i++) {\n if (await cb()) {\n return true;\n }\n }\n\n return false;\n}\n\nexport const getTimeServiceUrl = () => {\n if(typeof window !== 'undefined') {\n return window.TIMEINTERVALSINCE1970_API_URL || process.env.TIMEINTERVALSINCE1970_API_URL;\n }\n return null;\n};\n\nexport const getEventLocation = (event, summitVenueCount, summitShowLocDate = null, nowUtc = null) => {\n const shouldShowVenues = (summitShowLocDate && nowUtc) ? summitShowLocDate * 1000 < nowUtc : true;\n const locationName = [];\n const { location } = event;\n\n if (!shouldShowVenues) return 'TBA';\n\n if (!location) return 'TBA';\n\n if (summitVenueCount > 1 && location.venue?.name) locationName.push(location.venue.name);\n if (location.floor?.name) locationName.push(location.floor.name);\n if (location.name) locationName.push(location.name);\n\n return locationName.length > 0 ? locationName.join(' - ') : 'TBA';\n};\n\nexport const getEventHosts = (event) => {\n let hosts = [];\n if (event.speakers?.length > 0) {\n hosts = [...event.speakers];\n }\n if (event.moderator) hosts.push(event.moderator);\n\n return hosts;\n};\n\nconst loadImage = async url => {\n const img = document.createElement('img')\n img.src = url\n img.crossOrigin = 'anonymous'\n\n return new Promise((resolve, reject) => {\n img.onload = () => resolve(img)\n img.onerror = reject\n })\n}\n\nexport const convertSVGtoImg = async (svgUrl) => {\n const img = await loadImage(svgUrl)\n const newWidth = 100\n const newHeight = Math.floor(img.naturalHeight * 100 / img.naturalWidth)\n\n const canvas = document.createElement('canvas')\n canvas.width = newWidth\n canvas.height = newHeight\n canvas.getContext('2d').drawImage(img, 0, 0, newWidth, newHeight)\n\n const url = await canvas.toDataURL(`image/png`, 1.0)\n console.log(url, newWidth, newHeight);\n return {url, width: newWidth, height: newHeight}\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"lodash/debounce\");","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport { fetchErrorHandler, fetchResponseHandler, escapeFilterValue } from \"./actions\";\nimport { getAccessToken } from '../components/security/methods';\nimport { buildAPIBaseUrl } from \"./methods\";\nimport debounce from 'lodash/debounce';\nexport const RECEIVE_COUNTRIES = 'RECEIVE_COUNTRIES';\nconst callDelay = 500; // milliseconds\nimport URI from \"urijs\";\nURI.escapeQuerySpace = false;\nexport const DEFAULT_PAGE_SIZE = 10;\n\nconst _fetchPublic = async (endpoint, callback, options = {}) => {\n return fetch(buildAPIBaseUrl(endpoint.toString()), options)\n .then(fetchResponseHandler)\n .then((json) => {\n if(typeof callback === 'function')\n callback(json.data);\n })\n .catch(response => {\n const code = response && response.status;\n if (code === 404 && typeof callback === 'function') callback([]);\n return response;\n })\n .catch(fetchErrorHandler);\n}\n\n/**\n * @param endpoint\n * @param callback\n * @param options\n * @returns {Promise}\n * @private\n */\nconst _fetch = async (endpoint, callback, options = {}) => {\n\n let accessToken;\n\n try {\n accessToken = await getAccessToken();\n } catch (e) {\n // The caller is told through its callback; the query* functions do not\n // await this promise, so rejecting here would only surface as an\n // unhandled rejection.\n if(typeof callback === 'function')\n callback(e);\n return;\n }\n\n endpoint.addQuery('access_token', accessToken);\n\n return _fetchPublic(endpoint, callback, options);\n}\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryMembers = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/members`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n *\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryAttendees = debounce(async (summitId, input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n \n let endpoint = URI(`/api/v1/summits/${summitId}/attendees`);\n \n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n \n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name=@${input},email=@${input}`);\n }\n \n _fetch(endpoint, callback);\n \n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySummits = debounce(async (input, callback, per_page= DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/all`);\n\n endpoint.addQuery('expand', `tickets,rsvp,schedule_summit_events,all_affiliations`);\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySpeakers = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE ) => {\n\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/speakers`:`speakers`}`);\n\n endpoint.addQuery('expand', `member,registration_request`);\n endpoint.addQuery('order','first_name,last_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `full_name@@${input},first_name@@${input},last_name@@${input},email@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTags = debounce(async (summitId, input, callback, per_page = 50) => {\n\n let endpoint = URI(`/api/v1/${summitId ? `summits/${summitId}/track-tag-groups/all/allowed-tags`:`tags`}`);\n\n if(summitId)\n endpoint.addQuery('expand', `tag,track_tag_group`);\n\n endpoint.addQuery('order','tag');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `tag@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTracks = debounce(async (summitId, input, callback, excludedIds = [], per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/tracks`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if (excludedIds?.length > 0) {\n endpoint.addQuery('filter[]', `not_id==${excludedIds.join(\"||\")}`);\n }\n\n if (input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryTrackGroups = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/track-groups`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=, *): Promise)|*>}\n */\nexport const queryEvents = debounce(async (summitId, input, onlyPublished = false, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/events` + (onlyPublished ? '/published' : ''));\n\n endpoint.addQuery('order','title');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=, *=): Promise)|*>}\n */\nexport const queryEventTypes = debounce(async (summitId, input, callback, eventTypeClassName = null, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/event-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n if (eventTypeClassName) {\n eventTypeClassName = escapeFilterValue(eventTypeClassName);\n endpoint.addQuery('filter[]', `class_name==${eventTypeClassName}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryGroups = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/groups`);\n\n endpoint.addQuery('order','title,code');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `title@@${input},code@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryCompanies = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/companies`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryRegistrationCompanies = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/registration-companies`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsors = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type')\n endpoint.addQuery('order','id')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const querySponsorsWithBadgeScans = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/sponsors`);\n\n endpoint.addQuery('expand','company,sponsorship,sponsorship.type');\n endpoint.addQuery('fields','id,company.name,sponsorship.type.name');\n endpoint.addQuery('relations','none,company.none,sponsorship.type.none');\n endpoint.addQuery('filter[]','badge_scans_count>0');\n endpoint.addQuery('order','+company_name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `company_name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryAccessLevels = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/summits/${summitId}/access-level-types`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const queryOrganizations = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/v1/organizations`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\nexport const getLanguageList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/languages`), callback, { signal });\n};\n\nexport const getCountryList = (callback, signal) => {\n return _fetchPublic(new URI(`/api/public/v1/countries`), callback, { signal });\n};\n\nlet geocoder;\n\nexport const geoCodeAddress = (address) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\nexport const geoCodeLatLng = (lat, lng) => {\n\n if (!geocoder) geocoder = new google.maps.Geocoder();\n\n let latlng = {lat: parseFloat(lat), lng: parseFloat(lng)};\n // return a Promise\n return new Promise(function(resolve,reject) {\n geocoder.geocode( { 'location': latlng}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n // resolve results upon a successful status\n resolve(results);\n } else {\n // reject status upon un-successful status\n reject(status);\n }\n });\n });\n};\n\n/**\n * @type {DebouncedFunc<(function(*, *=, *, *=, *=): Promise)|*>}\n */\nexport const queryTicketTypes = debounce(async (summitId, filters = {}, callback, version = 'v1', per_page = DEFAULT_PAGE_SIZE) => {\n\n let endpoint = URI(`/api/${version}/summits/${summitId}/ticket-types`);\n\n endpoint.addQuery('order','name');\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(filters.hasOwnProperty('name')) {\n const name = escapeFilterValue(filters.name);\n if(name && name != '')\n endpoint.addQuery('filter[]', `name@@${name}`);\n }\n\n if(filters.hasOwnProperty('audience')){\n const audience = escapeFilterValue(filters.audience);\n if(audience && audience != '')\n endpoint.addQuery('filter[]', `audience==${audience}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *=): Promise)|*>}\n */\nexport const querySponsoredProjects = debounce(async (input, callback, per_page = DEFAULT_PAGE_SIZE) => {\n\n\n const endpoint = URI(`/api/v1/sponsored-projects`);\n\n endpoint.addQuery('order','name')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `name@@${input}`);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n\n/**\n * @type {DebouncedFunc<(function(*, *, *, *=): Promise)|*>}\n */\nexport const queryPromocodes = debounce(async (summitId, input, callback, per_page = DEFAULT_PAGE_SIZE, extraFilters = []) => {\n\n\n let endpoint = URI(`/api/v1/summits/${summitId}/promo-codes`);\n\n endpoint.addQuery('order','code')\n endpoint.addQuery('page', 1);\n endpoint.addQuery('per_page', per_page);\n\n if(input) {\n input = escapeFilterValue(input);\n endpoint.addQuery('filter[]', `code@@${input}`);\n }\n\n //eg: filter = 'class_name==SummitRegistrationPromoCode'\n for (const filter of extraFilters) {\n endpoint.addQuery('filter[]', filter);\n }\n\n _fetch(endpoint, callback);\n\n}, callDelay);\n","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"i18n-react/dist/i18n-react\");","module.exports = require(\"idtoken-verifier\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","module.exports = require(\"react-select\");","module.exports = require(\"superagent/lib/client\");","module.exports = require(\"sweetalert2\");","module.exports = require(\"urijs\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2018 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport Select from 'react-select';\nimport {getCountryList} from '../../utils/query-actions';\n\nexport default class CountryInput extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n options: []\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.setOptions = this.setOptions.bind(this);\n\n }\n\n setOptions(response) {\n let countryList = response.map(c => ({label: c.name, value: c.iso_code}));\n this.setState({options: countryList});\n }\n\n componentDidMount() {\n getCountryList(this.setOptions).catch(e => {\n console.log(\"Error getting countries: \", e);\n this.setState({options: []});\n });\n }\n\n handleChange(value) {\n let isMulti = (this.props.hasOwnProperty('multi'));\n let theValue = null;\n\n if (isMulti) {\n theValue = value.map(v => v.value);\n } else {\n theValue = value.value;\n }\n\n let ev = {target: {\n id: this.props.id,\n value: theValue,\n type: 'countryinput'\n }};\n\n this.props.onChange(ev);\n }\n\n render() {\n let {value, onChange, id, multi, error, ...rest} = this.props;\n let {options} = this.state;\n let isMulti = (this.props.hasOwnProperty('multi'));\n let theValue = null;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n\n if (isMulti) {\n theValue = options.filter(op => value.includes(op.value));\n } else {\n theValue = (value instanceof Object || value == null) ? value : options.find(opt => opt.value == value);\n }\n\n return (\n \n
\n {has_error &&\n
{error}
\n }\n
\n );\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","AUTH_ERROR_MISSING_AUTH_INFO","AUTH_ERROR_MISSING_REFRESH_TOKEN","AUTH_ERROR_ACCESS_TOKEN_EXPIRED","AUTH_ERROR_LOCK_ACQUIRE_ERROR","AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR","AUTH_ERROR_REFRESH_TOKEN_NETWORK_ERROR","require","Lock","SuperTokensLock","GET_TOKEN_SILENTLY_LOCK_KEY","RESPONSE_TYPE_CODE","AUTH_INFO","ID_TOKEN","processRefreshToken","async","flow","refreshToken","useOAuth2RefreshToken","clearAuthInfo","Error","response","fn","maxRetries","baseDelayMs","attempt","err","message","startsWith","delay","Math","pow","console","log","Promise","resolve","setTimeout","retryWithBackoff","refreshAccessToken","access_token","expires_in","refresh_token","id_token","storeAuthInfo","_getAccessToken","authInfo","getAuthInfo","accessToken","expiresIn","accessTokenUpdatedAt","getOAuth2Flow","now","moment","unix","timeElapsedSecs","ACCESS_TOKEN_RESOLVER_KEY","Symbol","for","getAccessToken","resolveAccessToken","globalThis","navigator","locks","request","lock","retryPromise","acquireLock","releaseLock","baseUrl","getOAuth2IDPBaseUrl","oauth2ClientId","getOAuth2ClientId","payload","encodeURI","controller","AbortController","timeoutId","abort","json","fetch","method","headers","body","JSON","stringify","signal","networkError","clearTimeout","ok","status","statusText","setSessionClearingState","parseError","new_refresh_token","idToken","formerAuthInfo","floor","Date","Cookies","secure","sameSite","putOnLocalStorage","res","getFromLocalStorage","parse","window","removeFromLocalStorage","OAUTH2_CLIENT_ID","OAUTH2_FLOW","Boolean","OAUTH2_USE_REFRESH_TOKEN","IDP_BASE_URL","URI","createAction","type","fetchErrorHandler","code","msg","Swal","T","fetchResponseHandler","escapeFilterValue","value","String","replace","crypto","msCrypto","buildAPIBaseUrl","relativeUrl","API_BASE_URL","key","localStorage","setItem","removeIt","val","getItem","removeItem","clearing_session_state","cb","maxNumberOfRetries","i","callDelay","_fetchPublic","endpoint","callback","options","toString","then","data","catch","_fetch","e","addQuery","getCountryList","debounce","input","per_page","DEFAULT_PAGE_SIZE","summitId","excludedIds","length","join","onlyPublished","eventTypeClassName","filters","version","hasOwnProperty","name","audience","extraFilters","filter","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","Object","defineProperty","enumerable","get","obj","prop","prototype","call","r","toStringTag","CountryInput","React","constructor","props","super","state","handleChange","bind","setOptions","countryList","map","c","label","iso_code","setState","componentDidMount","theValue","v","ev","target","id","onChange","render","_this$props","multi","error","rest","_objectWithoutProperties","_excluded","isMulti","has_error","op","includes","find","opt","Select","_extends","className"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/datetimepicker.js b/lib/components/inputs/datetimepicker.js
new file mode 100644
index 00000000..f2c21397
--- /dev/null
+++ b/lib/components/inputs/datetimepicker.js
@@ -0,0 +1,2 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},5812:e=>{e.exports=require("moment-timezone")},2015:e=>{e.exports=require("react")}},t={};function r(o){var i=t[o];if(void 0!==i)return i.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};r.r(o),r.d(o,{default:()=>O});var i=r(6031),a=r.n(i),n=r(1116),s=r.n(n),p=r(2462),l=r.n(p),u=r(2015),d=r.n(u);const c=require("react-datetime");var f=r.n(c),h=r(5812),m=r.n(h);const b=["onChange","id","value","format","error","inputProps","disabled"];function v(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function y(e){for(var t=1;t"==i)return e.isAfter(m().tz(1e3*a,r));if(">="==i)return e.isSameOrAfter(m().tz(1e3*a,r));{let t=m().tz(1e3*i,r).subtract(1,"day"),o=m().tz(1e3*a,r);return e.isAfter(t)&&e.isBefore(o)}}render(){let e=void 0!==this.props.validation,t=this.props,{onChange:r,id:o,value:i,format:n,error:s,inputProps:p,disabled:u}=t,c=l()(t,b),h=this.props.hasOwnProperty("error")&&""!=s,m="form-control "+(h?"error":""),v=!!this.props.hasOwnProperty("disabled")&&u;return d().createElement("div",null,e?d().createElement(f(),a()({isValidDate:this.isValidDate,onChange:this.handleChange,dateFormat:n.date,timeFormat:n.time,value:this.state.value,inputProps:y(y({},p),{},{id:o,className:m,disabled:v,autoComplete:"off"})},c)):d().createElement(f(),a()({onChange:this.handleChange,dateFormat:n.date,timeFormat:n.time,value:this.state.value,inputProps:y(y({},p),{},{id:o,className:m,disabled:v,autoComplete:"off"})},c)),h&&d().createElement("p",{className:"error-label"},s))}}return o})()));
+//# sourceMappingURL=datetimepicker.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/datetimepicker.js.map b/lib/components/inputs/datetimepicker.js.map
new file mode 100644
index 00000000..48710b1f
--- /dev/null
+++ b/lib/components/inputs/datetimepicker.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/datetimepicker.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,mCCTTH,EAAOD,QAAUK,QAAQ,wC,WCAzBJ,EAAOD,QAAUK,QAAQ,iC,WCAzBJ,EAAOD,QAAUK,QAAQ,iD,WCAzBJ,EAAOD,QAAUK,QAAQ,kB,WCAzBJ,EAAOD,QAAUK,QAAQ,Q,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP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,WAAYhC,EAAOH,KACnBoC,WAAYjC,EAAOkC,KACnBpD,MAAO5B,KAAKkC,MAAMN,MAClBwC,WAAUa,EAAAA,EAAA,GAAMb,GAAU,IAAEnB,GAAIA,EAAIyB,UAAWA,EAAWL,SAAUM,EAAeO,aAAc,SAC7FZ,IAGRxC,IAAAA,cAAC8C,IAAQC,IAAA,CACL1B,SAAUnD,KAAKmC,aACf2C,WAAYhC,EAAOH,KACnBoC,WAAYjC,EAAOkC,KACnBpD,MAAO5B,KAAKkC,MAAMN,MAClBwC,WAAUa,EAAAA,EAAA,GAAMb,GAAU,IAAEnB,GAAIA,EAAIyB,UAAWA,EAAWL,SAAUM,EAAeO,aAAc,SAC7FZ,IAIXG,GACD3C,IAAAA,cAAA,KAAG4C,UAAU,eAAeP,GAIxC,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"moment-timezone\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"react-datetime\"","webpack://openstack-uicore-foundation/./src/components/inputs/datetimepicker/index.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"moment-timezone\");","module.exports = require(\"react\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-datetime\");","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport './datetimepicker.less';\nimport Datetime from 'react-datetime';\nimport moment from 'moment-timezone';\n\nexport default class DateTimePicker extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.state = {\n value: props.value\n };\n\n this.handleChange = this.handleChange.bind(this);\n this.isValidDate = this.isValidDate.bind(this);\n }\n\n componentDidUpdate(prevProps, prevState, snapshot) {\n if (this.props.value !== prevProps.value) {\n this.setState({value: this.props.value})\n }\n }\n\n handleChange(date) {\n\n let { timezone } = this.props;\n\n if (date && moment.isMoment(date)) {\n date = moment.tz(date.format('YYYY-MM-DD HH:mm:ss'), timezone)\n } else if (date === '') {\n date = moment(0);\n }\n\n let ev = {target: {\n id: this.props.id,\n value: date,\n type: 'datetime'\n }};\n\n if (date && moment.isMoment(date)) {\n this.props.onChange(ev);\n }\n\n }\n\n isValidDate(currentDate, selectedDate) {\n let { timezone, validation } = this.props;\n let {after, before} = validation;\n\n if (after == '<')\n return (currentDate.isBefore(moment.tz(before * 1000, timezone)));\n else if(after == '<=')\n return (currentDate.isSameOrBefore(moment.tz(before * 1000, timezone)));\n else if(after == '>')\n return (currentDate.isAfter(moment.tz(before * 1000, timezone)));\n else if(after == '>=')\n return (currentDate.isSameOrAfter(moment.tz(before * 1000, timezone)));\n else {\n let afterDate = moment.tz(after * 1000, timezone).subtract(1, 'day');\n let beforeDate = moment.tz(before * 1000, timezone);\n return currentDate.isAfter(afterDate) && currentDate.isBefore(beforeDate);\n }\n }\n\n render() {\n let validate = (typeof this.props.validation != 'undefined');\n let {onChange, id, value, format, error, inputProps, disabled, ...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let className = 'form-control ' + (has_error ? 'error' : '');\n let inputDisabled = (this.props.hasOwnProperty('disabled')) ? disabled : false;\n\n return (\n \n {validate ? (\n
\n ) : (\n
\n )}\n\n {has_error &&\n
{error}
\n }\n
\n );\n }\n}\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","DateTimePicker","React","constructor","props","super","state","handleChange","bind","isValidDate","componentDidUpdate","prevProps","prevState","snapshot","setState","date","timezone","moment","format","ev","target","id","type","onChange","currentDate","selectedDate","validation","after","before","isBefore","isSameOrBefore","isAfter","isSameOrAfter","afterDate","subtract","beforeDate","render","validate","_this$props","error","inputProps","disabled","rest","_objectWithoutProperties","_excluded","has_error","className","inputDisabled","Datetime","_extends","dateFormat","timeFormat","time","_objectSpread","autoComplete"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/dropdown.js b/lib/components/inputs/dropdown.js
new file mode 100644
index 00000000..ab3d5ba9
--- /dev/null
+++ b/lib/components/inputs/dropdown.js
@@ -0,0 +1,2 @@
+!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],r):"object"==typeof exports?exports["openstack-uicore-foundation"]=r():e["openstack-uicore-foundation"]=r()}(this,(()=>(()=>{"use strict";var e={1116:e=>{e.exports=require("@babel/runtime/helpers/defineProperty")},6031:e=>{e.exports=require("@babel/runtime/helpers/extends")},2462:e=>{e.exports=require("@babel/runtime/helpers/objectWithoutProperties")},2015:e=>{e.exports=require("react")},8466:e=>{e.exports=require("react-select")}},r={};function t(o){var n=r[o];if(void 0!==n)return n.exports;var a=r[o]={exports:{}};return e[o](a,a.exports,t),a.exports}(()=>{t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r}})(),(()=>{t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})}})(),(()=>{t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r)})(),(()=>{t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var o={};t.r(o),t.d(o,{default:()=>O});var n=t(6031),a=t.n(n),l=t(1116),s=t.n(l),i=t(2462),p=t.n(i),u=t(2015),c=t.n(u),d=t(8466),b=t.n(d);const h=["onChange","value","className","error","clearable","disabled","overrideCSS","ariaLabelledBy"];function f(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function y(e){for(var r=1;re.value)):null:e?e.value:null;let t={target:{id:this.props.id,value:r,type:"dropdown"}};this.props.onChange(t)}render(){let e=this.props,{onChange:r,value:t,className:o,error:n,clearable:l,disabled:s,overrideCSS:i,ariaLabelledBy:u}=e,d=p()(e,h),f=this.props.hasOwnProperty("error")&&""!=n,O=this.props.hasOwnProperty("clearable"),m=this.props.hasOwnProperty("disabled")&&1==s,v=null,g=o;this.props.hasOwnProperty("overrideCSS")&&0!=i||(g="dropdown "+o+" "+(f?"error":"")),v=this.props.isMulti?this.props.options.filter((e=>t.includes(e.value))):t instanceof Object||null==t?t:this.props.options.find((e=>e.value==t));const j={menu:e=>y(y({},e),{},{zIndex:999})};return c().createElement("div",null,c().createElement(b(),a()({className:g,value:v,onChange:this.handleChange,isClearable:O,isDisabled:m,styles:j,"aria-labelledby":u,formatOptionLabel:e=>c().createElement("span",{dangerouslySetInnerHTML:{__html:e.label}})},d)),f&&c().createElement("p",{className:"error-label"},n))}}return O.defaultProps={ariaLabelledBy:null},o})()));
+//# sourceMappingURL=dropdown.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/dropdown.js.map b/lib/components/inputs/dropdown.js.map
new file mode 100644
index 00000000..106f2b1d
--- /dev/null
+++ b/lib/components/inputs/dropdown.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/dropdown.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,mCCTTH,EAAOD,QAAUK,QAAQ,wC,WCAzBJ,EAAOD,QAAUK,QAAQ,iC,WCAzBJ,EAAOD,QAAUK,QAAQ,iD,WCAzBJ,EAAOD,QAAUK,QAAQ,Q,WCAzBJ,EAAOD,QAAUK,QAAQ,e,GCCrBC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaT,QAGrB,IAAIC,EAASK,EAAyBE,GAAY,CAGjDR,QAAS,CAAC,GAOX,OAHAW,EAAoBH,GAAUP,EAAQA,EAAOD,QAASO,GAG/CN,EAAOD,OACf,C,MCrBAO,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdN,EAAoBQ,EAAI,CAACf,EAASiB,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEnB,EAASkB,IAC5EE,OAAOC,eAAerB,EAASkB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,C,WCNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,E,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A,IAGhH,MAAMuC,EAAe,CAAEC,KAAMC,GAAMC,EAAAA,EAAA,GAAUD,GAAM,IAAEE,OAAQ,OAE7D,OACIzC,IAAAA,cAAA,WACIA,IAAAA,cAAC0C,IAAMC,IAAA,CACH1B,UAAWa,EACXhC,MAAO+B,EACPf,SAAU5C,KAAKkC,aACfuB,YAAaA,EACbC,WAAYA,EACZW,OAAQF,EACR,kBAAiBf,EACjBsB,kBAAoBC,GAAS7C,IAAAA,cAAA,QAAM8C,wBAAyB,CAAEC,OAAQF,EAAKG,UACvEzB,IAEPG,GACD1B,IAAAA,cAAA,KAAGiB,UAAU,eAAeC,GAKxC,E,OAGJnB,EAASkD,aAAe,CACpB3B,eAAiB,M","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/defineProperty\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-select\"","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/./src/components/inputs/dropdown.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","module.exports = require(\"@babel/runtime/helpers/extends\");","module.exports = require(\"@babel/runtime/helpers/objectWithoutProperties\");","module.exports = require(\"react\");","module.exports = require(\"react-select\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React from 'react';\nimport Select from 'react-select';\n\nexport default class Dropdown extends React.Component {\n\n constructor(props) {\n super(props);\n\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange(selection) {\n\n let value = null;\n if (this.props.isMulti) {\n value = selection ? selection.map(val => val.value) : null;\n } else {\n value = selection ? selection.value : null;\n }\n\n let ev = {target: {\n id: this.props.id,\n value: value,\n type: 'dropdown'\n }};\n\n this.props.onChange(ev);\n }\n\n render() {\n\n let {onChange, value, className, error, clearable, disabled, overrideCSS, ariaLabelledBy, ...rest} = this.props;\n let has_error = ( this.props.hasOwnProperty('error') && error != '' );\n let isClearable = (this.props.hasOwnProperty('clearable'));\n let isDisabled = (this.props.hasOwnProperty('disabled') && disabled == true);\n let theValue = null;\n\n let selectClassName = className;\n\n if (!this.props.hasOwnProperty('overrideCSS') || overrideCSS == false) {\n selectClassName = 'dropdown ' + className + ' ' + (has_error ? 'error' : '');\n }\n\n if (this.props.isMulti) {\n theValue = this.props.options.filter(op => value.includes(op.value));\n } else {\n theValue = (value instanceof Object || value == null) ? value : this.props.options.find(opt => opt.value == value);\n }\n\n const selectStyles = { menu: styles => ({ ...styles, zIndex: 999 }) };\n\n return (\n \n
}\n {...rest}\n />\n {has_error &&\n {error}
\n }\n \n );\n\n }\n}\n\nDropdown.defaultProps = {\n ariaLabelledBy : null,\n}\n"],"names":["root","factory","exports","module","define","amd","this","require","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","Dropdown","React","constructor","props","super","handleChange","bind","selection","isMulti","map","val","ev","target","id","type","onChange","render","_this$props","className","error","clearable","disabled","overrideCSS","ariaLabelledBy","rest","_objectWithoutProperties","_excluded","has_error","isClearable","isDisabled","theValue","selectClassName","options","filter","op","includes","find","opt","selectStyles","menu","styles","_objectSpread","zIndex","Select","_extends","formatOptionLabel","data","dangerouslySetInnerHTML","__html","label","defaultProps"],"sourceRoot":""}
\ No newline at end of file
diff --git a/lib/components/inputs/editor-input-v2.js b/lib/components/inputs/editor-input-v2.js
new file mode 100644
index 00000000..19518d1a
--- /dev/null
+++ b/lib/components/inputs/editor-input-v2.js
@@ -0,0 +1,2 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("openstack-uicore-foundation",[],t):"object"==typeof exports?exports["openstack-uicore-foundation"]=t():e["openstack-uicore-foundation"]=t()}(this,(()=>(()=>{"use strict";var e={};(()=>{e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r}})(),(()=>{e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})}})(),(()=>{e.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{e.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var t={};e.r(t),e.d(t,{default:()=>d});const r=require("@babel/runtime/helpers/extends");var n=e.n(r);const o=require("@babel/runtime/helpers/objectWithoutProperties");var a=e.n(o);const l=require("react");var c=e.n(l);const u=require("react-rte");var i=e.n(u);const s=["id","value","onChange","error","className","maxLength"],m=({value:e,onSave:t})=>{const[r,n]=(0,l.useState)(e);return c().createElement(c().Fragment,null,c().createElement("textarea",{style:{width:"100%"},value:r,onChange:e=>n(e.target.value)}),c().createElement("button",{className:"btn btn-xs btn-primary",onClick:()=>t(r)},"Save"))},d=e=>{var t;let{id:r,value:o,onChange:d,error:p,className:v,maxLength:g}=e,b=a()(e,s);const[f,y]=(0,l.useState)("text"),[h,S]=(0,l.useState)((0,u.createValueFromString)(o,"html",{customBlockFn:u.getTextAlignBlockMetadata})),x=p&&""!==p,k=g-(null==h||null===(t=h.toString("html"))||void 0===t?void 0:t.length),E=e=>{S(e);let t=e.toString("html",{blockStyleFn:u.getTextAlignStyles});t="
"===t?"":t;d({target:{id:r,value:t,type:"texteditor"}})};return c().createElement("div",null,"text"===f&&c().createElement(i(),n()({id:r,className:v+" "+(x?"error":""),value:h,onChange:E,customControls:[(e,t,r)=>c().createElement(u.Button,{key:"view-code-btn",onClick:e=>{e.preventDefault(),y("text"===f?"code":"text")}},"view code")],blockStyleFn:u.getTextAlignClassName},b)),"code"===f&&c().createElement(m,{value:h.toString("html"),onSave:e=>{const t=(0,u.createValueFromString)(e,"html");E(t),y("text")}}),!!g&&c().createElement("p",null,c().createElement("i",null,"characters left: ",k)),x&&c().createElement("p",{className:"error-label"},p))};return t})()));
+//# sourceMappingURL=editor-input-v2.js.map
\ No newline at end of file
diff --git a/lib/components/inputs/editor-input-v2.js.map b/lib/components/inputs/editor-input-v2.js.map
new file mode 100644
index 00000000..963e092b
--- /dev/null
+++ b/lib/components/inputs/editor-input-v2.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"components/inputs/editor-input-v2.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,8BAA+B,GAAIH,GAChB,iBAAZC,QACdA,QAAQ,+BAAiCD,IAEzCD,EAAK,+BAAiCC,GACvC,CATD,CASGK,MAAM,I,mBCRT,IAAIC,EAAsB,CAAC,E,MCA3BA,EAAoBC,EAAKL,IACxB,IAAIM,EAASN,GAAUA,EAAOO,WAC7B,IAAOP,EAAiB,QACxB,IAAM,EAEP,OADAI,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,C,WCLdF,EAAoBI,EAAI,CAACT,EAASW,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAEb,EAASY,IAC5EE,OAAOC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IU,EAAcV,EAAYO,SAC1B,OACA,CACGI,aAAcC,EAAAA,qBAGrBF,EAA8B,gBAAhBA,EAAgC,GAAKA,EASnDzB,EAPW,CACPE,OAAQ,CACJK,GAAIA,EACJjB,MAAOmC,EACPG,KAAM,eAGF,EAmBhB,OACI/B,IAAAA,cAAA,WACc,SAATgB,GACGhB,IAAAA,cAACgC,IAAcC,IAAA,CACXvB,GAAIA,EACJJ,UAAWA,EAAY,KAAOiB,EAAY,QAAU,IACpD9B,MAAOyB,EACPf,SAAUwB,EACVO,eAAgB,CAxBTC,CAACC,EAAUC,EAAUC,IAMhCtC,IAAAA,cAACuC,EAAAA,OAAM,CAAC5D,IAAI,gBAAgB4B,QALpBH,IACZA,EAAGoC,iBACHvB,EAAiB,SAATD,EAAkB,OAAS,OAAO,GAGQ,cAmB1Ca,aAAcY,EAAAA,uBACV5B,IAGF,SAATG,GACGhB,IAAAA,cAACL,EAAQ,CAACF,MAAOyB,EAAYO,SAAS,QAAS7B,OArBvC8C,IAChB,MAAMjD,GAAQ2B,EAAAA,EAAAA,uBAAsBsB,EAAM,QAC1Cf,EAAalC,GACbwB,EAAQ,OAAO,MAoBRL,GACCZ,IAAAA,cAAA,SAAGA,IAAAA,cAAA,SAAG,oBAAkBwB,IAE3BD,GACGvB,IAAAA,cAAA,KAAGM,UAAU,eAAeK,GAE9B,E","sources":["webpack://openstack-uicore-foundation/webpack/universalModuleDefinition","webpack://openstack-uicore-foundation/webpack/bootstrap","webpack://openstack-uicore-foundation/webpack/runtime/compat get default export","webpack://openstack-uicore-foundation/webpack/runtime/define property getters","webpack://openstack-uicore-foundation/webpack/runtime/hasOwnProperty shorthand","webpack://openstack-uicore-foundation/webpack/runtime/make namespace object","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/extends\"","webpack://openstack-uicore-foundation/external commonjs \"@babel/runtime/helpers/objectWithoutProperties\"","webpack://openstack-uicore-foundation/external commonjs \"react\"","webpack://openstack-uicore-foundation/external commonjs \"react-rte\"","webpack://openstack-uicore-foundation/./src/components/inputs/editor-input-v2.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"openstack-uicore-foundation\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"openstack-uicore-foundation\"] = factory();\n\telse\n\t\troot[\"openstack-uicore-foundation\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/extends\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@babel/runtime/helpers/objectWithoutProperties\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"react-rte\");","/**\n * Copyright 2017 OpenStack Foundation\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n * http://www.apache.org/licenses/LICENSE-2.0\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nimport React, {useState} from 'react';\nimport RichTextEditor, { \n createValueFromString, \n getTextAlignClassName, \n getTextAlignBlockMetadata,\n getTextAlignStyles, \n Button } from 'react-rte';\n\nconst CodeView = ({value, onSave}) => {\n const [codeValue, setCodeValue] = useState(value);\n\n return (\n <>\n