| Server IP : 146.59.209.152 / Your IP : 216.73.216.152 Web Server : Apache System : Linux webm009.cluster131.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : monpetu ( 144298) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/monpetu/www/ipprint/wp-content/plugins/woocommerce-payments/dist/chunks/ |
Upload File : |
{"version":3,"file":"chunks/2768.js?ver=03cd760470d5cfcd256c","mappings":"uJAEA,MACMA,EAAmC,CACvCC,eAAgBC,MAChBC,iBAAkBD,OAEdE,EAAmC,CACvC,qBAAsB,CACpBC,yBAA0BC,MAC1BC,8BAA+BC,MAC/BC,oBAAqBC,MACrBC,gCAAiCC,MACjCC,qBAAsBC,MACtBC,UAAWb,MACXc,gBAAiBd,OAEnB,qBAAsB,CACpBW,qBAAsBC,OAExB,sBAAuB,CACrBD,qBAAsBC,MACtBG,yBAA0Bf,OAE5B,4BAA6B,CAC3BgB,mCAAoChB,MACpCiB,0BAA2BjB,OAE7B,eAAgB,CACdkB,eAAgBC,MAChBC,iBAAkBC,MAClBC,qBAAsBC,MACtBC,qBAAsBC,OAExB,qBAAsB,CACpBH,qBAAsBC,MACtBC,qBAAsBC,MACtBC,kBAAmBC,OAErB,oBAAqB,CACnBC,oBAAqBC,OAEvB,iCAAkC,CAChCD,oBAAqBC,OAEvBC,SAAU,CACRC,kBAAmBC,OAErB,kBAAmB,CACjBC,WAAYC,MACZC,WAAYnC,OAEd,mBAAoB,CAClBiC,WAAYC,MACZE,oBAAqBpC,OAEvB,eAAgB,CACdqC,8BAA+BC,MAC/BC,8BAA+BC,MAC/BC,wBAAyBzC,OAE3B,oBAAqB,CACnB0C,+BAAgC1C,MAChC2C,oBAAqBH,MACrBI,iCAAkC5C,OAEpC,iBAAkB,CAChB6C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F,OAAOE,OAoEkB,mBAApB4hB,iBAAiCA,e","sources":["webpack://woocommerce-payments/./node_modules/@stripe/connect-js/dist/connect.esm.js","webpack://woocommerce-payments/./node_modules/@stripe/react-connect-js/dist/react-connect.esm.js","webpack://woocommerce-payments/./node_modules/@wordpress/icons/build-module/library/chevron-down.js","webpack://woocommerce-payments/./node_modules/compute-scroll-into-view/dist/index.mjs","webpack://woocommerce-payments/./node_modules/downshift/dist/downshift.esm.js","webpack://woocommerce-payments/./node_modules/prop-types/factoryWithThrowingShims.js","webpack://woocommerce-payments/./node_modules/prop-types/index.js","webpack://woocommerce-payments/./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://woocommerce-payments/./node_modules/react-is/cjs/react-is.production.min.js","webpack://woocommerce-payments/./node_modules/react-is/index.js","webpack://woocommerce-payments/./node_modules/tslib/tslib.es6.mjs"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n// Source of truth for the entire list of components. When you add a new component, it should be added here.\nconst connectElementTagNames = [\"account-onboarding\", \"disputes-list\", \"payments\", \"payment-details\", \"payment-disputes\", \"payouts\", \"payouts-list\", \"payout-details\", \"balances\", \"account-management\", \"notification-banner\", \"instant-payouts-promotion\", \"issuing-card\", \"issuing-cards-list\", \"financial-account\", \"financial-account-transactions\", \"documents\", \"tax-registrations\", \"tax-settings\", \"balance-report\", \"payout-reconciliation-report\"];\nconst ConnectElementCommonMethodConfig = {\n setOnLoadError: _listener => {},\n setOnLoaderStart: _listener => {}\n};\nconst ConnectElementCustomMethodConfig = {\n \"account-onboarding\": {\n setFullTermsOfServiceUrl: _termOfServiceUrl => {},\n setRecipientTermsOfServiceUrl: _recipientTermsOfServiceUrl => {},\n setPrivacyPolicyUrl: _privacyPolicyUrl => {},\n setSkipTermsOfServiceCollection: _skipTermsOfServiceCollection => {},\n setCollectionOptions: _collectionOptions => {},\n setOnExit: _listener => {},\n setOnStepChange: _listener => {}\n },\n \"account-management\": {\n setCollectionOptions: _collectionOptions => {}\n },\n \"notification-banner\": {\n setCollectionOptions: _collectionOptions => {},\n setOnNotificationsChange: _listener => {}\n },\n \"instant-payouts-promotion\": {\n setOnInstantPayoutsPromotionLoaded: _listener => {},\n setOnInstantPayoutCreated: _listener => {}\n },\n \"issuing-card\": {\n setDefaultCard: _defaultCard => {},\n setCardSwitching: _cardSwitching => {},\n setFetchEphemeralKey: _fetchEphemeralKey => {},\n setShowSpendControls: _showSpendControls => {}\n },\n \"issuing-cards-list\": {\n setFetchEphemeralKey: _fetchEphemeralKey => {},\n setShowSpendControls: _showSpendControls => {},\n setIssuingProgram: _issuingProgram => {}\n },\n \"financial-account\": {\n setFinancialAccount: _financialAccount => {}\n },\n \"financial-account-transactions\": {\n setFinancialAccount: _financialAccount => {}\n },\n payments: {\n setDefaultFilters: _filters => {}\n },\n \"payment-details\": {\n setPayment: _payment => {},\n setOnClose: _listener => {}\n },\n \"payment-disputes\": {\n setPayment: _payment => {},\n setOnDisputesLoaded: _listener => {}\n },\n \"tax-settings\": {\n setHideProductTaxCodeSelector: _hidden => {},\n setDisplayHeadOfficeCountries: _countries => {},\n setOnTaxSettingsUpdated: _listener => {}\n },\n \"tax-registrations\": {\n setOnAfterTaxRegistrationAdded: _listener => {},\n setDisplayCountries: _countries => {},\n setOnAfterTaxRegistrationExpired: _listener => {}\n },\n \"payout-details\": {\n setPayout: _payout => {},\n setOnClose: _listener => {}\n },\n \"payout-reconciliation-report\": {\n setOnReportAvailabilityLoaded: _listener => {}\n }\n};\n\nconst EXISTING_SCRIPT_MESSAGE = \"loadConnect was called but an existing Connect.js script already exists in the document; existing script parameters will be used\";\nconst V0_URL = \"https://connect-js.stripe.com/v0.1/connect.js\";\nconst V1_URL = \"https://connect-js.stripe.com/v1.0/connect.js\";\nconst findScript = () => {\n return document.querySelectorAll(`script[src=\"${V1_URL}\"]`)[0] || document.querySelectorAll(`script[src=\"${V0_URL}\"]`)[0] || null;\n};\nconst injectScript = () => {\n const script = document.createElement(\"script\");\n script.src = V1_URL;\n const head = document.head;\n if (!head) {\n throw new Error(\"Expected document.head not to be null. Connect.js requires a <head> element.\");\n }\n document.head.appendChild(script);\n return script;\n};\n\nconst componentNameMapping = connectElementTagNames.reduce((acc, name) => {\n acc[name] = `stripe-connect-${name}`;\n return acc;\n}, {});\nlet stripePromise$1 = null;\nconst isWindowStripeConnectDefined = stripeConnect => {\n // We only consider `StripeConnect` defined if `init` is a function\n // Why? HTML markup like:\n // <a id=\"StripeConnect\"><a id=\"StripeConnect\" name=\"init\" href=\"stripe\"></a></a> in the <head> of the page\n // can end up \"contaminating\" the window.StripeConnect object and cause issues in connect.js initialization\n return !!(stripeConnect && typeof stripeConnect === \"object\" && \"init\" in stripeConnect && typeof stripeConnect.init === \"function\");\n};\nconst loadScript = () => {\n // Ensure that we only attempt to load Connect.js at most once\n if (stripePromise$1 !== null) {\n return stripePromise$1;\n }\n stripePromise$1 = new Promise((resolve, reject) => {\n if (typeof window === \"undefined\") {\n reject(\"ConnectJS won't load when rendering code in the server - it can only be loaded on a browser. This error is expected when loading ConnectJS in SSR environments, like NextJS. It will have no impact in the UI, however if you wish to avoid it, you can switch to the `pure` version of the connect.js loader: https://github.com/stripe/connect-js#importing-loadconnect-without-side-effects.\");\n return;\n }\n if (isWindowStripeConnectDefined(window.StripeConnect)) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n const wrapper = createWrapper(window.StripeConnect);\n resolve(wrapper);\n return;\n }\n try {\n let script = findScript();\n if (script) {\n console.warn(EXISTING_SCRIPT_MESSAGE);\n } else if (!script) {\n script = injectScript();\n }\n script.addEventListener(\"load\", () => {\n if (isWindowStripeConnectDefined(window.StripeConnect)) {\n const wrapper = createWrapper(window.StripeConnect);\n resolve(wrapper);\n } else {\n reject(new Error(\"Connect.js did not load the necessary objects\"));\n }\n });\n script.addEventListener(\"error\", () => {\n reject(new Error(\"Failed to load Connect.js\"));\n });\n } catch (error) {\n reject(error);\n }\n });\n return stripePromise$1;\n};\nconst hasCustomMethod = tagName => {\n return tagName in ConnectElementCustomMethodConfig;\n};\nconst initStripeConnect = (stripePromise, initParams) => {\n var _a;\n const eagerClientSecretPromise = (() => {\n try {\n return initParams.fetchClientSecret();\n } catch (error) {\n return Promise.reject(error);\n }\n })();\n const metaOptions = (_a = initParams.metaOptions) !== null && _a !== void 0 ? _a : {};\n const stripeConnectInstance = stripePromise.then(wrapper => wrapper.initialize(Object.assign(Object.assign({}, initParams), {\n metaOptions: Object.assign(Object.assign({}, metaOptions), {\n eagerClientSecretPromise\n })\n })));\n return {\n create: tagName => {\n let htmlName = componentNameMapping[tagName];\n if (!htmlName) {\n htmlName = tagName;\n }\n const element = document.createElement(htmlName);\n const customMethods = hasCustomMethod(tagName) ? ConnectElementCustomMethodConfig[tagName] : {};\n const methods = Object.assign(Object.assign({}, customMethods), ConnectElementCommonMethodConfig);\n for (const method in methods) {\n element[method] = function (value) {\n stripeConnectInstance.then(() => {\n if (!this[`${method}InternalOnly`]) {\n throw new Error(`Method ${method} is not available in the ${tagName} HTML element. Are you using a supported version of the \"@stripe/connect-js\" package? Using version: 3.4.3`);\n }\n this[`${method}InternalOnly`](value);\n });\n };\n }\n stripeConnectInstance.then(instance => {\n if (!element.isConnected && !element.setConnector) {\n // If the element is not connected to the DOM and the `setConnector` method is not\n // defined, this indicates the element was created before connect.js was loaded, and has\n // not been transformed into a custom element yet\n // To load the custom element code on it, we need to connect and disconnect it to the DOM\n // This isn't a problem, as the element will be invisible, and we know the element is already\n // not currently connected to the DOM\n const oldDisplay = element.style.display;\n element.style.display = \"none\";\n document.body.appendChild(element);\n document.body.removeChild(element);\n element.style.display = oldDisplay;\n }\n if (!element || !element.setConnector) {\n throw new Error(`Element ${tagName} was not transformed into a custom element. Are you using a documented component? See https://docs.stripe.com/connect/supported-embedded-components for a list of supported components`);\n }\n element.setConnector(instance.connect);\n });\n return element;\n },\n update: updateOptions => {\n stripeConnectInstance.then(instance => {\n instance.update(updateOptions);\n });\n },\n debugInstance: () => {\n return stripeConnectInstance;\n },\n logout: () => {\n return stripeConnectInstance.then(instance => {\n return instance.logout();\n });\n }\n };\n};\nconst createWrapper = stripeConnect => {\n window.StripeConnect = window.StripeConnect || {};\n window.StripeConnect.optimizedLoading = true;\n const wrapper = {\n initialize: params => {\n var _a;\n const metaOptions = (_a = params.metaOptions) !== null && _a !== void 0 ? _a : {};\n const stripeConnectInstance = stripeConnect.init(Object.assign(Object.assign({}, params), {\n metaOptions: Object.assign(Object.assign({}, metaOptions), {\n sdk: true,\n sdkOptions: {\n // This will be replaced by the npm package version when bundling\n sdkVersion: \"3.4.3\"\n }\n })\n }));\n return stripeConnectInstance;\n }\n };\n return wrapper;\n};\n\n// Execute our own script injection after a tick to give users time to do their\n// own script injection.\nconst stripePromise = Promise.resolve().then(() => loadScript());\nlet loadCalled = false;\nstripePromise.catch(err => {\n if (!loadCalled) {\n console.warn(err);\n }\n});\nconst loadConnectAndInitialize = initParams => {\n loadCalled = true;\n return initStripeConnect(stripePromise, initParams);\n};\n\nexport { ConnectElementCommonMethodConfig, ConnectElementCustomMethodConfig, connectElementTagNames, loadConnectAndInitialize };\n","import * as React from 'react';\nimport React__default from 'react';\n\nfunction _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar ConnectComponentsContext = /*#__PURE__*/React.createContext(null);\nConnectComponentsContext.displayName = 'ConnectComponents';\nvar ConnectComponentsProvider = function ConnectComponentsProvider(_ref) {\n var connectInstance = _ref.connectInstance,\n children = _ref.children;\n return /*#__PURE__*/React.createElement(ConnectComponentsContext.Provider, {\n value: {\n connectInstance: connectInstance\n }\n }, children);\n};\nvar useConnectComponents = function useConnectComponents() {\n var context = React.useContext(ConnectComponentsContext);\n if (!context) {\n throw new Error(\"Could not find Components context; You need to wrap the part of your app in an <ConnectComponentsProvider> provider.\");\n }\n return context;\n};\n\nvar useCreateComponent = function useCreateComponent(tagName) {\n var _React$useState = React.useState(null),\n _React$useState2 = _slicedToArray(_React$useState, 2),\n component = _React$useState2[0],\n setComponent = _React$useState2[1];\n var _useConnectComponents = useConnectComponents(),\n connectInstance = _useConnectComponents.connectInstance;\n var wrapperDivRef = React.useRef(null);\n // We set width to 100% to preserve this functionality aspect of embedded components even though\n // we are introducing a wrapper div for this element\n // https://docs.corp.stripe.com/connect/get-started-connect-embedded-components#width-and-height\n var wrapper = /*#__PURE__*/React.createElement(\"div\", {\n style: {\n width: '100%'\n },\n \"data-stripe-connect-js-wrapper\": true,\n ref: wrapperDivRef\n });\n React.useLayoutEffect(function () {\n if (wrapperDivRef.current !== null && component === null) {\n var newComponent = connectInstance.create(tagName);\n setComponent(newComponent);\n if (newComponent !== null) {\n try {\n newComponent.setAttribute('reactSdkAnalytics', '3.4.2');\n } catch (e) {\n console.log('Error setting React Sdk version with error message: ', e);\n }\n while (wrapperDivRef.current.firstChild) {\n wrapperDivRef.current.removeChild(wrapperDivRef.current.firstChild);\n }\n wrapperDivRef.current.appendChild(newComponent);\n }\n }\n }, [connectInstance, tagName]);\n return {\n wrapper: wrapper,\n component: component\n };\n};\n\nvar useUpdateWithSetter = function useUpdateWithSetter(component, value, onUpdated) {\n React__default.useEffect(function () {\n if (!component) return;\n try {\n onUpdated(component, value);\n } catch (error) {\n console.error('Error when calling setter! ', error);\n return;\n }\n }, [component, value, onUpdated]);\n};\n\nvar ConnectPayments = function ConnectPayments(_ref) {\n var defaultFilters = _ref.defaultFilters,\n onLoadError = _ref.onLoadError,\n onLoaderStart = _ref.onLoaderStart;\n var _useCreateComponent = useCreateComponent('payments'),\n wrapper = _useCreateComponent.wrapper,\n payments = _useCreateComponent.component;\n useUpdateWithSetter(payments, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(payments, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n useUpdateWithSetter(payments, defaultFilters, function (comp, val) {\n comp.setDefaultFilters(val);\n });\n return wrapper;\n};\nvar ConnectPayouts = function ConnectPayouts(_ref2) {\n var onLoadError = _ref2.onLoadError,\n onLoaderStart = _ref2.onLoaderStart;\n var _useCreateComponent2 = useCreateComponent('payouts'),\n wrapper = _useCreateComponent2.wrapper,\n payouts = _useCreateComponent2.component;\n useUpdateWithSetter(payouts, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(payouts, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectPaymentDetails = function ConnectPaymentDetails(_ref3) {\n var payment = _ref3.payment,\n onClose = _ref3.onClose,\n onLoadError = _ref3.onLoadError,\n onLoaderStart = _ref3.onLoaderStart;\n var _useCreateComponent3 = useCreateComponent('payment-details'),\n wrapper = _useCreateComponent3.wrapper,\n paymentDetails = _useCreateComponent3.component;\n useUpdateWithSetter(paymentDetails, payment, function (comp, val) {\n return comp.setPayment(val);\n });\n useUpdateWithSetter(paymentDetails, onClose, function (comp, val) {\n return comp.setOnClose(val);\n });\n useUpdateWithSetter(paymentDetails, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(paymentDetails, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectPaymentDisputes = function ConnectPaymentDisputes(_ref4) {\n var payment = _ref4.payment,\n onDisputesLoaded = _ref4.onDisputesLoaded,\n onLoadError = _ref4.onLoadError,\n onLoaderStart = _ref4.onLoaderStart;\n var _useCreateComponent4 = useCreateComponent('payment-disputes'),\n wrapper = _useCreateComponent4.wrapper,\n component = _useCreateComponent4.component;\n useUpdateWithSetter(component, payment, function (comp, val) {\n return comp.setPayment(val);\n });\n useUpdateWithSetter(component, onDisputesLoaded, function (comp, val) {\n return comp.setOnDisputesLoaded(val);\n });\n useUpdateWithSetter(component, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(component, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectDisputesList = function ConnectDisputesList(_ref5) {\n var onLoadError = _ref5.onLoadError,\n onLoaderStart = _ref5.onLoaderStart;\n var _useCreateComponent5 = useCreateComponent('disputes-list'),\n wrapper = _useCreateComponent5.wrapper,\n component = _useCreateComponent5.component;\n useUpdateWithSetter(component, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(component, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectAccountOnboarding = function ConnectAccountOnboarding(_ref6) {\n var onExit = _ref6.onExit,\n recipientTermsOfServiceUrl = _ref6.recipientTermsOfServiceUrl,\n fullTermsOfServiceUrl = _ref6.fullTermsOfServiceUrl,\n privacyPolicyUrl = _ref6.privacyPolicyUrl,\n skipTermsOfServiceCollection = _ref6.skipTermsOfServiceCollection,\n collectionOptions = _ref6.collectionOptions,\n onLoadError = _ref6.onLoadError,\n onLoaderStart = _ref6.onLoaderStart,\n onStepChange = _ref6.onStepChange;\n var _useCreateComponent6 = useCreateComponent('account-onboarding'),\n wrapper = _useCreateComponent6.wrapper,\n onboarding = _useCreateComponent6.component;\n useUpdateWithSetter(onboarding, recipientTermsOfServiceUrl, function (comp, val) {\n return comp.setRecipientTermsOfServiceUrl(val);\n });\n useUpdateWithSetter(onboarding, fullTermsOfServiceUrl, function (comp, val) {\n return comp.setFullTermsOfServiceUrl(val);\n });\n useUpdateWithSetter(onboarding, privacyPolicyUrl, function (comp, val) {\n return comp.setPrivacyPolicyUrl(val);\n });\n useUpdateWithSetter(onboarding, skipTermsOfServiceCollection, function (comp, val) {\n return comp.setSkipTermsOfServiceCollection(val);\n });\n useUpdateWithSetter(onboarding, collectionOptions, function (comp, val) {\n return comp.setCollectionOptions(val);\n });\n useUpdateWithSetter(onboarding, onExit, function (comp, val) {\n return comp.setOnExit(val);\n });\n useUpdateWithSetter(onboarding, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(onboarding, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n useUpdateWithSetter(onboarding, onStepChange, function (comp, val) {\n return comp.setOnStepChange(val);\n });\n return wrapper;\n};\nvar ConnectAccountManagement = function ConnectAccountManagement(_ref7) {\n var collectionOptions = _ref7.collectionOptions,\n onLoadError = _ref7.onLoadError,\n onLoaderStart = _ref7.onLoaderStart;\n var _useCreateComponent7 = useCreateComponent('account-management'),\n wrapper = _useCreateComponent7.wrapper,\n accountManagement = _useCreateComponent7.component;\n useUpdateWithSetter(accountManagement, collectionOptions, function (comp, val) {\n return comp.setCollectionOptions(val);\n });\n useUpdateWithSetter(accountManagement, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(accountManagement, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectNotificationBanner = function ConnectNotificationBanner(_ref8) {\n var collectionOptions = _ref8.collectionOptions,\n onNotificationsChange = _ref8.onNotificationsChange,\n onLoadError = _ref8.onLoadError,\n onLoaderStart = _ref8.onLoaderStart;\n var _useCreateComponent8 = useCreateComponent('notification-banner'),\n wrapper = _useCreateComponent8.wrapper,\n notificationBanner = _useCreateComponent8.component;\n useUpdateWithSetter(notificationBanner, collectionOptions, function (comp, val) {\n return comp.setCollectionOptions(val);\n });\n useUpdateWithSetter(notificationBanner, onNotificationsChange, function (comp, val) {\n return comp.setOnNotificationsChange(val);\n });\n useUpdateWithSetter(notificationBanner, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(notificationBanner, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectIssuingCard = function ConnectIssuingCard(_ref9) {\n var defaultCard = _ref9.defaultCard,\n cardSwitching = _ref9.cardSwitching,\n showSpendControls = _ref9.showSpendControls,\n fetchEphemeralKey = _ref9.fetchEphemeralKey,\n onLoadError = _ref9.onLoadError,\n onLoaderStart = _ref9.onLoaderStart;\n var _useCreateComponent9 = useCreateComponent('issuing-card'),\n wrapper = _useCreateComponent9.wrapper,\n issuingCard = _useCreateComponent9.component;\n useUpdateWithSetter(issuingCard, defaultCard, function (comp, val) {\n return comp.setDefaultCard(val);\n });\n useUpdateWithSetter(issuingCard, cardSwitching, function (comp, val) {\n return comp.setCardSwitching(val);\n });\n useUpdateWithSetter(issuingCard, showSpendControls, function (comp, val) {\n return comp.setShowSpendControls(val);\n });\n useUpdateWithSetter(issuingCard, fetchEphemeralKey, function (comp, val) {\n return comp.setFetchEphemeralKey(val);\n });\n useUpdateWithSetter(issuingCard, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(issuingCard, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectIssuingCardsList = function ConnectIssuingCardsList(_ref10) {\n var showSpendControls = _ref10.showSpendControls,\n issuingProgram = _ref10.issuingProgram,\n fetchEphemeralKey = _ref10.fetchEphemeralKey,\n onLoadError = _ref10.onLoadError,\n onLoaderStart = _ref10.onLoaderStart;\n var _useCreateComponent10 = useCreateComponent('issuing-cards-list'),\n wrapper = _useCreateComponent10.wrapper,\n issuingCardsList = _useCreateComponent10.component;\n useUpdateWithSetter(issuingCardsList, showSpendControls, function (comp, val) {\n return comp.setShowSpendControls(val);\n });\n useUpdateWithSetter(issuingCardsList, issuingProgram, function (comp, val) {\n return comp.setIssuingProgram(val);\n });\n useUpdateWithSetter(issuingCardsList, fetchEphemeralKey, function (comp, val) {\n return comp.setFetchEphemeralKey(val);\n });\n useUpdateWithSetter(issuingCardsList, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(issuingCardsList, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectFinancialAccount = function ConnectFinancialAccount(_ref11) {\n var financialAccount = _ref11.financialAccount,\n onLoadError = _ref11.onLoadError,\n onLoaderStart = _ref11.onLoaderStart;\n var _useCreateComponent11 = useCreateComponent('financial-account'),\n wrapper = _useCreateComponent11.wrapper,\n financialAccountComponent = _useCreateComponent11.component;\n useUpdateWithSetter(financialAccountComponent, financialAccount, function (comp, val) {\n return comp.setFinancialAccount(val);\n });\n useUpdateWithSetter(financialAccountComponent, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(financialAccountComponent, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectFinancialAccountTransactions = function ConnectFinancialAccountTransactions(_ref12) {\n var financialAccount = _ref12.financialAccount,\n onLoadError = _ref12.onLoadError,\n onLoaderStart = _ref12.onLoaderStart;\n var _useCreateComponent12 = useCreateComponent('financial-account-transactions'),\n wrapper = _useCreateComponent12.wrapper,\n financialAccountTransactionsComponent = _useCreateComponent12.component;\n useUpdateWithSetter(financialAccountTransactionsComponent, financialAccount, function (comp, val) {\n return comp.setFinancialAccount(val);\n });\n useUpdateWithSetter(financialAccountTransactionsComponent, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(financialAccountTransactionsComponent, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectDocuments = function ConnectDocuments(_ref13) {\n var onLoadError = _ref13.onLoadError,\n onLoaderStart = _ref13.onLoaderStart;\n var _useCreateComponent13 = useCreateComponent('documents'),\n wrapper = _useCreateComponent13.wrapper,\n documents = _useCreateComponent13.component;\n useUpdateWithSetter(documents, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(documents, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectPayoutsList = function ConnectPayoutsList(_ref14) {\n var onLoadError = _ref14.onLoadError,\n onLoaderStart = _ref14.onLoaderStart;\n var _useCreateComponent14 = useCreateComponent('payouts-list'),\n wrapper = _useCreateComponent14.wrapper,\n payoutsList = _useCreateComponent14.component;\n useUpdateWithSetter(payoutsList, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(payoutsList, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectBalances = function ConnectBalances(_ref15) {\n var onLoadError = _ref15.onLoadError,\n onLoaderStart = _ref15.onLoaderStart;\n var _useCreateComponent15 = useCreateComponent('balances'),\n wrapper = _useCreateComponent15.wrapper,\n balances = _useCreateComponent15.component;\n useUpdateWithSetter(balances, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(balances, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectTaxRegistrations = function ConnectTaxRegistrations(_ref16) {\n var onLoadError = _ref16.onLoadError,\n onLoaderStart = _ref16.onLoaderStart,\n displayCountries = _ref16.displayCountries,\n onAfterTaxRegistrationAdded = _ref16.onAfterTaxRegistrationAdded,\n onAfterTaxRegistrationExpired = _ref16.onAfterTaxRegistrationExpired;\n var _useCreateComponent16 = useCreateComponent('tax-registrations'),\n wrapper = _useCreateComponent16.wrapper,\n taxRegistrations = _useCreateComponent16.component;\n useUpdateWithSetter(taxRegistrations, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(taxRegistrations, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n useUpdateWithSetter(taxRegistrations, displayCountries, function (comp, val) {\n comp.setDisplayCountries(val);\n });\n useUpdateWithSetter(taxRegistrations, onAfterTaxRegistrationAdded, function (comp, val) {\n comp.setOnAfterTaxRegistrationAdded(val);\n });\n useUpdateWithSetter(taxRegistrations, onAfterTaxRegistrationExpired, function (comp, val) {\n comp.setOnAfterTaxRegistrationExpired(val);\n });\n return wrapper;\n};\nvar ConnectTaxSettings = function ConnectTaxSettings(_ref17) {\n var onLoadError = _ref17.onLoadError,\n onLoaderStart = _ref17.onLoaderStart,\n hideProductTaxCodeSelector = _ref17.hideProductTaxCodeSelector,\n displayHeadOfficeCountries = _ref17.displayHeadOfficeCountries,\n onTaxSettingsUpdated = _ref17.onTaxSettingsUpdated;\n var _useCreateComponent17 = useCreateComponent('tax-settings'),\n wrapper = _useCreateComponent17.wrapper,\n taxSettings = _useCreateComponent17.component;\n useUpdateWithSetter(taxSettings, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(taxSettings, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n useUpdateWithSetter(taxSettings, hideProductTaxCodeSelector, function (comp, val) {\n comp.setHideProductTaxCodeSelector(val);\n });\n useUpdateWithSetter(taxSettings, displayHeadOfficeCountries, function (comp, val) {\n comp.setDisplayHeadOfficeCountries(val);\n });\n useUpdateWithSetter(taxSettings, onTaxSettingsUpdated, function (comp, val) {\n comp.setOnTaxSettingsUpdated(val);\n });\n return wrapper;\n};\nvar ConnectInstantPayoutsPromotion = function ConnectInstantPayoutsPromotion(_ref18) {\n var onInstantPayoutsPromotionLoaded = _ref18.onInstantPayoutsPromotionLoaded,\n onInstantPayoutCreated = _ref18.onInstantPayoutCreated,\n onLoadError = _ref18.onLoadError,\n onLoaderStart = _ref18.onLoaderStart;\n var _useCreateComponent18 = useCreateComponent('instant-payouts-promotion'),\n wrapper = _useCreateComponent18.wrapper,\n instantPayoutsPromotion = _useCreateComponent18.component;\n useUpdateWithSetter(instantPayoutsPromotion, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(instantPayoutsPromotion, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n useUpdateWithSetter(instantPayoutsPromotion, onInstantPayoutsPromotionLoaded, function (comp, val) {\n comp.setOnInstantPayoutsPromotionLoaded(val);\n });\n useUpdateWithSetter(instantPayoutsPromotion, onInstantPayoutCreated, function (comp, val) {\n comp.setOnInstantPayoutCreated(val);\n });\n return wrapper;\n};\nvar ConnectPayoutDetails = function ConnectPayoutDetails(_ref19) {\n var payout = _ref19.payout,\n onClose = _ref19.onClose,\n onLoadError = _ref19.onLoadError,\n onLoaderStart = _ref19.onLoaderStart;\n var _useCreateComponent19 = useCreateComponent('payout-details'),\n wrapper = _useCreateComponent19.wrapper,\n payoutDetails = _useCreateComponent19.component;\n useUpdateWithSetter(payoutDetails, payout, function (comp, val) {\n return comp.setPayout(val);\n });\n useUpdateWithSetter(payoutDetails, onClose, function (comp, val) {\n return comp.setOnClose(val);\n });\n useUpdateWithSetter(payoutDetails, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(payoutDetails, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectBalanceReport = function ConnectBalanceReport(_ref20) {\n var onLoadError = _ref20.onLoadError,\n onLoaderStart = _ref20.onLoaderStart;\n var _useCreateComponent20 = useCreateComponent('balance-report'),\n wrapper = _useCreateComponent20.wrapper,\n balanceReport = _useCreateComponent20.component;\n useUpdateWithSetter(balanceReport, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(balanceReport, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\nvar ConnectPayoutReconciliationReport = function ConnectPayoutReconciliationReport(_ref21) {\n var onReportAvailabilityLoaded = _ref21.onReportAvailabilityLoaded,\n onLoadError = _ref21.onLoadError,\n onLoaderStart = _ref21.onLoaderStart;\n var _useCreateComponent21 = useCreateComponent('payout-reconciliation-report'),\n wrapper = _useCreateComponent21.wrapper,\n payoutReconciliationReport = _useCreateComponent21.component;\n useUpdateWithSetter(payoutReconciliationReport, onReportAvailabilityLoaded, function (comp, val) {\n comp.setOnReportAvailabilityLoaded(val);\n });\n useUpdateWithSetter(payoutReconciliationReport, onLoaderStart, function (comp, val) {\n comp.setOnLoaderStart(val);\n });\n useUpdateWithSetter(payoutReconciliationReport, onLoadError, function (comp, val) {\n comp.setOnLoadError(val);\n });\n return wrapper;\n};\n\n/**\n * @deprecated The method should not be used as we are deprecating the use of attributes directly.\n * Define a setter for your use case and use useUpdateWithSetter instead.\n */\nvar useAttachAttribute = function useAttachAttribute(component, attribute, value) {\n React__default.useEffect(function () {\n if (!component) return;\n if (value !== undefined) {\n component.setAttribute(attribute, value.toString());\n } else {\n // RemoveAttribute is a no-op if the attribute is not present\n component.removeAttribute(attribute);\n }\n }, [component, attribute, value]);\n};\n\nvar ConnectElementEventNames;\n(function (ConnectElementEventNames) {\n ConnectElementEventNames[\"exit\"] = \"exit\";\n ConnectElementEventNames[\"close\"] = \"close\";\n ConnectElementEventNames[\"instantPayoutCreated\"] = \"instantpayoutcreated\";\n})(ConnectElementEventNames || (ConnectElementEventNames = {}));\n/**\n * @deprecated The method should not be used as we are deprecating the use of events directly. Define a setter for\n * your use case and use useUpdateWithSetter instead.\n */\nvar useAttachEvent = function useAttachEvent(component, eventName, listener) {\n React__default.useEffect(function () {\n if (component) {\n component.addEventListener(eventName, listener);\n }\n return function () {\n if (component) {\n component.removeEventListener(eventName, listener);\n }\n };\n }, [component, eventName, listener]);\n};\n\nexport { ConnectAccountManagement, ConnectAccountOnboarding, ConnectBalanceReport, ConnectBalances, ConnectComponentsProvider, ConnectDisputesList, ConnectDocuments, ConnectElementEventNames, ConnectFinancialAccount, ConnectFinancialAccountTransactions, ConnectInstantPayoutsPromotion, ConnectIssuingCard, ConnectIssuingCardsList, ConnectNotificationBanner, ConnectPaymentDetails, ConnectPaymentDisputes, ConnectPayments, ConnectPayoutDetails, ConnectPayoutReconciliationReport, ConnectPayouts, ConnectPayoutsList, ConnectTaxRegistrations, ConnectTaxSettings, useAttachAttribute, useAttachEvent, useConnectComponents, useCreateComponent, useUpdateWithSetter };\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst chevronDown = /*#__PURE__*/_jsx(SVG, {\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /*#__PURE__*/_jsx(Path, {\n d: \"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z\"\n })\n});\nexport default chevronDown;\n//# sourceMappingURL=chevron-down.js.map","function t(t){return\"object\"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return(!e||\"hidden\"!==t)&&\"visible\"!==t&&\"clip\"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return!!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return!1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}var i=function(e,i){var o=window,l=i.scrollMode,d=i.block,f=i.inline,h=i.boundary,u=i.skipOverflowHiddenElements,s=\"function\"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError(\"Invalid target\");for(var a,c,g=document.scrollingElement||document.documentElement,p=[],m=e;t(m)&&s(m);){if((m=null==(c=(a=m).parentElement)?a.getRootNode().host||null:c)===g){p.push(m);break}null!=m&&m===document.body&&n(m)&&!n(document.documentElement)||null!=m&&n(m,u)&&p.push(m)}for(var w=o.visualViewport?o.visualViewport.width:innerWidth,v=o.visualViewport?o.visualViewport.height:innerHeight,W=window.scrollX||pageXOffset,H=window.scrollY||pageYOffset,b=e.getBoundingClientRect(),y=b.height,E=b.width,M=b.top,V=b.right,x=b.bottom,I=b.left,C=\"start\"===d||\"nearest\"===d?M:\"end\"===d?x:M+y/2,R=\"center\"===f?I+E/2:\"end\"===f?V:I,T=[],k=0;k<p.length;k++){var B=p[k],D=B.getBoundingClientRect(),O=D.height,X=D.width,Y=D.top,L=D.right,S=D.bottom,j=D.left;if(\"if-needed\"===l&&M>=0&&I>=0&&x<=v&&V<=w&&M>=Y&&x<=S&&I>=j&&V<=L)return T;var N=getComputedStyle(B),q=parseInt(N.borderLeftWidth,10),z=parseInt(N.borderTopWidth,10),A=parseInt(N.borderRightWidth,10),F=parseInt(N.borderBottomWidth,10),G=0,J=0,K=\"offsetWidth\"in B?B.offsetWidth-B.clientWidth-q-A:0,P=\"offsetHeight\"in B?B.offsetHeight-B.clientHeight-z-F:0,Q=\"offsetWidth\"in B?0===B.offsetWidth?0:X/B.offsetWidth:0,U=\"offsetHeight\"in B?0===B.offsetHeight?0:O/B.offsetHeight:0;if(g===B)G=\"start\"===d?C:\"end\"===d?C-v:\"nearest\"===d?r(H,H+v,v,z,F,H+C,H+C+y,y):C-v/2,J=\"start\"===f?R:\"center\"===f?R-w/2:\"end\"===f?R-w:r(W,W+w,w,q,A,W+R,W+R+E,E),G=Math.max(0,G+H),J=Math.max(0,J+W);else{G=\"start\"===d?C-Y-z:\"end\"===d?C-S+F+P:\"nearest\"===d?r(Y,S,O,z,F+P,C,C+y,y):C-(Y+O/2)+P/2,J=\"start\"===f?R-j-q:\"center\"===f?R-(j+X/2)+K/2:\"end\"===f?R-L+A+K:r(j,L,X,q,A+K,R,R+E,E);var Z=B.scrollLeft,$=B.scrollTop;C+=$-(G=Math.max(0,Math.min($+G/U,B.scrollHeight-O/U+P))),R+=Z-(J=Math.max(0,Math.min(Z+J/Q,B.scrollWidth-X/Q+K)))}T.push({el:B,top:G,left:J})}return T};export{i as default};\n//# sourceMappingURL=index.mjs.map\n","import PropTypes from 'prop-types';\nimport { Component, cloneElement, useRef, useEffect, useCallback, useLayoutEffect, useReducer, useMemo } from 'react';\nimport { isForwardRef } from 'react-is';\nimport computeScrollIntoView from 'compute-scroll-into-view';\nimport { __assign } from 'tslib';\n\nlet idCounter = 0;\n/**\n * Accepts a parameter and returns it if it's a function\n * or a noop function if it's not. This allows us to\n * accept a callback, but not worry about it if it's not\n * passed.\n * @param {Function} cb the callback\n * @return {Function} a function\n */\n\nfunction cbToCb(cb) {\n return typeof cb === 'function' ? cb : noop;\n}\n\nfunction noop() {}\n/**\n * Scroll node into view if necessary\n * @param {HTMLElement} node the element that should scroll into view\n * @param {HTMLElement} menuNode the menu element of the component\n */\n\n\nfunction scrollIntoView(node, menuNode) {\n if (!node) {\n return;\n }\n\n const actions = computeScrollIntoView(node, {\n boundary: menuNode,\n block: 'nearest',\n scrollMode: 'if-needed'\n });\n actions.forEach(_ref => {\n let {\n el,\n top,\n left\n } = _ref;\n el.scrollTop = top;\n el.scrollLeft = left;\n });\n}\n/**\n * @param {HTMLElement} parent the parent node\n * @param {HTMLElement} child the child node\n * @param {Window} environment The window context where downshift renders.\n * @return {Boolean} whether the parent is the child or the child is in the parent\n */\n\n\nfunction isOrContainsNode(parent, child, environment) {\n const result = parent === child || child instanceof environment.Node && parent.contains && parent.contains(child);\n return result;\n}\n/**\n * Simple debounce implementation. Will call the given\n * function once after the time given has passed since\n * it was last called.\n * @param {Function} fn the function to call after the time\n * @param {Number} time the time to wait\n * @return {Function} the debounced function\n */\n\n\nfunction debounce(fn, time) {\n let timeoutId;\n\n function cancel() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n }\n }\n\n function wrapper() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n cancel();\n timeoutId = setTimeout(() => {\n timeoutId = null;\n fn(...args);\n }, time);\n }\n\n wrapper.cancel = cancel;\n return wrapper;\n}\n/**\n * This is intended to be used to compose event handlers.\n * They are executed in order until one of them sets\n * `event.preventDownshiftDefault = true`.\n * @param {...Function} fns the event handler functions\n * @return {Function} the event handler to add to an element\n */\n\n\nfunction callAllEventHandlers() {\n for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n fns[_key2] = arguments[_key2];\n }\n\n return function (event) {\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n\n return fns.some(fn => {\n if (fn) {\n fn(event, ...args);\n }\n\n return event.preventDownshiftDefault || event.hasOwnProperty('nativeEvent') && event.nativeEvent.preventDownshiftDefault;\n });\n };\n}\n\nfunction handleRefs() {\n for (var _len4 = arguments.length, refs = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n refs[_key4] = arguments[_key4];\n }\n\n return node => {\n refs.forEach(ref => {\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n });\n };\n}\n/**\n * This generates a unique ID for an instance of Downshift\n * @return {String} the unique ID\n */\n\n\nfunction generateId() {\n return String(idCounter++);\n}\n/**\n * Resets idCounter to 0. Used for SSR.\n */\n\n\nfunction resetIdCounter() {\n idCounter = 0;\n}\n/**\n * Default implementation for status message. Only added when menu is open.\n * Will specify if there are results in the list, and if so, how many,\n * and what keys are relevant.\n *\n * @param {Object} param the downshift state and other relevant properties\n * @return {String} the a11y status message\n */\n\n\nfunction getA11yStatusMessage$1(_ref2) {\n let {\n isOpen,\n resultCount,\n previousResultCount\n } = _ref2;\n\n if (!isOpen) {\n return '';\n }\n\n if (!resultCount) {\n return 'No results are available.';\n }\n\n if (resultCount !== previousResultCount) {\n return `${resultCount} result${resultCount === 1 ? ' is' : 's are'} available, use up and down arrow keys to navigate. Press Enter key to select.`;\n }\n\n return '';\n}\n/**\n * Takes an argument and if it's an array, returns the first item in the array\n * otherwise returns the argument\n * @param {*} arg the maybe-array\n * @param {*} defaultValue the value if arg is falsey not defined\n * @return {*} the arg or it's first item\n */\n\n\nfunction unwrapArray(arg, defaultValue) {\n arg = Array.isArray(arg) ?\n /* istanbul ignore next (preact) */\n arg[0] : arg;\n\n if (!arg && defaultValue) {\n return defaultValue;\n } else {\n return arg;\n }\n}\n/**\n * @param {Object} element (P)react element\n * @return {Boolean} whether it's a DOM element\n */\n\n\nfunction isDOMElement(element) {\n\n\n return typeof element.type === 'string';\n}\n/**\n * @param {Object} element (P)react element\n * @return {Object} the props\n */\n\n\nfunction getElementProps(element) {\n\n return element.props;\n}\n/**\n * Throws a helpful error message for required properties. Useful\n * to be used as a default in destructuring or object params.\n * @param {String} fnName the function name\n * @param {String} propName the prop name\n */\n\n\nfunction requiredProp(fnName, propName) {\n // eslint-disable-next-line no-console\n console.error(`The property \"${propName}\" is required in \"${fnName}\"`);\n}\n\nconst stateKeys = ['highlightedIndex', 'inputValue', 'isOpen', 'selectedItem', 'type'];\n/**\n * @param {Object} state the state object\n * @return {Object} state that is relevant to downshift\n */\n\nfunction pickState(state) {\n if (state === void 0) {\n state = {};\n }\n\n const result = {};\n stateKeys.forEach(k => {\n if (state.hasOwnProperty(k)) {\n result[k] = state[k];\n }\n });\n return result;\n}\n/**\n * This will perform a shallow merge of the given state object\n * with the state coming from props\n * (for the controlled component scenario)\n * This is used in state updater functions so they're referencing\n * the right state regardless of where it comes from.\n *\n * @param {Object} state The state of the component/hook.\n * @param {Object} props The props that may contain controlled values.\n * @returns {Object} The merged controlled state.\n */\n\n\nfunction getState(state, props) {\n return Object.keys(state).reduce((prevState, key) => {\n prevState[key] = isControlledProp(props, key) ? props[key] : state[key];\n return prevState;\n }, {});\n}\n/**\n * This determines whether a prop is a \"controlled prop\" meaning it is\n * state which is controlled by the outside of this component rather\n * than within this component.\n *\n * @param {Object} props The props that may contain controlled values.\n * @param {String} key the key to check\n * @return {Boolean} whether it is a controlled controlled prop\n */\n\n\nfunction isControlledProp(props, key) {\n return props[key] !== undefined;\n}\n/**\n * Normalizes the 'key' property of a KeyboardEvent in IE/Edge\n * @param {Object} event a keyboardEvent object\n * @return {String} keyboard key\n */\n\n\nfunction normalizeArrowKey(event) {\n const {\n key,\n keyCode\n } = event;\n /* istanbul ignore next (ie) */\n\n if (keyCode >= 37 && keyCode <= 40 && key.indexOf('Arrow') !== 0) {\n return `Arrow${key}`;\n }\n\n return key;\n}\n/**\n * Simple check if the value passed is object literal\n * @param {*} obj any things\n * @return {Boolean} whether it's object literal\n */\n\n\nfunction isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n}\n/**\n * Returns the new index in the list, in a circular way. If next value is out of bonds from the total,\n * it will wrap to either 0 or itemCount - 1.\n *\n * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.\n * @param {number} baseIndex The initial position to move from.\n * @param {number} itemCount The total number of items.\n * @param {Function} getItemNodeFromIndex Used to check if item is disabled.\n * @param {boolean} circular Specify if navigation is circular. Default is true.\n * @returns {number} The new index after the move.\n */\n\n\nfunction getNextWrappingIndex(moveAmount, baseIndex, itemCount, getItemNodeFromIndex, circular) {\n if (circular === void 0) {\n circular = true;\n }\n\n if (itemCount === 0) {\n return -1;\n }\n\n const itemsLastIndex = itemCount - 1;\n\n if (typeof baseIndex !== 'number' || baseIndex < 0 || baseIndex >= itemCount) {\n baseIndex = moveAmount > 0 ? -1 : itemsLastIndex + 1;\n }\n\n let newIndex = baseIndex + moveAmount;\n\n if (newIndex < 0) {\n newIndex = circular ? itemsLastIndex : 0;\n } else if (newIndex > itemsLastIndex) {\n newIndex = circular ? 0 : itemsLastIndex;\n }\n\n const nonDisabledNewIndex = getNextNonDisabledIndex(moveAmount, newIndex, itemCount, getItemNodeFromIndex, circular);\n\n if (nonDisabledNewIndex === -1) {\n return baseIndex >= itemCount ? -1 : baseIndex;\n }\n\n return nonDisabledNewIndex;\n}\n/**\n * Returns the next index in the list of an item that is not disabled.\n *\n * @param {number} moveAmount Number of positions to move. Negative to move backwards, positive forwards.\n * @param {number} baseIndex The initial position to move from.\n * @param {number} itemCount The total number of items.\n * @param {Function} getItemNodeFromIndex Used to check if item is disabled.\n * @param {boolean} circular Specify if navigation is circular. Default is true.\n * @returns {number} The new index. Returns baseIndex if item is not disabled. Returns next non-disabled item otherwise. If no non-disabled found it will return -1.\n */\n\n\nfunction getNextNonDisabledIndex(moveAmount, baseIndex, itemCount, getItemNodeFromIndex, circular) {\n const currentElementNode = getItemNodeFromIndex(baseIndex);\n\n if (!currentElementNode || !currentElementNode.hasAttribute('disabled')) {\n return baseIndex;\n }\n\n if (moveAmount > 0) {\n for (let index = baseIndex + 1; index < itemCount; index++) {\n if (!getItemNodeFromIndex(index).hasAttribute('disabled')) {\n return index;\n }\n }\n } else {\n for (let index = baseIndex - 1; index >= 0; index--) {\n if (!getItemNodeFromIndex(index).hasAttribute('disabled')) {\n return index;\n }\n }\n }\n\n if (circular) {\n return moveAmount > 0 ? getNextNonDisabledIndex(1, 0, itemCount, getItemNodeFromIndex, false) : getNextNonDisabledIndex(-1, itemCount - 1, itemCount, getItemNodeFromIndex, false);\n }\n\n return -1;\n}\n/**\n * Checks if event target is within the downshift elements.\n *\n * @param {EventTarget} target Target to check.\n * @param {HTMLElement[]} downshiftElements The elements that form downshift (list, toggle button etc).\n * @param {Window} environment The window context where downshift renders.\n * @param {boolean} checkActiveElement Whether to also check activeElement.\n *\n * @returns {boolean} Whether or not the target is within downshift elements.\n */\n\n\nfunction targetWithinDownshift(target, downshiftElements, environment, checkActiveElement) {\n if (checkActiveElement === void 0) {\n checkActiveElement = true;\n }\n\n return downshiftElements.some(contextNode => contextNode && (isOrContainsNode(contextNode, target, environment) || checkActiveElement && isOrContainsNode(contextNode, environment.document.activeElement, environment)));\n} // eslint-disable-next-line import/no-mutable-exports\n\n\nlet validateControlledUnchanged = noop;\n/* istanbul ignore next */\n\nif (process.env.NODE_ENV !== 'production') {\n validateControlledUnchanged = (state, prevProps, nextProps) => {\n const warningDescription = `This prop should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled Downshift element for the lifetime of the component. More info: https://github.com/downshift-js/downshift#control-props`;\n Object.keys(state).forEach(propKey => {\n if (prevProps[propKey] !== undefined && nextProps[propKey] === undefined) {\n // eslint-disable-next-line no-console\n console.error(`downshift: A component has changed the controlled prop \"${propKey}\" to be uncontrolled. ${warningDescription}`);\n } else if (prevProps[propKey] === undefined && nextProps[propKey] !== undefined) {\n // eslint-disable-next-line no-console\n console.error(`downshift: A component has changed the uncontrolled prop \"${propKey}\" to be controlled. ${warningDescription}`);\n }\n });\n };\n}\n\nconst cleanupStatus = debounce(documentProp => {\n getStatusDiv(documentProp).textContent = '';\n}, 500);\n/**\n * @param {String} status the status message\n * @param {Object} documentProp document passed by the user.\n */\n\nfunction setStatus(status, documentProp) {\n const div = getStatusDiv(documentProp);\n\n if (!status) {\n return;\n }\n\n div.textContent = status;\n cleanupStatus(documentProp);\n}\n/**\n * Get the status node or create it if it does not already exist.\n * @param {Object} documentProp document passed by the user.\n * @return {HTMLElement} the status node.\n */\n\n\nfunction getStatusDiv(documentProp) {\n if (documentProp === void 0) {\n documentProp = document;\n }\n\n let statusDiv = documentProp.getElementById('a11y-status-message');\n\n if (statusDiv) {\n return statusDiv;\n }\n\n statusDiv = documentProp.createElement('div');\n statusDiv.setAttribute('id', 'a11y-status-message');\n statusDiv.setAttribute('role', 'status');\n statusDiv.setAttribute('aria-live', 'polite');\n statusDiv.setAttribute('aria-relevant', 'additions text');\n Object.assign(statusDiv.style, {\n border: '0',\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0',\n position: 'absolute',\n width: '1px'\n });\n documentProp.body.appendChild(statusDiv);\n return statusDiv;\n}\n\nconst unknown = process.env.NODE_ENV !== \"production\" ? '__autocomplete_unknown__' : 0;\nconst mouseUp = process.env.NODE_ENV !== \"production\" ? '__autocomplete_mouseup__' : 1;\nconst itemMouseEnter = process.env.NODE_ENV !== \"production\" ? '__autocomplete_item_mouseenter__' : 2;\nconst keyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_arrow_up__' : 3;\nconst keyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_arrow_down__' : 4;\nconst keyDownEscape = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_escape__' : 5;\nconst keyDownEnter = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_enter__' : 6;\nconst keyDownHome = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_home__' : 7;\nconst keyDownEnd = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_end__' : 8;\nconst clickItem = process.env.NODE_ENV !== \"production\" ? '__autocomplete_click_item__' : 9;\nconst blurInput = process.env.NODE_ENV !== \"production\" ? '__autocomplete_blur_input__' : 10;\nconst changeInput = process.env.NODE_ENV !== \"production\" ? '__autocomplete_change_input__' : 11;\nconst keyDownSpaceButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_keydown_space_button__' : 12;\nconst clickButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_click_button__' : 13;\nconst blurButton = process.env.NODE_ENV !== \"production\" ? '__autocomplete_blur_button__' : 14;\nconst controlledPropUpdatedSelectedItem = process.env.NODE_ENV !== \"production\" ? '__autocomplete_controlled_prop_updated_selected_item__' : 15;\nconst touchEnd = process.env.NODE_ENV !== \"production\" ? '__autocomplete_touchend__' : 16;\n\nvar stateChangeTypes$3 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n unknown: unknown,\n mouseUp: mouseUp,\n itemMouseEnter: itemMouseEnter,\n keyDownArrowUp: keyDownArrowUp,\n keyDownArrowDown: keyDownArrowDown,\n keyDownEscape: keyDownEscape,\n keyDownEnter: keyDownEnter,\n keyDownHome: keyDownHome,\n keyDownEnd: keyDownEnd,\n clickItem: clickItem,\n blurInput: blurInput,\n changeInput: changeInput,\n keyDownSpaceButton: keyDownSpaceButton,\n clickButton: clickButton,\n blurButton: blurButton,\n controlledPropUpdatedSelectedItem: controlledPropUpdatedSelectedItem,\n touchEnd: touchEnd\n});\n\n/* eslint camelcase:0 */\n\nconst Downshift = /*#__PURE__*/(() => {\n class Downshift extends Component {\n constructor(_props) {\n var _this;\n\n super(_props);\n _this = this;\n this.id = this.props.id || `downshift-${generateId()}`;\n this.menuId = this.props.menuId || `${this.id}-menu`;\n this.labelId = this.props.labelId || `${this.id}-label`;\n this.inputId = this.props.inputId || `${this.id}-input`;\n\n this.getItemId = this.props.getItemId || (index => `${this.id}-item-${index}`);\n\n this.input = null;\n this.items = [];\n this.itemCount = null;\n this.previousResultCount = 0;\n this.timeoutIds = [];\n\n this.internalSetTimeout = (fn, time) => {\n const id = setTimeout(() => {\n this.timeoutIds = this.timeoutIds.filter(i => i !== id);\n fn();\n }, time);\n this.timeoutIds.push(id);\n };\n\n this.setItemCount = count => {\n this.itemCount = count;\n };\n\n this.unsetItemCount = () => {\n this.itemCount = null;\n };\n\n this.setHighlightedIndex = function (highlightedIndex, otherStateToSet) {\n if (highlightedIndex === void 0) {\n highlightedIndex = _this.props.defaultHighlightedIndex;\n }\n\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n\n otherStateToSet = pickState(otherStateToSet);\n\n _this.internalSetState({\n highlightedIndex,\n ...otherStateToSet\n });\n };\n\n this.clearSelection = cb => {\n this.internalSetState({\n selectedItem: null,\n inputValue: '',\n highlightedIndex: this.props.defaultHighlightedIndex,\n isOpen: this.props.defaultIsOpen\n }, cb);\n };\n\n this.selectItem = (item, otherStateToSet, cb) => {\n otherStateToSet = pickState(otherStateToSet);\n this.internalSetState({\n isOpen: this.props.defaultIsOpen,\n highlightedIndex: this.props.defaultHighlightedIndex,\n selectedItem: item,\n inputValue: this.props.itemToString(item),\n ...otherStateToSet\n }, cb);\n };\n\n this.selectItemAtIndex = (itemIndex, otherStateToSet, cb) => {\n const item = this.items[itemIndex];\n\n if (item == null) {\n return;\n }\n\n this.selectItem(item, otherStateToSet, cb);\n };\n\n this.selectHighlightedItem = (otherStateToSet, cb) => {\n return this.selectItemAtIndex(this.getState().highlightedIndex, otherStateToSet, cb);\n };\n\n this.internalSetState = (stateToSet, cb) => {\n let isItemSelected, onChangeArg;\n const onStateChangeArg = {};\n const isStateToSetFunction = typeof stateToSet === 'function'; // we want to call `onInputValueChange` before the `setState` call\n // so someone controlling the `inputValue` state gets notified of\n // the input change as soon as possible. This avoids issues with\n // preserving the cursor position.\n // See https://github.com/downshift-js/downshift/issues/217 for more info.\n\n if (!isStateToSetFunction && stateToSet.hasOwnProperty('inputValue')) {\n this.props.onInputValueChange(stateToSet.inputValue, { ...this.getStateAndHelpers(),\n ...stateToSet\n });\n }\n\n return this.setState(state => {\n state = this.getState(state);\n let newStateToSet = isStateToSetFunction ? stateToSet(state) : stateToSet; // Your own function that could modify the state that will be set.\n\n newStateToSet = this.props.stateReducer(state, newStateToSet); // checks if an item is selected, regardless of if it's different from\n // what was selected before\n // used to determine if onSelect and onChange callbacks should be called\n\n isItemSelected = newStateToSet.hasOwnProperty('selectedItem'); // this keeps track of the object we want to call with setState\n\n const nextState = {}; // this is just used to tell whether the state changed\n // and we're trying to update that state. OR if the selection has changed and we're\n // trying to update the selection\n\n if (isItemSelected && newStateToSet.selectedItem !== state.selectedItem) {\n onChangeArg = newStateToSet.selectedItem;\n }\n\n newStateToSet.type = newStateToSet.type || unknown;\n Object.keys(newStateToSet).forEach(key => {\n // onStateChangeArg should only have the state that is\n // actually changing\n if (state[key] !== newStateToSet[key]) {\n onStateChangeArg[key] = newStateToSet[key];\n } // the type is useful for the onStateChangeArg\n // but we don't actually want to set it in internal state.\n // this is an undocumented feature for now... Not all internalSetState\n // calls support it and I'm not certain we want them to yet.\n // But it enables users controlling the isOpen state to know when\n // the isOpen state changes due to mouseup events which is quite handy.\n\n\n if (key === 'type') {\n return;\n }\n\n newStateToSet[key]; // if it's coming from props, then we don't care to set it internally\n\n if (!isControlledProp(this.props, key)) {\n nextState[key] = newStateToSet[key];\n }\n }); // if stateToSet is a function, then we weren't able to call onInputValueChange\n // earlier, so we'll call it now that we know what the inputValue state will be.\n\n if (isStateToSetFunction && newStateToSet.hasOwnProperty('inputValue')) {\n this.props.onInputValueChange(newStateToSet.inputValue, { ...this.getStateAndHelpers(),\n ...newStateToSet\n });\n }\n\n return nextState;\n }, () => {\n // call the provided callback if it's a function\n cbToCb(cb)(); // only call the onStateChange and onChange callbacks if\n // we have relevant information to pass them.\n\n const hasMoreStateThanType = Object.keys(onStateChangeArg).length > 1;\n\n if (hasMoreStateThanType) {\n this.props.onStateChange(onStateChangeArg, this.getStateAndHelpers());\n }\n\n if (isItemSelected) {\n this.props.onSelect(stateToSet.selectedItem, this.getStateAndHelpers());\n }\n\n if (onChangeArg !== undefined) {\n this.props.onChange(onChangeArg, this.getStateAndHelpers());\n } // this is currently undocumented and therefore subject to change\n // We'll try to not break it, but just be warned.\n\n\n this.props.onUserAction(onStateChangeArg, this.getStateAndHelpers());\n });\n };\n\n this.rootRef = node => this._rootNode = node;\n\n this.getRootProps = function (_temp, _temp2) {\n let {\n refKey = 'ref',\n ref,\n ...rest\n } = _temp === void 0 ? {} : _temp;\n let {\n suppressRefError = false\n } = _temp2 === void 0 ? {} : _temp2;\n // this is used in the render to know whether the user has called getRootProps.\n // It uses that to know whether to apply the props automatically\n _this.getRootProps.called = true;\n _this.getRootProps.refKey = refKey;\n _this.getRootProps.suppressRefError = suppressRefError;\n\n const {\n isOpen\n } = _this.getState();\n\n return {\n [refKey]: handleRefs(ref, _this.rootRef),\n role: 'combobox',\n 'aria-expanded': isOpen,\n 'aria-haspopup': 'listbox',\n 'aria-owns': isOpen ? _this.menuId : null,\n 'aria-labelledby': _this.labelId,\n ...rest\n };\n };\n\n this.keyDownHandlers = {\n ArrowDown(event) {\n event.preventDefault();\n\n if (this.getState().isOpen) {\n const amount = event.shiftKey ? 5 : 1;\n this.moveHighlightedIndex(amount, {\n type: keyDownArrowDown\n });\n } else {\n this.internalSetState({\n isOpen: true,\n type: keyDownArrowDown\n }, () => {\n const itemCount = this.getItemCount();\n\n if (itemCount > 0) {\n const {\n highlightedIndex\n } = this.getState();\n const nextHighlightedIndex = getNextWrappingIndex(1, highlightedIndex, itemCount, index => this.getItemNodeFromIndex(index));\n this.setHighlightedIndex(nextHighlightedIndex, {\n type: keyDownArrowDown\n });\n }\n });\n }\n },\n\n ArrowUp(event) {\n event.preventDefault();\n\n if (this.getState().isOpen) {\n const amount = event.shiftKey ? -5 : -1;\n this.moveHighlightedIndex(amount, {\n type: keyDownArrowUp\n });\n } else {\n this.internalSetState({\n isOpen: true,\n type: keyDownArrowUp\n }, () => {\n const itemCount = this.getItemCount();\n\n if (itemCount > 0) {\n const {\n highlightedIndex\n } = this.getState();\n const nextHighlightedIndex = getNextWrappingIndex(-1, highlightedIndex, itemCount, index => this.getItemNodeFromIndex(index));\n this.setHighlightedIndex(nextHighlightedIndex, {\n type: keyDownArrowUp\n });\n }\n });\n }\n },\n\n Enter(event) {\n if (event.which === 229) {\n return;\n }\n\n const {\n isOpen,\n highlightedIndex\n } = this.getState();\n\n if (isOpen && highlightedIndex != null) {\n event.preventDefault();\n const item = this.items[highlightedIndex];\n const itemNode = this.getItemNodeFromIndex(highlightedIndex);\n\n if (item == null || itemNode && itemNode.hasAttribute('disabled')) {\n return;\n }\n\n this.selectHighlightedItem({\n type: keyDownEnter\n });\n }\n },\n\n Escape(event) {\n event.preventDefault();\n this.reset({\n type: keyDownEscape,\n ...(!this.state.isOpen && {\n selectedItem: null,\n inputValue: ''\n })\n });\n }\n\n };\n this.buttonKeyDownHandlers = { ...this.keyDownHandlers,\n\n ' '(event) {\n event.preventDefault();\n this.toggleMenu({\n type: keyDownSpaceButton\n });\n }\n\n };\n this.inputKeyDownHandlers = { ...this.keyDownHandlers,\n\n Home(event) {\n const {\n isOpen\n } = this.getState();\n\n if (!isOpen) {\n return;\n }\n\n event.preventDefault();\n const itemCount = this.getItemCount();\n\n if (itemCount <= 0 || !isOpen) {\n return;\n } // get next non-disabled starting downwards from 0 if that's disabled.\n\n\n const newHighlightedIndex = getNextNonDisabledIndex(1, 0, itemCount, index => this.getItemNodeFromIndex(index), false);\n this.setHighlightedIndex(newHighlightedIndex, {\n type: keyDownHome\n });\n },\n\n End(event) {\n const {\n isOpen\n } = this.getState();\n\n if (!isOpen) {\n return;\n }\n\n event.preventDefault();\n const itemCount = this.getItemCount();\n\n if (itemCount <= 0 || !isOpen) {\n return;\n } // get next non-disabled starting upwards from last index if that's disabled.\n\n\n const newHighlightedIndex = getNextNonDisabledIndex(-1, itemCount - 1, itemCount, index => this.getItemNodeFromIndex(index), false);\n this.setHighlightedIndex(newHighlightedIndex, {\n type: keyDownEnd\n });\n }\n\n };\n\n this.getToggleButtonProps = function (_temp3) {\n let {\n onClick,\n onPress,\n onKeyDown,\n onKeyUp,\n onBlur,\n ...rest\n } = _temp3 === void 0 ? {} : _temp3;\n\n const {\n isOpen\n } = _this.getState();\n\n const enabledEventHandlers = {\n onClick: callAllEventHandlers(onClick, _this.buttonHandleClick),\n onKeyDown: callAllEventHandlers(onKeyDown, _this.buttonHandleKeyDown),\n onKeyUp: callAllEventHandlers(onKeyUp, _this.buttonHandleKeyUp),\n onBlur: callAllEventHandlers(onBlur, _this.buttonHandleBlur)\n };\n const eventHandlers = rest.disabled ? {} : enabledEventHandlers;\n return {\n type: 'button',\n role: 'button',\n 'aria-label': isOpen ? 'close menu' : 'open menu',\n 'aria-haspopup': true,\n 'data-toggle': true,\n ...eventHandlers,\n ...rest\n };\n };\n\n this.buttonHandleKeyUp = event => {\n // Prevent click event from emitting in Firefox\n event.preventDefault();\n };\n\n this.buttonHandleKeyDown = event => {\n const key = normalizeArrowKey(event);\n\n if (this.buttonKeyDownHandlers[key]) {\n this.buttonKeyDownHandlers[key].call(this, event);\n }\n };\n\n this.buttonHandleClick = event => {\n event.preventDefault(); // handle odd case for Safari and Firefox which\n // don't give the button the focus properly.\n\n /* istanbul ignore if (can't reasonably test this) */\n\n if (this.props.environment.document.activeElement === this.props.environment.document.body) {\n event.target.focus();\n } // to simplify testing components that use downshift, we'll not wrap this in a setTimeout\n // if the NODE_ENV is test. With the proper build system, this should be dead code eliminated\n // when building for production and should therefore have no impact on production code.\n\n\n if (process.env.NODE_ENV === 'test') {\n this.toggleMenu({\n type: clickButton\n });\n } else {\n // Ensure that toggle of menu occurs after the potential blur event in iOS\n this.internalSetTimeout(() => this.toggleMenu({\n type: clickButton\n }));\n }\n };\n\n this.buttonHandleBlur = event => {\n const blurTarget = event.target; // Save blur target for comparison with activeElement later\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not body element\n\n this.internalSetTimeout(() => {\n if (!this.isMouseDown && (this.props.environment.document.activeElement == null || this.props.environment.document.activeElement.id !== this.inputId) && this.props.environment.document.activeElement !== blurTarget // Do nothing if we refocus the same element again (to solve issue in Safari on iOS)\n ) {\n this.reset({\n type: blurButton\n });\n }\n });\n };\n\n this.getLabelProps = props => {\n return {\n htmlFor: this.inputId,\n id: this.labelId,\n ...props\n };\n };\n\n this.getInputProps = function (_temp4) {\n let {\n onKeyDown,\n onBlur,\n onChange,\n onInput,\n onChangeText,\n ...rest\n } = _temp4 === void 0 ? {} : _temp4;\n let onChangeKey;\n let eventHandlers = {};\n /* istanbul ignore next (preact) */\n\n {\n onChangeKey = 'onChange';\n }\n\n const {\n inputValue,\n isOpen,\n highlightedIndex\n } = _this.getState();\n\n if (!rest.disabled) {\n eventHandlers = {\n [onChangeKey]: callAllEventHandlers(onChange, onInput, _this.inputHandleChange),\n onKeyDown: callAllEventHandlers(onKeyDown, _this.inputHandleKeyDown),\n onBlur: callAllEventHandlers(onBlur, _this.inputHandleBlur)\n };\n }\n\n return {\n 'aria-autocomplete': 'list',\n 'aria-activedescendant': isOpen && typeof highlightedIndex === 'number' && highlightedIndex >= 0 ? _this.getItemId(highlightedIndex) : null,\n 'aria-controls': isOpen ? _this.menuId : null,\n 'aria-labelledby': _this.labelId,\n // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion\n // revert back since autocomplete=\"nope\" is ignored on latest Chrome and Opera\n autoComplete: 'off',\n value: inputValue,\n id: _this.inputId,\n ...eventHandlers,\n ...rest\n };\n };\n\n this.inputHandleKeyDown = event => {\n const key = normalizeArrowKey(event);\n\n if (key && this.inputKeyDownHandlers[key]) {\n this.inputKeyDownHandlers[key].call(this, event);\n }\n };\n\n this.inputHandleChange = event => {\n this.internalSetState({\n type: changeInput,\n isOpen: true,\n inputValue: event.target.value,\n highlightedIndex: this.props.defaultHighlightedIndex\n });\n };\n\n this.inputHandleBlur = () => {\n // Need setTimeout, so that when the user presses Tab, the activeElement is the next focused element, not the body element\n this.internalSetTimeout(() => {\n const downshiftButtonIsActive = this.props.environment.document && !!this.props.environment.document.activeElement && !!this.props.environment.document.activeElement.dataset && this.props.environment.document.activeElement.dataset.toggle && this._rootNode && this._rootNode.contains(this.props.environment.document.activeElement);\n\n if (!this.isMouseDown && !downshiftButtonIsActive) {\n this.reset({\n type: blurInput\n });\n }\n });\n };\n\n this.menuRef = node => {\n this._menuNode = node;\n };\n\n this.getMenuProps = function (_temp5, _temp6) {\n let {\n refKey = 'ref',\n ref,\n ...props\n } = _temp5 === void 0 ? {} : _temp5;\n let {\n suppressRefError = false\n } = _temp6 === void 0 ? {} : _temp6;\n _this.getMenuProps.called = true;\n _this.getMenuProps.refKey = refKey;\n _this.getMenuProps.suppressRefError = suppressRefError;\n return {\n [refKey]: handleRefs(ref, _this.menuRef),\n role: 'listbox',\n 'aria-labelledby': props && props['aria-label'] ? null : _this.labelId,\n id: _this.menuId,\n ...props\n };\n };\n\n this.getItemProps = function (_temp7) {\n let {\n onMouseMove,\n onMouseDown,\n onClick,\n onPress,\n index,\n item = process.env.NODE_ENV === 'production' ?\n /* istanbul ignore next */\n undefined : requiredProp('getItemProps', 'item'),\n ...rest\n } = _temp7 === void 0 ? {} : _temp7;\n\n if (index === undefined) {\n _this.items.push(item);\n\n index = _this.items.indexOf(item);\n } else {\n _this.items[index] = item;\n }\n\n const onSelectKey = 'onClick';\n const customClickHandler = onClick;\n const enabledEventHandlers = {\n // onMouseMove is used over onMouseEnter here. onMouseMove\n // is only triggered on actual mouse movement while onMouseEnter\n // can fire on DOM changes, interrupting keyboard navigation\n onMouseMove: callAllEventHandlers(onMouseMove, () => {\n if (index === _this.getState().highlightedIndex) {\n return;\n }\n\n _this.setHighlightedIndex(index, {\n type: itemMouseEnter\n }); // We never want to manually scroll when changing state based\n // on `onMouseMove` because we will be moving the element out\n // from under the user which is currently scrolling/moving the\n // cursor\n\n\n _this.avoidScrolling = true;\n\n _this.internalSetTimeout(() => _this.avoidScrolling = false, 250);\n }),\n onMouseDown: callAllEventHandlers(onMouseDown, event => {\n // This prevents the activeElement from being changed\n // to the item so it can remain with the current activeElement\n // which is a more common use case.\n event.preventDefault();\n }),\n [onSelectKey]: callAllEventHandlers(customClickHandler, () => {\n _this.selectItemAtIndex(index, {\n type: clickItem\n });\n })\n }; // Passing down the onMouseDown handler to prevent redirect\n // of the activeElement if clicking on disabled items\n\n const eventHandlers = rest.disabled ? {\n onMouseDown: enabledEventHandlers.onMouseDown\n } : enabledEventHandlers;\n return {\n id: _this.getItemId(index),\n role: 'option',\n 'aria-selected': _this.getState().highlightedIndex === index,\n ...eventHandlers,\n ...rest\n };\n };\n\n this.clearItems = () => {\n this.items = [];\n };\n\n this.reset = function (otherStateToSet, cb) {\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n\n otherStateToSet = pickState(otherStateToSet);\n\n _this.internalSetState(_ref => {\n let {\n selectedItem\n } = _ref;\n return {\n isOpen: _this.props.defaultIsOpen,\n highlightedIndex: _this.props.defaultHighlightedIndex,\n inputValue: _this.props.itemToString(selectedItem),\n ...otherStateToSet\n };\n }, cb);\n };\n\n this.toggleMenu = function (otherStateToSet, cb) {\n if (otherStateToSet === void 0) {\n otherStateToSet = {};\n }\n\n otherStateToSet = pickState(otherStateToSet);\n\n _this.internalSetState(_ref2 => {\n let {\n isOpen\n } = _ref2;\n return {\n isOpen: !isOpen,\n ...(isOpen && {\n highlightedIndex: _this.props.defaultHighlightedIndex\n }),\n ...otherStateToSet\n };\n }, () => {\n const {\n isOpen,\n highlightedIndex\n } = _this.getState();\n\n if (isOpen) {\n if (_this.getItemCount() > 0 && typeof highlightedIndex === 'number') {\n _this.setHighlightedIndex(highlightedIndex, otherStateToSet);\n }\n }\n\n cbToCb(cb)();\n });\n };\n\n this.openMenu = cb => {\n this.internalSetState({\n isOpen: true\n }, cb);\n };\n\n this.closeMenu = cb => {\n this.internalSetState({\n isOpen: false\n }, cb);\n };\n\n this.updateStatus = debounce(() => {\n const state = this.getState();\n const item = this.items[state.highlightedIndex];\n const resultCount = this.getItemCount();\n const status = this.props.getA11yStatusMessage({\n itemToString: this.props.itemToString,\n previousResultCount: this.previousResultCount,\n resultCount,\n highlightedItem: item,\n ...state\n });\n this.previousResultCount = resultCount;\n setStatus(status, this.props.environment.document);\n }, 200);\n // fancy destructuring + defaults + aliases\n // this basically says each value of state should either be set to\n // the initial value or the default value if the initial value is not provided\n const {\n defaultHighlightedIndex,\n initialHighlightedIndex: _highlightedIndex = defaultHighlightedIndex,\n defaultIsOpen,\n initialIsOpen: _isOpen = defaultIsOpen,\n initialInputValue: _inputValue = '',\n initialSelectedItem: _selectedItem = null\n } = this.props;\n\n const _state = this.getState({\n highlightedIndex: _highlightedIndex,\n isOpen: _isOpen,\n inputValue: _inputValue,\n selectedItem: _selectedItem\n });\n\n if (_state.selectedItem != null && this.props.initialInputValue === undefined) {\n _state.inputValue = this.props.itemToString(_state.selectedItem);\n }\n\n this.state = _state;\n }\n\n /**\n * Clear all running timeouts\n */\n internalClearTimeouts() {\n this.timeoutIds.forEach(id => {\n clearTimeout(id);\n });\n this.timeoutIds = [];\n }\n /**\n * Gets the state based on internal state or props\n * If a state value is passed via props, then that\n * is the value given, otherwise it's retrieved from\n * stateToMerge\n *\n * @param {Object} stateToMerge defaults to this.state\n * @return {Object} the state\n */\n\n\n getState(stateToMerge) {\n if (stateToMerge === void 0) {\n stateToMerge = this.state;\n }\n\n return getState(stateToMerge, this.props);\n }\n\n getItemCount() {\n // things read better this way. They're in priority order:\n // 1. `this.itemCount`\n // 2. `this.props.itemCount`\n // 3. `this.items.length`\n let itemCount = this.items.length;\n\n if (this.itemCount != null) {\n itemCount = this.itemCount;\n } else if (this.props.itemCount !== undefined) {\n itemCount = this.props.itemCount;\n }\n\n return itemCount;\n }\n\n getItemNodeFromIndex(index) {\n return this.props.environment.document.getElementById(this.getItemId(index));\n }\n\n scrollHighlightedItemIntoView() {\n /* istanbul ignore else (react-native) */\n {\n const node = this.getItemNodeFromIndex(this.getState().highlightedIndex);\n this.props.scrollIntoView(node, this._menuNode);\n }\n }\n\n moveHighlightedIndex(amount, otherStateToSet) {\n const itemCount = this.getItemCount();\n const {\n highlightedIndex\n } = this.getState();\n\n if (itemCount > 0) {\n const nextHighlightedIndex = getNextWrappingIndex(amount, highlightedIndex, itemCount, index => this.getItemNodeFromIndex(index));\n this.setHighlightedIndex(nextHighlightedIndex, otherStateToSet);\n }\n }\n\n getStateAndHelpers() {\n const {\n highlightedIndex,\n inputValue,\n selectedItem,\n isOpen\n } = this.getState();\n const {\n itemToString\n } = this.props;\n const {\n id\n } = this;\n const {\n getRootProps,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getItemProps,\n openMenu,\n closeMenu,\n toggleMenu,\n selectItem,\n selectItemAtIndex,\n selectHighlightedItem,\n setHighlightedIndex,\n clearSelection,\n clearItems,\n reset,\n setItemCount,\n unsetItemCount,\n internalSetState: setState\n } = this;\n return {\n // prop getters\n getRootProps,\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getItemProps,\n // actions\n reset,\n openMenu,\n closeMenu,\n toggleMenu,\n selectItem,\n selectItemAtIndex,\n selectHighlightedItem,\n setHighlightedIndex,\n clearSelection,\n clearItems,\n setItemCount,\n unsetItemCount,\n setState,\n // props\n itemToString,\n // derived\n id,\n // state\n highlightedIndex,\n inputValue,\n isOpen,\n selectedItem\n };\n } //////////////////////////// ROOT\n\n\n componentDidMount() {\n /* istanbul ignore if (react-native) */\n if (process.env.NODE_ENV !== 'production' && !false && this.getMenuProps.called && !this.getMenuProps.suppressRefError) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);\n }\n /* istanbul ignore if (react-native) */\n\n\n {\n // this.isMouseDown helps us track whether the mouse is currently held down.\n // This is useful when the user clicks on an item in the list, but holds the mouse\n // down long enough for the list to disappear (because the blur event fires on the input)\n // this.isMouseDown is used in the blur handler on the input to determine whether the blur event should\n // trigger hiding the menu.\n const onMouseDown = () => {\n this.isMouseDown = true;\n };\n\n const onMouseUp = event => {\n this.isMouseDown = false; // if the target element or the activeElement is within a downshift node\n // then we don't want to reset downshift\n\n const contextWithinDownshift = targetWithinDownshift(event.target, [this._rootNode, this._menuNode], this.props.environment);\n\n if (!contextWithinDownshift && this.getState().isOpen) {\n this.reset({\n type: mouseUp\n }, () => this.props.onOuterClick(this.getStateAndHelpers()));\n }\n }; // Touching an element in iOS gives focus and hover states, but touching out of\n // the element will remove hover, and persist the focus state, resulting in the\n // blur event not being triggered.\n // this.isTouchMove helps us track whether the user is tapping or swiping on a touch screen.\n // If the user taps outside of Downshift, the component should be reset,\n // but not if the user is swiping\n\n\n const onTouchStart = () => {\n this.isTouchMove = false;\n };\n\n const onTouchMove = () => {\n this.isTouchMove = true;\n };\n\n const onTouchEnd = event => {\n const contextWithinDownshift = targetWithinDownshift(event.target, [this._rootNode, this._menuNode], this.props.environment, false);\n\n if (!this.isTouchMove && !contextWithinDownshift && this.getState().isOpen) {\n this.reset({\n type: touchEnd\n }, () => this.props.onOuterClick(this.getStateAndHelpers()));\n }\n };\n\n const {\n environment\n } = this.props;\n environment.addEventListener('mousedown', onMouseDown);\n environment.addEventListener('mouseup', onMouseUp);\n environment.addEventListener('touchstart', onTouchStart);\n environment.addEventListener('touchmove', onTouchMove);\n environment.addEventListener('touchend', onTouchEnd);\n\n this.cleanup = () => {\n this.internalClearTimeouts();\n this.updateStatus.cancel();\n environment.removeEventListener('mousedown', onMouseDown);\n environment.removeEventListener('mouseup', onMouseUp);\n environment.removeEventListener('touchstart', onTouchStart);\n environment.removeEventListener('touchmove', onTouchMove);\n environment.removeEventListener('touchend', onTouchEnd);\n };\n }\n }\n\n shouldScroll(prevState, prevProps) {\n const {\n highlightedIndex: currentHighlightedIndex\n } = this.props.highlightedIndex === undefined ? this.getState() : this.props;\n const {\n highlightedIndex: prevHighlightedIndex\n } = prevProps.highlightedIndex === undefined ? prevState : prevProps;\n const scrollWhenOpen = currentHighlightedIndex && this.getState().isOpen && !prevState.isOpen;\n const scrollWhenNavigating = currentHighlightedIndex !== prevHighlightedIndex;\n return scrollWhenOpen || scrollWhenNavigating;\n }\n\n componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== 'production') {\n validateControlledUnchanged(this.state, prevProps, this.props);\n /* istanbul ignore if (react-native) */\n\n if (this.getMenuProps.called && !this.getMenuProps.suppressRefError) {\n validateGetMenuPropsCalledCorrectly(this._menuNode, this.getMenuProps);\n }\n }\n\n if (isControlledProp(this.props, 'selectedItem') && this.props.selectedItemChanged(prevProps.selectedItem, this.props.selectedItem)) {\n this.internalSetState({\n type: controlledPropUpdatedSelectedItem,\n inputValue: this.props.itemToString(this.props.selectedItem)\n });\n }\n\n if (!this.avoidScrolling && this.shouldScroll(prevState, prevProps)) {\n this.scrollHighlightedItemIntoView();\n }\n /* istanbul ignore else (react-native) */\n\n\n {\n this.updateStatus();\n }\n }\n\n componentWillUnmount() {\n this.cleanup(); // avoids memory leak\n }\n\n render() {\n const children = unwrapArray(this.props.children, noop); // because the items are rerendered every time we call the children\n // we clear this out each render and it will be populated again as\n // getItemProps is called.\n\n this.clearItems(); // we reset this so we know whether the user calls getRootProps during\n // this render. If they do then we don't need to do anything,\n // if they don't then we need to clone the element they return and\n // apply the props for them.\n\n this.getRootProps.called = false;\n this.getRootProps.refKey = undefined;\n this.getRootProps.suppressRefError = undefined; // we do something similar for getMenuProps\n\n this.getMenuProps.called = false;\n this.getMenuProps.refKey = undefined;\n this.getMenuProps.suppressRefError = undefined; // we do something similar for getLabelProps\n\n this.getLabelProps.called = false; // and something similar for getInputProps\n\n this.getInputProps.called = false;\n const element = unwrapArray(children(this.getStateAndHelpers()));\n\n if (!element) {\n return null;\n }\n\n if (this.getRootProps.called || this.props.suppressRefError) {\n if (process.env.NODE_ENV !== 'production' && !this.getRootProps.suppressRefError && !this.props.suppressRefError) {\n validateGetRootPropsCalledCorrectly(element, this.getRootProps);\n }\n\n return element;\n } else if (isDOMElement(element)) {\n // they didn't apply the root props, but we can clone\n // this and apply the props ourselves\n return /*#__PURE__*/cloneElement(element, this.getRootProps(getElementProps(element)));\n }\n /* istanbul ignore else */\n\n\n if (process.env.NODE_ENV !== 'production') {\n // they didn't apply the root props, but they need to\n // otherwise we can't query around the autocomplete\n throw new Error('downshift: If you return a non-DOM element, you must apply the getRootProps function');\n }\n /* istanbul ignore next */\n\n\n return undefined;\n }\n\n }\n\n Downshift.defaultProps = {\n defaultHighlightedIndex: null,\n defaultIsOpen: false,\n getA11yStatusMessage: getA11yStatusMessage$1,\n itemToString: i => {\n if (i == null) {\n return '';\n }\n\n if (process.env.NODE_ENV !== 'production' && isPlainObject(i) && !i.hasOwnProperty('toString')) {\n // eslint-disable-next-line no-console\n console.warn('downshift: An object was passed to the default implementation of `itemToString`. You should probably provide your own `itemToString` implementation. Please refer to the `itemToString` API documentation.', 'The object that was passed:', i);\n }\n\n return String(i);\n },\n onStateChange: noop,\n onInputValueChange: noop,\n onUserAction: noop,\n onChange: noop,\n onSelect: noop,\n onOuterClick: noop,\n selectedItemChanged: (prevItem, item) => prevItem !== item,\n environment:\n /* istanbul ignore next (ssr) */\n typeof window === 'undefined' ? {} : window,\n stateReducer: (state, stateToSet) => stateToSet,\n suppressRefError: false,\n scrollIntoView\n };\n Downshift.stateChangeTypes = stateChangeTypes$3;\n return Downshift;\n})();\n\nprocess.env.NODE_ENV !== \"production\" ? Downshift.propTypes = {\n children: PropTypes.func,\n defaultHighlightedIndex: PropTypes.number,\n defaultIsOpen: PropTypes.bool,\n initialHighlightedIndex: PropTypes.number,\n initialSelectedItem: PropTypes.any,\n initialInputValue: PropTypes.string,\n initialIsOpen: PropTypes.bool,\n getA11yStatusMessage: PropTypes.func,\n itemToString: PropTypes.func,\n onChange: PropTypes.func,\n onSelect: PropTypes.func,\n onStateChange: PropTypes.func,\n onInputValueChange: PropTypes.func,\n onUserAction: PropTypes.func,\n onOuterClick: PropTypes.func,\n selectedItemChanged: PropTypes.func,\n stateReducer: PropTypes.func,\n itemCount: PropTypes.number,\n id: PropTypes.string,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any\n })\n }),\n suppressRefError: PropTypes.bool,\n scrollIntoView: PropTypes.func,\n // things we keep in state for uncontrolled components\n // but can accept as props for controlled components\n\n /* eslint-disable react/no-unused-prop-types */\n selectedItem: PropTypes.any,\n isOpen: PropTypes.bool,\n inputValue: PropTypes.string,\n highlightedIndex: PropTypes.number,\n labelId: PropTypes.string,\n inputId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func\n /* eslint-enable react/no-unused-prop-types */\n\n} : void 0;\nvar Downshift$1 = Downshift;\n\nfunction validateGetMenuPropsCalledCorrectly(node, _ref3) {\n let {\n refKey\n } = _ref3;\n\n if (!node) {\n // eslint-disable-next-line no-console\n console.error(`downshift: The ref prop \"${refKey}\" from getMenuProps was not applied correctly on your menu element.`);\n }\n}\n\nfunction validateGetRootPropsCalledCorrectly(element, _ref4) {\n let {\n refKey\n } = _ref4;\n const refKeySpecified = refKey !== 'ref';\n const isComposite = !isDOMElement(element);\n\n if (isComposite && !refKeySpecified && !isForwardRef(element)) {\n // eslint-disable-next-line no-console\n console.error('downshift: You returned a non-DOM element. You must specify a refKey in getRootProps');\n } else if (!isComposite && refKeySpecified) {\n // eslint-disable-next-line no-console\n console.error(`downshift: You returned a DOM element. You should not specify a refKey in getRootProps. You specified \"${refKey}\"`);\n }\n\n if (!isForwardRef(element) && !getElementProps(element)[refKey]) {\n // eslint-disable-next-line no-console\n console.error(`downshift: You must apply the ref prop \"${refKey}\" from getRootProps onto your root element.`);\n }\n}\n\nconst dropdownDefaultStateValues = {\n highlightedIndex: -1,\n isOpen: false,\n selectedItem: null,\n inputValue: ''\n};\n\nfunction callOnChangeProps(action, state, newState) {\n const {\n props,\n type\n } = action;\n const changes = {};\n Object.keys(state).forEach(key => {\n invokeOnChangeHandler(key, action, state, newState);\n\n if (newState[key] !== state[key]) {\n changes[key] = newState[key];\n }\n });\n\n if (props.onStateChange && Object.keys(changes).length) {\n props.onStateChange({\n type,\n ...changes\n });\n }\n}\n\nfunction invokeOnChangeHandler(key, action, state, newState) {\n const {\n props,\n type\n } = action;\n const handler = `on${capitalizeString(key)}Change`;\n\n if (props[handler] && newState[key] !== undefined && newState[key] !== state[key]) {\n props[handler]({\n type,\n ...newState\n });\n }\n}\n/**\n * Default state reducer that returns the changes.\n *\n * @param {Object} s state.\n * @param {Object} a action with changes.\n * @returns {Object} changes.\n */\n\n\nfunction stateReducer(s, a) {\n return a.changes;\n}\n/**\n * Returns a message to be added to aria-live region when item is selected.\n *\n * @param {Object} selectionParameters Parameters required to build the message.\n * @returns {string} The a11y message.\n */\n\n\nfunction getA11ySelectionMessage(selectionParameters) {\n const {\n selectedItem,\n itemToString: itemToStringLocal\n } = selectionParameters;\n return selectedItem ? `${itemToStringLocal(selectedItem)} has been selected.` : '';\n}\n/**\n * Debounced call for updating the a11y message.\n */\n\n\nconst updateA11yStatus = debounce((getA11yMessage, document) => {\n setStatus(getA11yMessage(), document);\n}, 200); // istanbul ignore next\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;\n\nfunction useElementIds(_ref) {\n let {\n id = `downshift-${generateId()}`,\n labelId,\n menuId,\n getItemId,\n toggleButtonId,\n inputId\n } = _ref;\n const elementIdsRef = useRef({\n labelId: labelId || `${id}-label`,\n menuId: menuId || `${id}-menu`,\n getItemId: getItemId || (index => `${id}-item-${index}`),\n toggleButtonId: toggleButtonId || `${id}-toggle-button`,\n inputId: inputId || `${id}-input`\n });\n return elementIdsRef.current;\n}\n\nfunction getItemIndex(index, item, items) {\n if (index !== undefined) {\n return index;\n }\n\n if (items.length === 0) {\n return -1;\n }\n\n return items.indexOf(item);\n}\n\nfunction itemToString(item) {\n return item ? String(item) : '';\n}\n\nfunction isAcceptedCharacterKey(key) {\n return /^\\S{1}$/.test(key);\n}\n\nfunction capitalizeString(string) {\n return `${string.slice(0, 1).toUpperCase()}${string.slice(1)}`;\n}\n\nfunction useLatestRef(val) {\n const ref = useRef(val); // technically this is not \"concurrent mode safe\" because we're manipulating\n // the value during render (so it's not idempotent). However, the places this\n // hook is used is to support memoizing callbacks which will be called\n // *during* render, so we need the latest values *during* render.\n // If not for this, then we'd probably want to use useLayoutEffect instead.\n\n ref.current = val;\n return ref;\n}\n/**\n * Computes the controlled state using a the previous state, props,\n * two reducers, one from downshift and an optional one from the user.\n * Also calls the onChange handlers for state values that have changed.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} initialState Initial state of the hook.\n * @param {Object} props The hook props.\n * @returns {Array} An array with the state and an action dispatcher.\n */\n\n\nfunction useEnhancedReducer(reducer, initialState, props) {\n const prevStateRef = useRef();\n const actionRef = useRef();\n const enhancedReducer = useCallback((state, action) => {\n actionRef.current = action;\n state = getState(state, action.props);\n const changes = reducer(state, action);\n const newState = action.props.stateReducer(state, { ...action,\n changes\n });\n return newState;\n }, [reducer]);\n const [state, dispatch] = useReducer(enhancedReducer, initialState);\n const propsRef = useLatestRef(props);\n const dispatchWithProps = useCallback(action => dispatch({\n props: propsRef.current,\n ...action\n }), [propsRef]);\n const action = actionRef.current;\n useEffect(() => {\n if (action && prevStateRef.current && prevStateRef.current !== state) {\n callOnChangeProps(action, getState(prevStateRef.current, action.props), state);\n }\n\n prevStateRef.current = state;\n }, [state, props, action]);\n return [state, dispatchWithProps];\n}\n/**\n * Wraps the useEnhancedReducer and applies the controlled prop values before\n * returning the new state.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} initialState Initial state of the hook.\n * @param {Object} props The hook props.\n * @returns {Array} An array with the state and an action dispatcher.\n */\n\n\nfunction useControlledReducer$1(reducer, initialState, props) {\n const [state, dispatch] = useEnhancedReducer(reducer, initialState, props);\n return [getState(state, props), dispatch];\n}\n\nconst defaultProps$3 = {\n itemToString,\n stateReducer,\n getA11ySelectionMessage,\n scrollIntoView,\n circularNavigation: false,\n environment:\n /* istanbul ignore next (ssr) */\n typeof window === 'undefined' ? {} : window\n};\n\nfunction getDefaultValue$1(props, propKey, defaultStateValues) {\n if (defaultStateValues === void 0) {\n defaultStateValues = dropdownDefaultStateValues;\n }\n\n const defaultValue = props[`default${capitalizeString(propKey)}`];\n\n if (defaultValue !== undefined) {\n return defaultValue;\n }\n\n return defaultStateValues[propKey];\n}\n\nfunction getInitialValue$1(props, propKey, defaultStateValues) {\n if (defaultStateValues === void 0) {\n defaultStateValues = dropdownDefaultStateValues;\n }\n\n const value = props[propKey];\n\n if (value !== undefined) {\n return value;\n }\n\n const initialValue = props[`initial${capitalizeString(propKey)}`];\n\n if (initialValue !== undefined) {\n return initialValue;\n }\n\n return getDefaultValue$1(props, propKey, defaultStateValues);\n}\n\nfunction getInitialState$2(props) {\n const selectedItem = getInitialValue$1(props, 'selectedItem');\n const isOpen = getInitialValue$1(props, 'isOpen');\n const highlightedIndex = getInitialValue$1(props, 'highlightedIndex');\n const inputValue = getInitialValue$1(props, 'inputValue');\n return {\n highlightedIndex: highlightedIndex < 0 && selectedItem && isOpen ? props.items.indexOf(selectedItem) : highlightedIndex,\n isOpen,\n selectedItem,\n inputValue\n };\n}\n\nfunction getHighlightedIndexOnOpen(props, state, offset, getItemNodeFromIndex) {\n const {\n items,\n initialHighlightedIndex,\n defaultHighlightedIndex\n } = props;\n const {\n selectedItem,\n highlightedIndex\n } = state;\n\n if (items.length === 0) {\n return -1;\n } // initialHighlightedIndex will give value to highlightedIndex on initial state only.\n\n\n if (initialHighlightedIndex !== undefined && highlightedIndex === initialHighlightedIndex) {\n return initialHighlightedIndex;\n }\n\n if (defaultHighlightedIndex !== undefined) {\n return defaultHighlightedIndex;\n }\n\n if (selectedItem) {\n if (offset === 0) {\n return items.indexOf(selectedItem);\n }\n\n return getNextWrappingIndex(offset, items.indexOf(selectedItem), items.length, getItemNodeFromIndex, false);\n }\n\n if (offset === 0) {\n return -1;\n }\n\n return offset < 0 ? items.length - 1 : 0;\n}\n/**\n * Reuse the movement tracking of mouse and touch events.\n *\n * @param {boolean} isOpen Whether the dropdown is open or not.\n * @param {Array<Object>} downshiftElementRefs Downshift element refs to track movement (toggleButton, menu etc.)\n * @param {Object} environment Environment where component/hook exists.\n * @param {Function} handleBlur Handler on blur from mouse or touch.\n * @returns {Object} Ref containing whether mouseDown or touchMove event is happening\n */\n\n\nfunction useMouseAndTouchTracker(isOpen, downshiftElementRefs, environment, handleBlur) {\n const mouseAndTouchTrackersRef = useRef({\n isMouseDown: false,\n isTouchMove: false\n });\n useEffect(() => {\n // The same strategy for checking if a click occurred inside or outside downsift\n // as in downshift.js.\n const onMouseDown = () => {\n mouseAndTouchTrackersRef.current.isMouseDown = true;\n };\n\n const onMouseUp = event => {\n mouseAndTouchTrackersRef.current.isMouseDown = false;\n\n if (isOpen && !targetWithinDownshift(event.target, downshiftElementRefs.map(ref => ref.current), environment)) {\n handleBlur();\n }\n };\n\n const onTouchStart = () => {\n mouseAndTouchTrackersRef.current.isTouchMove = false;\n };\n\n const onTouchMove = () => {\n mouseAndTouchTrackersRef.current.isTouchMove = true;\n };\n\n const onTouchEnd = event => {\n if (isOpen && !mouseAndTouchTrackersRef.current.isTouchMove && !targetWithinDownshift(event.target, downshiftElementRefs.map(ref => ref.current), environment, false)) {\n handleBlur();\n }\n };\n\n environment.addEventListener('mousedown', onMouseDown);\n environment.addEventListener('mouseup', onMouseUp);\n environment.addEventListener('touchstart', onTouchStart);\n environment.addEventListener('touchmove', onTouchMove);\n environment.addEventListener('touchend', onTouchEnd);\n return function cleanup() {\n environment.removeEventListener('mousedown', onMouseDown);\n environment.removeEventListener('mouseup', onMouseUp);\n environment.removeEventListener('touchstart', onTouchStart);\n environment.removeEventListener('touchmove', onTouchMove);\n environment.removeEventListener('touchend', onTouchEnd);\n }; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isOpen, environment]);\n return mouseAndTouchTrackersRef;\n}\n/* istanbul ignore next */\n// eslint-disable-next-line import/no-mutable-exports\n\n\nlet useGetterPropsCalledChecker = () => noop;\n/**\n * Custom hook that checks if getter props are called correctly.\n *\n * @param {...any} propKeys Getter prop names to be handled.\n * @returns {Function} Setter function called inside getter props to set call information.\n */\n\n/* istanbul ignore next */\n\n\nif (process.env.NODE_ENV !== 'production') {\n useGetterPropsCalledChecker = function () {\n const isInitialMountRef = useRef(true);\n\n for (var _len = arguments.length, propKeys = new Array(_len), _key = 0; _key < _len; _key++) {\n propKeys[_key] = arguments[_key];\n }\n\n const getterPropsCalledRef = useRef(propKeys.reduce((acc, propKey) => {\n acc[propKey] = {};\n return acc;\n }, {}));\n useEffect(() => {\n Object.keys(getterPropsCalledRef.current).forEach(propKey => {\n const propCallInfo = getterPropsCalledRef.current[propKey];\n\n if (isInitialMountRef.current) {\n if (!Object.keys(propCallInfo).length) {\n // eslint-disable-next-line no-console\n console.error(`downshift: You forgot to call the ${propKey} getter function on your component / element.`);\n return;\n }\n }\n\n const {\n suppressRefError,\n refKey,\n elementRef\n } = propCallInfo;\n\n if ((!elementRef || !elementRef.current) && !suppressRefError) {\n // eslint-disable-next-line no-console\n console.error(`downshift: The ref prop \"${refKey}\" from ${propKey} was not applied correctly on your element.`);\n }\n });\n isInitialMountRef.current = false;\n });\n const setGetterPropCallInfo = useCallback((propKey, suppressRefError, refKey, elementRef) => {\n getterPropsCalledRef.current[propKey] = {\n suppressRefError,\n refKey,\n elementRef\n };\n }, []);\n return setGetterPropCallInfo;\n };\n}\n\nfunction useA11yMessageSetter(getA11yMessage, dependencyArray, _ref2) {\n let {\n isInitialMount,\n highlightedIndex,\n items,\n environment,\n ...rest\n } = _ref2;\n // Sets a11y status message on changes in state.\n useEffect(() => {\n if (isInitialMount || false) {\n return;\n }\n\n updateA11yStatus(() => getA11yMessage({\n highlightedIndex,\n highlightedItem: items[highlightedIndex],\n resultCount: items.length,\n ...rest\n }), environment.document); // eslint-disable-next-line react-hooks/exhaustive-deps\n }, dependencyArray);\n}\n\nfunction useScrollIntoView(_ref3) {\n let {\n highlightedIndex,\n isOpen,\n itemRefs,\n getItemNodeFromIndex,\n menuElement,\n scrollIntoView: scrollIntoViewProp\n } = _ref3;\n // used not to scroll on highlight by mouse.\n const shouldScrollRef = useRef(true); // Scroll on highlighted item if change comes from keyboard.\n\n useIsomorphicLayoutEffect(() => {\n if (highlightedIndex < 0 || !isOpen || !Object.keys(itemRefs.current).length) {\n return;\n }\n\n if (shouldScrollRef.current === false) {\n shouldScrollRef.current = true;\n } else {\n scrollIntoViewProp(getItemNodeFromIndex(highlightedIndex), menuElement);\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, [highlightedIndex]);\n return shouldScrollRef;\n} // eslint-disable-next-line import/no-mutable-exports\n\n\nlet useControlPropsValidator = noop;\n/* istanbul ignore next */\n\nif (process.env.NODE_ENV !== 'production') {\n useControlPropsValidator = _ref4 => {\n let {\n isInitialMount,\n props,\n state\n } = _ref4;\n // used for checking when props are moving from controlled to uncontrolled.\n const prevPropsRef = useRef(props);\n useEffect(() => {\n if (isInitialMount) {\n return;\n }\n\n validateControlledUnchanged(state, prevPropsRef.current, props);\n prevPropsRef.current = props;\n }, [state, props, isInitialMount]);\n };\n}\n\n/* eslint-disable complexity */\n\nfunction downshiftCommonReducer(state, action, stateChangeTypes) {\n const {\n type,\n props\n } = action;\n let changes;\n\n switch (type) {\n case stateChangeTypes.ItemMouseMove:\n changes = {\n highlightedIndex: action.disabled ? -1 : action.index\n };\n break;\n\n case stateChangeTypes.MenuMouseLeave:\n changes = {\n highlightedIndex: -1\n };\n break;\n\n case stateChangeTypes.ToggleButtonClick:\n case stateChangeTypes.FunctionToggleMenu:\n changes = {\n isOpen: !state.isOpen,\n highlightedIndex: state.isOpen ? -1 : getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n\n case stateChangeTypes.FunctionOpenMenu:\n changes = {\n isOpen: true,\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 0)\n };\n break;\n\n case stateChangeTypes.FunctionCloseMenu:\n changes = {\n isOpen: false\n };\n break;\n\n case stateChangeTypes.FunctionSetHighlightedIndex:\n changes = {\n highlightedIndex: action.highlightedIndex\n };\n break;\n\n case stateChangeTypes.FunctionSetInputValue:\n changes = {\n inputValue: action.inputValue\n };\n break;\n\n case stateChangeTypes.FunctionReset:\n changes = {\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n isOpen: getDefaultValue$1(props, 'isOpen'),\n selectedItem: getDefaultValue$1(props, 'selectedItem'),\n inputValue: getDefaultValue$1(props, 'inputValue')\n };\n break;\n\n default:\n throw new Error('Reducer called without proper action type.');\n }\n\n return { ...state,\n ...changes\n };\n}\n/* eslint-enable complexity */\n\nfunction getItemIndexByCharacterKey(_a) {\n var keysSoFar = _a.keysSoFar, highlightedIndex = _a.highlightedIndex, items = _a.items, itemToString = _a.itemToString, getItemNodeFromIndex = _a.getItemNodeFromIndex;\n var lowerCasedKeysSoFar = keysSoFar.toLowerCase();\n for (var index = 0; index < items.length; index++) {\n var offsetIndex = (index + highlightedIndex + 1) % items.length;\n var item = items[offsetIndex];\n if (item !== undefined &&\n itemToString(item)\n .toLowerCase()\n .startsWith(lowerCasedKeysSoFar)) {\n var element = getItemNodeFromIndex(offsetIndex);\n if (!(element === null || element === void 0 ? void 0 : element.hasAttribute('disabled'))) {\n return offsetIndex;\n }\n }\n }\n return highlightedIndex;\n}\nvar propTypes$2 = {\n items: PropTypes.array.isRequired,\n itemToString: PropTypes.func,\n getA11yStatusMessage: PropTypes.func,\n getA11ySelectionMessage: PropTypes.func,\n circularNavigation: PropTypes.bool,\n highlightedIndex: PropTypes.number,\n defaultHighlightedIndex: PropTypes.number,\n initialHighlightedIndex: PropTypes.number,\n isOpen: PropTypes.bool,\n defaultIsOpen: PropTypes.bool,\n initialIsOpen: PropTypes.bool,\n selectedItem: PropTypes.any,\n initialSelectedItem: PropTypes.any,\n defaultSelectedItem: PropTypes.any,\n id: PropTypes.string,\n labelId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func,\n toggleButtonId: PropTypes.string,\n stateReducer: PropTypes.func,\n onSelectedItemChange: PropTypes.func,\n onHighlightedIndexChange: PropTypes.func,\n onStateChange: PropTypes.func,\n onIsOpenChange: PropTypes.func,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any\n })\n })\n};\n/**\n * Default implementation for status message. Only added when menu is open.\n * Will specift if there are results in the list, and if so, how many,\n * and what keys are relevant.\n *\n * @param {Object} param the downshift state and other relevant properties\n * @return {String} the a11y status message\n */\nfunction getA11yStatusMessage(_a) {\n var isOpen = _a.isOpen, resultCount = _a.resultCount, previousResultCount = _a.previousResultCount;\n if (!isOpen) {\n return '';\n }\n if (!resultCount) {\n return 'No results are available.';\n }\n if (resultCount !== previousResultCount) {\n return \"\".concat(resultCount, \" result\").concat(resultCount === 1 ? ' is' : 's are', \" available, use up and down arrow keys to navigate. Press Enter or Space Bar keys to select.\");\n }\n return '';\n}\nvar defaultProps$2 = __assign(__assign({}, defaultProps$3), { getA11yStatusMessage: getA11yStatusMessage });\n// eslint-disable-next-line import/no-mutable-exports\nvar validatePropTypes$2 = noop;\n/* istanbul ignore next */\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes$2 = function (options, caller) {\n PropTypes.checkPropTypes(propTypes$2, options, 'prop', caller.name);\n };\n}\n\nconst MenuKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_arrow_down__' : 0;\nconst MenuKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_arrow_up__' : 1;\nconst MenuKeyDownEscape = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_escape__' : 2;\nconst MenuKeyDownHome = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_home__' : 3;\nconst MenuKeyDownEnd = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_end__' : 4;\nconst MenuKeyDownEnter = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_enter__' : 5;\nconst MenuKeyDownSpaceButton = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_space_button__' : 6;\nconst MenuKeyDownCharacter = process.env.NODE_ENV !== \"production\" ? '__menu_keydown_character__' : 7;\nconst MenuBlur = process.env.NODE_ENV !== \"production\" ? '__menu_blur__' : 8;\nconst MenuMouseLeave$1 = process.env.NODE_ENV !== \"production\" ? '__menu_mouse_leave__' : 9;\nconst ItemMouseMove$1 = process.env.NODE_ENV !== \"production\" ? '__item_mouse_move__' : 10;\nconst ItemClick$1 = process.env.NODE_ENV !== \"production\" ? '__item_click__' : 11;\nconst ToggleButtonClick$1 = process.env.NODE_ENV !== \"production\" ? '__togglebutton_click__' : 12;\nconst ToggleButtonKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_arrow_down__' : 13;\nconst ToggleButtonKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_arrow_up__' : 14;\nconst ToggleButtonKeyDownCharacter = process.env.NODE_ENV !== \"production\" ? '__togglebutton_keydown_character__' : 15;\nconst FunctionToggleMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_toggle_menu__' : 16;\nconst FunctionOpenMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_open_menu__' : 17;\nconst FunctionCloseMenu$1 = process.env.NODE_ENV !== \"production\" ? '__function_close_menu__' : 18;\nconst FunctionSetHighlightedIndex$1 = process.env.NODE_ENV !== \"production\" ? '__function_set_highlighted_index__' : 19;\nconst FunctionSelectItem$1 = process.env.NODE_ENV !== \"production\" ? '__function_select_item__' : 20;\nconst FunctionSetInputValue$1 = process.env.NODE_ENV !== \"production\" ? '__function_set_input_value__' : 21;\nconst FunctionReset$2 = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 22;\n\nvar stateChangeTypes$2 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MenuKeyDownArrowDown: MenuKeyDownArrowDown,\n MenuKeyDownArrowUp: MenuKeyDownArrowUp,\n MenuKeyDownEscape: MenuKeyDownEscape,\n MenuKeyDownHome: MenuKeyDownHome,\n MenuKeyDownEnd: MenuKeyDownEnd,\n MenuKeyDownEnter: MenuKeyDownEnter,\n MenuKeyDownSpaceButton: MenuKeyDownSpaceButton,\n MenuKeyDownCharacter: MenuKeyDownCharacter,\n MenuBlur: MenuBlur,\n MenuMouseLeave: MenuMouseLeave$1,\n ItemMouseMove: ItemMouseMove$1,\n ItemClick: ItemClick$1,\n ToggleButtonClick: ToggleButtonClick$1,\n ToggleButtonKeyDownArrowDown: ToggleButtonKeyDownArrowDown,\n ToggleButtonKeyDownArrowUp: ToggleButtonKeyDownArrowUp,\n ToggleButtonKeyDownCharacter: ToggleButtonKeyDownCharacter,\n FunctionToggleMenu: FunctionToggleMenu$1,\n FunctionOpenMenu: FunctionOpenMenu$1,\n FunctionCloseMenu: FunctionCloseMenu$1,\n FunctionSetHighlightedIndex: FunctionSetHighlightedIndex$1,\n FunctionSelectItem: FunctionSelectItem$1,\n FunctionSetInputValue: FunctionSetInputValue$1,\n FunctionReset: FunctionReset$2\n});\n\n/* eslint-disable complexity */\n\nfunction downshiftSelectReducer(state, action) {\n const {\n type,\n props,\n shiftKey\n } = action;\n let changes;\n\n switch (type) {\n case ItemClick$1:\n changes = {\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n selectedItem: props.items[action.index]\n };\n break;\n\n case ToggleButtonKeyDownCharacter:\n {\n const lowercasedKey = action.key;\n const inputValue = `${state.inputValue}${lowercasedKey}`;\n const itemIndex = getItemIndexByCharacterKey({\n keysSoFar: inputValue,\n highlightedIndex: state.selectedItem ? props.items.indexOf(state.selectedItem) : -1,\n items: props.items,\n itemToString: props.itemToString,\n getItemNodeFromIndex: action.getItemNodeFromIndex\n });\n changes = {\n inputValue,\n ...(itemIndex >= 0 && {\n selectedItem: props.items[itemIndex]\n })\n };\n }\n break;\n\n case ToggleButtonKeyDownArrowDown:\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 1, action.getItemNodeFromIndex),\n isOpen: true\n };\n break;\n\n case ToggleButtonKeyDownArrowUp:\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, -1, action.getItemNodeFromIndex),\n isOpen: true\n };\n break;\n\n case MenuKeyDownEnter:\n case MenuKeyDownSpaceButton:\n changes = {\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n ...(state.highlightedIndex >= 0 && {\n selectedItem: props.items[state.highlightedIndex]\n })\n };\n break;\n\n case MenuKeyDownHome:\n changes = {\n highlightedIndex: getNextNonDisabledIndex(1, 0, props.items.length, action.getItemNodeFromIndex, false)\n };\n break;\n\n case MenuKeyDownEnd:\n changes = {\n highlightedIndex: getNextNonDisabledIndex(-1, props.items.length - 1, props.items.length, action.getItemNodeFromIndex, false)\n };\n break;\n\n case MenuKeyDownEscape:\n changes = {\n isOpen: false,\n highlightedIndex: -1\n };\n break;\n\n case MenuBlur:\n changes = {\n isOpen: false,\n highlightedIndex: -1\n };\n break;\n\n case MenuKeyDownCharacter:\n {\n const lowercasedKey = action.key;\n const inputValue = `${state.inputValue}${lowercasedKey}`;\n const highlightedIndex = getItemIndexByCharacterKey({\n keysSoFar: inputValue,\n highlightedIndex: state.highlightedIndex,\n items: props.items,\n itemToString: props.itemToString,\n getItemNodeFromIndex: action.getItemNodeFromIndex\n });\n changes = {\n inputValue,\n ...(highlightedIndex >= 0 && {\n highlightedIndex\n })\n };\n }\n break;\n\n case MenuKeyDownArrowDown:\n changes = {\n highlightedIndex: getNextWrappingIndex(shiftKey ? 5 : 1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)\n };\n break;\n\n case MenuKeyDownArrowUp:\n changes = {\n highlightedIndex: getNextWrappingIndex(shiftKey ? -5 : -1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)\n };\n break;\n\n case FunctionSelectItem$1:\n changes = {\n selectedItem: action.selectedItem\n };\n break;\n\n default:\n return downshiftCommonReducer(state, action, stateChangeTypes$2);\n }\n\n return { ...state,\n ...changes\n };\n}\n/* eslint-enable complexity */\n\n/* eslint-disable max-statements */\nuseSelect.stateChangeTypes = stateChangeTypes$2;\n\nfunction useSelect(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n\n validatePropTypes$2(userProps, useSelect); // Props defaults and destructuring.\n\n const props = { ...defaultProps$2,\n ...userProps\n };\n const {\n items,\n scrollIntoView,\n environment,\n initialIsOpen,\n defaultIsOpen,\n itemToString,\n getA11ySelectionMessage,\n getA11yStatusMessage\n } = props; // Initial state depending on controlled props.\n\n const initialState = getInitialState$2(props);\n const [state, dispatch] = useControlledReducer$1(downshiftSelectReducer, initialState, props);\n const {\n isOpen,\n highlightedIndex,\n selectedItem,\n inputValue\n } = state; // Element efs.\n\n const toggleButtonRef = useRef(null);\n const menuRef = useRef(null);\n const itemRefs = useRef({}); // used not to trigger menu blur action in some scenarios.\n\n const shouldBlurRef = useRef(true); // used to keep the inputValue clearTimeout object between renders.\n\n const clearTimeoutRef = useRef(null); // prevent id re-generation between renders.\n\n const elementIds = useElementIds(props); // used to keep track of how many items we had on previous cycle.\n\n const previousResultCountRef = useRef();\n const isInitialMountRef = useRef(true); // utility callback to get item element.\n\n const latest = useLatestRef({\n state,\n props\n }); // Some utils.\n\n const getItemNodeFromIndex = useCallback(index => itemRefs.current[elementIds.getItemId(index)], [elementIds]); // Effects.\n // Sets a11y status message on changes in state.\n\n useA11yMessageSetter(getA11yStatusMessage, [isOpen, highlightedIndex, inputValue, items], {\n isInitialMount: isInitialMountRef.current,\n previousResultCount: previousResultCountRef.current,\n items,\n environment,\n itemToString,\n ...state\n }); // Sets a11y status message on changes in selectedItem.\n\n useA11yMessageSetter(getA11ySelectionMessage, [selectedItem], {\n isInitialMount: isInitialMountRef.current,\n previousResultCount: previousResultCountRef.current,\n items,\n environment,\n itemToString,\n ...state\n }); // Scroll on highlighted item if change comes from keyboard.\n\n const shouldScrollRef = useScrollIntoView({\n menuElement: menuRef.current,\n highlightedIndex,\n isOpen,\n itemRefs,\n scrollIntoView,\n getItemNodeFromIndex\n }); // Sets cleanup for the keysSoFar callback, debounded after 500ms.\n\n useEffect(() => {\n // init the clean function here as we need access to dispatch.\n clearTimeoutRef.current = debounce(outerDispatch => {\n outerDispatch({\n type: FunctionSetInputValue$1,\n inputValue: ''\n });\n }, 500); // Cancel any pending debounced calls on mount\n\n return () => {\n clearTimeoutRef.current.cancel();\n };\n }, []); // Invokes the keysSoFar callback set up above.\n\n useEffect(() => {\n if (!inputValue) {\n return;\n }\n\n clearTimeoutRef.current(dispatch);\n }, [dispatch, inputValue]);\n useControlPropsValidator({\n isInitialMount: isInitialMountRef.current,\n props,\n state\n });\n /* Controls the focus on the menu or the toggle button. */\n\n useEffect(() => {\n // Don't focus menu on first render.\n if (isInitialMountRef.current) {\n // Unless it was initialised as open.\n if ((initialIsOpen || defaultIsOpen || isOpen) && menuRef.current) {\n menuRef.current.focus();\n }\n\n return;\n } // Focus menu on open.\n\n\n if (isOpen) {\n // istanbul ignore else\n if (menuRef.current) {\n menuRef.current.focus();\n }\n\n return;\n } // Focus toggleButton on close, but not if it was closed with (Shift+)Tab.\n\n\n if (environment.document.activeElement === menuRef.current) {\n // istanbul ignore else\n if (toggleButtonRef.current) {\n shouldBlurRef.current = false;\n toggleButtonRef.current.focus();\n }\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, [isOpen]);\n useEffect(() => {\n if (isInitialMountRef.current) {\n return;\n }\n\n previousResultCountRef.current = items.length;\n }); // Add mouse/touch events to document.\n\n const mouseAndTouchTrackersRef = useMouseAndTouchTracker(isOpen, [menuRef, toggleButtonRef], environment, () => {\n dispatch({\n type: MenuBlur\n });\n });\n const setGetterPropCallInfo = useGetterPropsCalledChecker('getMenuProps', 'getToggleButtonProps'); // Make initial ref false.\n\n useEffect(() => {\n isInitialMountRef.current = false;\n }, []); // Reset itemRefs on close.\n\n useEffect(() => {\n if (!isOpen) {\n itemRefs.current = {};\n }\n }, [isOpen]); // Event handler functions.\n\n const toggleButtonKeyDownHandlers = useMemo(() => ({\n ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownArrowDown,\n getItemNodeFromIndex,\n shiftKey: event.shiftKey\n });\n },\n\n ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: ToggleButtonKeyDownArrowUp,\n getItemNodeFromIndex,\n shiftKey: event.shiftKey\n });\n }\n\n }), [dispatch, getItemNodeFromIndex]);\n const menuKeyDownHandlers = useMemo(() => ({\n ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownArrowDown,\n getItemNodeFromIndex,\n shiftKey: event.shiftKey\n });\n },\n\n ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownArrowUp,\n getItemNodeFromIndex,\n shiftKey: event.shiftKey\n });\n },\n\n Home(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownHome,\n getItemNodeFromIndex\n });\n },\n\n End(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownEnd,\n getItemNodeFromIndex\n });\n },\n\n Escape() {\n dispatch({\n type: MenuKeyDownEscape\n });\n },\n\n Enter(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownEnter\n });\n },\n\n ' '(event) {\n event.preventDefault();\n dispatch({\n type: MenuKeyDownSpaceButton\n });\n }\n\n }), [dispatch, getItemNodeFromIndex]); // Action functions.\n\n const toggleMenu = useCallback(() => {\n dispatch({\n type: FunctionToggleMenu$1\n });\n }, [dispatch]);\n const closeMenu = useCallback(() => {\n dispatch({\n type: FunctionCloseMenu$1\n });\n }, [dispatch]);\n const openMenu = useCallback(() => {\n dispatch({\n type: FunctionOpenMenu$1\n });\n }, [dispatch]);\n const setHighlightedIndex = useCallback(newHighlightedIndex => {\n dispatch({\n type: FunctionSetHighlightedIndex$1,\n highlightedIndex: newHighlightedIndex\n });\n }, [dispatch]);\n const selectItem = useCallback(newSelectedItem => {\n dispatch({\n type: FunctionSelectItem$1,\n selectedItem: newSelectedItem\n });\n }, [dispatch]);\n const reset = useCallback(() => {\n dispatch({\n type: FunctionReset$2\n });\n }, [dispatch]);\n const setInputValue = useCallback(newInputValue => {\n dispatch({\n type: FunctionSetInputValue$1,\n inputValue: newInputValue\n });\n }, [dispatch]); // Getter functions.\n\n const getLabelProps = useCallback(labelProps => ({\n id: elementIds.labelId,\n htmlFor: elementIds.toggleButtonId,\n ...labelProps\n }), [elementIds]);\n const getMenuProps = useCallback(function (_temp, _temp2) {\n let {\n onMouseLeave,\n refKey = 'ref',\n onKeyDown,\n onBlur,\n ref,\n ...rest\n } = _temp === void 0 ? {} : _temp;\n let {\n suppressRefError = false\n } = _temp2 === void 0 ? {} : _temp2;\n const latestState = latest.current.state;\n\n const menuHandleKeyDown = event => {\n const key = normalizeArrowKey(event);\n\n if (key && menuKeyDownHandlers[key]) {\n menuKeyDownHandlers[key](event);\n } else if (isAcceptedCharacterKey(key)) {\n dispatch({\n type: MenuKeyDownCharacter,\n key,\n getItemNodeFromIndex\n });\n }\n };\n\n const menuHandleBlur = () => {\n // if the blur was a result of selection, we don't trigger this action.\n if (shouldBlurRef.current === false) {\n shouldBlurRef.current = true;\n return;\n }\n\n const shouldBlur = !mouseAndTouchTrackersRef.current.isMouseDown;\n /* istanbul ignore else */\n\n if (shouldBlur) {\n dispatch({\n type: MenuBlur\n });\n }\n };\n\n const menuHandleMouseLeave = () => {\n dispatch({\n type: MenuMouseLeave$1\n });\n };\n\n setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);\n return {\n [refKey]: handleRefs(ref, menuNode => {\n menuRef.current = menuNode;\n }),\n id: elementIds.menuId,\n role: 'listbox',\n 'aria-labelledby': elementIds.labelId,\n tabIndex: -1,\n ...(latestState.isOpen && latestState.highlightedIndex > -1 && {\n 'aria-activedescendant': elementIds.getItemId(latestState.highlightedIndex)\n }),\n onMouseLeave: callAllEventHandlers(onMouseLeave, menuHandleMouseLeave),\n onKeyDown: callAllEventHandlers(onKeyDown, menuHandleKeyDown),\n onBlur: callAllEventHandlers(onBlur, menuHandleBlur),\n ...rest\n };\n }, [dispatch, latest, menuKeyDownHandlers, mouseAndTouchTrackersRef, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]);\n const getToggleButtonProps = useCallback(function (_temp3, _temp4) {\n let {\n onClick,\n onKeyDown,\n refKey = 'ref',\n ref,\n ...rest\n } = _temp3 === void 0 ? {} : _temp3;\n let {\n suppressRefError = false\n } = _temp4 === void 0 ? {} : _temp4;\n\n const toggleButtonHandleClick = () => {\n dispatch({\n type: ToggleButtonClick$1\n });\n };\n\n const toggleButtonHandleKeyDown = event => {\n const key = normalizeArrowKey(event);\n\n if (key && toggleButtonKeyDownHandlers[key]) {\n toggleButtonKeyDownHandlers[key](event);\n } else if (isAcceptedCharacterKey(key)) {\n dispatch({\n type: ToggleButtonKeyDownCharacter,\n key,\n getItemNodeFromIndex\n });\n }\n };\n\n const toggleProps = {\n [refKey]: handleRefs(ref, toggleButtonNode => {\n toggleButtonRef.current = toggleButtonNode;\n }),\n id: elementIds.toggleButtonId,\n 'aria-haspopup': 'listbox',\n 'aria-expanded': latest.current.state.isOpen,\n 'aria-labelledby': `${elementIds.labelId} ${elementIds.toggleButtonId}`,\n ...rest\n };\n\n if (!rest.disabled) {\n toggleProps.onClick = callAllEventHandlers(onClick, toggleButtonHandleClick);\n toggleProps.onKeyDown = callAllEventHandlers(onKeyDown, toggleButtonHandleKeyDown);\n }\n\n setGetterPropCallInfo('getToggleButtonProps', suppressRefError, refKey, toggleButtonRef);\n return toggleProps;\n }, [dispatch, latest, toggleButtonKeyDownHandlers, setGetterPropCallInfo, elementIds, getItemNodeFromIndex]);\n const getItemProps = useCallback(function (_temp5) {\n let {\n item,\n index,\n onMouseMove,\n onClick,\n refKey = 'ref',\n ref,\n disabled,\n ...rest\n } = _temp5 === void 0 ? {} : _temp5;\n const {\n state: latestState,\n props: latestProps\n } = latest.current;\n\n const itemHandleMouseMove = () => {\n if (index === latestState.highlightedIndex) {\n return;\n }\n\n shouldScrollRef.current = false;\n dispatch({\n type: ItemMouseMove$1,\n index,\n disabled\n });\n };\n\n const itemHandleClick = () => {\n dispatch({\n type: ItemClick$1,\n index\n });\n };\n\n const itemIndex = getItemIndex(index, item, latestProps.items);\n\n if (itemIndex < 0) {\n throw new Error('Pass either item or item index in getItemProps!');\n }\n\n const itemProps = {\n disabled,\n role: 'option',\n 'aria-selected': `${itemIndex === latestState.highlightedIndex}`,\n id: elementIds.getItemId(itemIndex),\n [refKey]: handleRefs(ref, itemNode => {\n if (itemNode) {\n itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;\n }\n }),\n ...rest\n };\n\n if (!disabled) {\n itemProps.onClick = callAllEventHandlers(onClick, itemHandleClick);\n }\n\n itemProps.onMouseMove = callAllEventHandlers(onMouseMove, itemHandleMouseMove);\n return itemProps;\n }, [dispatch, latest, shouldScrollRef, elementIds]);\n return {\n // prop getters.\n getToggleButtonProps,\n getLabelProps,\n getMenuProps,\n getItemProps,\n // actions.\n toggleMenu,\n openMenu,\n closeMenu,\n setHighlightedIndex,\n selectItem,\n reset,\n setInputValue,\n // state.\n highlightedIndex,\n isOpen,\n selectedItem,\n inputValue\n };\n}\n\nconst InputKeyDownArrowDown = process.env.NODE_ENV !== \"production\" ? '__input_keydown_arrow_down__' : 0;\nconst InputKeyDownArrowUp = process.env.NODE_ENV !== \"production\" ? '__input_keydown_arrow_up__' : 1;\nconst InputKeyDownEscape = process.env.NODE_ENV !== \"production\" ? '__input_keydown_escape__' : 2;\nconst InputKeyDownHome = process.env.NODE_ENV !== \"production\" ? '__input_keydown_home__' : 3;\nconst InputKeyDownEnd = process.env.NODE_ENV !== \"production\" ? '__input_keydown_end__' : 4;\nconst InputKeyDownEnter = process.env.NODE_ENV !== \"production\" ? '__input_keydown_enter__' : 5;\nconst InputChange = process.env.NODE_ENV !== \"production\" ? '__input_change__' : 6;\nconst InputBlur = process.env.NODE_ENV !== \"production\" ? '__input_blur__' : 7;\nconst MenuMouseLeave = process.env.NODE_ENV !== \"production\" ? '__menu_mouse_leave__' : 8;\nconst ItemMouseMove = process.env.NODE_ENV !== \"production\" ? '__item_mouse_move__' : 9;\nconst ItemClick = process.env.NODE_ENV !== \"production\" ? '__item_click__' : 10;\nconst ToggleButtonClick = process.env.NODE_ENV !== \"production\" ? '__togglebutton_click__' : 11;\nconst FunctionToggleMenu = process.env.NODE_ENV !== \"production\" ? '__function_toggle_menu__' : 12;\nconst FunctionOpenMenu = process.env.NODE_ENV !== \"production\" ? '__function_open_menu__' : 13;\nconst FunctionCloseMenu = process.env.NODE_ENV !== \"production\" ? '__function_close_menu__' : 14;\nconst FunctionSetHighlightedIndex = process.env.NODE_ENV !== \"production\" ? '__function_set_highlighted_index__' : 15;\nconst FunctionSelectItem = process.env.NODE_ENV !== \"production\" ? '__function_select_item__' : 16;\nconst FunctionSetInputValue = process.env.NODE_ENV !== \"production\" ? '__function_set_input_value__' : 17;\nconst FunctionReset$1 = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 18;\nconst ControlledPropUpdatedSelectedItem = process.env.NODE_ENV !== \"production\" ? '__controlled_prop_updated_selected_item__' : 19;\n\nvar stateChangeTypes$1 = /*#__PURE__*/Object.freeze({\n __proto__: null,\n InputKeyDownArrowDown: InputKeyDownArrowDown,\n InputKeyDownArrowUp: InputKeyDownArrowUp,\n InputKeyDownEscape: InputKeyDownEscape,\n InputKeyDownHome: InputKeyDownHome,\n InputKeyDownEnd: InputKeyDownEnd,\n InputKeyDownEnter: InputKeyDownEnter,\n InputChange: InputChange,\n InputBlur: InputBlur,\n MenuMouseLeave: MenuMouseLeave,\n ItemMouseMove: ItemMouseMove,\n ItemClick: ItemClick,\n ToggleButtonClick: ToggleButtonClick,\n FunctionToggleMenu: FunctionToggleMenu,\n FunctionOpenMenu: FunctionOpenMenu,\n FunctionCloseMenu: FunctionCloseMenu,\n FunctionSetHighlightedIndex: FunctionSetHighlightedIndex,\n FunctionSelectItem: FunctionSelectItem,\n FunctionSetInputValue: FunctionSetInputValue,\n FunctionReset: FunctionReset$1,\n ControlledPropUpdatedSelectedItem: ControlledPropUpdatedSelectedItem\n});\n\nfunction getInitialState$1(props) {\n const initialState = getInitialState$2(props);\n const {\n selectedItem\n } = initialState;\n let {\n inputValue\n } = initialState;\n\n if (inputValue === '' && selectedItem && props.defaultInputValue === undefined && props.initialInputValue === undefined && props.inputValue === undefined) {\n inputValue = props.itemToString(selectedItem);\n }\n\n return { ...initialState,\n inputValue\n };\n}\n\nconst propTypes$1 = {\n items: PropTypes.array.isRequired,\n itemToString: PropTypes.func,\n getA11yStatusMessage: PropTypes.func,\n getA11ySelectionMessage: PropTypes.func,\n circularNavigation: PropTypes.bool,\n highlightedIndex: PropTypes.number,\n defaultHighlightedIndex: PropTypes.number,\n initialHighlightedIndex: PropTypes.number,\n isOpen: PropTypes.bool,\n defaultIsOpen: PropTypes.bool,\n initialIsOpen: PropTypes.bool,\n selectedItem: PropTypes.any,\n initialSelectedItem: PropTypes.any,\n defaultSelectedItem: PropTypes.any,\n inputValue: PropTypes.string,\n defaultInputValue: PropTypes.string,\n initialInputValue: PropTypes.string,\n id: PropTypes.string,\n labelId: PropTypes.string,\n menuId: PropTypes.string,\n getItemId: PropTypes.func,\n inputId: PropTypes.string,\n toggleButtonId: PropTypes.string,\n stateReducer: PropTypes.func,\n onSelectedItemChange: PropTypes.func,\n onHighlightedIndexChange: PropTypes.func,\n onStateChange: PropTypes.func,\n onIsOpenChange: PropTypes.func,\n onInputValueChange: PropTypes.func,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any\n })\n })\n};\n/**\n * The useCombobox version of useControlledReducer, which also\n * checks if the controlled prop selectedItem changed between\n * renders. If so, it will also update inputValue with its\n * string equivalent. It uses the common useEnhancedReducer to\n * compute the rest of the state.\n *\n * @param {Function} reducer Reducer function from downshift.\n * @param {Object} initialState Initial state of the hook.\n * @param {Object} props The hook props.\n * @returns {Array} An array with the state and an action dispatcher.\n */\n\nfunction useControlledReducer(reducer, initialState, props) {\n const previousSelectedItemRef = useRef();\n const [state, dispatch] = useEnhancedReducer(reducer, initialState, props); // ToDo: if needed, make same approach as selectedItemChanged from Downshift.\n\n useEffect(() => {\n if (isControlledProp(props, 'selectedItem')) {\n if (previousSelectedItemRef.current !== props.selectedItem) {\n dispatch({\n type: ControlledPropUpdatedSelectedItem,\n inputValue: props.itemToString(props.selectedItem)\n });\n }\n\n previousSelectedItemRef.current = state.selectedItem === previousSelectedItemRef.current ? props.selectedItem : state.selectedItem;\n }\n });\n return [getState(state, props), dispatch];\n} // eslint-disable-next-line import/no-mutable-exports\n\n\nlet validatePropTypes$1 = noop;\n/* istanbul ignore next */\n\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes$1 = (options, caller) => {\n PropTypes.checkPropTypes(propTypes$1, options, 'prop', caller.name);\n };\n}\n\nconst defaultProps$1 = { ...defaultProps$3,\n getA11yStatusMessage: getA11yStatusMessage$1,\n circularNavigation: true\n};\n\n/* eslint-disable complexity */\n\nfunction downshiftUseComboboxReducer(state, action) {\n const {\n type,\n props,\n shiftKey\n } = action;\n let changes;\n\n switch (type) {\n case ItemClick:\n changes = {\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n selectedItem: props.items[action.index],\n inputValue: props.itemToString(props.items[action.index])\n };\n break;\n\n case InputKeyDownArrowDown:\n if (state.isOpen) {\n changes = {\n highlightedIndex: getNextWrappingIndex(shiftKey ? 5 : 1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)\n };\n } else {\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, 1, action.getItemNodeFromIndex),\n isOpen: props.items.length >= 0\n };\n }\n\n break;\n\n case InputKeyDownArrowUp:\n if (state.isOpen) {\n changes = {\n highlightedIndex: getNextWrappingIndex(shiftKey ? -5 : -1, state.highlightedIndex, props.items.length, action.getItemNodeFromIndex, props.circularNavigation)\n };\n } else {\n changes = {\n highlightedIndex: getHighlightedIndexOnOpen(props, state, -1, action.getItemNodeFromIndex),\n isOpen: props.items.length >= 0\n };\n }\n\n break;\n\n case InputKeyDownEnter:\n changes = { ...(state.isOpen && state.highlightedIndex >= 0 && {\n selectedItem: props.items[state.highlightedIndex],\n isOpen: getDefaultValue$1(props, 'isOpen'),\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n inputValue: props.itemToString(props.items[state.highlightedIndex])\n })\n };\n break;\n\n case InputKeyDownEscape:\n changes = {\n isOpen: false,\n highlightedIndex: -1,\n ...(!state.isOpen && {\n selectedItem: null,\n inputValue: ''\n })\n };\n break;\n\n case InputKeyDownHome:\n changes = {\n highlightedIndex: getNextNonDisabledIndex(1, 0, props.items.length, action.getItemNodeFromIndex, false)\n };\n break;\n\n case InputKeyDownEnd:\n changes = {\n highlightedIndex: getNextNonDisabledIndex(-1, props.items.length - 1, props.items.length, action.getItemNodeFromIndex, false)\n };\n break;\n\n case InputBlur:\n changes = {\n isOpen: false,\n highlightedIndex: -1,\n ...(state.highlightedIndex >= 0 && action.selectItem && {\n selectedItem: props.items[state.highlightedIndex],\n inputValue: props.itemToString(props.items[state.highlightedIndex])\n })\n };\n break;\n\n case InputChange:\n changes = {\n isOpen: true,\n highlightedIndex: getDefaultValue$1(props, 'highlightedIndex'),\n inputValue: action.inputValue\n };\n break;\n\n case FunctionSelectItem:\n changes = {\n selectedItem: action.selectedItem,\n inputValue: props.itemToString(action.selectedItem)\n };\n break;\n\n case ControlledPropUpdatedSelectedItem:\n changes = {\n inputValue: action.inputValue\n };\n break;\n\n default:\n return downshiftCommonReducer(state, action, stateChangeTypes$1);\n }\n\n return { ...state,\n ...changes\n };\n}\n/* eslint-enable complexity */\n\n/* eslint-disable max-statements */\nuseCombobox.stateChangeTypes = stateChangeTypes$1;\n\nfunction useCombobox(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n\n validatePropTypes$1(userProps, useCombobox); // Props defaults and destructuring.\n\n const props = { ...defaultProps$1,\n ...userProps\n };\n const {\n initialIsOpen,\n defaultIsOpen,\n items,\n scrollIntoView,\n environment,\n getA11yStatusMessage,\n getA11ySelectionMessage,\n itemToString\n } = props; // Initial state depending on controlled props.\n\n const initialState = getInitialState$1(props);\n const [state, dispatch] = useControlledReducer(downshiftUseComboboxReducer, initialState, props);\n const {\n isOpen,\n highlightedIndex,\n selectedItem,\n inputValue\n } = state; // Element refs.\n\n const menuRef = useRef(null);\n const itemRefs = useRef({});\n const inputRef = useRef(null);\n const toggleButtonRef = useRef(null);\n const comboboxRef = useRef(null);\n const isInitialMountRef = useRef(true); // prevent id re-generation between renders.\n\n const elementIds = useElementIds(props); // used to keep track of how many items we had on previous cycle.\n\n const previousResultCountRef = useRef(); // utility callback to get item element.\n\n const latest = useLatestRef({\n state,\n props\n });\n const getItemNodeFromIndex = useCallback(index => itemRefs.current[elementIds.getItemId(index)], [elementIds]); // Effects.\n // Sets a11y status message on changes in state.\n\n useA11yMessageSetter(getA11yStatusMessage, [isOpen, highlightedIndex, inputValue, items], {\n isInitialMount: isInitialMountRef.current,\n previousResultCount: previousResultCountRef.current,\n items,\n environment,\n itemToString,\n ...state\n }); // Sets a11y status message on changes in selectedItem.\n\n useA11yMessageSetter(getA11ySelectionMessage, [selectedItem], {\n isInitialMount: isInitialMountRef.current,\n previousResultCount: previousResultCountRef.current,\n items,\n environment,\n itemToString,\n ...state\n }); // Scroll on highlighted item if change comes from keyboard.\n\n const shouldScrollRef = useScrollIntoView({\n menuElement: menuRef.current,\n highlightedIndex,\n isOpen,\n itemRefs,\n scrollIntoView,\n getItemNodeFromIndex\n });\n useControlPropsValidator({\n isInitialMount: isInitialMountRef.current,\n props,\n state\n }); // Focus the input on first render if required.\n\n useEffect(() => {\n const focusOnOpen = initialIsOpen || defaultIsOpen || isOpen;\n\n if (focusOnOpen && inputRef.current) {\n inputRef.current.focus();\n } // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, []);\n useEffect(() => {\n if (isInitialMountRef.current) {\n return;\n }\n\n previousResultCountRef.current = items.length;\n }); // Add mouse/touch events to document.\n\n const mouseAndTouchTrackersRef = useMouseAndTouchTracker(isOpen, [comboboxRef, menuRef, toggleButtonRef], environment, () => {\n dispatch({\n type: InputBlur,\n selectItem: false\n });\n });\n const setGetterPropCallInfo = useGetterPropsCalledChecker('getInputProps', 'getComboboxProps', 'getMenuProps'); // Make initial ref false.\n\n useEffect(() => {\n isInitialMountRef.current = false;\n }, []); // Reset itemRefs on close.\n\n useEffect(() => {\n if (!isOpen) {\n itemRefs.current = {};\n }\n }, [isOpen]);\n /* Event handler functions */\n\n const inputKeyDownHandlers = useMemo(() => ({\n ArrowDown(event) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownArrowDown,\n shiftKey: event.shiftKey,\n getItemNodeFromIndex\n });\n },\n\n ArrowUp(event) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownArrowUp,\n shiftKey: event.shiftKey,\n getItemNodeFromIndex\n });\n },\n\n Home(event) {\n if (!latest.current.state.isOpen) {\n return;\n }\n\n event.preventDefault();\n dispatch({\n type: InputKeyDownHome,\n getItemNodeFromIndex\n });\n },\n\n End(event) {\n if (!latest.current.state.isOpen) {\n return;\n }\n\n event.preventDefault();\n dispatch({\n type: InputKeyDownEnd,\n getItemNodeFromIndex\n });\n },\n\n Escape(event) {\n const latestState = latest.current.state;\n\n if (latestState.isOpen || latestState.inputValue || latestState.selectedItem || latestState.highlightedIndex > -1) {\n event.preventDefault();\n dispatch({\n type: InputKeyDownEscape\n });\n }\n },\n\n Enter(event) {\n const latestState = latest.current.state; // if closed or no highlighted index, do nothing.\n\n if (!latestState.isOpen || latestState.highlightedIndex < 0 || event.which === 229 // if IME composing, wait for next Enter keydown event.\n ) {\n return;\n }\n\n event.preventDefault();\n dispatch({\n type: InputKeyDownEnter,\n getItemNodeFromIndex\n });\n }\n\n }), [dispatch, latest, getItemNodeFromIndex]); // Getter props.\n\n const getLabelProps = useCallback(labelProps => ({\n id: elementIds.labelId,\n htmlFor: elementIds.inputId,\n ...labelProps\n }), [elementIds]);\n const getMenuProps = useCallback(function (_temp, _temp2) {\n let {\n onMouseLeave,\n refKey = 'ref',\n ref,\n ...rest\n } = _temp === void 0 ? {} : _temp;\n let {\n suppressRefError = false\n } = _temp2 === void 0 ? {} : _temp2;\n setGetterPropCallInfo('getMenuProps', suppressRefError, refKey, menuRef);\n return {\n [refKey]: handleRefs(ref, menuNode => {\n menuRef.current = menuNode;\n }),\n id: elementIds.menuId,\n role: 'listbox',\n 'aria-labelledby': elementIds.labelId,\n onMouseLeave: callAllEventHandlers(onMouseLeave, () => {\n dispatch({\n type: MenuMouseLeave\n });\n }),\n ...rest\n };\n }, [dispatch, setGetterPropCallInfo, elementIds]);\n const getItemProps = useCallback(function (_temp3) {\n let {\n item,\n index,\n refKey = 'ref',\n ref,\n onMouseMove,\n onMouseDown,\n onClick,\n onPress,\n disabled,\n ...rest\n } = _temp3 === void 0 ? {} : _temp3;\n const {\n props: latestProps,\n state: latestState\n } = latest.current;\n const itemIndex = getItemIndex(index, item, latestProps.items);\n\n if (itemIndex < 0) {\n throw new Error('Pass either item or item index in getItemProps!');\n }\n\n const onSelectKey = 'onClick';\n const customClickHandler = onClick;\n\n const itemHandleMouseMove = () => {\n if (index === latestState.highlightedIndex) {\n return;\n }\n\n shouldScrollRef.current = false;\n dispatch({\n type: ItemMouseMove,\n index,\n disabled\n });\n };\n\n const itemHandleClick = () => {\n dispatch({\n type: ItemClick,\n index\n });\n };\n\n const itemHandleMouseDown = e => e.preventDefault();\n\n return {\n [refKey]: handleRefs(ref, itemNode => {\n if (itemNode) {\n itemRefs.current[elementIds.getItemId(itemIndex)] = itemNode;\n }\n }),\n disabled,\n role: 'option',\n 'aria-selected': `${itemIndex === latestState.highlightedIndex}`,\n id: elementIds.getItemId(itemIndex),\n ...(!disabled && {\n [onSelectKey]: callAllEventHandlers(customClickHandler, itemHandleClick)\n }),\n onMouseMove: callAllEventHandlers(onMouseMove, itemHandleMouseMove),\n onMouseDown: callAllEventHandlers(onMouseDown, itemHandleMouseDown),\n ...rest\n };\n }, [dispatch, latest, shouldScrollRef, elementIds]);\n const getToggleButtonProps = useCallback(function (_temp4) {\n let {\n onClick,\n onPress,\n refKey = 'ref',\n ref,\n ...rest\n } = _temp4 === void 0 ? {} : _temp4;\n\n const toggleButtonHandleClick = () => {\n dispatch({\n type: ToggleButtonClick\n });\n\n if (!latest.current.state.isOpen && inputRef.current) {\n inputRef.current.focus();\n }\n };\n\n return {\n [refKey]: handleRefs(ref, toggleButtonNode => {\n toggleButtonRef.current = toggleButtonNode;\n }),\n id: elementIds.toggleButtonId,\n tabIndex: -1,\n ...(!rest.disabled && { ...({\n onClick: callAllEventHandlers(onClick, toggleButtonHandleClick)\n })\n }),\n ...rest\n };\n }, [dispatch, latest, elementIds]);\n const getInputProps = useCallback(function (_temp5, _temp6) {\n let {\n onKeyDown,\n onChange,\n onInput,\n onBlur,\n onChangeText,\n refKey = 'ref',\n ref,\n ...rest\n } = _temp5 === void 0 ? {} : _temp5;\n let {\n suppressRefError = false\n } = _temp6 === void 0 ? {} : _temp6;\n setGetterPropCallInfo('getInputProps', suppressRefError, refKey, inputRef);\n const latestState = latest.current.state;\n\n const inputHandleKeyDown = event => {\n const key = normalizeArrowKey(event);\n\n if (key && inputKeyDownHandlers[key]) {\n inputKeyDownHandlers[key](event);\n }\n };\n\n const inputHandleChange = event => {\n dispatch({\n type: InputChange,\n inputValue: event.target.value\n });\n };\n\n const inputHandleBlur = () => {\n /* istanbul ignore else */\n if (latestState.isOpen && !mouseAndTouchTrackersRef.current.isMouseDown) {\n dispatch({\n type: InputBlur,\n selectItem: true\n });\n }\n };\n /* istanbul ignore next (preact) */\n\n\n const onChangeKey = 'onChange';\n let eventHandlers = {};\n\n if (!rest.disabled) {\n eventHandlers = {\n [onChangeKey]: callAllEventHandlers(onChange, onInput, inputHandleChange),\n onKeyDown: callAllEventHandlers(onKeyDown, inputHandleKeyDown),\n onBlur: callAllEventHandlers(onBlur, inputHandleBlur)\n };\n }\n\n return {\n [refKey]: handleRefs(ref, inputNode => {\n inputRef.current = inputNode;\n }),\n id: elementIds.inputId,\n 'aria-autocomplete': 'list',\n 'aria-controls': elementIds.menuId,\n ...(latestState.isOpen && latestState.highlightedIndex > -1 && {\n 'aria-activedescendant': elementIds.getItemId(latestState.highlightedIndex)\n }),\n 'aria-labelledby': elementIds.labelId,\n // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion\n // revert back since autocomplete=\"nope\" is ignored on latest Chrome and Opera\n autoComplete: 'off',\n value: latestState.inputValue,\n ...eventHandlers,\n ...rest\n };\n }, [dispatch, inputKeyDownHandlers, latest, mouseAndTouchTrackersRef, setGetterPropCallInfo, elementIds]);\n const getComboboxProps = useCallback(function (_temp7, _temp8) {\n let {\n refKey = 'ref',\n ref,\n ...rest\n } = _temp7 === void 0 ? {} : _temp7;\n let {\n suppressRefError = false\n } = _temp8 === void 0 ? {} : _temp8;\n setGetterPropCallInfo('getComboboxProps', suppressRefError, refKey, comboboxRef);\n return {\n [refKey]: handleRefs(ref, comboboxNode => {\n comboboxRef.current = comboboxNode;\n }),\n role: 'combobox',\n 'aria-haspopup': 'listbox',\n 'aria-owns': elementIds.menuId,\n 'aria-expanded': latest.current.state.isOpen,\n ...rest\n };\n }, [latest, setGetterPropCallInfo, elementIds]); // returns\n\n const toggleMenu = useCallback(() => {\n dispatch({\n type: FunctionToggleMenu\n });\n }, [dispatch]);\n const closeMenu = useCallback(() => {\n dispatch({\n type: FunctionCloseMenu\n });\n }, [dispatch]);\n const openMenu = useCallback(() => {\n dispatch({\n type: FunctionOpenMenu\n });\n }, [dispatch]);\n const setHighlightedIndex = useCallback(newHighlightedIndex => {\n dispatch({\n type: FunctionSetHighlightedIndex,\n highlightedIndex: newHighlightedIndex\n });\n }, [dispatch]);\n const selectItem = useCallback(newSelectedItem => {\n dispatch({\n type: FunctionSelectItem,\n selectedItem: newSelectedItem\n });\n }, [dispatch]);\n const setInputValue = useCallback(newInputValue => {\n dispatch({\n type: FunctionSetInputValue,\n inputValue: newInputValue\n });\n }, [dispatch]);\n const reset = useCallback(() => {\n dispatch({\n type: FunctionReset$1\n });\n }, [dispatch]);\n return {\n // prop getters.\n getItemProps,\n getLabelProps,\n getMenuProps,\n getInputProps,\n getComboboxProps,\n getToggleButtonProps,\n // actions.\n toggleMenu,\n openMenu,\n closeMenu,\n setHighlightedIndex,\n setInputValue,\n selectItem,\n reset,\n // state.\n highlightedIndex,\n isOpen,\n selectedItem,\n inputValue\n };\n}\n\nconst defaultStateValues = {\n activeIndex: -1,\n selectedItems: []\n};\n/**\n * Returns the initial value for a state key in the following order:\n * 1. controlled prop, 2. initial prop, 3. default prop, 4. default\n * value from Downshift.\n *\n * @param {Object} props Props passed to the hook.\n * @param {string} propKey Props key to generate the value for.\n * @returns {any} The initial value for that prop.\n */\n\nfunction getInitialValue(props, propKey) {\n return getInitialValue$1(props, propKey, defaultStateValues);\n}\n/**\n * Returns the default value for a state key in the following order:\n * 1. controlled prop, 2. default prop, 3. default value from Downshift.\n *\n * @param {Object} props Props passed to the hook.\n * @param {string} propKey Props key to generate the value for.\n * @returns {any} The initial value for that prop.\n */\n\n\nfunction getDefaultValue(props, propKey) {\n return getDefaultValue$1(props, propKey, defaultStateValues);\n}\n/**\n * Gets the initial state based on the provided props. It uses initial, default\n * and controlled props related to state in order to compute the initial value.\n *\n * @param {Object} props Props passed to the hook.\n * @returns {Object} The initial state.\n */\n\n\nfunction getInitialState(props) {\n const activeIndex = getInitialValue(props, 'activeIndex');\n const selectedItems = getInitialValue(props, 'selectedItems');\n return {\n activeIndex,\n selectedItems\n };\n}\n/**\n * Returns true if dropdown keydown operation is permitted. Should not be\n * allowed on keydown with modifier keys (ctrl, alt, shift, meta), on\n * input element with text content that is either highlighted or selection\n * cursor is not at the starting position.\n *\n * @param {KeyboardEvent} event The event from keydown.\n * @returns {boolean} Whether the operation is allowed.\n */\n\n\nfunction isKeyDownOperationPermitted(event) {\n if (event.shiftKey || event.metaKey || event.ctrlKey || event.altKey) {\n return false;\n }\n\n const element = event.target;\n\n if (element instanceof HTMLInputElement && // if element is a text input\n element.value !== '' && ( // and we have text in it\n // and cursor is either not at the start or is currently highlighting text.\n element.selectionStart !== 0 || element.selectionEnd !== 0)) {\n return false;\n }\n\n return true;\n}\n/**\n * Returns a message to be added to aria-live region when item is removed.\n *\n * @param {Object} selectionParameters Parameters required to build the message.\n * @returns {string} The a11y message.\n */\n\n\nfunction getA11yRemovalMessage(selectionParameters) {\n const {\n removedSelectedItem,\n itemToString: itemToStringLocal\n } = selectionParameters;\n return `${itemToStringLocal(removedSelectedItem)} has been removed.`;\n}\n\nconst propTypes = {\n selectedItems: PropTypes.array,\n initialSelectedItems: PropTypes.array,\n defaultSelectedItems: PropTypes.array,\n itemToString: PropTypes.func,\n getA11yRemovalMessage: PropTypes.func,\n stateReducer: PropTypes.func,\n activeIndex: PropTypes.number,\n initialActiveIndex: PropTypes.number,\n defaultActiveIndex: PropTypes.number,\n onActiveIndexChange: PropTypes.func,\n onSelectedItemsChange: PropTypes.func,\n keyNavigationNext: PropTypes.string,\n keyNavigationPrevious: PropTypes.string,\n environment: PropTypes.shape({\n addEventListener: PropTypes.func,\n removeEventListener: PropTypes.func,\n document: PropTypes.shape({\n getElementById: PropTypes.func,\n activeElement: PropTypes.any,\n body: PropTypes.any\n })\n })\n};\nconst defaultProps = {\n itemToString: defaultProps$3.itemToString,\n stateReducer: defaultProps$3.stateReducer,\n environment: defaultProps$3.environment,\n getA11yRemovalMessage,\n keyNavigationNext: 'ArrowRight',\n keyNavigationPrevious: 'ArrowLeft'\n}; // eslint-disable-next-line import/no-mutable-exports\n\nlet validatePropTypes = noop;\n/* istanbul ignore next */\n\nif (process.env.NODE_ENV !== 'production') {\n validatePropTypes = (options, caller) => {\n PropTypes.checkPropTypes(propTypes, options, 'prop', caller.name);\n };\n}\n\nconst SelectedItemClick = process.env.NODE_ENV !== \"production\" ? '__selected_item_click__' : 0;\nconst SelectedItemKeyDownDelete = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_delete__' : 1;\nconst SelectedItemKeyDownBackspace = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_backspace__' : 2;\nconst SelectedItemKeyDownNavigationNext = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_navigation_next__' : 3;\nconst SelectedItemKeyDownNavigationPrevious = process.env.NODE_ENV !== \"production\" ? '__selected_item_keydown_navigation_previous__' : 4;\nconst DropdownKeyDownNavigationPrevious = process.env.NODE_ENV !== \"production\" ? '__dropdown_keydown_navigation_previous__' : 5;\nconst DropdownKeyDownBackspace = process.env.NODE_ENV !== \"production\" ? '__dropdown_keydown_backspace__' : 6;\nconst DropdownClick = process.env.NODE_ENV !== \"production\" ? '__dropdown_click__' : 7;\nconst FunctionAddSelectedItem = process.env.NODE_ENV !== \"production\" ? '__function_add_selected_item__' : 8;\nconst FunctionRemoveSelectedItem = process.env.NODE_ENV !== \"production\" ? '__function_remove_selected_item__' : 9;\nconst FunctionSetSelectedItems = process.env.NODE_ENV !== \"production\" ? '__function_set_selected_items__' : 10;\nconst FunctionSetActiveIndex = process.env.NODE_ENV !== \"production\" ? '__function_set_active_index__' : 11;\nconst FunctionReset = process.env.NODE_ENV !== \"production\" ? '__function_reset__' : 12;\n\nvar stateChangeTypes = /*#__PURE__*/Object.freeze({\n __proto__: null,\n SelectedItemClick: SelectedItemClick,\n SelectedItemKeyDownDelete: SelectedItemKeyDownDelete,\n SelectedItemKeyDownBackspace: SelectedItemKeyDownBackspace,\n SelectedItemKeyDownNavigationNext: SelectedItemKeyDownNavigationNext,\n SelectedItemKeyDownNavigationPrevious: SelectedItemKeyDownNavigationPrevious,\n DropdownKeyDownNavigationPrevious: DropdownKeyDownNavigationPrevious,\n DropdownKeyDownBackspace: DropdownKeyDownBackspace,\n DropdownClick: DropdownClick,\n FunctionAddSelectedItem: FunctionAddSelectedItem,\n FunctionRemoveSelectedItem: FunctionRemoveSelectedItem,\n FunctionSetSelectedItems: FunctionSetSelectedItems,\n FunctionSetActiveIndex: FunctionSetActiveIndex,\n FunctionReset: FunctionReset\n});\n\n/* eslint-disable complexity */\n\nfunction downshiftMultipleSelectionReducer(state, action) {\n const {\n type,\n index,\n props,\n selectedItem\n } = action;\n const {\n activeIndex,\n selectedItems\n } = state;\n let changes;\n\n switch (type) {\n case SelectedItemClick:\n changes = {\n activeIndex: index\n };\n break;\n\n case SelectedItemKeyDownNavigationPrevious:\n changes = {\n activeIndex: activeIndex - 1 < 0 ? 0 : activeIndex - 1\n };\n break;\n\n case SelectedItemKeyDownNavigationNext:\n changes = {\n activeIndex: activeIndex + 1 >= selectedItems.length ? -1 : activeIndex + 1\n };\n break;\n\n case SelectedItemKeyDownBackspace:\n case SelectedItemKeyDownDelete:\n {\n let newActiveIndex = activeIndex;\n\n if (selectedItems.length === 1) {\n newActiveIndex = -1;\n } else if (activeIndex === selectedItems.length - 1) {\n newActiveIndex = selectedItems.length - 2;\n }\n\n changes = {\n selectedItems: [...selectedItems.slice(0, activeIndex), ...selectedItems.slice(activeIndex + 1)],\n ...{\n activeIndex: newActiveIndex\n }\n };\n break;\n }\n\n case DropdownKeyDownNavigationPrevious:\n changes = {\n activeIndex: selectedItems.length - 1\n };\n break;\n\n case DropdownKeyDownBackspace:\n changes = {\n selectedItems: selectedItems.slice(0, selectedItems.length - 1)\n };\n break;\n\n case FunctionAddSelectedItem:\n changes = {\n selectedItems: [...selectedItems, selectedItem]\n };\n break;\n\n case DropdownClick:\n changes = {\n activeIndex: -1\n };\n break;\n\n case FunctionRemoveSelectedItem:\n {\n let newActiveIndex = activeIndex;\n const selectedItemIndex = selectedItems.indexOf(selectedItem);\n\n if (selectedItemIndex >= 0) {\n if (selectedItems.length === 1) {\n newActiveIndex = -1;\n } else if (selectedItemIndex === selectedItems.length - 1) {\n newActiveIndex = selectedItems.length - 2;\n }\n\n changes = {\n selectedItems: [...selectedItems.slice(0, selectedItemIndex), ...selectedItems.slice(selectedItemIndex + 1)],\n activeIndex: newActiveIndex\n };\n }\n\n break;\n }\n\n case FunctionSetSelectedItems:\n {\n const {\n selectedItems: newSelectedItems\n } = action;\n changes = {\n selectedItems: newSelectedItems\n };\n break;\n }\n\n case FunctionSetActiveIndex:\n {\n const {\n activeIndex: newActiveIndex\n } = action;\n changes = {\n activeIndex: newActiveIndex\n };\n break;\n }\n\n case FunctionReset:\n changes = {\n activeIndex: getDefaultValue(props, 'activeIndex'),\n selectedItems: getDefaultValue(props, 'selectedItems')\n };\n break;\n\n default:\n throw new Error('Reducer called without proper action type.');\n }\n\n return { ...state,\n ...changes\n };\n}\n\nuseMultipleSelection.stateChangeTypes = stateChangeTypes;\n\nfunction useMultipleSelection(userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n\n validatePropTypes(userProps, useMultipleSelection); // Props defaults and destructuring.\n\n const props = { ...defaultProps,\n ...userProps\n };\n const {\n getA11yRemovalMessage,\n itemToString,\n environment,\n keyNavigationNext,\n keyNavigationPrevious\n } = props; // Reducer init.\n\n const [state, dispatch] = useControlledReducer$1(downshiftMultipleSelectionReducer, getInitialState(props), props);\n const {\n activeIndex,\n selectedItems\n } = state; // Refs.\n\n const isInitialMountRef = useRef(true);\n const dropdownRef = useRef(null);\n const previousSelectedItemsRef = useRef(selectedItems);\n const selectedItemRefs = useRef();\n selectedItemRefs.current = [];\n const latest = useLatestRef({\n state,\n props\n }); // Effects.\n\n /* Sets a11y status message on changes in selectedItem. */\n\n useEffect(() => {\n if (isInitialMountRef.current) {\n return;\n }\n\n if (selectedItems.length < previousSelectedItemsRef.current.length) {\n const removedSelectedItem = previousSelectedItemsRef.current.find(item => selectedItems.indexOf(item) < 0);\n setStatus(getA11yRemovalMessage({\n itemToString,\n resultCount: selectedItems.length,\n removedSelectedItem,\n activeIndex,\n activeSelectedItem: selectedItems[activeIndex]\n }), environment.document);\n }\n\n previousSelectedItemsRef.current = selectedItems; // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedItems.length]); // Sets focus on active item.\n\n useEffect(() => {\n if (isInitialMountRef.current) {\n return;\n }\n\n if (activeIndex === -1 && dropdownRef.current) {\n dropdownRef.current.focus();\n } else if (selectedItemRefs.current[activeIndex]) {\n selectedItemRefs.current[activeIndex].focus();\n }\n }, [activeIndex]);\n useControlPropsValidator({\n isInitialMount: isInitialMountRef.current,\n props,\n state\n });\n const setGetterPropCallInfo = useGetterPropsCalledChecker('getDropdownProps'); // Make initial ref false.\n\n useEffect(() => {\n isInitialMountRef.current = false;\n }, []); // Event handler functions.\n\n const selectedItemKeyDownHandlers = useMemo(() => ({\n [keyNavigationPrevious]() {\n dispatch({\n type: SelectedItemKeyDownNavigationPrevious\n });\n },\n\n [keyNavigationNext]() {\n dispatch({\n type: SelectedItemKeyDownNavigationNext\n });\n },\n\n Delete() {\n dispatch({\n type: SelectedItemKeyDownDelete\n });\n },\n\n Backspace() {\n dispatch({\n type: SelectedItemKeyDownBackspace\n });\n }\n\n }), [dispatch, keyNavigationNext, keyNavigationPrevious]);\n const dropdownKeyDownHandlers = useMemo(() => ({\n [keyNavigationPrevious](event) {\n if (isKeyDownOperationPermitted(event)) {\n dispatch({\n type: DropdownKeyDownNavigationPrevious\n });\n }\n },\n\n Backspace(event) {\n if (isKeyDownOperationPermitted(event)) {\n dispatch({\n type: DropdownKeyDownBackspace\n });\n }\n }\n\n }), [dispatch, keyNavigationPrevious]); // Getter props.\n\n const getSelectedItemProps = useCallback(function (_temp) {\n let {\n refKey = 'ref',\n ref,\n onClick,\n onKeyDown,\n selectedItem,\n index,\n ...rest\n } = _temp === void 0 ? {} : _temp;\n const {\n state: latestState\n } = latest.current;\n const itemIndex = getItemIndex(index, selectedItem, latestState.selectedItems);\n\n if (itemIndex < 0) {\n throw new Error('Pass either selectedItem or index in getSelectedItemProps!');\n }\n\n const selectedItemHandleClick = () => {\n dispatch({\n type: SelectedItemClick,\n index\n });\n };\n\n const selectedItemHandleKeyDown = event => {\n const key = normalizeArrowKey(event);\n\n if (key && selectedItemKeyDownHandlers[key]) {\n selectedItemKeyDownHandlers[key](event);\n }\n };\n\n return {\n [refKey]: handleRefs(ref, selectedItemNode => {\n if (selectedItemNode) {\n selectedItemRefs.current.push(selectedItemNode);\n }\n }),\n tabIndex: index === latestState.activeIndex ? 0 : -1,\n onClick: callAllEventHandlers(onClick, selectedItemHandleClick),\n onKeyDown: callAllEventHandlers(onKeyDown, selectedItemHandleKeyDown),\n ...rest\n };\n }, [dispatch, latest, selectedItemKeyDownHandlers]);\n const getDropdownProps = useCallback(function (_temp2, _temp3) {\n let {\n refKey = 'ref',\n ref,\n onKeyDown,\n onClick,\n preventKeyAction = false,\n ...rest\n } = _temp2 === void 0 ? {} : _temp2;\n let {\n suppressRefError = false\n } = _temp3 === void 0 ? {} : _temp3;\n setGetterPropCallInfo('getDropdownProps', suppressRefError, refKey, dropdownRef);\n\n const dropdownHandleKeyDown = event => {\n const key = normalizeArrowKey(event);\n\n if (key && dropdownKeyDownHandlers[key]) {\n dropdownKeyDownHandlers[key](event);\n }\n };\n\n const dropdownHandleClick = () => {\n dispatch({\n type: DropdownClick\n });\n };\n\n return {\n [refKey]: handleRefs(ref, dropdownNode => {\n if (dropdownNode) {\n dropdownRef.current = dropdownNode;\n }\n }),\n ...(!preventKeyAction && {\n onKeyDown: callAllEventHandlers(onKeyDown, dropdownHandleKeyDown),\n onClick: callAllEventHandlers(onClick, dropdownHandleClick)\n }),\n ...rest\n };\n }, [dispatch, dropdownKeyDownHandlers, setGetterPropCallInfo]); // returns\n\n const addSelectedItem = useCallback(selectedItem => {\n dispatch({\n type: FunctionAddSelectedItem,\n selectedItem\n });\n }, [dispatch]);\n const removeSelectedItem = useCallback(selectedItem => {\n dispatch({\n type: FunctionRemoveSelectedItem,\n selectedItem\n });\n }, [dispatch]);\n const setSelectedItems = useCallback(newSelectedItems => {\n dispatch({\n type: FunctionSetSelectedItems,\n selectedItems: newSelectedItems\n });\n }, [dispatch]);\n const setActiveIndex = useCallback(newActiveIndex => {\n dispatch({\n type: FunctionSetActiveIndex,\n activeIndex: newActiveIndex\n });\n }, [dispatch]);\n const reset = useCallback(() => {\n dispatch({\n type: FunctionReset\n });\n }, [dispatch]);\n return {\n getSelectedItemProps,\n getDropdownProps,\n addSelectedItem,\n removeSelectedItem,\n setSelectedItems,\n setActiveIndex,\n reset,\n selectedItems,\n activeIndex\n };\n}\n\nexport { Downshift$1 as default, resetIdCounter, useCombobox, useMultipleSelection, useSelect };\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/** @license React v17.0.2\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=60103,c=60106,d=60107,e=60108,f=60114,g=60109,h=60110,k=60112,l=60113,m=60120,n=60115,p=60116,q=60121,r=60122,u=60117,v=60129,w=60131;\nif(\"function\"===typeof Symbol&&Symbol.for){var x=Symbol.for;b=x(\"react.element\");c=x(\"react.portal\");d=x(\"react.fragment\");e=x(\"react.strict_mode\");f=x(\"react.profiler\");g=x(\"react.provider\");h=x(\"react.context\");k=x(\"react.forward_ref\");l=x(\"react.suspense\");m=x(\"react.suspense_list\");n=x(\"react.memo\");p=x(\"react.lazy\");q=x(\"react.block\");r=x(\"react.server.block\");u=x(\"react.fundamental\");v=x(\"react.debug_trace_mode\");w=x(\"react.legacy_hidden\")}\nfunction y(a){if(\"object\"===typeof a&&null!==a){var t=a.$$typeof;switch(t){case b:switch(a=a.type,a){case d:case f:case e:case l:case m:return a;default:switch(a=a&&a.$$typeof,a){case h:case k:case p:case n:case g:return a;default:return t}}case c:return t}}}var z=g,A=b,B=k,C=d,D=p,E=n,F=c,G=f,H=e,I=l;exports.ContextConsumer=h;exports.ContextProvider=z;exports.Element=A;exports.ForwardRef=B;exports.Fragment=C;exports.Lazy=D;exports.Memo=E;exports.Portal=F;exports.Profiler=G;exports.StrictMode=H;\nexports.Suspense=I;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return y(a)===h};exports.isContextProvider=function(a){return y(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return y(a)===k};exports.isFragment=function(a){return y(a)===d};exports.isLazy=function(a){return y(a)===p};exports.isMemo=function(a){return y(a)===n};\nexports.isPortal=function(a){return y(a)===c};exports.isProfiler=function(a){return y(a)===f};exports.isStrictMode=function(a){return y(a)===e};exports.isSuspense=function(a){return y(a)===l};exports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===v||a===e||a===l||a===m||a===w||\"object\"===typeof a&&null!==a&&(a.$$typeof===p||a.$$typeof===n||a.$$typeof===g||a.$$typeof===h||a.$$typeof===k||a.$$typeof===u||a.$$typeof===q||a[0]===r)?!0:!1};\nexports.typeOf=y;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n"],"names":["ConnectElementCommonMethodConfig","setOnLoadError","_listener","setOnLoaderStart","ConnectElementCustomMethodConfig","setFullTermsOfServiceUrl","_termOfServiceUrl","setRecipientTermsOfServiceUrl","_recipientTermsOfServiceUrl","setPrivacyPolicyUrl","_privacyPolicyUrl","setSkipTermsOfServiceCollection","_skipTermsOfServiceCollection","setCollectionOptions","_collectionOptions","setOnExit","setOnStepChange","setOnNotificationsChange","setOnInstantPayoutsPromotionLoaded","setOnInstantPayoutCreated","setDefaultCard","_defaultCard","setCardSwitching","_cardSwitching","setFetchEphemeralKey","_fetchEphemeralKey","setShowSpendControls","_showSpendControls","setIssuingProgram","_issuingProgram","setFinancialAccount","_financialAccount","payments","setDefaultFilters","_filters","setPayment","_payment","setOnClose","setOnDisputesLoaded","setHideProductTaxCodeSelector","_hidden","setDisplayHeadOfficeCountries","_countries","setOnTaxSettingsUpdated","setOnAfterTaxRegistrationAdded","setDisplayCountries","setOnAfterTaxRegistrationExpired","setPayout","_payout","setOnReportAvailabilityLoaded","EXISTING_SCRIPT_MESSAGE","V1_URL","componentNameMapping","reduce","acc","name","stripePromise$1","isWindowStripeConnectDefined","stripeConnect","init","initStripeConnect","stripePromise","initParams","_a","eagerClientSecretPromise","fetchClientSecret","error","Promise","reject","metaOptions","stripeConnectInstance","then","wrapper","initialize","Object","assign","create","tagName","htmlName","element","document","createElement","customMethods","hasCustomMethod","methods","method","value","this","Error","instance","isConnected","setConnector","oldDisplay","style","display","body","appendChild","removeChild","connect","update","updateOptions","debugInstance","logout","createWrapper","window","StripeConnect","optimizedLoading","params","sdk","sdkOptions","sdkVersion","resolve","console","warn","script","querySelectorAll","src","head","injectScript","addEventListener","loadCalled","catch","err","loadConnectAndInitialize","_arrayLikeToArray","arr","len","length","i","arr2","Array","ConnectComponentsContext","displayName","ConnectElementEventNames","ConnectComponentsProvider","_ref","connectInstance","children","Provider","useCreateComponent","_React$useState2","isArray","_arrayWithHoles","r","l","t","Symbol","iterator","e","n","u","a","f","o","call","next","done","push","return","_iterableToArrayLimit","minLen","prototype","toString","slice","constructor","from","test","_unsupportedIterableToArray","TypeError","_nonIterableRest","component","setComponent","context","useConnectComponents","wrapperDivRef","width","ref","current","newComponent","setAttribute","log","firstChild","useUpdateWithSetter","onUpdated","ConnectAccountOnboarding","_ref6","onExit","recipientTermsOfServiceUrl","fullTermsOfServiceUrl","privacyPolicyUrl","skipTermsOfServiceCollection","collectionOptions","onLoadError","onLoaderStart","onStepChange","_useCreateComponent6","onboarding","comp","val","ConnectNotificationBanner","_ref8","onNotificationsChange","_useCreateComponent8","notificationBanner","SVG","viewBox","xmlns","Path","d","nodeType","clientHeight","scrollHeight","clientWidth","scrollWidth","getComputedStyle","overflowY","overflowX","ownerDocument","defaultView","frameElement","idCounter","noop","isOrContainsNode","parent","child","environment","Node","contains","debounce","fn","time","timeoutId","cancel","clearTimeout","_len","arguments","args","_key","setTimeout","callAllEventHandlers","_len2","fns","_key2","event","_len3","_key3","some","preventDownshiftDefault","hasOwnProperty","nativeEvent","handleRefs","_len4","refs","_key4","node","forEach","generateId","String","getState","state","props","keys","prevState","key","undefined","isControlledProp","normalizeArrowKey","keyCode","indexOf","getNextWrappingIndex","moveAmount","baseIndex","itemCount","getItemNodeFromIndex","circular","itemsLastIndex","newIndex","nonDisabledNewIndex","getNextNonDisabledIndex","currentElementNode","hasAttribute","index","targetWithinDownshift","target","downshiftElements","checkActiveElement","contextNode","activeElement","cleanupStatus","documentProp","getStatusDiv","textContent","statusDiv","getElementById","border","clip","height","margin","overflow","padding","position","dropdownDefaultStateValues","highlightedIndex","isOpen","selectedItem","inputValue","updateA11yStatus","getA11yMessage","status","div","setStatus","useIsomorphicLayoutEffect","useLayoutEffect","useEffect","isAcceptedCharacterKey","capitalizeString","string","toUpperCase","useLatestRef","useRef","useEnhancedReducer","reducer","initialState","prevStateRef","actionRef","enhancedReducer","useCallback","action","changes","stateReducer","dispatch","useReducer","propsRef","dispatchWithProps","newState","type","handler","invokeOnChangeHandler","onStateChange","callOnChangeProps","defaultProps$3","itemToString","item","s","getA11ySelectionMessage","selectionParameters","itemToStringLocal","scrollIntoView","menuNode","actions","scrollMode","block","inline","h","boundary","skipOverflowHiddenElements","c","g","scrollingElement","documentElement","p","m","parentElement","getRootNode","host","w","visualViewport","innerWidth","v","innerHeight","W","scrollX","pageXOffset","H","scrollY","pageYOffset","b","getBoundingClientRect","y","E","M","top","V","right","x","bottom","I","left","C","R","T","k","B","D","O","X","Y","L","S","j","N","q","parseInt","borderLeftWidth","z","borderTopWidth","A","borderRightWidth","F","borderBottomWidth","G","J","K","offsetWidth","P","offsetHeight","Q","U","Math","max","Z","scrollLeft","$","scrollTop","min","el","circularNavigation","getDefaultValue$1","propKey","defaultStateValues","defaultValue","getInitialValue$1","initialValue","getHighlightedIndexOnOpen","offset","items","initialHighlightedIndex","defaultHighlightedIndex","useA11yMessageSetter","dependencyArray","_ref2","isInitialMount","rest","highlightedItem","resultCount","useControlPropsValidator","getItemIndexByCharacterKey","keysSoFar","lowerCasedKeysSoFar","toLowerCase","offsetIndex","startsWith","isRequired","removeEventListener","defaultProps$2","getA11yStatusMessage","previousResultCount","concat","validatePropTypes$2","stateChangeTypes$2","freeze","__proto__","MenuKeyDownArrowDown","MenuKeyDownArrowUp","MenuKeyDownEscape","MenuKeyDownHome","MenuKeyDownEnd","MenuKeyDownEnter","MenuKeyDownSpaceButton","MenuKeyDownCharacter","MenuBlur","MenuMouseLeave","ItemMouseMove","ItemClick","ToggleButtonClick","ToggleButtonKeyDownArrowDown","ToggleButtonKeyDownArrowUp","ToggleButtonKeyDownCharacter","FunctionToggleMenu","FunctionOpenMenu","FunctionCloseMenu","FunctionSetHighlightedIndex","FunctionSelectItem","FunctionSetInputValue","FunctionReset","downshiftSelectReducer","shiftKey","lowercasedKey","itemIndex","stateChangeTypes","disabled","downshiftCommonReducer","useSelect","userProps","initialIsOpen","defaultIsOpen","getInitialState$2","useControlledReducer$1","toggleButtonRef","menuRef","itemRefs","shouldBlurRef","clearTimeoutRef","elementIds","id","labelId","menuId","getItemId","toggleButtonId","inputId","useElementIds","previousResultCountRef","isInitialMountRef","latest","shouldScrollRef","_ref3","menuElement","scrollIntoViewProp","useScrollIntoView","outerDispatch","focus","mouseAndTouchTrackersRef","downshiftElementRefs","handleBlur","isMouseDown","isTouchMove","onMouseDown","onMouseUp","map","onTouchStart","onTouchMove","onTouchEnd","useMouseAndTouchTracker","setGetterPropCallInfo","toggleButtonKeyDownHandlers","useMemo","ArrowDown","preventDefault","ArrowUp","menuKeyDownHandlers","Home","End","Escape","Enter","toggleMenu","closeMenu","openMenu","setHighlightedIndex","newHighlightedIndex","selectItem","newSelectedItem","reset","setInputValue","newInputValue","getLabelProps","labelProps","htmlFor","getMenuProps","_temp","_temp2","onMouseLeave","refKey","onKeyDown","onBlur","suppressRefError","latestState","role","tabIndex","getToggleButtonProps","_temp3","_temp4","onClick","toggleProps","toggleButtonNode","getItemProps","_temp5","onMouseMove","latestProps","getItemIndex","itemProps","itemNode","ReactPropTypesSecret","emptyFunction","emptyFunctionWithReset","resetWarningCache","module","exports","shim","propName","componentName","location","propFullName","secret","getShim","ReactPropTypes","array","bigint","bool","func","number","object","symbol","any","arrayOf","elementType","instanceOf","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes","for","__assign","apply","SuppressedError"],"sourceRoot":""}