{"version":3,"file":"bundle.mjs","sources":["webpack://~admin/webpack/runtime/create_fake_namespace_object","webpack://~admin/webpack/runtime/auto_public_path","webpack://~admin/webpack/runtime/module_chunk_loading","webpack://~admin/../../node_modules/balanced-match/index.js","webpack://~admin/../../node_modules/tippy.js/dist/tippy.css","webpack://~admin/../../node_modules/css-loader/dist/runtime/api.js","webpack://~admin/../../node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://~admin/../../node_modules/dayjs/dayjs.min.js","webpack://~admin/../../node_modules/dayjs/locale|lazy|/^\\.\\/.*\\.js$/|chunkName: Time Translations|groupOptions: {}|namespace object|importPhase: evaluation","webpack://~admin/../../node_modules/dayjs/plugin/customParseFormat.js","webpack://~admin/../../node_modules/dayjs/plugin/isSameOrAfter.js","webpack://~admin/../../node_modules/formik/node_modules/react-fast-compare/index.js","webpack://~admin/../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack://~admin/../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","webpack://~admin/../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","webpack://~admin/../../node_modules/lodash/_Hash.js","webpack://~admin/../../node_modules/lodash/_ListCache.js","webpack://~admin/../../node_modules/lodash/_Map.js","webpack://~admin/../../node_modules/lodash/_MapCache.js","webpack://~admin/../../node_modules/lodash/_Stack.js","webpack://~admin/../../node_modules/lodash/_Symbol.js","webpack://~admin/../../node_modules/lodash/_Uint8Array.js","webpack://~admin/../../node_modules/lodash/_apply.js","webpack://~admin/../../node_modules/lodash/_arrayLikeKeys.js","webpack://~admin/../../node_modules/lodash/_assignMergeValue.js","webpack://~admin/../../node_modules/lodash/_assignValue.js","webpack://~admin/../../node_modules/lodash/_assocIndexOf.js","webpack://~admin/../../node_modules/lodash/_baseAssignValue.js","webpack://~admin/../../node_modules/lodash/_baseCreate.js","webpack://~admin/../../node_modules/lodash/_baseFor.js","webpack://~admin/../../node_modules/lodash/_baseGetTag.js","webpack://~admin/../../node_modules/lodash/_baseIsArguments.js","webpack://~admin/../../node_modules/lodash/_baseIsNative.js","webpack://~admin/../../node_modules/lodash/_baseIsTypedArray.js","webpack://~admin/../../node_modules/lodash/_baseKeysIn.js","webpack://~admin/../../node_modules/lodash/_baseMerge.js","webpack://~admin/../../node_modules/lodash/_baseMergeDeep.js","webpack://~admin/../../node_modules/lodash/_baseRest.js","webpack://~admin/../../node_modules/lodash/_baseSetToString.js","webpack://~admin/../../node_modules/lodash/_baseTimes.js","webpack://~admin/../../node_modules/lodash/_baseUnary.js","webpack://~admin/../../node_modules/lodash/_cloneArrayBuffer.js","webpack://~admin/../../node_modules/lodash/_cloneBuffer.js","webpack://~admin/../../node_modules/lodash/_cloneTypedArray.js","webpack://~admin/../../node_modules/lodash/_copyArray.js","webpack://~admin/../../node_modules/lodash/_copyObject.js","webpack://~admin/../../node_modules/lodash/_coreJsData.js","webpack://~admin/../../node_modules/lodash/_createAssigner.js","webpack://~admin/../../node_modules/lodash/_createBaseFor.js","webpack://~admin/../../node_modules/lodash/_defineProperty.js","webpack://~admin/../../node_modules/lodash/_freeGlobal.js","webpack://~admin/../../node_modules/lodash/_getMapData.js","webpack://~admin/../../node_modules/lodash/_getNative.js","webpack://~admin/../../node_modules/lodash/_getPrototype.js","webpack://~admin/../../node_modules/lodash/_getRawTag.js","webpack://~admin/../../node_modules/lodash/_getValue.js","webpack://~admin/../../node_modules/lodash/_hashClear.js","webpack://~admin/../../node_modules/lodash/_hashDelete.js","webpack://~admin/../../node_modules/lodash/_hashGet.js","webpack://~admin/../../node_modules/lodash/_hashHas.js","webpack://~admin/../../node_modules/lodash/_hashSet.js","webpack://~admin/../../node_modules/lodash/_initCloneObject.js","webpack://~admin/../../node_modules/lodash/_isIndex.js","webpack://~admin/../../node_modules/lodash/_isIterateeCall.js","webpack://~admin/../../node_modules/lodash/_isKeyable.js","webpack://~admin/../../node_modules/lodash/_isMasked.js","webpack://~admin/../../node_modules/lodash/_isPrototype.js","webpack://~admin/../../node_modules/lodash/_listCacheClear.js","webpack://~admin/../../node_modules/lodash/_listCacheDelete.js","webpack://~admin/../../node_modules/lodash/_listCacheGet.js","webpack://~admin/../../node_modules/lodash/_listCacheHas.js","webpack://~admin/../../node_modules/lodash/_listCacheSet.js","webpack://~admin/../../node_modules/lodash/_mapCacheClear.js","webpack://~admin/../../node_modules/lodash/_mapCacheDelete.js","webpack://~admin/../../node_modules/lodash/_mapCacheGet.js","webpack://~admin/../../node_modules/lodash/_mapCacheHas.js","webpack://~admin/../../node_modules/lodash/_mapCacheSet.js","webpack://~admin/../../node_modules/lodash/_nativeCreate.js","webpack://~admin/../../node_modules/lodash/_nativeKeysIn.js","webpack://~admin/../../node_modules/lodash/_nodeUtil.js","webpack://~admin/../../node_modules/lodash/_objectToString.js","webpack://~admin/../../node_modules/lodash/_overArg.js","webpack://~admin/../../node_modules/lodash/_overRest.js","webpack://~admin/../../node_modules/lodash/_root.js","webpack://~admin/../../node_modules/lodash/_safeGet.js","webpack://~admin/../../node_modules/lodash/_setToString.js","webpack://~admin/../../node_modules/lodash/_shortOut.js","webpack://~admin/../../node_modules/lodash/_stackClear.js","webpack://~admin/../../node_modules/lodash/_stackDelete.js","webpack://~admin/../../node_modules/lodash/_stackGet.js","webpack://~admin/../../node_modules/lodash/_stackHas.js","webpack://~admin/../../node_modules/lodash/_stackSet.js","webpack://~admin/../../node_modules/lodash/_toSource.js","webpack://~admin/../../node_modules/lodash/constant.js","webpack://~admin/../../node_modules/lodash/eq.js","webpack://~admin/../../node_modules/lodash/identity.js","webpack://~admin/../../node_modules/lodash/isArguments.js","webpack://~admin/../../node_modules/lodash/isArray.js","webpack://~admin/../../node_modules/lodash/isArrayLike.js","webpack://~admin/../../node_modules/lodash/isArrayLikeObject.js","webpack://~admin/../../node_modules/lodash/isBuffer.js","webpack://~admin/../../node_modules/lodash/isFunction.js","webpack://~admin/../../node_modules/lodash/isLength.js","webpack://~admin/../../node_modules/lodash/isObject.js","webpack://~admin/../../node_modules/lodash/isObjectLike.js","webpack://~admin/../../node_modules/lodash/isPlainObject.js","webpack://~admin/../../node_modules/lodash/isTypedArray.js","webpack://~admin/../../node_modules/lodash/keysIn.js","webpack://~admin/../../node_modules/lodash/merge.js","webpack://~admin/../../node_modules/lodash/stubFalse.js","webpack://~admin/../../node_modules/lodash/toPlainObject.js","webpack://~admin/../../node_modules/math-expression-evaluator/src/formula_evaluator.js","webpack://~admin/../../node_modules/math-expression-evaluator/src/lexer.js","webpack://~admin/../../node_modules/math-expression-evaluator/src/math_function.js","webpack://~admin/../../node_modules/math-expression-evaluator/src/postfix.js","webpack://~admin/../../node_modules/math-expression-evaluator/src/postfix_evaluator.js","webpack://~admin/../../node_modules/preact/compat/dist/compat.module.js","webpack://~admin/../../node_modules/preact/dist/preact.module.js","webpack://~admin/../../node_modules/preact/hooks/dist/hooks.module.js","webpack://~admin/../../node_modules/prop-types/factoryWithThrowingShims.js","webpack://~admin/../../node_modules/prop-types/index.js","webpack://~admin/../../node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack://~admin/../../node_modules/property-expr/index.js","webpack://~admin/../../node_modules/react-input-autosize/lib/AutosizeInput.js","webpack://~admin/../../node_modules/react-is/cjs/react-is.production.min.js","webpack://~admin/../../node_modules/react-is/index.js","webpack://~admin/../../node_modules/reduce-css-calc/index.js","webpack://~admin/../../node_modules/reduce-css-calc/node_modules/balanced-match/index.js","webpack://~admin/../../node_modules/reduce-function-call/index.js","webpack://~admin/../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://~admin/../../node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://~admin/../../node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://~admin/../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://~admin/../../node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://~admin/../../node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://~admin/../../node_modules/@floating-ui/react/dist/floating-ui.react.mjs","webpack://~admin/../../node_modules/swr/dist/_internal/index.mjs","webpack://~admin/../../node_modules/axios/lib/utils.js","webpack://~admin/../../node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack://~admin/../../node_modules/@visx/text/esm/util/memoize.js","webpack://~admin/../../node_modules/tinycolor2/esm/tinycolor.js","webpack://~admin/../../../src/adapters/ClientAdapter.tsx","webpack://~admin/../../node_modules/wouter-preact/src/react-deps.js","webpack://~admin/../../../src/atoms/Icon/Icon.tsx","webpack://~admin/../../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","webpack://~admin/./src/components/Menu/index.tsx","webpack://~admin/./src/components/Status/index.styles.ts","webpack://~admin/./src/components/Status/index.tsx","webpack://~admin/../../../src/molecules/Button/Button.tsx","webpack://~admin/../../../src/adapters/GrowlAdapter.tsx","webpack://~admin/../../../src/atoms/Transition/Transition.tsx","webpack://~admin/../api/src/models/installation-model.ts","webpack://~admin/../api/src/models/question-model.ts","webpack://~admin/../hooks/src/FeatureFlag.ts","webpack://~admin/../../node_modules/lodash-es/_isMasked.js","webpack://~admin/../../node_modules/lodash-es/_memoizeCapped.js","webpack://~admin/../api/src/models/feedback-model.ts","webpack://~admin/../../node_modules/@popperjs/core/lib/createPopper.js","webpack://~admin/../../node_modules/@tippyjs/react/dist/tippy-react.esm.js","webpack://~admin/../../node_modules/@emotion/core/node_modules/@emotion/memoize/dist/memoize.browser.esm.js","webpack://~admin/../../node_modules/@emotion/core/node_modules/@emotion/cache/dist/cache.browser.esm.js","webpack://~admin/../../node_modules/@emotion/css/node_modules/@emotion/memoize/dist/memoize.browser.esm.js","webpack://~admin/../../node_modules/react-select/dist/stateManager-2f2b6f5b.browser.esm.js","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionTypeSelector/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/SelectQuestionType/index.tsx","webpack://~admin/../../../src/organisms/Pagination/Pagination.tsx","webpack://~admin/../../node_modules/lodash-es/_basePropertyOf.js","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/schedulingOptions.ts","webpack://~admin/../../node_modules/@visx/bounds/esm/enhancers/withBoundingRects.js","webpack://~admin/../../node_modules/@emotion/serialize/dist/emotion-serialize.esm.js","webpack://~admin/../../node_modules/d3-format/src/formatPrefixAuto.js","webpack://~admin/../../node_modules/d3-format/src/defaultLocale.js","webpack://~admin/../../node_modules/immer/dist/immer.mjs","webpack://~admin/../../node_modules/@emotion/core/node_modules/@emotion/serialize/dist/serialize.browser.esm.js","webpack://~admin/../../node_modules/@emotion/css/node_modules/@emotion/serialize/dist/serialize.browser.esm.js","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/ScheduleFormat/ScheduleFormat.tsx","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://~admin/../../../src/hooks/useStore/useStore.ts","webpack://~admin/../../src/utils.tsx","webpack://~admin/../../../src/adapters/shared.ts","webpack://~admin/../../../src/adapters/I18nAdapter.tsx","webpack://~admin/../../../src/adapters/FeatureFlagsAdapter.tsx","webpack://~admin/../hooks/src/useLanguage.ts","webpack://~admin/../hooks/index.ts","webpack://~admin/../hooks/src/useIsClient.ts","webpack://~admin/../hooks/src/useIsRTL.ts","webpack://~admin/../hooks/src/TemporaryContext.tsx","webpack://~admin/../hooks/src/useApiContext.ts","webpack://~admin/../../node_modules/dequal/lite/index.mjs","webpack://~admin/../../node_modules/swr/dist/config-context-ext53wcz.mjs","webpack://~admin/../../node_modules/swr/dist/use-swr-emll9s78.mjs","webpack://~admin/../i18n/src/I18nContext/index.tsx","webpack://~admin/../../node_modules/@emotion/cache/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js","webpack://~admin/../../node_modules/stylis/src/Utility.js","webpack://~admin/../../node_modules/stylis/src/Tokenizer.js","webpack://~admin/../../node_modules/stylis/src/Enum.js","webpack://~admin/../../node_modules/stylis/src/Serializer.js","webpack://~admin/../../node_modules/stylis/src/Parser.js","webpack://~admin/../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/extends.js","webpack://~admin/../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js","webpack://~admin/../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","webpack://~admin/../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","webpack://~admin/../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","webpack://~admin/../../node_modules/@emotion/hash/dist/emotion-hash.esm.js","webpack://~admin/../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","webpack://~admin/../../node_modules/@emotion/react/dist/emotion-element-f0de968e.browser.esm.js","webpack://~admin/../../node_modules/stylis/src/Middleware.js","webpack://~admin/../../node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js","webpack://~admin/../../../src/theming/baseValues/breakpoint.ts","webpack://~admin/../../../src/theming/baseValues/color.ts","webpack://~admin/../../../src/theming/baseValues/font.ts","webpack://~admin/../../../src/theming/baseValues/sizing.ts","webpack://~admin/../../../src/theming/defaultThemeConfigs/index.ts","webpack://~admin/../../../src/theming/defaultThemeConfigs/studioDefault.ts","webpack://~admin/../../../src/theming/defaultThemeConfigs/studioTheme.ts","webpack://~admin/../../../src/theming/defaultThemeConfigs/brandTheme.ts","webpack://~admin/../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js","webpack://~admin/../../src/theming/ThemeProvider.tsx","webpack://~admin/../../src/theme.ts","webpack://~admin/../../../src/hooks/useTheme/useTheme.tsx","webpack://~admin/../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js","webpack://~admin/../../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js","webpack://~admin/../../node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js","webpack://~admin/../hooks/src/useTranslation.ts","webpack://~admin/../hooks/src/useI18nDevMode.ts","webpack://~admin/../../node_modules/wouter-preact/src/use-browser-location.js","webpack://~admin/../../node_modules/wouter-preact/src/paths.js","webpack://~admin/../../node_modules/wouter-preact/src/index.js","webpack://~admin/../../node_modules/regexparam/dist/index.mjs","webpack://~admin/../../../src/atoms/Icon/staffbase-icons.ts","webpack://~admin/../../../src/helpers/keyboardEvents.ts","webpack://~admin/../../../src/helpers/a11y.ts","webpack://~admin/../../../src/atoms/TabbedList/TabbedList.style.ts","webpack://~admin/../../../src/atoms/TabbedList/TabbedList.tsx","webpack://~admin/./src/pages/index.styles.ts","webpack://~admin/../../../src/adapters/NavigationAdapter.tsx","webpack://~admin/./src/components/RedirectHandler/index.tsx","webpack://~admin/./src/hooks/useOnClickOutside.ts","webpack://~admin/./src/components/DropdownMenu/index.styles.ts","webpack://~admin/./src/components/DropdownMenu/index.tsx","webpack://~admin/./src/components/index.tsx","webpack://~admin/../../node_modules/swr/dist/mutation/index.mjs","webpack://~admin/../../../src/atoms/Portal/Portal.tsx","webpack://~admin/../../../src/organisms/DesktopModal/DesktopModal.tsx","webpack://~admin/../../../src/organisms/ConfirmationDialog/ConfirmationDialog.tsx","webpack://~admin/../../../src/adapters/runtime/RuntimeAdapter.ts","webpack://~admin/../../../src/adapters/runtime/RuntimeFormData.ts","webpack://~admin/../../../src/adapters/runtime/WebActionSheet.tsx","webpack://~admin/../../../src/adapters/runtime/WebRuntime.tsx","webpack://~admin/../../../src/adapters/runtime/AdapterStore.ts","webpack://~admin/../../../src/adapters/StaffbaseApiAdapter.tsx","webpack://~admin/../../../src/api/SimpleRequestBuilder.ts","webpack://~admin/../../../src/api/ApiError.ts","webpack://~admin/../../../src/api/NetworkError.ts","webpack://~admin/../../../src/api/AbstractApi.ts","webpack://~admin/../hooks/src/useStaffbaseApi.ts","webpack://~admin/../../node_modules/swr/dist/immutable/index.mjs","webpack://~admin/../../node_modules/axios/lib/helpers/bind.js","webpack://~admin/../../node_modules/axios/lib/helpers/parseHeaders.js","webpack://~admin/../../node_modules/axios/lib/helpers/sanitizeHeaderValue.js","webpack://~admin/../../node_modules/axios/lib/core/AxiosHeaders.js","webpack://~admin/../../node_modules/axios/lib/core/AxiosError.js","webpack://~admin/../../node_modules/axios/lib/helpers/toFormData.js","webpack://~admin/../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js","webpack://~admin/../../node_modules/axios/lib/helpers/buildURL.js","webpack://~admin/../../node_modules/axios/lib/core/InterceptorManager.js","webpack://~admin/../../node_modules/axios/lib/defaults/transitional.js","webpack://~admin/../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","webpack://~admin/../../node_modules/axios/lib/platform/browser/classes/FormData.js","webpack://~admin/../../node_modules/axios/lib/platform/browser/classes/Blob.js","webpack://~admin/../../node_modules/axios/lib/platform/common/utils.js","webpack://~admin/../../node_modules/axios/lib/platform/index.js","webpack://~admin/../../node_modules/axios/lib/platform/browser/index.js","webpack://~admin/../../node_modules/axios/lib/helpers/formDataToJSON.js","webpack://~admin/../../node_modules/axios/lib/core/methodList.js","webpack://~admin/../../node_modules/axios/lib/defaults/index.js","webpack://~admin/../../node_modules/axios/lib/helpers/toURLEncodedForm.js","webpack://~admin/../../node_modules/axios/lib/core/transformData.js","webpack://~admin/../../node_modules/axios/lib/cancel/isCancel.js","webpack://~admin/../../node_modules/axios/lib/cancel/CanceledError.js","webpack://~admin/../../node_modules/axios/lib/core/settle.js","webpack://~admin/../../node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js","webpack://~admin/../../node_modules/axios/lib/helpers/parseProtocol.js","webpack://~admin/../../node_modules/axios/lib/helpers/speedometer.js","webpack://~admin/../../node_modules/axios/lib/helpers/throttle.js","webpack://~admin/../../node_modules/axios/lib/helpers/progressEventReducer.js","webpack://~admin/../../node_modules/axios/lib/helpers/cookies.js","webpack://~admin/../../node_modules/axios/lib/core/buildFullPath.js","webpack://~admin/../../node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack://~admin/../../node_modules/axios/lib/helpers/combineURLs.js","webpack://~admin/../../node_modules/axios/lib/core/mergeConfig.js","webpack://~admin/../../node_modules/axios/lib/core/setFormDataHeaders.js","webpack://~admin/../../node_modules/axios/lib/helpers/resolveConfig.js","webpack://~admin/../../node_modules/axios/lib/adapters/xhr.js","webpack://~admin/../../node_modules/axios/lib/helpers/trackStream.js","webpack://~admin/../../node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js","webpack://~admin/../../node_modules/axios/lib/adapters/fetch.js","webpack://~admin/../../node_modules/axios/lib/helpers/composeSignals.js","webpack://~admin/../../node_modules/axios/lib/adapters/adapters.js","webpack://~admin/../../node_modules/axios/lib/core/dispatchRequest.js","webpack://~admin/../../node_modules/axios/lib/helpers/validator.js","webpack://~admin/../../node_modules/axios/lib/core/Axios.js","webpack://~admin/../../node_modules/axios/lib/cancel/CancelToken.js","webpack://~admin/../../node_modules/axios/lib/helpers/HttpStatusCode.js","webpack://~admin/../../node_modules/axios/lib/axios.js","webpack://~admin/../../node_modules/axios/lib/helpers/spread.js","webpack://~admin/../../node_modules/axios/lib/helpers/isAxiosError.js","webpack://~admin/../api/src/models/survey-model.ts","webpack://~admin/../api/src/models/result-models.ts","webpack://~admin/../api/src/models/filters-model.ts","webpack://~admin/../api/src/models/installation-results-model.ts","webpack://~admin/../../node_modules/jwt-decode/build/esm/index.js","webpack://~admin/../api/src/token-generator.ts","webpack://~admin/../api/src/api.ts","webpack://~admin/../../node_modules/@staffbase/api/dist/client.mjs","webpack://~admin/../api/src/client.ts","webpack://~admin/../api/src/employeeClient.ts","webpack://~admin/../api/src/hooks/useApi.ts","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionForm/index.styles.ts","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionPreview/Button/index.tsx","webpack://~admin/../../node_modules/clsx/dist/clsx.mjs","webpack://~admin/../../../src/components/divider/Divider.tsx","webpack://~admin/../../../src/icons/directional/CaretUpIcon.tsx","webpack://~admin/../../../src/icons/directional/CaretDownIcon.tsx","webpack://~admin/../hooks/src/useLocalizedContent.ts","webpack://~admin/../components/src/ShareableResults/QuestionOverview.tsx","webpack://~admin/../../node_modules/@visx/responsive/esm/hooks/useParentSize.js","webpack://~admin/../../node_modules/@visx/responsive/esm/utils/debounce.js","webpack://~admin/../../node_modules/@visx/responsive/esm/components/ParentSize.js","webpack://~admin/../../../src/icons/toggle/StarAltIcon.tsx","webpack://~admin/../../../src/icons/plugin-surveys/SliderQuestionIcon.tsx","webpack://~admin/../../../src/icons/plugin-surveys/NpsQuestionIcon.tsx","webpack://~admin/../../../src/icons/plugin-surveys/MultipleChoiceQuestionIcon.tsx","webpack://~admin/../../../src/icons/plugin-surveys/TextQuestionIcon.tsx","webpack://~admin/../../../src/components/emptyState/EmptyState.tsx","webpack://~admin/../../../src/icons/toggle/ViewAltIcon.tsx","webpack://~admin/../../node_modules/@visx/group/esm/Group.js","webpack://~admin/../../node_modules/d3-scale/src/init.js","webpack://~admin/../../node_modules/internmap/src/index.js","webpack://~admin/../../node_modules/d3-scale/src/ordinal.js","webpack://~admin/../../node_modules/d3-scale/src/band.js","webpack://~admin/../../node_modules/d3-array/src/range.js","webpack://~admin/../../node_modules/d3-color/src/define.js","webpack://~admin/../../node_modules/d3-color/src/color.js","webpack://~admin/../../node_modules/d3-color/src/math.js","webpack://~admin/../../node_modules/d3-color/src/lab.js","webpack://~admin/../../node_modules/d3-interpolate/src/constant.js","webpack://~admin/../../node_modules/d3-interpolate/src/color.js","webpack://~admin/../../node_modules/d3-interpolate/src/hcl.js","webpack://~admin/../../node_modules/d3-interpolate/src/hsl.js","webpack://~admin/../../node_modules/d3-color/src/cubehelix.js","webpack://~admin/../../node_modules/d3-interpolate/src/cubehelix.js","webpack://~admin/../../node_modules/d3-interpolate/src/rgb.js","webpack://~admin/../../node_modules/@visx/scale/esm/utils/createColorInterpolator.js","webpack://~admin/../../node_modules/d3-interpolate/src/lab.js","webpack://~admin/../../node_modules/d3-time/src/interval.js","webpack://~admin/../../node_modules/d3-time/src/duration.js","webpack://~admin/../../node_modules/d3-time/src/day.js","webpack://~admin/../../node_modules/d3-time/src/hour.js","webpack://~admin/../../node_modules/d3-time/src/minute.js","webpack://~admin/../../node_modules/d3-time/src/month.js","webpack://~admin/../../node_modules/d3-time/src/second.js","webpack://~admin/../../node_modules/d3-time/src/week.js","webpack://~admin/../../node_modules/d3-time/src/year.js","webpack://~admin/../../node_modules/@visx/scale/esm/utils/isUtcScale.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/nice.js","webpack://~admin/../../node_modules/d3-interpolate/src/round.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/scaleOperator.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/domain.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/zero.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/interpolate.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/round.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/align.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/base.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/clamp.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/constant.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/exponent.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/padding.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/range.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/reverse.js","webpack://~admin/../../node_modules/@visx/scale/esm/operators/unknown.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/band.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/point.js","webpack://~admin/../../node_modules/d3-array/src/ticks.js","webpack://~admin/../../node_modules/d3-array/src/ascending.js","webpack://~admin/../../node_modules/d3-array/src/descending.js","webpack://~admin/../../node_modules/d3-array/src/bisector.js","webpack://~admin/../../node_modules/d3-array/src/bisect.js","webpack://~admin/../../node_modules/d3-interpolate/src/number.js","webpack://~admin/../../node_modules/d3-array/src/number.js","webpack://~admin/../../node_modules/d3-interpolate/src/string.js","webpack://~admin/../../node_modules/d3-scale/src/number.js","webpack://~admin/../../node_modules/d3-scale/src/continuous.js","webpack://~admin/../../node_modules/d3-scale/src/constant.js","webpack://~admin/../../node_modules/d3-format/src/formatSpecifier.js","webpack://~admin/../../node_modules/d3-format/src/formatDecimal.js","webpack://~admin/../../node_modules/d3-format/src/exponent.js","webpack://~admin/../../node_modules/d3-format/src/formatRounded.js","webpack://~admin/../../node_modules/d3-format/src/formatTypes.js","webpack://~admin/../../node_modules/d3-format/src/identity.js","webpack://~admin/../../node_modules/d3-format/src/locale.js","webpack://~admin/../../node_modules/d3-format/src/formatGroup.js","webpack://~admin/../../node_modules/d3-format/src/formatNumerals.js","webpack://~admin/../../node_modules/d3-format/src/formatTrim.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/linear.js","webpack://~admin/../../node_modules/d3-scale/src/linear.js","webpack://~admin/../../node_modules/d3-interpolate/src/value.js","webpack://~admin/../../node_modules/d3-interpolate/src/numberArray.js","webpack://~admin/../../node_modules/d3-interpolate/src/date.js","webpack://~admin/../../node_modules/d3-interpolate/src/array.js","webpack://~admin/../../node_modules/d3-interpolate/src/object.js","webpack://~admin/../../node_modules/d3-scale/src/tickFormat.js","webpack://~admin/../../node_modules/d3-format/src/precisionRound.js","webpack://~admin/../../node_modules/d3-format/src/precisionPrefix.js","webpack://~admin/../../node_modules/d3-format/src/precisionFixed.js","webpack://~admin/../../node_modules/@visx/scale/esm/utils/coerceNumber.js","webpack://~admin/../../node_modules/@visx/scale/esm/utils/getTicks.js","webpack://~admin/../../node_modules/@visx/scale/esm/utils/toString.js","webpack://~admin/../../node_modules/d3-shape/src/constant.js","webpack://~admin/../../node_modules/d3-shape/src/curve/linear.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/radial.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/time.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/utc.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/log.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/power.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/ordinal.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/quantize.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/quantile.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/symlog.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/threshold.js","webpack://~admin/../../node_modules/@visx/scale/esm/scales/squareRoot.js","webpack://~admin/../../node_modules/@visx/scale/esm/updateScale.js","webpack://~admin/../../node_modules/d3-shape/src/array.js","webpack://~admin/../../node_modules/d3-path/src/path.js","webpack://~admin/../../node_modules/d3-shape/src/point.js","webpack://~admin/../../node_modules/@visx/shape/esm/shapes/Line.js","webpack://~admin/../../node_modules/@visx/shape/esm/shapes/LinePath.js","webpack://~admin/../../node_modules/@visx/shape/esm/util/D3ShapeFactories.js","webpack://~admin/../../node_modules/@visx/shape/esm/util/setNumberOrNumberAccessor.js","webpack://~admin/../../node_modules/d3-shape/src/line.js","webpack://~admin/../../node_modules/d3-shape/src/path.js","webpack://~admin/../../node_modules/@visx/shape/esm/shapes/Bar.js","webpack://~admin/../../node_modules/@visx/shape/esm/shapes/BarRounded.js","webpack://~admin/../../node_modules/@visx/text/esm/util/getStringWidth.js","webpack://~admin/../../node_modules/@visx/text/esm/hooks/useText.js","webpack://~admin/../../node_modules/@visx/text/esm/Text.js","webpack://~admin/../../node_modules/@visx/axis/esm/constants/orientation.js","webpack://~admin/../../node_modules/@visx/axis/esm/axis/Ticks.js","webpack://~admin/../../node_modules/@visx/axis/esm/axis/AxisRenderer.js","webpack://~admin/../../node_modules/@visx/axis/esm/utils/getLabelTransform.js","webpack://~admin/../../node_modules/@visx/point/esm/Point.js","webpack://~admin/../../node_modules/@visx/axis/esm/utils/createPoint.js","webpack://~admin/../../node_modules/@visx/axis/esm/axis/Axis.js","webpack://~admin/../../node_modules/@visx/axis/esm/utils/getTickFormatter.js","webpack://~admin/../../node_modules/@visx/axis/esm/utils/getTickPosition.js","webpack://~admin/../../node_modules/@visx/axis/esm/utils/getAxisRangePaddingConfig.js","webpack://~admin/../../node_modules/@visx/axis/esm/axis/AxisLeft.js","webpack://~admin/../../node_modules/@visx/axis/esm/axis/AxisRight.js","webpack://~admin/../../node_modules/@visx/axis/esm/axis/AxisBottom.js","webpack://~admin/../components/src/utils/index.ts","webpack://~admin/../components/src/charts/BarChart/index.style.ts","webpack://~admin/../components/src/charts/BarChart/index.tsx","webpack://~admin/../components/src/charts/OptionChart/index.styled.ts","webpack://~admin/../components/src/charts/OptionChart/index.tsx","webpack://~admin/../components/src/ShareableResults/Results.tsx","webpack://~admin/../components/src/ShareableResults/ResultSummary.tsx","webpack://~admin/../components/src/ShareableResults/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionPreview/Results/index.tsx","webpack://~admin/../../../src/components/button/Button.tsx","webpack://~admin/../../../src/icons/plugin-chat/DoubleCheckIcon.tsx","webpack://~admin/../components/src/SurveyCard/index.tsx","webpack://~admin/../components/src/SurveyThanks/index.tsx","webpack://~admin/../../node_modules/formik/node_modules/deepmerge/dist/es.js","webpack://~admin/../../node_modules/lodash-es/_freeGlobal.js","webpack://~admin/../../node_modules/lodash-es/_root.js","webpack://~admin/../../node_modules/lodash-es/_Symbol.js","webpack://~admin/../../node_modules/lodash-es/_getRawTag.js","webpack://~admin/../../node_modules/lodash-es/_objectToString.js","webpack://~admin/../../node_modules/lodash-es/_baseGetTag.js","webpack://~admin/../../node_modules/lodash-es/_overArg.js","webpack://~admin/../../node_modules/lodash-es/_getPrototype.js","webpack://~admin/../../node_modules/lodash-es/isObjectLike.js","webpack://~admin/../../node_modules/lodash-es/isPlainObject.js","webpack://~admin/../../node_modules/lodash-es/eq.js","webpack://~admin/../../node_modules/lodash-es/_assocIndexOf.js","webpack://~admin/../../node_modules/lodash-es/_listCacheDelete.js","webpack://~admin/../../node_modules/lodash-es/_ListCache.js","webpack://~admin/../../node_modules/lodash-es/_listCacheClear.js","webpack://~admin/../../node_modules/lodash-es/_listCacheGet.js","webpack://~admin/../../node_modules/lodash-es/_listCacheHas.js","webpack://~admin/../../node_modules/lodash-es/_listCacheSet.js","webpack://~admin/../../node_modules/lodash-es/isObject.js","webpack://~admin/../../node_modules/lodash-es/isFunction.js","webpack://~admin/../../node_modules/lodash-es/_coreJsData.js","webpack://~admin/../../node_modules/lodash-es/_toSource.js","webpack://~admin/../../node_modules/lodash-es/_baseIsNative.js","webpack://~admin/../../node_modules/lodash-es/_getNative.js","webpack://~admin/../../node_modules/lodash-es/_getValue.js","webpack://~admin/../../node_modules/lodash-es/_Map.js","webpack://~admin/../../node_modules/lodash-es/_nativeCreate.js","webpack://~admin/../../node_modules/lodash-es/_hashGet.js","webpack://~admin/../../node_modules/lodash-es/_hashHas.js","webpack://~admin/../../node_modules/lodash-es/_Hash.js","webpack://~admin/../../node_modules/lodash-es/_hashClear.js","webpack://~admin/../../node_modules/lodash-es/_hashDelete.js","webpack://~admin/../../node_modules/lodash-es/_hashSet.js","webpack://~admin/../../node_modules/lodash-es/_isKeyable.js","webpack://~admin/../../node_modules/lodash-es/_getMapData.js","webpack://~admin/../../node_modules/lodash-es/_MapCache.js","webpack://~admin/../../node_modules/lodash-es/_Stack.js","webpack://~admin/../../node_modules/lodash-es/_mapCacheClear.js","webpack://~admin/../../node_modules/lodash-es/_mapCacheDelete.js","webpack://~admin/../../node_modules/lodash-es/_mapCacheGet.js","webpack://~admin/../../node_modules/lodash-es/_mapCacheHas.js","webpack://~admin/../../node_modules/lodash-es/_mapCacheSet.js","webpack://~admin/../../node_modules/lodash-es/_stackClear.js","webpack://~admin/../../node_modules/lodash-es/_stackDelete.js","webpack://~admin/../../node_modules/lodash-es/_stackGet.js","webpack://~admin/../../node_modules/lodash-es/_stackHas.js","webpack://~admin/../../node_modules/lodash-es/_stackSet.js","webpack://~admin/../../node_modules/lodash-es/_arrayEach.js","webpack://~admin/../../node_modules/lodash-es/_defineProperty.js","webpack://~admin/../../node_modules/lodash-es/_baseAssignValue.js","webpack://~admin/../../node_modules/lodash-es/_assignValue.js","webpack://~admin/../../node_modules/lodash-es/_copyObject.js","webpack://~admin/../../node_modules/lodash-es/_baseTimes.js","webpack://~admin/../../node_modules/lodash-es/_baseIsArguments.js","webpack://~admin/../../node_modules/lodash-es/isArguments.js","webpack://~admin/../../node_modules/lodash-es/isArray.js","webpack://~admin/../../node_modules/lodash-es/isBuffer.js","webpack://~admin/../../node_modules/lodash-es/stubFalse.js","webpack://~admin/../../node_modules/lodash-es/_isIndex.js","webpack://~admin/../../node_modules/lodash-es/isLength.js","webpack://~admin/../../node_modules/lodash-es/_baseIsTypedArray.js","webpack://~admin/../../node_modules/lodash-es/_baseUnary.js","webpack://~admin/../../node_modules/lodash-es/_nodeUtil.js","webpack://~admin/../../node_modules/lodash-es/isTypedArray.js","webpack://~admin/../../node_modules/lodash-es/_arrayLikeKeys.js","webpack://~admin/../../node_modules/lodash-es/_isPrototype.js","webpack://~admin/../../node_modules/lodash-es/_nativeKeys.js","webpack://~admin/../../node_modules/lodash-es/_baseKeys.js","webpack://~admin/../../node_modules/lodash-es/isArrayLike.js","webpack://~admin/../../node_modules/lodash-es/keys.js","webpack://~admin/../../node_modules/lodash-es/_nativeKeysIn.js","webpack://~admin/../../node_modules/lodash-es/_baseKeysIn.js","webpack://~admin/../../node_modules/lodash-es/keysIn.js","webpack://~admin/../../node_modules/lodash-es/_cloneBuffer.js","webpack://~admin/../../node_modules/lodash-es/_copyArray.js","webpack://~admin/../../node_modules/lodash-es/_arrayFilter.js","webpack://~admin/../../node_modules/lodash-es/stubArray.js","webpack://~admin/../../node_modules/lodash-es/_getSymbols.js","webpack://~admin/../../node_modules/lodash-es/_arrayPush.js","webpack://~admin/../../node_modules/lodash-es/_getSymbolsIn.js","webpack://~admin/../../node_modules/lodash-es/_baseGetAllKeys.js","webpack://~admin/../../node_modules/lodash-es/_getAllKeys.js","webpack://~admin/../../node_modules/lodash-es/_getAllKeysIn.js","webpack://~admin/../../node_modules/lodash-es/_DataView.js","webpack://~admin/../../node_modules/lodash-es/_Promise.js","webpack://~admin/../../node_modules/lodash-es/_Set.js","webpack://~admin/../../node_modules/lodash-es/_WeakMap.js","webpack://~admin/../../node_modules/lodash-es/_getTag.js","webpack://~admin/../../node_modules/lodash-es/_initCloneArray.js","webpack://~admin/../../node_modules/lodash-es/_Uint8Array.js","webpack://~admin/../../node_modules/lodash-es/_cloneArrayBuffer.js","webpack://~admin/../../node_modules/lodash-es/_cloneDataView.js","webpack://~admin/../../node_modules/lodash-es/_cloneRegExp.js","webpack://~admin/../../node_modules/lodash-es/_cloneSymbol.js","webpack://~admin/../../node_modules/lodash-es/_cloneTypedArray.js","webpack://~admin/../../node_modules/lodash-es/_initCloneByTag.js","webpack://~admin/../../node_modules/lodash-es/_baseCreate.js","webpack://~admin/../../node_modules/lodash-es/isMap.js","webpack://~admin/../../node_modules/lodash-es/_baseIsMap.js","webpack://~admin/../../node_modules/lodash-es/isSet.js","webpack://~admin/../../node_modules/lodash-es/_baseIsSet.js","webpack://~admin/../../node_modules/lodash-es/_baseClone.js","webpack://~admin/../../node_modules/lodash-es/_initCloneObject.js","webpack://~admin/../../node_modules/lodash-es/_baseAssignIn.js","webpack://~admin/../../node_modules/lodash-es/_copySymbolsIn.js","webpack://~admin/../../node_modules/lodash-es/_baseAssign.js","webpack://~admin/../../node_modules/lodash-es/_copySymbols.js","webpack://~admin/../../node_modules/lodash-es/cloneDeep.js","webpack://~admin/../../node_modules/tiny-warning/dist/tiny-warning.esm.js","webpack://~admin/../../node_modules/lodash-es/clone.js","webpack://~admin/../../node_modules/lodash-es/_arrayMap.js","webpack://~admin/../../node_modules/lodash-es/isSymbol.js","webpack://~admin/../../node_modules/lodash-es/memoize.js","webpack://~admin/../../node_modules/lodash-es/_stringToPath.js","webpack://~admin/../../node_modules/lodash-es/_toKey.js","webpack://~admin/../../node_modules/lodash-es/_baseToString.js","webpack://~admin/../../node_modules/lodash-es/toString.js","webpack://~admin/../../node_modules/lodash-es/toPath.js","webpack://~admin/../../node_modules/formik/dist/formik.esm.js","webpack://~admin/../../../src/icons/essentials/AlertIcon.tsx","webpack://~admin/../../../src/components/pill/Pill.tsx","webpack://~admin/../components/src/ProgressBar/index.tsx","webpack://~admin/../components/src/QuestionContents/index.tsx","webpack://~admin/../../../src/icons/toggle/LockIcon.tsx","webpack://~admin/../../../src/icons/content/BarChartIcon.tsx","webpack://~admin/../components/src/MultipleQuestions/Wizard/helpers.ts","webpack://~admin/../components/src/MultipleQuestions/SubmissionStep/index.tsx","webpack://~admin/../components/src/SurveyInputs/TextQuestionInput/index.tsx","webpack://~admin/../components/src/SurveyInputs/ScaleQuestionInput/index.tsx","webpack://~admin/../../../src/icons/toggle/StarIcon.tsx","webpack://~admin/../components/src/SurveyInputs/RatingStarList/RatingStar/index.tsx","webpack://~admin/../components/src/SurveyInputs/RatingStarList/index.tsx","webpack://~admin/../../../src/components/radio/Radio.tsx","webpack://~admin/../../../src/icons/essentials/CheckIcon.tsx","webpack://~admin/../../../src/components/checkbox/Checkbox.tsx","webpack://~admin/../components/src/SurveyInputs/MultipleChoiceInput/index.tsx","webpack://~admin/../components/src/SurveyInputs/NPSQuestionInput/index.tsx","webpack://~admin/../components/src/MultipleQuestions/Wizard/Field/index.tsx","webpack://~admin/../../../src/components/ghostButton/GhostButton.tsx","webpack://~admin/../../../src/icons/directional/ArrowRightIcon.tsx","webpack://~admin/../../../src/icons/directional/ArrowLeftIcon.tsx","webpack://~admin/../components/src/MultipleQuestions/Wizard/Footer/index.tsx","webpack://~admin/../components/src/MultipleQuestions/Wizard/reducer.ts","webpack://~admin/../components/src/MultipleQuestions/Wizard/index.tsx","webpack://~admin/../../../src/components/loadingSpinner/LoadingSpinner.tsx","webpack://~admin/../components/src/SurveyForm/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/PreviewSurvey/index.tsx","webpack://~admin/../../node_modules/wouter-preact/src/memory-location.js","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionPreview/RenderPreview/index.styles.ts","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionPreview/RenderPreview/index.tsx","webpack://~admin/../hooks/src/useGrowlNotification.ts","webpack://~admin/./src/reducers/QuestionReducer.ts","webpack://~admin/../../../src/atoms/IconButton/IconButton.tsx","webpack://~admin/../../../src/organisms/TranslationsBar/TranslationsBar.style.ts","webpack://~admin/../../../src/organisms/TranslationsBar/TranslationsBar.tsx","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/math.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/userAgent.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","webpack://~admin/../../node_modules/@popperjs/core/lib/enums.js","webpack://~admin/../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/getVariation.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","webpack://~admin/../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","webpack://~admin/../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/contains.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/within.js","webpack://~admin/../../node_modules/@popperjs/core/lib/modifiers/hide.js","webpack://~admin/../../node_modules/@popperjs/core/lib/popper.js","webpack://~admin/../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","webpack://~admin/../../node_modules/@popperjs/core/lib/modifiers/offset.js","webpack://~admin/../../node_modules/@popperjs/core/lib/modifiers/flip.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","webpack://~admin/../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","webpack://~admin/../../node_modules/@popperjs/core/lib/modifiers/arrow.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/debounce.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/mergeByName.js","webpack://~admin/../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","webpack://~admin/../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","webpack://~admin/../../node_modules/tippy.js/dist/tippy.esm.js","webpack://~admin/../../node_modules/tippy.js/dist/tippy.css?ea34","webpack://~admin/./src/components/TooltipElement/index.tsx","webpack://~admin/../../../src/atoms/Select/SelectComponents.tsx","webpack://~admin/../../../src/molecules/SingleValueSelect/SingleValueSelectUtils.ts","webpack://~admin/../../../src/atoms/Select/SelectUtils.tsx","webpack://~admin/../../node_modules/@emotion/sheet/dist/sheet.browser.esm.js","webpack://~admin/../../node_modules/@emotion/core/node_modules/@emotion/utils/dist/utils.browser.esm.js","webpack://~admin/../../node_modules/@emotion/core/node_modules/@emotion/hash/dist/hash.browser.esm.js","webpack://~admin/../../node_modules/@emotion/core/node_modules/@emotion/unitless/dist/unitless.browser.esm.js","webpack://~admin/../../node_modules/@emotion/core/dist/emotion-element-04d85134.browser.esm.js","webpack://~admin/../../node_modules/@emotion/stylis/dist/stylis.browser.esm.js","webpack://~admin/../../node_modules/@emotion/css/node_modules/@emotion/hash/dist/hash.browser.esm.js","webpack://~admin/../../node_modules/@emotion/css/node_modules/@emotion/unitless/dist/unitless.browser.esm.js","webpack://~admin/../../node_modules/@emotion/css/dist/css.browser.esm.js","webpack://~admin/../../node_modules/@emotion/core/dist/core.browser.esm.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/inherits.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://~admin/../../node_modules/memoize-one/dist/memoize-one.esm.js","webpack://~admin/../../node_modules/react-select/dist/index-75b02bac.browser.esm.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","webpack://~admin/../../node_modules/react-select/dist/Select-e1cf49ae.browser.esm.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://~admin/../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://~admin/../../node_modules/react-select/dist/react-select.browser.esm.js","webpack://~admin/../../../src/atoms/Select/NativeSelect.ts","webpack://~admin/../../../src/atoms/Select/SelectStyles.ts","webpack://~admin/../../../src/atoms/Select/Select.tsx","webpack://~admin/../../../src/atoms/Select/ReactSelectProps.ts","webpack://~admin/../../../src/molecules/SingleValueSelect/SingleValueSelect.tsx","webpack://~admin/../../../src/atoms/SwitchHandle/SwitchHandle.style.tsx","webpack://~admin/../../../src/atoms/SwitchHandle/SwitchHandle.tsx","webpack://~admin/../../../src/molecules/Switch/Switch.style.tsx","webpack://~admin/../../../src/molecules/Switch/Switch.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/AddLanguageDialog/index.styles.ts","webpack://~admin/./src/pages/Planner/QuestionForm/AddLanguageDialog/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/ExpandableElement/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionForm/index.tsx","webpack://~admin/../../../src/atoms/Textarea/Textarea.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionForm/useQuestionFormActions.ts","webpack://~admin/./src/pages/Planner/QuestionForm/DefaultQuestionForm/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/DefaultQuestionForm/index.styles.ts","webpack://~admin/./src/pages/Planner/QuestionForm/MaxOptionsSelector/index.styled.ts","webpack://~admin/./src/pages/Planner/QuestionForm/MaxOptionsSelector/index.tsx","webpack://~admin/../../node_modules/react-movable/lib/utils.js","webpack://~admin/../../node_modules/react-movable/lib/List.js","webpack://~admin/./src/pages/Planner/QuestionForm/OptionList/index.styled.ts","webpack://~admin/./src/pages/Planner/QuestionForm/OptionList/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/MultipleChoiceQuestionForm/index.styled.ts","webpack://~admin/./src/pages/Planner/QuestionForm/MultipleChoiceQuestionForm/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/NPSQuestionForm/index.styled.ts","webpack://~admin/./src/pages/Planner/QuestionForm/NPSQuestionForm/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionTypeInput/index.style.ts","webpack://~admin/./src/pages/Planner/QuestionForm/QuestionTypeInput/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/ScaleQuestionForm/index.styles.ts","webpack://~admin/./src/pages/Planner/QuestionForm/ScaleQuestionForm/index.tsx","webpack://~admin/./src/pages/Planner/QuestionForm/ScaleQuestionRangeSelector/index.styles.ts","webpack://~admin/./src/pages/Planner/QuestionForm/ScaleQuestionRangeSelector/index.tsx","webpack://~admin/./src/pages/Planner/QuestionFormController/index.tsx","webpack://~admin/../../../src/atoms/Spinner/Spinner.tsx","webpack://~admin/./src/pages/MultipleQuestions/FormFooter/index.styles.ts","webpack://~admin/./src/pages/MultipleQuestions/FormFooter/index.tsx","webpack://~admin/./src/hooks/useSyncedLists.ts","webpack://~admin/./src/hooks/useWindowSize.ts","webpack://~admin/./src/pages/MultipleQuestions/List/index.styles.ts","webpack://~admin/./src/pages/MultipleQuestions/List/DeleteQuestionModal/index.style.ts","webpack://~admin/./src/pages/MultipleQuestions/List/DeleteQuestionModal/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/List/QuestionMenu/index.style.ts","webpack://~admin/./src/pages/MultipleQuestions/List/QuestionMenu/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/List/Question/index.style.ts","webpack://~admin/./src/pages/MultipleQuestions/List/Question/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/List/QuestionIndexes/index.style.ts","webpack://~admin/./src/pages/MultipleQuestions/List/QuestionIndexes/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/List/EditableList/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/List/ViewableList/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/List/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/Layout/index.styles.ts","webpack://~admin/./src/pages/MultipleQuestions/Layout/index.tsx","webpack://~admin/./src/components/CardButton/index.styles.ts","webpack://~admin/./src/pages/MultipleQuestions/SelectQuestionType/index.styles.ts","webpack://~admin/../components/src/Icons/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/Editor/SelectQuestion/index.style.ts","webpack://~admin/./src/pages/MultipleQuestions/Editor/SelectQuestion/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/Editor/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/Menu/index.styles.ts","webpack://~admin/./src/pages/MultipleQuestions/Menu/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/State/reducer.ts","webpack://~admin/./src/pages/MultipleQuestions/State/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/Entrypoint/index.tsx","webpack://~admin/../../../src/atoms/Input/Input.tsx","webpack://~admin/../../../src/organisms/Pagination/Pagination.styled.ts","webpack://~admin/./src/hooks/useFormattedDate.ts","webpack://~admin/../../../src/atoms/LinkButton/LinkButton.styled.ts","webpack://~admin/./src/pages/Overview/components/SurveyTable/SurveyTable.style.ts","webpack://~admin/../../../src/atoms/LinkButton/LinkButton.tsx","webpack://~admin/./src/pages/Overview/components/SurveyTable/SurveyRow.tsx","webpack://~admin/./src/pages/Overview/components/SurveyTable/index.tsx","webpack://~admin/./src/pages/Overview/index.tsx","webpack://~admin/./src/context/Filters/reducer.ts","webpack://~admin/./src/context/Filters/index.tsx","webpack://~admin/../../node_modules/compute-scroll-into-view/dist/index.js","webpack://~admin/../../node_modules/downshift/dist/downshift.esm.mjs","webpack://~admin/./src/pages/Results/SurveySelect/index.styles.ts","webpack://~admin/./src/pages/Results/SurveySelect/index.tsx","webpack://~admin/./src/pages/Results/Menu/CsvExport/RenderExport/index.style.ts","webpack://~admin/./src/pages/Results/Menu/CsvExport/RenderExport/index.tsx","webpack://~admin/./src/pages/Results/Menu/CsvExport/Button/index.style.ts","webpack://~admin/./src/pages/Results/Menu/CsvExport/Button/index.tsx","webpack://~admin/./src/pages/Results/Menu/CsvExport/index.tsx","webpack://~admin/./src/pages/Results/Menu/index.style.ts","webpack://~admin/./src/pages/Results/Menu/index.tsx","webpack://~admin/./src/pages/Results/NoResultsYet/index.styles.ts","webpack://~admin/./src/pages/Results/NoResultsYet/index.tsx","webpack://~admin/./src/pages/Results/Filters/ProfileFieldFilter/index.styles.ts","webpack://~admin/./src/pages/Results/Filters/ProfileFieldFilter/index.tsx","webpack://~admin/./src/pages/Results/Filters/Filter/index.tsx","webpack://~admin/./src/pages/Results/Filters/helpers.ts","webpack://~admin/./src/pages/Results/Filters/index.styles.ts","webpack://~admin/./src/pages/Results/Filters/Tags/index.styles.ts","webpack://~admin/./src/pages/Results/Filters/Tags/index.tsx","webpack://~admin/./src/pages/Results/Filters/Filters/index.tsx","webpack://~admin/./src/pages/Results/Filters/Resolve/index.tsx","webpack://~admin/./src/pages/Results/index.style.ts","webpack://~admin/./src/pages/Results/components/QuestionDetails/index.styles.ts","webpack://~admin/./src/pages/Results/components/QuestionDetails/index.tsx","webpack://~admin/./src/pages/Results/components/ResultLayout/CalculationSelector/index.styled.ts","webpack://~admin/./src/pages/Results/components/ResultLayout/CalculationSelector/index.tsx","webpack://~admin/./src/pages/Results/components/ResultLayout/index.styles.ts","webpack://~admin/./src/pages/Results/components/ResultLayout/index.tsx","webpack://~admin/./src/pages/Results/components/NotEnoughFeedback/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Numeric/Chart/index.styled.ts","webpack://~admin/./src/pages/Results/components/Result/Numeric/Chart/index.tsx","webpack://~admin/../../node_modules/lodash-es/_baseHas.js","webpack://~admin/../../node_modules/lodash-es/_isKey.js","webpack://~admin/../../node_modules/lodash-es/_castPath.js","webpack://~admin/../../node_modules/lodash-es/_hasPath.js","webpack://~admin/../../node_modules/lodash-es/has.js","webpack://~admin/../../node_modules/lodash-es/cloneDeepWith.js","webpack://~admin/../../node_modules/lodash-es/_iteratorToArray.js","webpack://~admin/../../node_modules/lodash-es/_mapToArray.js","webpack://~admin/../../node_modules/lodash-es/_setToArray.js","webpack://~admin/../../node_modules/lodash-es/_hasUnicode.js","webpack://~admin/../../node_modules/lodash-es/_unicodeToArray.js","webpack://~admin/../../node_modules/lodash-es/_stringToArray.js","webpack://~admin/../../node_modules/lodash-es/_asciiToArray.js","webpack://~admin/../../node_modules/lodash-es/values.js","webpack://~admin/../../node_modules/lodash-es/_baseValues.js","webpack://~admin/../../node_modules/lodash-es/toArray.js","webpack://~admin/../../node_modules/lodash-es/isString.js","webpack://~admin/../../node_modules/yup/es/util/printValue.js","webpack://~admin/../../node_modules/yup/es/locale.js","webpack://~admin/../../node_modules/yup/es/util/isSchema.js","webpack://~admin/../../node_modules/yup/es/Condition.js","webpack://~admin/../../node_modules/yup/es/ValidationError.js","webpack://~admin/../../node_modules/yup/es/util/async.js","webpack://~admin/../../node_modules/yup/es/util/runTests.js","webpack://~admin/../../node_modules/yup/es/util/prependDeep.js","webpack://~admin/../../node_modules/lodash-es/_baseFor.js","webpack://~admin/../../node_modules/lodash-es/_createBaseFor.js","webpack://~admin/../../node_modules/lodash-es/_baseForOwn.js","webpack://~admin/../../node_modules/lodash-es/_SetCache.js","webpack://~admin/../../node_modules/lodash-es/_setCacheAdd.js","webpack://~admin/../../node_modules/lodash-es/_setCacheHas.js","webpack://~admin/../../node_modules/lodash-es/_arraySome.js","webpack://~admin/../../node_modules/lodash-es/_equalArrays.js","webpack://~admin/../../node_modules/lodash-es/_cacheHas.js","webpack://~admin/../../node_modules/lodash-es/_equalByTag.js","webpack://~admin/../../node_modules/lodash-es/_equalObjects.js","webpack://~admin/../../node_modules/lodash-es/_baseIsEqualDeep.js","webpack://~admin/../../node_modules/lodash-es/_baseIsEqual.js","webpack://~admin/../../node_modules/lodash-es/_baseIsMatch.js","webpack://~admin/../../node_modules/lodash-es/_isStrictComparable.js","webpack://~admin/../../node_modules/lodash-es/_getMatchData.js","webpack://~admin/../../node_modules/lodash-es/_matchesStrictComparable.js","webpack://~admin/../../node_modules/lodash-es/_baseMatches.js","webpack://~admin/../../node_modules/lodash-es/_baseGet.js","webpack://~admin/../../node_modules/lodash-es/get.js","webpack://~admin/../../node_modules/lodash-es/_baseHasIn.js","webpack://~admin/../../node_modules/lodash-es/identity.js","webpack://~admin/../../node_modules/lodash-es/property.js","webpack://~admin/../../node_modules/lodash-es/_baseProperty.js","webpack://~admin/../../node_modules/lodash-es/_basePropertyDeep.js","webpack://~admin/../../node_modules/lodash-es/_baseIteratee.js","webpack://~admin/../../node_modules/lodash-es/_baseMatchesProperty.js","webpack://~admin/../../node_modules/lodash-es/hasIn.js","webpack://~admin/../../node_modules/lodash-es/mapValues.js","webpack://~admin/../../node_modules/yup/es/Reference.js","webpack://~admin/../../node_modules/yup/es/util/createValidation.js","webpack://~admin/../../node_modules/yup/es/mixed.js","webpack://~admin/../../node_modules/yup/es/util/reach.js","webpack://~admin/../../node_modules/yup/es/util/inherits.js","webpack://~admin/../../node_modules/yup/es/util/isAbsent.js","webpack://~admin/../../node_modules/yup/es/boolean.js","webpack://~admin/../../node_modules/yup/es/string.js","webpack://~admin/../../node_modules/yup/es/number.js","webpack://~admin/../../node_modules/yup/es/util/isodate.js","webpack://~admin/../../node_modules/yup/es/date.js","webpack://~admin/../../node_modules/lodash-es/_arrayReduce.js","webpack://~admin/../../node_modules/lodash-es/_deburrLetter.js","webpack://~admin/../../node_modules/lodash-es/deburr.js","webpack://~admin/../../node_modules/lodash-es/_asciiWords.js","webpack://~admin/../../node_modules/lodash-es/_hasUnicodeWord.js","webpack://~admin/../../node_modules/lodash-es/_unicodeWords.js","webpack://~admin/../../node_modules/lodash-es/words.js","webpack://~admin/../../node_modules/lodash-es/_createCompounder.js","webpack://~admin/../../node_modules/lodash-es/snakeCase.js","webpack://~admin/../../node_modules/lodash-es/_baseSlice.js","webpack://~admin/../../node_modules/lodash-es/_castSlice.js","webpack://~admin/../../node_modules/lodash-es/upperFirst.js","webpack://~admin/../../node_modules/lodash-es/_createCaseFirst.js","webpack://~admin/../../node_modules/lodash-es/camelCase.js","webpack://~admin/../../node_modules/lodash-es/capitalize.js","webpack://~admin/../../node_modules/lodash-es/mapKeys.js","webpack://~admin/../../node_modules/yup/es/util/sortFields.js","webpack://~admin/../../node_modules/yup/es/util/sortByKeyOrder.js","webpack://~admin/../../node_modules/yup/es/object.js","webpack://~admin/../../node_modules/yup/es/array.js","webpack://~admin/../../node_modules/yup/es/Lazy.js","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/utils/index.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/State/reducer.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/State/context.tsx","webpack://~admin/./src/utils/index.ts","webpack://~admin/./src/pages/Results/components/Result/Numeric/Header/AverageResults/index.styled.ts","webpack://~admin/./src/pages/Results/components/Result/Numeric/Header/AverageResults/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Numeric/Header/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Numeric/index.styled.ts","webpack://~admin/../../node_modules/@visx/legend/esm/legends/Legend/LegendItem.js","webpack://~admin/../../node_modules/@visx/legend/esm/legends/Legend/LegendLabel.js","webpack://~admin/./src/pages/Results/components/Result/Numeric/NPSLabels/index.styled.ts","webpack://~admin/./src/pages/Results/components/Result/Numeric/NPSLabels/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Numeric/ScaleRangeLabels/index.styled.ts","webpack://~admin/./src/pages/Results/components/Result/Numeric/ScaleRangeLabels/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Numeric/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Text/Header/index.styled.ts","webpack://~admin/./src/pages/Results/components/Result/Text/Header/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Text/List/index.styled.ts","webpack://~admin/./src/pages/Results/components/Result/Text/List/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Text/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Choice/Header/index.styled.ts","webpack://~admin/./src/pages/Results/components/Result/Choice/Header/SortOrderSelector/index.styled.ts","webpack://~admin/./src/pages/Results/components/Result/Choice/Header/SortOrderSelector/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Choice/Header/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Choice/List/index.styled.ts","webpack://~admin/./src/pages/Results/components/Result/Choice/List/index.tsx","webpack://~admin/./src/pages/Results/components/Result/Choice/index.tsx","webpack://~admin/../../node_modules/@visx/event/esm/getXAndYFromEvent.js","webpack://~admin/../../node_modules/@visx/grid/esm/utils/getScaleBandwidth.js","webpack://~admin/../../node_modules/@visx/grid/esm/grids/GridRows.js","webpack://~admin/../../node_modules/@visx/grid/esm/grids/GridColumns.js","webpack://~admin/../../node_modules/@visx/grid/esm/grids/Grid.js","webpack://~admin/../../node_modules/@visx/marker/esm/markers/Marker.js","webpack://~admin/../../node_modules/@visx/marker/esm/markers/Circle.js","webpack://~admin/../../node_modules/@visx/tooltip/esm/tooltips/Tooltip.js","webpack://~admin/../../node_modules/@visx/tooltip/esm/context/TooltipPositionContext.js","webpack://~admin/../../node_modules/@visx/tooltip/esm/tooltips/TooltipWithBounds.js","webpack://~admin/../components/src/charts/LineGraph/index.styles.ts","webpack://~admin/../components/src/charts/LineGraph/index.tsx","webpack://~admin/../../node_modules/@visx/tooltip/esm/hooks/useTooltip.js","webpack://~admin/../../node_modules/@visx/event/esm/localPoint.js","webpack://~admin/../../node_modules/@visx/event/esm/typeGuards.js","webpack://~admin/../../node_modules/@visx/event/esm/localPointGeneric.js","webpack://~admin/./src/pages/Results/components/TimeSeriesCard/LineGraphController/index.tsx","webpack://~admin/./src/pages/Results/components/TimeSeriesCard/index.tsx","webpack://~admin/./src/pages/Results/Layout/index.styles.ts","webpack://~admin/./src/pages/Results/Layout/index.tsx","webpack://~admin/./src/pages/Results/SurveyInformationCards/icons.tsx","webpack://~admin/./src/pages/Results/SurveyInformationCards/index.styles.ts","webpack://~admin/./src/pages/Results/SurveyInformationCards/index.tsx","webpack://~admin/./src/pages/Results/SurveyResultsPage/index.styles.ts","webpack://~admin/./src/pages/Results/SurveyResultsPage/index.tsx","webpack://~admin/./src/pages/Results/Navigation/index.tsx","webpack://~admin/./src/pages/Navigation/Back/index.styles.tsx","webpack://~admin/./src/pages/Navigation/Back/index.tsx","webpack://~admin/./src/pages/Planner/NavMenu/index.styles.ts","webpack://~admin/./src/pages/Planner/NavMenu/index.tsx","webpack://~admin/./src/pages/Planner/QuestionList/index.styles.ts","webpack://~admin/./src/pages/Planner/QuestionList/QuestionRow.tsx","webpack://~admin/./src/pages/Planner/QuestionList/index.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/State/index.tsx","webpack://~admin/./src/pages/Planner/Sidebar/AdditionalOptions/AdditionalOptions.styled.ts","webpack://~admin/../../../src/components/toggle/Toggle.tsx","webpack://~admin/./src/pages/Planner/Sidebar/AdditionalOptions/ResultSharing/ResultSharing.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/AdditionalOptions/ResultSharing/ResultSharing.tsx","webpack://~admin/../../../src/icons/essentials/LinkIcon.tsx","webpack://~admin/../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","webpack://~admin/../../node_modules/@floating-ui/react/dist/floating-ui.react.utils.mjs","webpack://~admin/../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","webpack://~admin/../../node_modules/tabbable/dist/index.esm.js","webpack://~admin/../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","webpack://~admin/../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","webpack://~admin/../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs","webpack://~admin/../../../src/components/tooltip/Tooltip.tsx","webpack://~admin/../../src/utils/useFloatingElement.ts","webpack://~admin/../../../src/icons/essentials/CopyIcon.tsx","webpack://~admin/./src/pages/Planner/Sidebar/AdditionalOptions/SurveyLink/SurveyLink.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/AdditionalOptions/SurveyLink/SurveyLink.tsx","webpack://~admin/../hooks/src/useWebURL.ts","webpack://~admin/./src/pages/Planner/Sidebar/AdditionalOptions/AdditionalOptions.tsx","webpack://~admin/../../../src/icons/essentials/EditIcon.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/ConfirmationDialog/ConfirmationDialog.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/ConfirmationDialog/ConfirmationDialog.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Sidebar.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Controls/Controls.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Controls/Controls.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Status/Status.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Header/Header.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Header/Header.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Overview/Overview.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Overview/Overview.tsx","webpack://~admin/../../../src/components/radio/RadioGroup.tsx","webpack://~admin/./src/pages/Planner/Sidebar/PublicationStrategy/PublicationStrategy.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/PublicationStrategy/PublicationStrategy.tsx","webpack://~admin/../../../src/icons/essentials/CalendarIcon.tsx","webpack://~admin/../../src/utils/useForkRef.ts","webpack://~admin/../../../src/icons/essentials/SearchIcon.tsx","webpack://~admin/../../../src/components/singleSelect/SingleSelect.tsx","webpack://~admin/../../../src/icons/essentials/ClockIcon.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/RecurringSettings/hooks.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/CommonSettings/CommonSettings.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/CommonSettings/CommonSettings.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/NotificationSettings/index.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/NotificationSettings/NotificationSettings.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/OneTimeSettings/OneTimeSettings.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/OneTimeSettings/OneTimeSettings.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/Scheduler.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/Warning/Warning.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/Warning/Warning.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/OneTimeForm/OneTimeForm.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/RecurringSettings/RecurringSettings.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/RecurringForm/RecurringForm.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/Scheduler.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/ImmediateSettings/ImmediateSettings.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/ImmediateSettings/ImmediateSettings.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/ImmediateForm/ImmediateForm.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/Scheduler/ImmediateForm/ImmediateForm.tsx","webpack://~admin/./src/pages/Planner/Sidebar/SchedulerLink/SchedulerLink.styled.ts","webpack://~admin/./src/pages/Planner/Sidebar/SchedulerLink/SchedulerLink.tsx","webpack://~admin/./src/pages/Planner/Sidebar/Sidebar.tsx","webpack://~admin/./src/pages/Planner/SidebarController/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/NoQuestionsYet/index.styles.ts","webpack://~admin/./src/pages/MultipleQuestions/NoQuestionsYet/index.tsx","webpack://~admin/./src/pages/MultipleQuestions/Planner/index.tsx","webpack://~admin/./src/pages/Planner/index.styles.ts","webpack://~admin/./src/pages/Planner/SingleQuestionEditor/FormFooter/index.styles.ts","webpack://~admin/./src/pages/Planner/SingleQuestionEditor/FormFooter/index.tsx","webpack://~admin/./src/pages/Planner/index.tsx","webpack://~admin/./src/pages/Navigation/Planner/index.tsx","webpack://~admin/./src/pages/Navigation/index.tsx","webpack://~admin/./src/index.tsx","webpack://~admin/../../node_modules/preact/compat/client.mjs","webpack://~admin/../../node_modules/toposort/index.js","webpack://~admin/../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js","webpack://~admin/../../node_modules/use-sync-external-store/shim/index.js","webpack://~admin/../i18n/locales|lazy|/^\\.\\/.*\\.json$/|chunkName: Translations|groupOptions: {}|namespace object|importPhase: evaluation","webpack://~admin/../../node_modules/classnames/index.js","webpack://~admin/webpack/runtime/compat_get_default_export","webpack://~admin/webpack/runtime/define_property_getters","webpack://~admin/webpack/runtime/ensure_chunk","webpack://~admin/webpack/runtime/get javascript chunk filename","webpack://~admin/webpack/runtime/global","webpack://~admin/webpack/runtime/has_own_property","webpack://~admin/webpack/runtime/make_namespace_object","webpack://~admin/webpack/runtime/node_module_decorator","webpack://~admin/webpack/runtime/nonce"],"sourcesContent":["var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n __webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => { def[key] = () => (value[key]) });\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","var scriptUrl;\n\nif (typeof import.meta.url === \"string\") scriptUrl = import.meta.url\n\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\",\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.',\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n\n__webpack_require__.p = scriptUrl;\n","// no BaseURI\n // object to store loaded and loading chunks\n // undefined = chunk not loaded, null = chunk preloaded/prefetched\n // [resolve, Promise] = chunk loading, 0 = chunk loaded\n var moduleInstalledChunks = {3133: 0,};\n var moduleInstallChunk = (data) => {\n var __rspack_esm_ids = data.__rspack_esm_ids;\n var moreModules = data.__webpack_modules__;\n var __rspack_esm_runtime = data.__rspack_esm_runtime;\n // add \"modules\" to the modules object,\n // then flag all \"ids\" as loaded and fire callback\n var moduleId, chunkId, i = 0;\n for (moduleId in moreModules) {\n if (__webpack_require__.o(moreModules, moduleId)) {\n __webpack_require__.m[moduleId] = moreModules[moduleId];\n }\n }\n if (__rspack_esm_runtime) __rspack_esm_runtime(__webpack_require__);\n for (; i < __rspack_esm_ids.length; i++) {\n chunkId = __rspack_esm_ids[i];\n if (__webpack_require__.o(moduleInstalledChunks, chunkId) && moduleInstalledChunks[chunkId]) {\n moduleInstalledChunks[chunkId][0]();\n }\n moduleInstalledChunks[__rspack_esm_ids[i]] = 0;\n }\n \n};\n\n __webpack_require__.f.j = function (chunkId, promises) {\n // import() chunk loading for javascript\nvar installedChunkData = __webpack_require__.o(moduleInstalledChunks, chunkId) ? moduleInstalledChunks[chunkId] : undefined;\nif (installedChunkData !== 0) { // 0 means \"already installed\".'\n // a Promise means \"currently loading\".\n if (installedChunkData) {\n promises.push(installedChunkData[1]);\n } else {\n if (true) {\n // setup Promise in chunk cache\n var promise = import(\"./\" + __webpack_require__.u(chunkId)).then(moduleInstallChunk, (e) => {\n if (moduleInstalledChunks[chunkId] !== 0) moduleInstalledChunks[chunkId] = undefined;\n throw e;\n });\n var promise = Promise.race([promise, new Promise((resolve) => {\n installedChunkData = moduleInstalledChunks[chunkId] = [resolve];\n })]);\n promises.push(installedChunkData[1] = promise);\n }\n \n }\n}\n\n }\n // no external install chunk\n// no on chunks loaded\n// no HMR\n// no HMR manifest\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\"\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}`, \"\",{\"version\":3,\"sources\":[\"webpack://./../../node_modules/tippy.js/dist/tippy.css\"],\"names\":[],\"mappings\":\"AAAA,mDAAmD,SAAS,CAAC,kBAAkB,4BAA4B,CAAC,WAAW,iBAAiB,CAAC,qBAAqB,CAAC,UAAU,CAAC,iBAAiB,CAAC,cAAc,CAAC,eAAe,CAAC,kBAAkB,CAAC,SAAS,CAAC,gDAAgD,CAAC,6CAA6C,QAAQ,CAAC,oDAAoD,WAAW,CAAC,MAAM,CAAC,sBAAsB,CAAC,wBAAwB,CAAC,2BAA2B,CAAC,gDAAgD,KAAK,CAAC,uDAAuD,QAAQ,CAAC,MAAM,CAAC,sBAAsB,CAAC,2BAA2B,CAAC,8BAA8B,CAAC,8CAA8C,OAAO,CAAC,qDAAqD,0BAA0B,CAAC,yBAAyB,CAAC,UAAU,CAAC,4BAA4B,CAAC,+CAA+C,MAAM,CAAC,sDAAsD,SAAS,CAAC,0BAA0B,CAAC,0BAA0B,CAAC,6BAA6B,CAAC,6CAA6C,yDAAyD,CAAC,aAAa,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,oBAAoB,UAAU,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,kBAAkB,CAAC,eAAe,iBAAiB,CAAC,eAAe,CAAC,SAAS\",\"sourcesContent\":[\".tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:\\\"\\\";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) {\nvar e = new Error(\"Cannot find module '\" + req + \"'\");\ne.code = 'MODULE_NOT_FOUND';\nthrow e;\n});\n }\n\n var ids = map[req], id = ids[0];\n return __webpack_require__.e(ids[1][0]).then(() => (__webpack_require__.t(id, 7 | 16)));\n}\n\n__rspack_async_context.keys = () => (Object.keys(map));\n__rspack_async_context.id = 1892;\nmodule.exports = __rspack_async_context;\n","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_customParseFormat=t()}(this,(function(){\"use strict\";var e={LTS:\"h:mm:ss A\",LT:\"h:mm A\",L:\"MM/DD/YYYY\",LL:\"MMMM D, YYYY\",LLL:\"MMMM D, YYYY h:mm A\",LLLL:\"dddd, MMMM D, YYYY h:mm A\"},t=/(\\[[^[]*\\])|([-_:/.,()\\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\\d/,r=/\\d\\d/,i=/\\d\\d?/,o=/\\d*[^-_:/,()\\s\\d]+/,s={},a=function(e){return(e=+e)+(e>68?1900:2e3)};var f=function(e){return function(t){this[e]=+t}},h=[/[+-]\\d\\d:?(\\d\\d)?|Z/,function(e){(this.zone||(this.zone={})).offset=function(e){if(!e)return 0;if(\"Z\"===e)return 0;var t=e.match(/([+-]|\\d\\d)/g),n=60*t[1]+(+t[2]||0);return 0===n?0:\"+\"===t[0]?-n:n}(e)}],u=function(e){var t=s[e];return t&&(t.indexOf?t:t.s.concat(t.f))},d=function(e,t){var n,r=s.meridiem;if(r){for(var i=1;i<=24;i+=1)if(e.indexOf(r(i,0,t))>-1){n=i>12;break}}else n=e===(t?\"pm\":\"PM\");return n},c={A:[o,function(e){this.afternoon=d(e,!1)}],a:[o,function(e){this.afternoon=d(e,!0)}],Q:[n,function(e){this.month=3*(e-1)+1}],S:[n,function(e){this.milliseconds=100*+e}],SS:[r,function(e){this.milliseconds=10*+e}],SSS:[/\\d{3}/,function(e){this.milliseconds=+e}],s:[i,f(\"seconds\")],ss:[i,f(\"seconds\")],m:[i,f(\"minutes\")],mm:[i,f(\"minutes\")],H:[i,f(\"hours\")],h:[i,f(\"hours\")],HH:[i,f(\"hours\")],hh:[i,f(\"hours\")],D:[i,f(\"day\")],DD:[r,f(\"day\")],Do:[o,function(e){var t=s.ordinal,n=e.match(/\\d+/);if(this.day=n[0],t)for(var r=1;r<=31;r+=1)t(r).replace(/\\[|\\]/g,\"\")===e&&(this.day=r)}],w:[i,f(\"week\")],ww:[r,f(\"week\")],M:[i,f(\"month\")],MM:[r,f(\"month\")],MMM:[o,function(e){var t=u(\"months\"),n=(u(\"monthsShort\")||t.map((function(e){return e.slice(0,3)}))).indexOf(e)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[o,function(e){var t=u(\"months\").indexOf(e)+1;if(t<1)throw new Error;this.month=t%12||t}],Y:[/[+-]?\\d+/,f(\"year\")],YY:[r,function(e){this.year=a(e)}],YYYY:[/\\d{4}/,f(\"year\")],Z:h,ZZ:h};function l(n){var r,i;r=n,i=s&&s.formats;for(var o=(n=r.replace(/(\\[[^\\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(t,n,r){var o=r&&r.toUpperCase();return n||i[r]||e[r]||i[o].replace(/(\\[[^\\]]+])|(MMMM|MM|DD|dddd)/g,(function(e,t,n){return t||n.slice(1)}))}))).match(t),a=o.length,f=0;f-1)return new Date((\"X\"===t?1e3:1)*e);var i=l(t)(e),o=i.year,s=i.month,a=i.day,f=i.hours,h=i.minutes,u=i.seconds,d=i.milliseconds,c=i.zone,m=i.week,M=new Date,Y=a||(o||s?1:M.getDate()),p=o||M.getFullYear(),v=0;o&&!s||(v=s>0?s-1:M.getMonth());var D,w=f||0,g=h||0,y=u||0,L=d||0;return c?new Date(Date.UTC(p,v,Y,w,g,y,L+60*c.offset*1e3)):n?new Date(Date.UTC(p,v,Y,w,g,y,L)):(D=new Date(p,v,Y,w,g,y,L),m&&(D=r(D).week(m).toDate()),D)}catch(e){return new Date(\"\")}}(t,a,r,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&t!=this.format(a)&&(this.$d=new Date(\"\")),s={}}else if(a instanceof Array)for(var c=a.length,m=1;m<=c;m+=1){o[1]=a[m-1];var M=n.apply(this,o);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===c&&(this.$d=new Date(\"\"))}else i.call(this,e)}}}));","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define(t):(e=\"undefined\"!=typeof globalThis?globalThis:e||self).dayjs_plugin_isSameOrAfter=t()}(this,(function(){\"use strict\";return function(e,t){t.prototype.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)}}}));","'use strict';\n\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\nvar hasElementType = typeof Element !== 'undefined';\n\nfunction equal(a, b) {\n // fast-deep-equal index.js 2.0.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = isArray(a)\n , arrB = isArray(b)\n , i\n , length\n , key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n if (arrA != arrB) return false;\n\n var dateA = a instanceof Date\n , dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n\n var regexpA = a instanceof RegExp\n , regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n\n var keys = keyList(a);\n length = keys.length;\n\n if (length !== keyList(b).length)\n return false;\n\n for (i = length; i-- !== 0;)\n if (!hasProp.call(b, keys[i])) return false;\n // end fast-deep-equal\n\n // start react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element && b instanceof Element)\n return a === b;\n\n // custom handling for React\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of a react element\n continue;\n } else {\n // all other properties should be traversed as usual\n if (!equal(a[key], b[key])) return false;\n }\n }\n // end react-fast-compare\n\n // fast-deep-equal index.js 2.0.1\n return true;\n }\n\n return a !== a && b !== b;\n}\n// end fast-deep-equal\n\nmodule.exports = function exportedEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if ((error.message && error.message.match(/stack|recursion/i)) || (error.number === -2146828260)) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('Warning: react-fast-compare does not handle circular references.', error.name, error.message);\n return false;\n }\n // some other error. we should definitely know about these\n throw error;\n }\n};\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","/** @license React v16.13.1\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\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\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","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;\n","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nmodule.exports = safeGet;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nmodule.exports = merge;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n","var Mexp=require('./postfix_evaluator.js');\r\nMexp.prototype.formulaEval = function () {\r\n\t\"use strict\";\r\n\tvar stack=[],pop1,pop2,pop3;\r\n\tvar disp=[];\r\n\tvar temp='';\r\n\tvar arr=this.value;\r\n\tfor(var i=0;i\"+pop2.value+\"\"+arr[i].show+\"\"+pop1.value+\"\",type:10});\r\n\t\t\telse disp.push({value:(pop2.type!=1?\"(\":\"\")+pop2.value+(pop2.type!=1?\")\":\"\")+\"\"+pop1.value+\"\",type:1});\r\n\t\t}\r\n\t\telse if(arr[i].type===2||arr[i].type===9){\r\n\t\t\tpop1=disp.pop();\r\n\t\t\tpop2=disp.pop();\r\n\t\t\tdisp.push({value:(pop2.type!=1?\"(\":\"\")+pop2.value+(pop2.type!=1?\")\":\"\")+arr[i].show+(pop1.type!=1?\"(\":\"\")+pop1.value+(pop1.type!=1?\")\":\"\"),type:arr[i].type});\r\n\t\t}\r\n\t\telse if(arr[i].type===12){\r\n\t\t\tpop1=disp.pop();\r\n\t\t\tpop2=disp.pop();\r\n\t\t\tpop3=disp.pop();\r\n\t\t\tdisp.push({value:arr[i].show+\"(\"+pop3.value+\",\"+pop2.value+\",\"+pop1.value+\")\",type:12});\r\n\t\t}\r\n\t}\r\n\treturn disp[0].value;\r\n};\r\nmodule.exports=Mexp;","'use strict'\r\nvar Mexp = require('./math_function.js')\r\nfunction inc(arr, val) {\r\n\tfor (var i = 0; i < arr.length; i++) {\r\n\t\tarr[i] += val\r\n\t}\r\n\treturn arr\r\n}\r\nvar tokens = [\r\n\t{ token: 'sin', show: 'sin', type: 0, value: Mexp.math.sin },\r\n\t{ token: 'cos', show: 'cos', type: 0, value: Mexp.math.cos },\r\n\t{ token: 'tan', show: 'tan', type: 0, value: Mexp.math.tan },\r\n\t{ token: 'pi', show: 'π', type: 3, value: 'PI' },\r\n\t{ token: '(', show: '(', type: 4, value: '(' },\r\n\t{ token: ')', show: ')', type: 5, value: ')' },\r\n\t{ token: 'P', show: 'P', type: 10, value: Mexp.math.P },\r\n\t{ token: 'C', show: 'C', type: 10, value: Mexp.math.C },\r\n\t{ token: ' ', show: ' ', type: 14, value: ' '.anchor },\r\n\t{ token: 'asin', show: 'asin', type: 0, value: Mexp.math.asin },\r\n\t{ token: 'acos', show: 'acos', type: 0, value: Mexp.math.acos },\r\n\t{ token: 'atan', show: 'atan', type: 0, value: Mexp.math.atan },\r\n\t{ token: '7', show: '7', type: 1, value: '7' },\r\n\t{ token: '8', show: '8', type: 1, value: '8' },\r\n\t{ token: '9', show: '9', type: 1, value: '9' },\r\n\t{ token: 'int', show: 'Int', type: 0, value: Math.floor },\r\n\t{ token: 'cosh', show: 'cosh', type: 0, value: Mexp.math.cosh },\r\n\t{ token: 'acosh', show: 'acosh', type: 0, value: Mexp.math.acosh },\r\n\t{ token: 'ln', show: ' ln', type: 0, value: Math.log },\r\n\t{ token: '^', show: '^', type: 10, value: Math.pow },\r\n\t{ token: 'root', show: 'root', type: 0, value: Math.sqrt },\r\n\t{ token: '4', show: '4', type: 1, value: '4' },\r\n\t{ token: '5', show: '5', type: 1, value: '5' },\r\n\t{ token: '6', show: '6', type: 1, value: '6' },\r\n\t{ token: '/', show: '÷', type: 2, value: Mexp.math.div },\r\n\t{ token: '!', show: '!', type: 7, value: Mexp.math.fact },\r\n\t{ token: 'tanh', show: 'tanh', type: 0, value: Mexp.math.tanh },\r\n\t{ token: 'atanh', show: 'atanh', type: 0, value: Mexp.math.atanh },\r\n\t{ token: 'Mod', show: ' Mod ', type: 2, value: Mexp.math.mod },\r\n\t{ token: '1', show: '1', type: 1, value: '1' },\r\n\t{ token: '2', show: '2', type: 1, value: '2' },\r\n\t{ token: '3', show: '3', type: 1, value: '3' },\r\n\t{ token: '*', show: '×', type: 2, value: Mexp.math.mul },\r\n\t{ token: 'sinh', show: 'sinh', type: 0, value: Mexp.math.sinh },\r\n\t{ token: 'asinh', show: 'asinh', type: 0, value: Mexp.math.asinh },\r\n\t{ token: 'e', show: 'e', type: 3, value: 'E' },\r\n\t{ token: 'log', show: ' log', type: 0, value: Mexp.math.log },\r\n\t{ token: '0', show: '0', type: 1, value: '0' },\r\n\t{ token: '.', show: '.', type: 6, value: '.' },\r\n\t{ token: '+', show: '+', type: 9, value: Mexp.math.add },\r\n\t{ token: '-', show: '-', type: 9, value: Mexp.math.sub },\r\n\t{ token: ',', show: ',', type: 11, value: ',' },\r\n\t{ token: 'Sigma', show: 'Σ', type: 12, value: Mexp.math.sigma },\r\n\t{ token: 'n', show: 'n', type: 13, value: 'n' },\r\n\t{ token: 'Pi', show: 'Π', type: 12, value: Mexp.math.Pi },\r\n\t{ token: 'pow', show: 'pow', type: 8, value: Math.pow, numberOfArguments: 2 },\r\n\t{ token: '&', show: '&', type: 9, value: Mexp.math.and },\r\n]\r\nvar preced = {\r\n\t0: 11,\r\n\t1: 0,\r\n\t2: 3,\r\n\t3: 0,\r\n\t4: 0,\r\n\t5: 0,\r\n\t6: 0,\r\n\t7: 11,\r\n\t8: 11,\r\n\t9: 1,\r\n\t10: 10,\r\n\t11: 0,\r\n\t12: 11,\r\n\t13: 0,\r\n\t14: -1,\r\n\t15: 11, // will be filtered after lexer\r\n} // stores precedence by types\r\nfor (var i = 0; i < tokens.length; i++) {\r\n\ttokens[i].precedence = preced[tokens[i].type]\r\n}\r\nvar type0 = {\r\n\t0: true,\r\n\t1: true,\r\n\t3: true,\r\n\t4: true,\r\n\t6: true,\r\n\t8: true,\r\n\t9: true,\r\n\t12: true,\r\n\t13: true,\r\n\t14: true,\r\n\t15: true,\r\n} // type2:true,type4:true,type9:true,type11:true,type21:true,type22\r\nvar type1 = {\r\n\t0: true,\r\n\t1: true,\r\n\t2: true,\r\n\t3: true,\r\n\t4: true,\r\n\t5: true,\r\n\t6: true,\r\n\t7: true,\r\n\t8: true,\r\n\t9: true,\r\n\t10: true,\r\n\t11: true,\r\n\t12: true,\r\n\t13: true,\r\n\t15: true,\r\n} // type3:true,type5:true,type7:true,type23\r\nvar type1Asterick = {\r\n\t0: true,\r\n\t3: true,\r\n\t4: true,\r\n\t8: true,\r\n\t12: true,\r\n\t13: true,\r\n\t15: true,\r\n}\r\nvar empty = {}\r\nvar type3Asterick = {\r\n\t0: true,\r\n\t1: true,\r\n\t3: true,\r\n\t4: true,\r\n\t6: true,\r\n\t8: true,\r\n\t12: true,\r\n\t13: true,\r\n\t15: true,\r\n} // type_5:true,type_7:true,type_23\r\nvar type6 = {\r\n\t1: true,\r\n}\r\nvar newAr = [\r\n\t[],\r\n\t[\r\n\t\t'1',\r\n\t\t'2',\r\n\t\t'3',\r\n\t\t'7',\r\n\t\t'8',\r\n\t\t'9',\r\n\t\t'4',\r\n\t\t'5',\r\n\t\t'6',\r\n\t\t'+',\r\n\t\t'-',\r\n\t\t'*',\r\n\t\t'/',\r\n\t\t'(',\r\n\t\t')',\r\n\t\t'^',\r\n\t\t'!',\r\n\t\t'P',\r\n\t\t'C',\r\n\t\t'e',\r\n\t\t'0',\r\n\t\t'.',\r\n\t\t',',\r\n\t\t'n',\r\n\t\t' ',\r\n\t\t'&',\r\n\t],\r\n\t['pi', 'ln', 'Pi'],\r\n\t['sin', 'cos', 'tan', 'Del', 'int', 'Mod', 'log', 'pow'],\r\n\t['asin', 'acos', 'atan', 'cosh', 'root', 'tanh', 'sinh'],\r\n\t['acosh', 'atanh', 'asinh', 'Sigma'],\r\n]\r\n\r\nfunction match(str1, str2, i, x) {\r\n\tfor (var f = 0; f < x; f++) {\r\n\t\tif (str1[i + f] !== str2[f]) {\r\n\t\t\treturn false\r\n\t\t}\r\n\t}\r\n\treturn true\r\n}\r\nMexp.tokenTypes = {\r\n\tFUNCTION_WITH_ONE_ARG: 0,\r\n\tNUMBER: 1,\r\n\tBINARY_OPERATOR_HIGH_PRECENDENCE: 2,\r\n\tCONSTANT: 3,\r\n\tOPENING_PARENTHESIS: 4,\r\n\tCLOSING_PARENTHESIS: 5,\r\n\tDECIMAL: 6,\r\n\tPOSTFIX_FUNCTION_WITH_ONE_ARG: 7,\r\n\tFUNCTION_WITH_N_ARGS: 8,\r\n\tBINARY_OPERATOR_LOW_PRECENDENCE: 9,\r\n\tBINARY_OPERATOR_PERMUTATION: 10,\r\n\tCOMMA: 11,\r\n\tEVALUATED_FUNCTION: 12,\r\n\tEVALUATED_FUNCTION_PARAMETER: 13,\r\n\tSPACE: 14,\r\n}\r\n/**\r\n \r\n 0 : function with syntax function_name(Maths_exp)\r\n 1 : numbers\r\n 2 : binary operators like * / Mod left associate and same precedence\r\n 3 : Math constant values like e,pi,Cruncher ans\r\n 4 : opening bracket\r\n 5 : closing bracket\r\n 6 : decimal\r\n 7 : function with syntax (Math_exp)function_name\r\n 8: function with syntax function_name(Math_exp1,Math_exp2)\r\n 9 : binary operator like +,-\r\n 10: binary operator like P C or ^\r\n 11: ,\r\n 12: function with , seperated three parameters and third parameter is a string that will be mexp string\r\n 13: variable of Sigma function\r\n */\r\nMexp.addToken = function (newTokens) {\r\n\tfor (var i = 0; i < newTokens.length; i++) {\r\n\t\tvar x = newTokens[i].token.length\r\n\t\tvar temp = -1\r\n\t\tif (newTokens[i].type === Mexp.tokenTypes.FUNCTION_WITH_N_ARGS && newTokens[i].numberOfArguments === undefined) {\r\n\t\t\tnewTokens[i].numberOfArguments = 2\r\n\t\t}\r\n\r\n\t\t// newAr is a specially designed data structure index of 1d array = length of tokens\r\n\t\tnewAr[x] = newAr[x] || []\r\n\t\tfor (var y = 0; y < newAr[x].length; y++) {\r\n\t\t\tif (newTokens[i].token === newAr[x][y]) {\r\n\t\t\t\ttemp = indexOfToken(newAr[x][y], tokens)\r\n\t\t\t\tbreak\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (temp === -1) {\r\n\t\t\ttokens.push(newTokens[i])\r\n\t\t\tnewTokens[i].precedence = preced[newTokens[i].type]\r\n\t\t\tif (newAr.length <= newTokens[i].token.length) {\r\n\t\t\t\tnewAr[newTokens[i].token.length] = []\r\n\t\t\t}\r\n\t\t\tnewAr[newTokens[i].token.length].push(newTokens[i].token)\r\n\t\t} else {\r\n\t\t\t// overwrite\r\n\t\t\ttokens[temp] = newTokens[i]\r\n\t\t\tnewTokens[i].precedence = preced[newTokens[i].type]\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction indexOfToken(key, tokens) {\r\n\tfor (var search = 0; search < tokens.length; search++) {\r\n\t\tif (tokens[search].token === key) return search\r\n\t}\r\n\treturn -1\r\n}\r\nfunction tokenize(string) {\r\n\tvar nodes = []\r\n\tvar length = string.length\r\n\tvar key, x, y\r\n\tfor (var i = 0; i < length; i++) {\r\n\t\tif (i < length - 1 && string[i] === ' ' && string[i + 1] === ' ') {\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tkey = ''\r\n\t\tfor (x = string.length - i > newAr.length - 2 ? newAr.length - 1 : string.length - i; x > 0; x--) {\r\n\t\t\tif (newAr[x] === undefined) continue\r\n\t\t\tfor (y = 0; y < newAr[x].length; y++) {\r\n\t\t\t\tif (match(string, newAr[x][y], i, x)) {\r\n\t\t\t\t\tkey = newAr[x][y]\r\n\t\t\t\t\ty = newAr[x].length\r\n\t\t\t\t\tx = 0\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\ti += key.length - 1\r\n\t\tif (key === '') {\r\n\t\t\tthrow new Mexp.Exception(\"Can't understand after \" + string.slice(i))\r\n\t\t}\r\n\t\tnodes.push(tokens[indexOfToken(key, tokens)])\r\n\t}\r\n\treturn nodes\r\n}\r\n\r\nvar changeSignObj = {\r\n\tvalue: Mexp.math.changeSign,\r\n\ttype: 0,\r\n\tpre: 21,\r\n\tshow: '-',\r\n}\r\nvar closingParObj = {\r\n\tvalue: ')',\r\n\tshow: ')',\r\n\ttype: 5,\r\n\tpre: 0,\r\n}\r\nvar openingParObj = {\r\n\tvalue: '(',\r\n\ttype: 4,\r\n\tpre: 0,\r\n\tshow: '(',\r\n}\r\nMexp.lex = function (inp, tokens) {\r\n\t'use strict'\r\n\r\n\tvar str = [openingParObj]\r\n\r\n\tvar ptc = [] // Parenthesis to close at the beginning is after one token\r\n\tvar inpStr = inp\r\n\tvar allowed = type0\r\n\tvar bracToClose = 0\r\n\tvar asterick = empty\r\n\tvar prevKey = ''\r\n\tvar i\r\n\tif (typeof tokens !== 'undefined') {\r\n\t\tMexp.addToken(tokens)\r\n\t}\r\n\tvar obj = {}\r\n\tvar nodes = tokenize(inpStr)\r\n\tfor (i = 0; i < nodes.length; i++) {\r\n\t\tvar node = nodes[i]\r\n\t\tif (node.type === 14) {\r\n\t\t\tif (\r\n\t\t\t\ti > 0 &&\r\n\t\t\t\ti < nodes.length - 1 &&\r\n\t\t\t\tnodes[i + 1].type === 1 &&\r\n\t\t\t\t(nodes[i - 1].type === 1 || nodes[i - 1].type === 6)\r\n\t\t\t) {\r\n\t\t\t\tthrow new Mexp.Exception('Unexpected Space')\r\n\t\t\t}\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\tvar cToken = node.token\r\n\t\tvar cType = node.type\r\n\t\tvar cEv = node.value\r\n\t\tvar cPre = node.precedence\r\n\t\tvar cShow = node.show\r\n\t\tvar pre = str[str.length - 1]\r\n\t\tvar j\r\n\t\tfor (j = ptc.length; j--; ) {\r\n\t\t\t// loop over ptc\r\n\t\t\tif (ptc[j] === 0) {\r\n\t\t\t\tif ([0, 2, 3, 4, 5, 9, 11, 12, 13].indexOf(cType) !== -1) {\r\n\t\t\t\t\tif (allowed[cType] !== true) {\r\n\t\t\t\t\t\tthrow new Mexp.Exception(cToken + ' is not allowed after ' + prevKey)\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstr.push(closingParObj)\r\n\t\t\t\t\tallowed = type1\r\n\t\t\t\t\tasterick = type3Asterick\r\n\t\t\t\t\tptc.pop()\r\n\t\t\t\t}\r\n\t\t\t} else break\r\n\t\t}\r\n\t\tif (allowed[cType] !== true) {\r\n\t\t\tthrow new Mexp.Exception(cToken + ' is not allowed after ' + prevKey)\r\n\t\t}\r\n\t\tif (asterick[cType] === true) {\r\n\t\t\tcType = 2\r\n\t\t\tcEv = Mexp.math.mul\r\n\t\t\tcShow = '×'\r\n\t\t\tcPre = 3\r\n\t\t\ti = i - 1\r\n\t\t}\r\n\t\tobj = {\r\n\t\t\tvalue: cEv,\r\n\t\t\ttype: cType,\r\n\t\t\tpre: cPre,\r\n\t\t\tshow: cShow,\r\n\t\t\tnumberOfArguments: node.numberOfArguments,\r\n\t\t}\r\n\t\tif (cType === 0) {\r\n\t\t\tallowed = type0\r\n\t\t\tasterick = empty\r\n\t\t\tinc(ptc, 2)\r\n\t\t\tstr.push(obj)\r\n\t\t\tif (nodes[i + 1].type !== 4) {\r\n\t\t\t\tstr.push(openingParObj)\r\n\t\t\t\tptc.push(2)\r\n\t\t\t}\r\n\t\t\t// bracToClose++\r\n\t\t} else if (cType === 1) {\r\n\t\t\tif (pre.type === 1) {\r\n\t\t\t\tpre.value += cEv\r\n\t\t\t\tinc(ptc, 1)\r\n\t\t\t} else {\r\n\t\t\t\tstr.push(obj)\r\n\t\t\t}\r\n\t\t\tallowed = type1\r\n\t\t\tasterick = type1Asterick\r\n\t\t} else if (cType === 2) {\r\n\t\t\tallowed = type0\r\n\t\t\tasterick = empty\r\n\t\t\tinc(ptc, 2)\r\n\t\t\tstr.push(obj)\r\n\t\t} else if (cType === 3) {\r\n\t\t\t// constant\r\n\t\t\tstr.push(obj)\r\n\t\t\tallowed = type1\r\n\t\t\tasterick = type3Asterick\r\n\t\t} else if (cType === 4) {\r\n\t\t\tinc(ptc, 1)\r\n\t\t\tbracToClose++\r\n\t\t\tallowed = type0\r\n\t\t\tasterick = empty\r\n\t\t\tstr.push(obj)\r\n\t\t} else if (cType === 5) {\r\n\t\t\tif (!bracToClose) {\r\n\t\t\t\tthrow new Mexp.Exception('Closing parenthesis are more than opening one, wait What!!!')\r\n\t\t\t}\r\n\t\t\tbracToClose--\r\n\t\t\tallowed = type1\r\n\t\t\tasterick = type3Asterick\r\n\t\t\tstr.push(obj)\r\n\t\t\tinc(ptc, 1)\r\n\t\t} else if (cType === 6) {\r\n\t\t\tif (pre.hasDec) {\r\n\t\t\t\tthrow new Mexp.Exception('Two decimals are not allowed in one number')\r\n\t\t\t}\r\n\t\t\tif (pre.type !== 1) {\r\n\t\t\t\tpre = {\r\n\t\t\t\t\tvalue: 0,\r\n\t\t\t\t\ttype: 1,\r\n\t\t\t\t\tpre: 0,\r\n\t\t\t\t} // pre needs to be changed as it will the last value now to be safe in later code\r\n\t\t\t\tstr.push(pre)\r\n\t\t\t\t// inc(ptc, 1)\r\n\t\t\t}\r\n\t\t\tallowed = type6\r\n\t\t\tinc(ptc, 1)\r\n\t\t\tasterick = empty\r\n\t\t\tpre.value += cEv\r\n\t\t\tpre.hasDec = true\r\n\t\t} else if (cType === 7) {\r\n\t\t\tallowed = type1\r\n\t\t\tasterick = type3Asterick\r\n\t\t\tinc(ptc, 1)\r\n\t\t\tstr.push(obj)\r\n\t\t}\r\n\t\tif (cType === 8) {\r\n\t\t\tallowed = type0\r\n\t\t\tasterick = empty\r\n\t\t\tinc(ptc, node.numberOfArguments + 2)\r\n\t\t\tstr.push(obj)\r\n\t\t\t// str.push(openingParObj)\r\n\t\t\tif (nodes[i + 1].type !== 4) {\r\n\t\t\t\tstr.push(openingParObj)\r\n\t\t\t\tptc.push(node.numberOfArguments + 2)\r\n\t\t\t}\r\n\t\t} else if (cType === 9) {\r\n\t\t\tif (pre.type === 9) {\r\n\t\t\t\tif (pre.value === Mexp.math.add) {\r\n\t\t\t\t\tpre.value = cEv\r\n\t\t\t\t\tpre.show = cShow\r\n\t\t\t\t\tinc(ptc, 1)\r\n\t\t\t\t} else if (pre.value === Mexp.math.sub && cShow === '-') {\r\n\t\t\t\t\tpre.value = Mexp.math.add\r\n\t\t\t\t\tpre.show = '+'\r\n\t\t\t\t\tinc(ptc, 1)\r\n\t\t\t\t}\r\n\t\t\t} else if (pre.type !== 5 && pre.type !== 7 && pre.type !== 1 && pre.type !== 3 && pre.type !== 13) {\r\n\t\t\t\t// changesign only when negative is found\r\n\t\t\t\tif (cToken === '-') {\r\n\t\t\t\t\t// do nothing for + token\r\n\t\t\t\t\t// don't add with the above if statement as that will run the else statement of parent if on Ctoken +\r\n\t\t\t\t\tallowed = type0\r\n\t\t\t\t\tasterick = empty\r\n\t\t\t\t\tinc(ptc, 2).push(2)\r\n\t\t\t\t\tstr.push(changeSignObj)\r\n\t\t\t\t\tstr.push(openingParObj)\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tstr.push(obj)\r\n\t\t\t\tinc(ptc, 2)\r\n\t\t\t}\r\n\t\t\tallowed = type0\r\n\t\t\tasterick = empty\r\n\t\t} else if (cType === 10) {\r\n\t\t\tallowed = type0\r\n\t\t\tasterick = empty\r\n\t\t\tinc(ptc, 2)\r\n\t\t\tstr.push(obj)\r\n\t\t} else if (cType === 11) {\r\n\t\t\tallowed = type0\r\n\t\t\tasterick = empty\r\n\t\t\tstr.push(obj)\r\n\t\t} else if (cType === 12) {\r\n\t\t\tallowed = type0\r\n\t\t\tasterick = empty\r\n\t\t\tinc(ptc, 6)\r\n\t\t\tstr.push(obj)\r\n\t\t\tif (nodes[i + 1].type !== 4) {\r\n\t\t\t\tstr.push(openingParObj)\r\n\t\t\t\tptc.push(6)\r\n\t\t\t}\r\n\t\t} else if (cType === 13) {\r\n\t\t\tallowed = type1\r\n\t\t\tasterick = type3Asterick\r\n\t\t\tstr.push(obj)\r\n\t\t}\r\n\r\n\t\tinc(ptc, -1)\r\n\t\tprevKey = cToken\r\n\t}\r\n\tfor (j = ptc.length; j--; ) {\r\n\t\t// loop over ptc\r\n\t\tstr.push(closingParObj)\r\n\t}\r\n\tif (allowed[5] !== true) {\r\n\t\tthrow new Mexp.Exception('complete the expression')\r\n\t}\r\n\twhile (bracToClose--) {\r\n\t\tstr.push(closingParObj)\r\n\t}\r\n\r\n\tstr.push(closingParObj)\r\n\t// console.log(str);\r\n\treturn new Mexp(str)\r\n}\r\nmodule.exports = Mexp\r\n","\"use strict\";\r\nvar Mexp = function (parsed) {\r\n this.value = parsed\r\n}\r\n\r\nMexp.math = {\r\n isDegree: true, // mode of calculator\r\n acos: function (x) {\r\n return (Mexp.math.isDegree ? 180 / Math.PI * Math.acos(x) : Math.acos(x))\r\n },\r\n add: function (a, b) {\r\n return a + b\r\n },\r\n asin: function (x) {\r\n return (Mexp.math.isDegree ? 180 / Math.PI * Math.asin(x) : Math.asin(x))\r\n },\r\n atan: function (x) {\r\n return (Mexp.math.isDegree ? 180 / Math.PI * Math.atan(x) : Math.atan(x))\r\n },\r\n acosh: function (x) {\r\n return Math.log(x + Math.sqrt(x * x - 1))\r\n },\r\n asinh: function (x) {\r\n return Math.log(x + Math.sqrt(x * x + 1))\r\n },\r\n atanh: function (x) {\r\n return Math.log((1 + x) / (1 - x))\r\n },\r\n C: function (n, r) {\r\n var pro = 1\r\n var other = n - r\r\n var choice = r\r\n if (choice < other) {\r\n choice = other\r\n other = r\r\n }\r\n for (var i = choice + 1; i <= n; i++) {\r\n pro *= i\r\n }\r\n return pro / Mexp.math.fact(other)\r\n },\r\n changeSign: function (x) {\r\n return -x\r\n },\r\n cos: function (x) {\r\n if (Mexp.math.isDegree) x = Mexp.math.toRadian(x)\r\n return Math.cos(x)\r\n },\r\n cosh: function (x) {\r\n return (Math.pow(Math.E, x) + Math.pow(Math.E, -1 * x)) / 2\r\n },\r\n div: function (a, b) {\r\n return a / b\r\n },\r\n fact: function (n) {\r\n if (n % 1 !== 0) return 'NaN'\r\n var pro = 1\r\n for (var i = 2; i <= n; i++) {\r\n pro *= i\r\n }\r\n return pro\r\n },\r\n inverse: function (x) {\r\n return 1 / x\r\n },\r\n log: function (i) {\r\n return Math.log(i) / Math.log(10)\r\n },\r\n mod: function (a, b) {\r\n return a % b\r\n },\r\n mul: function (a, b) {\r\n return a * b\r\n },\r\n P: function (n, r) {\r\n var pro = 1\r\n for (var i = Math.floor(n) - Math.floor(r) + 1; i <= Math.floor(n); i++) {\r\n pro *= i\r\n }\r\n return pro\r\n },\r\n Pi: function (low, high, ex) {\r\n var pro = 1\r\n for (var i = low; i <= high; i++) {\r\n pro *= Number(ex.postfixEval({\r\n n: i\r\n }))\r\n }\r\n return pro\r\n },\r\n pow10x: function (e) {\r\n var x = 1\r\n while (e--) {\r\n x *= 10\r\n }\r\n return x\r\n },\r\n sigma: function (low, high, ex) {\r\n var sum = 0\r\n for (var i = low; i <= high; i++) {\r\n sum += Number(ex.postfixEval({\r\n n: i\r\n }))\r\n }\r\n return sum\r\n },\r\n sin: function (x) {\r\n if (Mexp.math.isDegree) x = Mexp.math.toRadian(x)\r\n return Math.sin(x)\r\n },\r\n sinh: function (x) {\r\n return (Math.pow(Math.E, x) - Math.pow(Math.E, -1 * x)) / 2\r\n },\r\n sub: function (a, b) {\r\n return a - b\r\n },\r\n tan: function (x) {\r\n if (Mexp.math.isDegree) x = Mexp.math.toRadian(x)\r\n return Math.tan(x)\r\n },\r\n tanh: function (x) {\r\n return Mexp.sinha(x) / Mexp.cosha(x)\r\n },\r\n toRadian: function (x) {\r\n return x * Math.PI / 180\r\n },\r\n and: function (a, b) {\r\n return a & b\r\n }\r\n}\r\nMexp.Exception = function (message) {\r\n this.message = message\r\n}\r\nmodule.exports = Mexp\r\n","\r\nvar Mexp = require('./lexer.js');\r\n\r\nMexp.prototype.toPostfix = function () {\r\n\t'use strict';\r\n\tvar post = [], elem, popped, prep, pre, ele;\r\n\tvar stack = [{ value: \"(\", type: 4, pre: 0 }];\r\n\tvar arr = this.value;\r\n\tfor (var i = 1; i < arr.length; i++) {\r\n\t\tif (arr[i].type === 1 || arr[i].type === 3 || arr[i].type === 13) {\t//if token is number,constant,or n(which is also a special constant in our case)\r\n\t\t\tif (arr[i].type === 1)\r\n\t\t\t\tarr[i].value = Number(arr[i].value);\r\n\t\t\tpost.push(arr[i]);\r\n\t\t}\r\n\t\telse if (arr[i].type === 4) {\r\n\t\t\tstack.push(arr[i]);\r\n\t\t}\r\n\t\telse if (arr[i].type === 5) {\r\n\t\t\twhile ((popped = stack.pop()).type !== 4) {\r\n\t\t\t\tpost.push(popped);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (arr[i].type === 11) {\r\n\t\t\twhile ((popped = stack.pop()).type !== 4) {\r\n\t\t\t\tpost.push(popped);\r\n\t\t\t}\r\n\t\t\tstack.push(popped);\r\n\t\t}\r\n\t\telse {\r\n\t\t\telem = arr[i];\r\n\t\t\tpre = elem.pre;\r\n\t\t\tele = stack[stack.length - 1];\r\n\t\t\tprep = ele.pre;\r\n\t\t\tvar flag = ele.value == 'Math.pow' && elem.value == 'Math.pow';\r\n\t\t\tif (pre > prep) stack.push(elem);\r\n\t\t\telse {\r\n\t\t\t\twhile (prep >= pre && !flag || flag && pre < prep) {\r\n\t\t\t\t\tpopped = stack.pop();\r\n\t\t\t\t\tele = stack[stack.length - 1];\r\n\t\t\t\t\tpost.push(popped);\r\n\t\t\t\t\tprep = ele.pre;\r\n\t\t\t\t\tflag = elem.value == 'Math.pow' && ele.value == 'Math.pow';\r\n\t\t\t\t}\r\n\t\t\t\tstack.push(elem);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn new Mexp(post);\r\n};\r\nmodule.exports = Mexp;","var Mexp = require('./postfix.js')\r\nMexp.prototype.postfixEval = function (UserDefined) {\r\n\t'use strict'\r\n\tUserDefined = UserDefined || {}\r\n\tUserDefined.PI = Math.PI\r\n\tUserDefined.E = Math.E\r\n\tvar stack = [],\r\n\t\tpop1,\r\n\t\tpop2,\r\n\t\tpop3\r\n\tvar disp = []\r\n\tvar temp = ''\r\n\tvar arr = this.value\r\n\tvar bool = typeof UserDefined.n !== 'undefined'\r\n\tfor (var i = 0; i < arr.length; i++) {\r\n\t\tif (arr[i].type === 1) {\r\n\t\t\tstack.push({ value: arr[i].value, type: 1 })\r\n\t\t} else if (arr[i].type === 3) {\r\n\t\t\tstack.push({ value: UserDefined[arr[i].value], type: 1 })\r\n\t\t} else if (arr[i].type === 0) {\r\n\t\t\tif (typeof stack[stack.length - 1].type === 'undefined') {\r\n\t\t\t\tstack[stack.length - 1].value.push(arr[i])\r\n\t\t\t} else stack[stack.length - 1].value = arr[i].value(stack[stack.length - 1].value)\r\n\t\t} else if (arr[i].type === 7) {\r\n\t\t\tif (typeof stack[stack.length - 1].type === 'undefined') {\r\n\t\t\t\tstack[stack.length - 1].value.push(arr[i])\r\n\t\t\t} else stack[stack.length - 1].value = arr[i].value(stack[stack.length - 1].value)\r\n\t\t} else if (arr[i].type === 8) {\r\n\t\t\tvar popped = []\r\n\t\t\tfor (var x = 0; x < arr[i].numberOfArguments; x++) {\r\n\t\t\t\tpopped.push(stack.pop().value)\r\n\t\t\t}\r\n\t\t\tstack.push({ type: 1, value: arr[i].value.apply(arr[i], popped.reverse()) })\r\n\t\t} else if (arr[i].type === 10) {\r\n\t\t\tpop1 = stack.pop()\r\n\t\t\tpop2 = stack.pop()\r\n\t\t\tif (typeof pop2.type === 'undefined') {\r\n\t\t\t\tpop2.value = pop2.concat(pop1)\r\n\t\t\t\tpop2.value.push(arr[i])\r\n\t\t\t\tstack.push(pop2)\r\n\t\t\t} else if (typeof pop1.type === 'undefined') {\r\n\t\t\t\tpop1.unshift(pop2)\r\n\t\t\t\tpop1.push(arr[i])\r\n\t\t\t\tstack.push(pop1)\r\n\t\t\t} else {\r\n\t\t\t\tstack.push({ type: 1, value: arr[i].value(pop2.value, pop1.value) })\r\n\t\t\t}\r\n\t\t} else if (arr[i].type === 2 || arr[i].type === 9) {\r\n\t\t\tpop1 = stack.pop()\r\n\t\t\tpop2 = stack.pop()\r\n\t\t\tif (typeof pop2.type === 'undefined') {\r\n\t\t\t\tpop2 = pop2.concat(pop1)\r\n\t\t\t\tpop2.push(arr[i])\r\n\t\t\t\tstack.push(pop2)\r\n\t\t\t} else if (typeof pop1.type === 'undefined') {\r\n\t\t\t\tpop1.unshift(pop2)\r\n\t\t\t\tpop1.push(arr[i])\r\n\t\t\t\tstack.push(pop1)\r\n\t\t\t} else {\r\n\t\t\t\tstack.push({ type: 1, value: arr[i].value(pop2.value, pop1.value) })\r\n\t\t\t}\r\n\t\t} else if (arr[i].type === 12) {\r\n\t\t\tpop1 = stack.pop()\r\n\t\t\tif (typeof pop1.type !== 'undefined') {\r\n\t\t\t\tpop1 = [pop1]\r\n\t\t\t}\r\n\t\t\tpop2 = stack.pop()\r\n\t\t\tpop3 = stack.pop()\r\n\t\t\tstack.push({ type: 1, value: arr[i].value(pop3.value, pop2.value, new Mexp(pop1)) })\r\n\t\t} else if (arr[i].type === 13) {\r\n\t\t\tif (bool) {\r\n\t\t\t\tstack.push({ value: UserDefined[arr[i].value], type: 3 })\r\n\t\t\t} else stack.push([arr[i]])\r\n\t\t}\r\n\t}\r\n\tif (stack.length > 1) {\r\n\t\tthrow new Mexp.Exception('Uncaught Syntax error')\r\n\t}\r\n\treturn stack[0].value > 1000000000000000 ? 'Infinity' : parseFloat(stack[0].value.toFixed(15))\r\n}\r\nMexp.eval = function (str, tokens, obj) {\r\n\tif (typeof tokens === 'undefined') {\r\n\t\treturn this.lex(str).toPostfix().postfixEval()\r\n\t} else if (typeof obj === 'undefined') {\r\n\t\tif (typeof tokens.length !== 'undefined') return this.lex(str, tokens).toPostfix().postfixEval()\r\n\t\telse return this.lex(str).toPostfix().postfixEval(tokens)\r\n\t} else return this.lex(str, tokens).toPostfix().postfixEval(obj)\r\n}\r\nmodule.exports = Mexp\r\n","import{Component as n,createElement as t,options as e,toChildArray as r,Fragment as u,render as o,hydrate as i,createContext as l,createRef as f,cloneElement as a}from\"preact\";export{Component,Fragment,Fragment as StrictMode,createContext,createElement,createRef}from\"preact\";import{useState as c,useLayoutEffect as s,useEffect as h,useCallback as v,useContext as d,useDebugValue as m,useId as p,useImperativeHandle as y,useMemo as _,useReducer as b,useRef as S}from\"preact/hooks\";export*from\"preact/hooks\";function g(n,t){for(var e in t)n[e]=t[e];return n}function E(n,t){for(var e in n)if(\"__source\"!==e&&!(e in t))return!0;for(var r in t)if(\"__source\"!==r&&n[r]!==t[r])return!0;return!1}function C(n,t){var e=t(),r=c({t:{__:e,u:t}}),u=r[0].t,o=r[1];return s(function(){u.__=e,u.u=t,R(u)&&o({t:u})},[n,e,t]),h(function(){return R(u)&&o({t:u}),n(function(){R(u)&&o({t:u})})},[n]),e}function R(n){try{return!((t=n.__)===(e=n.u())&&(0!==t||1/t==1/e)||t!=t&&e!=e)}catch(n){return!0}var t,e}function x(n){n()}function w(n){return n}function k(){return[!1,x]}var I=s;function M(n,t){this.props=n,this.context=t}function N(n,e){function r(n){var t=this.props.ref;return t!=n.ref&&t&&(\"function\"==typeof t?t(null):t.current=null),e?!e(this.props,n)||t!=n.ref:E(this.props,n)}function u(e){return this.shouldComponentUpdate=r,t(n,e)}return u.displayName=\"Memo(\"+(n.displayName||n.name)+\")\",u.__f=u.prototype.isReactComponent=!0,u.type=n,u}(M.prototype=new n).isPureReactComponent=!0,M.prototype.shouldComponentUpdate=function(n,t){return E(this.props,n)||E(this.state,t)};var T=e.__b;e.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),T&&T(n)};var A=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.forward_ref\")||3911;function D(n){function t(t){var e=g({},t);return delete e.ref,n(e,t.ref||null)}return t.$$typeof=A,t.render=n,t.prototype.isReactComponent=t.__f=!0,t.displayName=\"ForwardRef(\"+(n.displayName||n.name)+\")\",t}var F=function(n,t){return null==n?null:r(r(n).map(t))},L={map:F,forEach:F,count:function(n){return n?r(n).length:0},only:function(n){var t=r(n);if(1!==t.length)throw\"Children.only\";return t[0]},toArray:r},O=e.__e;e.__e=function(n,t,e,r){if(n.then)for(var u,o=t;o=o.__;)if((u=o.__c)&&u.__c)return null==t.__e&&(t.__e=e.__e,t.__k=e.__k||[]),u.__c(n,t);O(n,t,e,r)};var U=e.unmount;function V(n,t,e){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(n){\"function\"==typeof n.__c&&n.__c()}),n.__c.__H=null),null!=(n=g({},n)).__c&&(n.__c.__P===e&&(n.__c.__P=t),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(n){return V(n,t,e)})),n}function W(n,t,e){return n&&e&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(n){return W(n,t,e)}),n.__c&&n.__c.__P===t&&(n.__e&&e.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=e)),n}function P(){this.__u=0,this.o=null,this.__b=null}function j(n){var t=n.__&&n.__.__c;return t&&t.__a&&t.__a(n)}function z(n){var e,r,u,o=null;function i(i){if(e||(e=n()).then(function(n){n&&(o=n.default||n),u=!0},function(n){r=n,u=!0}),r)throw r;if(!u)throw e;return o?t(o,i):null}return i.displayName=\"Lazy\",i.__f=!0,i}function B(){this.i=null,this.l=null}e.unmount=function(n){var t=n.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&n.__u&&(n.type=null),U&&U(n)},(P.prototype=new n).__c=function(n,t){var e=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(e);var u=j(r.__v),o=!1,i=function(){o||r.__z||(o=!0,e.__R=null,u?u(f):f())};e.__R=i;var l=e.__P;e.__P=null;var f=function(){if(!--r.__u){if(r.state.__a){var n=r.state.__a;r.__v.__k[0]=W(n,n.__c.__P,n.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=l,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(i,i)},P.prototype.componentWillUnmount=function(){this.o=[]},P.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var r=document.createElement(\"div\"),o=this.__v.__k[0].__c;this.__v.__k[0]=V(this.__b,r,o.__O=o.__P)}this.__b=null}var i=e.__a&&t(u,null,n.fallback);return i&&(i.__u&=-33),[t(u,null,e.__a?null:n.children),i]};var H=function(n,t,e){if(++e[1]===e[0]&&n.l.delete(t),n.props.revealOrder&&(\"t\"!==n.props.revealOrder[0]||!n.l.size))for(e=n.i;e;){for(;e.length>3;)e.pop()();if(e[1]>>1,1),e.h.removeChild(n)}}}o(t(Z,{context:e.context},n.__v),e.v)}function $(n,e){var r=t(Y,{__v:n,h:e});return r.containerInfo=e,r}(B.prototype=new n).__a=function(n){var t=this,e=j(t.__v),r=t.l.get(n);return r[0]++,function(u){var o=function(){t.props.revealOrder?(r.push(u),H(t,n,r)):u()};e?e(o):o()}},B.prototype.render=function(n){this.i=null,this.l=new Map;var t=r(n.children);n.revealOrder&&\"b\"===n.revealOrder[0]&&t.reverse();for(var e=t.length;e--;)this.l.set(t[e],this.i=[1,0,this.i]);return n.children},B.prototype.componentDidUpdate=B.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(t,e){H(n,e,t)})};var q=\"undefined\"!=typeof Symbol&&Symbol.for&&Symbol.for(\"react.element\")||60103,G=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,J=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,K=/[A-Z0-9]/g,Q=\"undefined\"!=typeof document,X=function(n){return(\"undefined\"!=typeof Symbol&&\"symbol\"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(n)};function nn(n,t,e){return null==t.__k&&(t.textContent=\"\"),o(n,t),\"function\"==typeof e&&e(),n?n.__c:null}function tn(n,t,e){return i(n,t),\"function\"==typeof e&&e(),n?n.__c:null}n.prototype.isReactComponent=!0,[\"componentWillMount\",\"componentWillReceiveProps\",\"componentWillUpdate\"].forEach(function(t){Object.defineProperty(n.prototype,t,{configurable:!0,get:function(){return this[\"UNSAFE_\"+t]},set:function(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})});var en=e.event;e.event=function(n){return en&&(n=en(n)),n.persist=function(){},n.isPropagationStopped=function(){return this.cancelBubble},n.isDefaultPrevented=function(){return this.defaultPrevented},n.nativeEvent=n};var rn,un={configurable:!0,get:function(){return this.class}},on=e.vnode;e.vnode=function(n){\"string\"==typeof n.type&&function(n){var t=n.props,e=n.type,u={},o=-1==e.indexOf(\"-\");for(var i in t){var l=t[i];if(!(\"value\"===i&&\"defaultValue\"in t&&null==l||Q&&\"children\"===i&&\"noscript\"===e||\"class\"===i||\"className\"===i)){var f=i.toLowerCase();\"defaultValue\"===i&&\"value\"in t&&null==t.value?i=\"value\":\"download\"===i&&!0===l?l=\"\":\"translate\"===f&&\"no\"===l?l=!1:\"o\"===f[0]&&\"n\"===f[1]?\"ondoubleclick\"===f?i=\"ondblclick\":\"onchange\"!==f||\"input\"!==e&&\"textarea\"!==e||X(t.type)?\"onfocus\"===f?i=\"onfocusin\":\"onblur\"===f?i=\"onfocusout\":J.test(i)&&(i=f):f=i=\"oninput\":o&&G.test(i)?i=i.replace(K,\"-$&\").toLowerCase():null===l&&(l=void 0),\"oninput\"===f&&u[i=f]&&(i=\"oninputCapture\"),u[i]=l}}\"select\"==e&&(u.multiple&&Array.isArray(u.value)&&(u.value=r(t.children).forEach(function(n){n.props.selected=-1!=u.value.indexOf(n.props.value)})),null!=u.defaultValue&&(u.value=r(t.children).forEach(function(n){n.props.selected=u.multiple?-1!=u.defaultValue.indexOf(n.props.value):u.defaultValue==n.props.value}))),t.class&&!t.className?(u.class=t.class,Object.defineProperty(u,\"className\",un)):t.className&&(u.class=u.className=t.className),n.props=u}(n),n.$$typeof=q,on&&on(n)};var ln=e.__r;e.__r=function(n){ln&&ln(n),rn=n.__c};var fn=e.diffed;e.diffed=function(n){fn&&fn(n);var t=n.props,e=n.__e;null!=e&&\"textarea\"===n.type&&\"value\"in t&&t.value!==e.value&&(e.value=null==t.value?\"\":t.value),rn=null};var an={ReactCurrentDispatcher:{current:{readContext:function(n){return rn.__n[n.__c].props.value},useCallback:v,useContext:d,useDebugValue:m,useDeferredValue:w,useEffect:h,useId:p,useImperativeHandle:y,useInsertionEffect:I,useLayoutEffect:s,useMemo:_,useReducer:b,useRef:S,useState:c,useSyncExternalStore:C,useTransition:k}}},cn=\"18.3.1\";function sn(n){return t.bind(null,n)}function hn(n){return!!n&&n.$$typeof===q}function vn(n){return hn(n)&&n.type===u}function dn(n){return!!n&&\"string\"==typeof n.displayName&&0==n.displayName.indexOf(\"Memo(\")}function mn(n){return hn(n)?a.apply(null,arguments):n}function pn(n){return!!n.__k&&(o(null,n),!0)}function yn(n){return n&&(n.base||1===n.nodeType&&n)||null}var _n=function(n,t){return n(t)},bn=function(n,t){var r,u=e.debounceRendering;e.debounceRendering=function(n){r=n};try{var o=n(t);return r&&r(),o}finally{e.debounceRendering=u}},Sn=hn,gn={useState:c,useId:p,useReducer:b,useEffect:h,useLayoutEffect:s,useInsertionEffect:I,useTransition:k,useDeferredValue:w,useSyncExternalStore:C,startTransition:x,useRef:S,useImperativeHandle:y,useMemo:_,useCallback:v,useContext:d,useDebugValue:m,version:\"18.3.1\",Children:L,render:nn,hydrate:tn,unmountComponentAtNode:pn,createPortal:$,createElement:t,createContext:l,createFactory:sn,cloneElement:mn,createRef:f,Fragment:u,isValidElement:hn,isElement:Sn,isFragment:vn,isMemo:dn,findDOMNode:yn,Component:n,PureComponent:M,memo:N,forwardRef:D,flushSync:bn,unstable_batchedUpdates:_n,StrictMode:u,Suspense:P,SuspenseList:B,lazy:z,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:an};export{L as Children,M as PureComponent,P as Suspense,B as SuspenseList,an as __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,mn as cloneElement,sn as createFactory,$ as createPortal,gn as default,yn as findDOMNode,bn as flushSync,D as forwardRef,tn as hydrate,Sn as isElement,vn as isFragment,dn as isMemo,hn as isValidElement,z as lazy,N as memo,nn as render,x as startTransition,pn as unmountComponentAtNode,_n as unstable_batchedUpdates,w as useDeferredValue,I as useInsertionEffect,C as useSyncExternalStore,k as useTransition,cn as version};\n//# sourceMappingURL=compat.module.js.map\n","var n,l,u,t,i,r,o,e,f,c,a,s,h,p,v,y,d={},w=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,g=Array.isArray;function m(n,l){for(var u in l)n[u]=l[u];return n}function b(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function k(l,u,t){var i,r,o,e={};for(o in u)\"key\"==o?i=u[o]:\"ref\"==o?r=u[o]:e[o]=u[o];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),\"function\"==typeof l&&null!=l.defaultProps)for(o in l.defaultProps)void 0===e[o]&&(e[o]=l.defaultProps[o]);return x(l,e,i,r,null)}function x(n,t,i,r,o){var e={type:n,props:t,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==o?++u:o,__i:-1,__u:0};return null==o&&null!=l.vnode&&l.vnode(e),e}function M(){return{current:null}}function S(n){return n.children}function C(n,l){this.props=n,this.context=l}function $(n,l){if(null==l)return n.__?$(n.__,n.__i+1):null;for(var u;ll&&i.sort(e),n=i.shift(),l=i.length,I(n)}finally{i.length=H.__r=0}}function L(n,l,u,t,i,r,o,e,f,c,a){var s,h,p,v,y,_,g=t&&t.__k||w,m=l.length;for(f=T(u,l,g,f,m),s=0;s0?o=n.__k[r]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):n.__k[r]=o,f=r+h,o.__=n,o.__b=n.__b+1,e=null,-1!=(c=o.__i=O(o,u,f,s))&&(s--,(e=u[c])&&(e.__u|=2)),null==e||null==e.__v?(-1==c&&(i>a?h--:if?h--:h++,o.__u|=4))):n.__k[r]=null;if(s)for(r=0;r(a?1:0))for(i=u-1,r=u+1;i>=0||r=0?i--:r++])&&0==(2&c.__u)&&e==c.key&&f==c.type)return o;return-1}function z(n,l,u){\"-\"==l[0]?n.setProperty(l,null==u?\"\":u):n[l]=null==u?\"\":\"number\"!=typeof u||_.test(l)?u:u+\"px\"}function N(n,l,u,t,i){var r,o;n:if(\"style\"==l)if(\"string\"==typeof u)n.style.cssText=u;else{if(\"string\"==typeof t&&(n.style.cssText=t=\"\"),t)for(l in t)u&&l in u||z(n.style,l,\"\");if(u)for(l in u)t&&u[l]==t[l]||z(n.style,l,u[l])}else if(\"o\"==l[0]&&\"n\"==l[1])r=l!=(l=l.replace(s,\"$1\")),o=l.toLowerCase(),l=o in n||\"onFocusOut\"==l||\"onFocusIn\"==l?o.slice(2):l.slice(2),n.l||(n.l={}),n.l[l+r]=u,u?t?u[a]=t[a]:(u[a]=h,n.addEventListener(l,r?v:p,r)):n.removeEventListener(l,r?v:p,r);else{if(\"http://www.w3.org/2000/svg\"==i)l=l.replace(/xlink(H|:h)/,\"h\").replace(/sName$/,\"s\");else if(\"width\"!=l&&\"height\"!=l&&\"href\"!=l&&\"list\"!=l&&\"form\"!=l&&\"tabIndex\"!=l&&\"download\"!=l&&\"rowSpan\"!=l&&\"colSpan\"!=l&&\"role\"!=l&&\"popover\"!=l&&l in n)try{n[l]=null==u?\"\":u;break n}catch(n){}\"function\"==typeof u||(null==u||!1===u&&\"-\"!=l[4]?n.removeAttribute(l):n.setAttribute(l,\"popover\"==l&&1==u?\"\":u))}}function V(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u[c])u[c]=h++;else if(u[c]0?n:g(n)?n.map(E):void 0!==n.constructor?null:m({},n)}function G(u,t,i,r,o,e,f,c,a){var s,h,p,v,y,w,_,m=i.props||d,k=t.props,x=t.type;if(\"svg\"==x?o=\"http://www.w3.org/2000/svg\":\"math\"==x?o=\"http://www.w3.org/1998/Math/MathML\":o||(o=\"http://www.w3.org/1999/xhtml\"),null!=e)for(s=0;s2&&(f.children=arguments.length>3?n.call(arguments,2):t),x(l.type,f,i||l.key,r||l.ref,null)}function X(n){function l(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l.__c]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!=n.value&&u.forEach(function(n){n.__e=!0,A(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}return l.__c=\"__cC\"+y++,l.__=n,l.Provider=l.__l=(l.Consumer=function(n,l){return n.children(l)}).contextType=l,l}n=w.slice,l={__e:function(n,l,u,t){for(var i,r,o;l=l.__;)if((i=l.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(n)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),o=i.__d),o)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&void 0===n.constructor},C.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=m({},this.state),\"function\"==typeof n&&(n=n(m({},u),this.props)),n&&m(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),A(this))},C.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),A(this))},C.prototype.render=S,i=[],o=\"function\"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},H.__r=0,f=Math.random().toString(8),c=\"__d\"+f,a=\"__a\"+f,s=/(PointerCapture)$|Capture$/i,h=0,p=V(!1),v=V(!0),y=0;export{C as Component,S as Fragment,W as cloneElement,X as createContext,k as createElement,M as createRef,k as h,U as hydrate,t as isValidElement,l as options,R as render,F as toChildArray};\n//# sourceMappingURL=preact.module.js.map\n","import{options as n}from\"preact\";var t,r,u,i,o=0,f=[],c=n,e=c.__b,a=c.__r,v=c.diffed,l=c.__c,m=c.unmount,p=c.__;function s(n,t){c.__h&&c.__h(r,n,o||t),o=0;var u=r.__H||(r.__H={__:[],__h:[]});return n>=u.__.length&&u.__.push({}),u.__[n]}function d(n){return o=1,y(D,n)}function y(n,u,i){var o=s(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):D(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}))}],o.__c=r,!r.__f)){var f=function(n,t,r){if(!o.__c.__H)return!0;var u=!1,i=o.__c.props!==n;if(o.__c.__H.__.some(function(n){if(n.__N){u=!0;var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0)}}),c){var f=c.call(this,n,t,r);return u?f||i:f}return!u||i};r.__f=!0;var c=r.shouldComponentUpdate,e=r.componentWillUpdate;r.componentWillUpdate=function(n,t,r){if(this.__e){var u=c;c=void 0,f(n,t,r),c=u}e&&e.call(this,n,t,r)},r.shouldComponentUpdate=f}return o.__N||o.__}function h(n,u){var i=s(t++,3);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__H.__h.push(i))}function _(n,u){var i=s(t++,4);!c.__s&&C(i.__H,u)&&(i.__=n,i.u=u,r.__h.push(i))}function A(n){return o=5,T(function(){return{current:n}},[])}function F(n,t,r){o=6,_(function(){if(\"function\"==typeof n){var r=n(t());return function(){n(null),r&&\"function\"==typeof r&&r()}}if(n)return n.current=t(),function(){return n.current=null}},null==r?r:r.concat(n))}function T(n,r){var u=s(t++,7);return C(u.__H,r)&&(u.__=n(),u.__H=r,u.__h=n),u.__}function q(n,t){return o=8,T(function(){return n},t)}function x(n){var u=r.context[n.__c],i=s(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function P(n,t){c.useDebugValue&&c.useDebugValue(t?t(n):n)}function b(n){var u=s(t++,10),i=d();return u.__=n,r.componentDidCatch||(r.componentDidCatch=function(n,t){u.__&&u.__(n,t),i[1](n)}),[i[0],function(){i[1](void 0)}]}function g(){var n=s(t++,11);if(!n.__){for(var u=r.__v;null!==u&&!u.__m&&null!==u.__;)u=u.__;var i=u.__m||(u.__m=[0,0]);n.__=\"P\"+i[0]+\"-\"+i[1]++}return n.__}function j(){for(var n;n=f.shift();){var t=n.__H;if(n.__P&&t)try{t.__h.some(z),t.__h.some(B),t.__h=[]}catch(r){t.__h=[],c.__e(r,n.__v)}}}c.__b=function(n){r=null,e&&e(n)},c.__=function(n,t){n&&t.__k&&t.__k.__m&&(n.__m=t.__k.__m),p&&p(n,t)},c.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(i.__h.some(z),i.__h.some(B),i.__h=[],t=0)),u=r},c.diffed=function(n){v&&v(n);var t=n.__c;t&&t.__H&&(t.__H.__h.length&&(1!==f.push(t)&&i===c.requestAnimationFrame||((i=c.requestAnimationFrame)||w)(j)),t.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),u=r=null},c.__c=function(n,t){t.some(function(n){try{n.__h.some(z),n.__h=n.__h.filter(function(n){return!n.__||B(n)})}catch(r){t.some(function(n){n.__h&&(n.__h=[])}),t=[],c.__e(r,n.__v)}}),l&&l(n,t)},c.unmount=function(n){m&&m(n);var t,r=n.__c;r&&r.__H&&(r.__H.__.some(function(n){try{z(n)}catch(n){t=n}}),r.__H=void 0,t&&c.__e(t,r.__v))};var k=\"function\"==typeof requestAnimationFrame;function w(n){var t,r=function(){clearTimeout(u),k&&cancelAnimationFrame(t),setTimeout(n)},u=setTimeout(r,35);k&&(t=requestAnimationFrame(r))}function z(n){var t=r,u=n.__c;\"function\"==typeof u&&(n.__c=void 0,u()),r=t}function B(n){var t=r;n.__c=n.__(),r=t}function C(n,t){return!n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function D(n,t){return\"function\"==typeof t?t(n):t}export{q as useCallback,x as useContext,P as useDebugValue,h as useEffect,b as useErrorBoundary,g as useId,F as useImperativeHandle,_ as useLayoutEffect,T as useMemo,y as useReducer,A as useRef,d as useState};\n//# sourceMappingURL=hooks.module.js.map\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","/**\n * Based on Kendo UI Core expression code \n */\n'use strict'\n\nfunction Cache(maxSize) {\n this._maxSize = maxSize\n this.clear()\n}\nCache.prototype.clear = function () {\n this._size = 0\n this._values = Object.create(null)\n}\nCache.prototype.get = function (key) {\n return this._values[key]\n}\nCache.prototype.set = function (key, value) {\n this._size >= this._maxSize && this.clear()\n if (!(key in this._values)) this._size++\n\n return (this._values[key] = value)\n}\n\nvar SPLIT_REGEX = /[^.^\\]^[]+|(?=\\[\\]|\\.\\.)/g,\n DIGIT_REGEX = /^\\d+$/,\n LEAD_DIGIT_REGEX = /^\\d/,\n SPEC_CHAR_REGEX = /[~`!#$%\\^&*+=\\-\\[\\]\\\\';,/{}|\\\\\":<>\\?]/g,\n CLEAN_QUOTES_REGEX = /^\\s*(['\"]?)(.*?)(\\1)\\s*$/,\n MAX_CACHE_SIZE = 512\n\nvar pathCache = new Cache(MAX_CACHE_SIZE),\n setCache = new Cache(MAX_CACHE_SIZE),\n getCache = new Cache(MAX_CACHE_SIZE)\n\nvar config\n\nmodule.exports = {\n Cache: Cache,\n\n split: split,\n\n normalizePath: normalizePath,\n\n setter: function (path) {\n var parts = normalizePath(path)\n\n return (\n setCache.get(path) ||\n setCache.set(path, function setter(obj, value) {\n var index = 0\n var len = parts.length\n var data = obj\n\n while (index < len - 1) {\n var part = parts[index]\n if (\n part === '__proto__' ||\n part === 'constructor' ||\n part === 'prototype'\n ) {\n return obj\n }\n\n data = data[parts[index++]]\n }\n data[parts[index]] = value\n })\n )\n },\n\n getter: function (path, safe) {\n var parts = normalizePath(path)\n return (\n getCache.get(path) ||\n getCache.set(path, function getter(data) {\n var index = 0,\n len = parts.length\n while (index < len) {\n if (data != null || !safe) data = data[parts[index++]]\n else return\n }\n return data\n })\n )\n },\n\n join: function (segments) {\n return segments.reduce(function (path, part) {\n return (\n path +\n (isQuoted(part) || DIGIT_REGEX.test(part)\n ? '[' + part + ']'\n : (path ? '.' : '') + part)\n )\n }, '')\n },\n\n forEach: function (path, cb, thisArg) {\n forEach(Array.isArray(path) ? path : split(path), cb, thisArg)\n },\n}\n\nfunction normalizePath(path) {\n return (\n pathCache.get(path) ||\n pathCache.set(\n path,\n split(path).map(function (part) {\n return part.replace(CLEAN_QUOTES_REGEX, '$2')\n })\n )\n )\n}\n\nfunction split(path) {\n return path.match(SPLIT_REGEX) || ['']\n}\n\nfunction forEach(parts, iter, thisArg) {\n var len = parts.length,\n part,\n idx,\n isArray,\n isBracket\n\n for (idx = 0; idx < len; idx++) {\n part = parts[idx]\n\n if (part) {\n if (shouldBeQuoted(part)) {\n part = '\"' + part + '\"'\n }\n\n isBracket = isQuoted(part)\n isArray = !isBracket && /^\\d+$/.test(part)\n\n iter.call(thisArg, part, isBracket, isArray, idx, parts)\n }\n }\n}\n\nfunction isQuoted(str) {\n return (\n typeof str === 'string' && str && [\"'\", '\"'].indexOf(str.charAt(0)) !== -1\n )\n}\n\nfunction hasLeadingNumber(part) {\n return part.match(LEAD_DIGIT_REGEX) && !part.match(DIGIT_REGEX)\n}\n\nfunction hasSpecialChars(part) {\n return SPEC_CHAR_REGEX.test(part)\n}\n\nfunction shouldBeQuoted(part) {\n return !isQuoted(part) && (hasLeadingNumber(part) || hasSpecialChars(part))\n}\n","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar sizerStyle = {\n\tposition: 'absolute',\n\ttop: 0,\n\tleft: 0,\n\tvisibility: 'hidden',\n\theight: 0,\n\toverflow: 'scroll',\n\twhiteSpace: 'pre'\n};\n\nvar INPUT_PROPS_BLACKLIST = ['extraWidth', 'injectStyles', 'inputClassName', 'inputRef', 'inputStyle', 'minWidth', 'onAutosize', 'placeholderIsMinWidth'];\n\nvar cleanInputProps = function cleanInputProps(inputProps) {\n\tINPUT_PROPS_BLACKLIST.forEach(function (field) {\n\t\treturn delete inputProps[field];\n\t});\n\treturn inputProps;\n};\n\nvar copyStyles = function copyStyles(styles, node) {\n\tnode.style.fontSize = styles.fontSize;\n\tnode.style.fontFamily = styles.fontFamily;\n\tnode.style.fontWeight = styles.fontWeight;\n\tnode.style.fontStyle = styles.fontStyle;\n\tnode.style.letterSpacing = styles.letterSpacing;\n\tnode.style.textTransform = styles.textTransform;\n};\n\nvar isIE = typeof window !== 'undefined' && window.navigator ? /MSIE |Trident\\/|Edge\\//.test(window.navigator.userAgent) : false;\n\nvar generateId = function generateId() {\n\t// we only need an auto-generated ID for stylesheet injection, which is only\n\t// used for IE. so if the browser is not IE, this should return undefined.\n\treturn isIE ? '_' + Math.random().toString(36).substr(2, 12) : undefined;\n};\n\nvar AutosizeInput = function (_Component) {\n\t_inherits(AutosizeInput, _Component);\n\n\t_createClass(AutosizeInput, null, [{\n\t\tkey: 'getDerivedStateFromProps',\n\t\tvalue: function getDerivedStateFromProps(props, state) {\n\t\t\tvar id = props.id;\n\n\t\t\treturn id !== state.prevId ? { inputId: id || generateId(), prevId: id } : null;\n\t\t}\n\t}]);\n\n\tfunction AutosizeInput(props) {\n\t\t_classCallCheck(this, AutosizeInput);\n\n\t\tvar _this = _possibleConstructorReturn(this, (AutosizeInput.__proto__ || Object.getPrototypeOf(AutosizeInput)).call(this, props));\n\n\t\t_this.inputRef = function (el) {\n\t\t\t_this.input = el;\n\t\t\tif (typeof _this.props.inputRef === 'function') {\n\t\t\t\t_this.props.inputRef(el);\n\t\t\t}\n\t\t};\n\n\t\t_this.placeHolderSizerRef = function (el) {\n\t\t\t_this.placeHolderSizer = el;\n\t\t};\n\n\t\t_this.sizerRef = function (el) {\n\t\t\t_this.sizer = el;\n\t\t};\n\n\t\t_this.state = {\n\t\t\tinputWidth: props.minWidth,\n\t\t\tinputId: props.id || generateId(),\n\t\t\tprevId: props.id\n\t\t};\n\t\treturn _this;\n\t}\n\n\t_createClass(AutosizeInput, [{\n\t\tkey: 'componentDidMount',\n\t\tvalue: function componentDidMount() {\n\t\t\tthis.mounted = true;\n\t\t\tthis.copyInputStyles();\n\t\t\tthis.updateInputWidth();\n\t\t}\n\t}, {\n\t\tkey: 'componentDidUpdate',\n\t\tvalue: function componentDidUpdate(prevProps, prevState) {\n\t\t\tif (prevState.inputWidth !== this.state.inputWidth) {\n\t\t\t\tif (typeof this.props.onAutosize === 'function') {\n\t\t\t\t\tthis.props.onAutosize(this.state.inputWidth);\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.updateInputWidth();\n\t\t}\n\t}, {\n\t\tkey: 'componentWillUnmount',\n\t\tvalue: function componentWillUnmount() {\n\t\t\tthis.mounted = false;\n\t\t}\n\t}, {\n\t\tkey: 'copyInputStyles',\n\t\tvalue: function copyInputStyles() {\n\t\t\tif (!this.mounted || !window.getComputedStyle) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar inputStyles = this.input && window.getComputedStyle(this.input);\n\t\t\tif (!inputStyles) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcopyStyles(inputStyles, this.sizer);\n\t\t\tif (this.placeHolderSizer) {\n\t\t\t\tcopyStyles(inputStyles, this.placeHolderSizer);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'updateInputWidth',\n\t\tvalue: function updateInputWidth() {\n\t\t\tif (!this.mounted || !this.sizer || typeof this.sizer.scrollWidth === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar newInputWidth = void 0;\n\t\t\tif (this.props.placeholder && (!this.props.value || this.props.value && this.props.placeholderIsMinWidth)) {\n\t\t\t\tnewInputWidth = Math.max(this.sizer.scrollWidth, this.placeHolderSizer.scrollWidth) + 2;\n\t\t\t} else {\n\t\t\t\tnewInputWidth = this.sizer.scrollWidth + 2;\n\t\t\t}\n\t\t\t// add extraWidth to the detected width. for number types, this defaults to 16 to allow for the stepper UI\n\t\t\tvar extraWidth = this.props.type === 'number' && this.props.extraWidth === undefined ? 16 : parseInt(this.props.extraWidth) || 0;\n\t\t\tnewInputWidth += extraWidth;\n\t\t\tif (newInputWidth < this.props.minWidth) {\n\t\t\t\tnewInputWidth = this.props.minWidth;\n\t\t\t}\n\t\t\tif (newInputWidth !== this.state.inputWidth) {\n\t\t\t\tthis.setState({\n\t\t\t\t\tinputWidth: newInputWidth\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'getInput',\n\t\tvalue: function getInput() {\n\t\t\treturn this.input;\n\t\t}\n\t}, {\n\t\tkey: 'focus',\n\t\tvalue: function focus() {\n\t\t\tthis.input.focus();\n\t\t}\n\t}, {\n\t\tkey: 'blur',\n\t\tvalue: function blur() {\n\t\t\tthis.input.blur();\n\t\t}\n\t}, {\n\t\tkey: 'select',\n\t\tvalue: function select() {\n\t\t\tthis.input.select();\n\t\t}\n\t}, {\n\t\tkey: 'renderStyles',\n\t\tvalue: function renderStyles() {\n\t\t\t// this method injects styles to hide IE's clear indicator, which messes\n\t\t\t// with input size detection. the stylesheet is only injected when the\n\t\t\t// browser is IE, and can also be disabled by the `injectStyles` prop.\n\t\t\tvar injectStyles = this.props.injectStyles;\n\n\t\t\treturn isIE && injectStyles ? _react2.default.createElement('style', { dangerouslySetInnerHTML: {\n\t\t\t\t\t__html: 'input#' + this.state.inputId + '::-ms-clear {display: none;}'\n\t\t\t\t} }) : null;\n\t\t}\n\t}, {\n\t\tkey: 'render',\n\t\tvalue: function render() {\n\t\t\tvar sizerValue = [this.props.defaultValue, this.props.value, ''].reduce(function (previousValue, currentValue) {\n\t\t\t\tif (previousValue !== null && previousValue !== undefined) {\n\t\t\t\t\treturn previousValue;\n\t\t\t\t}\n\t\t\t\treturn currentValue;\n\t\t\t});\n\n\t\t\tvar wrapperStyle = _extends({}, this.props.style);\n\t\t\tif (!wrapperStyle.display) wrapperStyle.display = 'inline-block';\n\n\t\t\tvar inputStyle = _extends({\n\t\t\t\tboxSizing: 'content-box',\n\t\t\t\twidth: this.state.inputWidth + 'px'\n\t\t\t}, this.props.inputStyle);\n\n\t\t\tvar inputProps = _objectWithoutProperties(this.props, []);\n\n\t\t\tcleanInputProps(inputProps);\n\t\t\tinputProps.className = this.props.inputClassName;\n\t\t\tinputProps.id = this.state.inputId;\n\t\t\tinputProps.style = inputStyle;\n\n\t\t\treturn _react2.default.createElement(\n\t\t\t\t'div',\n\t\t\t\t{ className: this.props.className, style: wrapperStyle },\n\t\t\t\tthis.renderStyles(),\n\t\t\t\t_react2.default.createElement('input', _extends({}, inputProps, { ref: this.inputRef })),\n\t\t\t\t_react2.default.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ ref: this.sizerRef, style: sizerStyle },\n\t\t\t\t\tsizerValue\n\t\t\t\t),\n\t\t\t\tthis.props.placeholder ? _react2.default.createElement(\n\t\t\t\t\t'div',\n\t\t\t\t\t{ ref: this.placeHolderSizerRef, style: sizerStyle },\n\t\t\t\t\tthis.props.placeholder\n\t\t\t\t) : null\n\t\t\t);\n\t\t}\n\t}]);\n\n\treturn AutosizeInput;\n}(_react.Component);\n\nAutosizeInput.propTypes = {\n\tclassName: _propTypes2.default.string, // className for the outer element\n\tdefaultValue: _propTypes2.default.any, // default field value\n\textraWidth: _propTypes2.default.oneOfType([// additional width for input element\n\t_propTypes2.default.number, _propTypes2.default.string]),\n\tid: _propTypes2.default.string, // id to use for the input, can be set for consistent snapshots\n\tinjectStyles: _propTypes2.default.bool, // inject the custom stylesheet to hide clear UI, defaults to true\n\tinputClassName: _propTypes2.default.string, // className for the input element\n\tinputRef: _propTypes2.default.func, // ref callback for the input element\n\tinputStyle: _propTypes2.default.object, // css styles for the input element\n\tminWidth: _propTypes2.default.oneOfType([// minimum width for input element\n\t_propTypes2.default.number, _propTypes2.default.string]),\n\tonAutosize: _propTypes2.default.func, // onAutosize handler: function(newWidth) {}\n\tonChange: _propTypes2.default.func, // onChange handler: function(event) {}\n\tplaceholder: _propTypes2.default.string, // placeholder text\n\tplaceholderIsMinWidth: _propTypes2.default.bool, // don't collapse size to less than the placeholder\n\tstyle: _propTypes2.default.object, // css styles for the outer element\n\tvalue: _propTypes2.default.any // field value\n};\nAutosizeInput.defaultProps = {\n\tminWidth: 1,\n\tinjectStyles: true\n};\n\nexports.default = AutosizeInput;","/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","/**\n * Module dependencies\n */\nvar balanced = require(\"balanced-match\")\nvar reduceFunctionCall = require(\"reduce-function-call\")\nvar mexp = require(\"math-expression-evaluator\")\n\n/**\n * Constantes\n */\nvar MAX_STACK = 100 // should be enough for a single calc()...\nvar NESTED_CALC_RE = /(\\+|\\-|\\*|\\\\|[^a-z]|)(\\s*)(\\()/g\n\n/**\n * Global variables\n */\nvar stack\n\n/**\n * Expose reduceCSSCalc plugin\n *\n * @type {Function}\n */\nmodule.exports = reduceCSSCalc\n\n/**\n * Reduce CSS calc() in a string, whenever it's possible\n *\n * @param {String} value css input\n */\nfunction reduceCSSCalc(value, decimalPrecision) {\n stack = 0\n decimalPrecision = Math.pow(10, decimalPrecision === undefined ? 5 : decimalPrecision)\n\n // Allow calc() on multiple lines\n value = value.replace(/\\n+/g, \" \")\n\n /**\n * Evaluates an expression\n *\n * @param {String} expression\n * @returns {String}\n */\n function evaluateExpression (expression, functionIdentifier, call) {\n if (stack++ > MAX_STACK) {\n stack = 0\n throw new Error(\"Call stack overflow for \" + call)\n }\n\n if (expression === \"\") {\n throw new Error(functionIdentifier + \"(): '\" + call + \"' must contain a non-whitespace string\")\n }\n\n expression = evaluateNestedExpression(expression, call)\n\n var units = getUnitsInExpression(expression)\n\n // If the expression contains multiple units or CSS variables,\n // then let the expression be (i.e. browser calc())\n if (units.length > 1 || expression.indexOf(\"var(\") > -1) {\n return functionIdentifier + \"(\" + expression + \")\"\n }\n\n var unit = units[0] || \"\"\n\n if (unit === \"%\") {\n // Convert percentages to numbers, to handle expressions like: 50% * 50% (will become: 25%):\n // console.log(expression)\n expression = expression.replace(/\\b[0-9\\.]+%/g, function(percent) {\n return parseFloat(percent.slice(0, -1)) * 0.01\n })\n }\n\n // Remove units in expression:\n var toEvaluate = expression.replace(new RegExp(unit, \"gi\"), \"\")\n var result\n\n try {\n result = mexp.eval(toEvaluate)\n }\n catch (e) {\n return functionIdentifier + \"(\" + expression + \")\"\n }\n\n // Transform back to a percentage result:\n if (unit === \"%\") {\n result *= 100\n }\n\n // adjust rounding shit\n // (0.1 * 0.2 === 0.020000000000000004)\n if (functionIdentifier.length || unit === \"%\") {\n result = Math.round(result * decimalPrecision) / decimalPrecision\n }\n\n // Add unit\n result += unit\n\n return result\n }\n\n /**\n * Evaluates nested expressions\n *\n * @param {String} expression\n * @returns {String}\n */\n function evaluateNestedExpression(expression, call) {\n // Remove the calc part from nested expressions to ensure\n // better browser compatibility\n expression = expression.replace(/((?:\\-[a-z]+\\-)?calc)/g, \"\")\n var evaluatedPart = \"\"\n var nonEvaluatedPart = expression\n var matches\n while ((matches = NESTED_CALC_RE.exec(nonEvaluatedPart))) {\n if (matches[0].index > 0) {\n evaluatedPart += nonEvaluatedPart.substring(0, matches[0].index)\n }\n\n var balancedExpr = balanced(\"(\", \")\", nonEvaluatedPart.substring([0].index))\n if (balancedExpr.body === \"\") {\n throw new Error(\"'\" + expression + \"' must contain a non-whitespace string\")\n }\n\n var evaluated = evaluateExpression(balancedExpr.body, \"\", call)\n\n evaluatedPart += balancedExpr.pre + evaluated\n nonEvaluatedPart = balancedExpr.post\n }\n\n return evaluatedPart + nonEvaluatedPart\n }\n\n return reduceFunctionCall(value, /((?:\\-[a-z]+\\-)?calc)\\(/, evaluateExpression)\n}\n\n/**\n * Checks what units are used in an expression\n *\n * @param {String} expression\n * @returns {Array}\n */\n\nfunction getUnitsInExpression(expression) {\n var uniqueUnits = []\n var uniqueLowerCaseUnits = []\n var unitRegEx = /[\\.0-9]([%a-z]+)/gi\n var matches = unitRegEx.exec(expression)\n\n while (matches) {\n if (!matches || !matches[1]) {\n continue\n }\n\n if (uniqueLowerCaseUnits.indexOf(matches[1].toLowerCase()) === -1) {\n uniqueUnits.push(matches[1])\n uniqueLowerCaseUnits.push(matches[1].toLowerCase())\n }\n\n matches = unitRegEx.exec(expression)\n }\n\n return uniqueUnits\n}\n","module.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","/*\n * Module dependencies\n */\nvar balanced = require(\"balanced-match\")\n\n/**\n * Expose `reduceFunctionCall`\n *\n * @type {Function}\n */\nmodule.exports = reduceFunctionCall\n\n/**\n * Walkthrough all expressions, evaluate them and insert them into the declaration\n *\n * @param {Array} expressions\n * @param {Object} declaration\n */\n\nfunction reduceFunctionCall(string, functionRE, callback) {\n var call = string\n return getFunctionCalls(string, functionRE).reduce(function(string, obj) {\n return string.replace(obj.functionIdentifier + \"(\" + obj.matches.body + \")\", evalFunctionCall(obj.matches.body, obj.functionIdentifier, callback, call, functionRE))\n }, string)\n}\n\n/**\n * Parses expressions in a value\n *\n * @param {String} value\n * @returns {Array}\n * @api private\n */\n\nfunction getFunctionCalls(call, functionRE) {\n var expressions = []\n\n var fnRE = typeof functionRE === \"string\" ? new RegExp(\"\\\\b(\" + functionRE + \")\\\\(\") : functionRE\n do {\n var searchMatch = fnRE.exec(call)\n if (!searchMatch) {\n return expressions\n }\n if (searchMatch[1] === undefined) {\n throw new Error(\"Missing the first couple of parenthesis to get the function identifier in \" + functionRE)\n }\n var fn = searchMatch[1]\n var startIndex = searchMatch.index\n var matches = balanced(\"(\", \")\", call.substring(startIndex))\n\n if (!matches || matches.start !== searchMatch[0].length - 1) {\n throw new SyntaxError(fn + \"(): missing closing ')' in the value '\" + call + \"'\")\n }\n\n expressions.push({matches: matches, functionIdentifier: fn})\n call = matches.post\n }\n while (fnRE.test(call))\n\n return expressions\n}\n\n/**\n * Evaluates an expression\n *\n * @param {String} expression\n * @returns {String}\n * @api private\n */\n\nfunction evalFunctionCall (string, functionIdentifier, callback, call, functionRE) {\n // allow recursivity\n return callback(reduceFunctionCall(string, functionRE, callback), functionIdentifier, call)\n}\n","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","import * as React from 'react';\nimport { useLayoutEffect, useEffect, useRef } from 'react';\nimport { stopEvent, getDocument, isMouseLikePointerType, contains, activeElement, isSafari, isTypeableCombobox, isVirtualClick, isVirtualPointerEvent, getTarget, getPlatform, isTypeableElement, isReactEvent, isRootElement, isEventTargetWithin, isMac, getUserAgent } from '@floating-ui/react/utils';\nimport { floor, evaluate, max, min, round } from '@floating-ui/utils';\nimport { getComputedStyle, isElement, getNodeName, isHTMLElement, getWindow, isLastTraversableNode, getParentNode, isWebKit } from '@floating-ui/utils/dom';\nimport { tabbable, isTabbable } from 'tabbable';\nimport * as ReactDOM from 'react-dom';\nimport { getOverflowAncestors, useFloating as useFloating$1, offset, detectOverflow } from '@floating-ui/react-dom';\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size } from '@floating-ui/react-dom';\n\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n * @see https://floating-ui.com/docs/react-utils#usemergerefs\n */\nfunction useMergeRefs(refs) {\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return value => {\n refs.forEach(ref => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}\n\n// https://github.com/mui/material-ui/issues/41190#issuecomment-2040873379\nconst SafeReact = {\n ...React\n};\n\nconst useInsertionEffect = SafeReact.useInsertionEffect;\nconst useSafeInsertionEffect = useInsertionEffect || (fn => fn());\nfunction useEffectEvent(callback) {\n const ref = React.useRef(() => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error('Cannot call an event handler while rendering.');\n }\n });\n useSafeInsertionEffect(() => {\n ref.current = callback;\n });\n return React.useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return ref.current == null ? void 0 : ref.current(...args);\n }, []);\n}\n\nconst ARROW_UP = 'ArrowUp';\nconst ARROW_DOWN = 'ArrowDown';\nconst ARROW_LEFT = 'ArrowLeft';\nconst ARROW_RIGHT = 'ArrowRight';\nfunction isDifferentRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\nfunction isIndexOutOfBounds(listRef, index) {\n return index < 0 || index >= listRef.current.length;\n}\nfunction getMinIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n disabledIndices\n });\n}\nfunction getMaxIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\nfunction findNonDisabledIndex(listRef, _temp) {\n let {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n } = _temp === void 0 ? {} : _temp;\n const list = listRef.current;\n let index = startingIndex;\n do {\n index += decrement ? -amount : amount;\n } while (index >= 0 && index <= list.length - 1 && isDisabled(list, index, disabledIndices));\n return index;\n}\nfunction getGridNavigatedIndex(elementsRef, _ref) {\n let {\n event,\n orientation,\n loop,\n rtl,\n cols,\n disabledIndices,\n minIndex,\n maxIndex,\n prevIndex,\n stopEvent: stop = false\n } = _ref;\n let nextIndex = prevIndex;\n if (event.key === ARROW_UP) {\n stop && stopEvent(event);\n if (prevIndex === -1) {\n nextIndex = maxIndex;\n } else {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: nextIndex,\n amount: cols,\n decrement: true,\n disabledIndices\n });\n if (loop && (prevIndex - cols < minIndex || nextIndex < 0)) {\n const col = prevIndex % cols;\n const maxCol = maxIndex % cols;\n const offset = maxIndex - (maxCol - col);\n if (maxCol === col) {\n nextIndex = maxIndex;\n } else {\n nextIndex = maxCol > col ? offset : offset - cols;\n }\n }\n }\n if (isIndexOutOfBounds(elementsRef, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === ARROW_DOWN) {\n stop && stopEvent(event);\n if (prevIndex === -1) {\n nextIndex = minIndex;\n } else {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex,\n amount: cols,\n disabledIndices\n });\n if (loop && prevIndex + cols > maxIndex) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex % cols - cols,\n amount: cols,\n disabledIndices\n });\n }\n }\n if (isIndexOutOfBounds(elementsRef, nextIndex)) {\n nextIndex = prevIndex;\n }\n }\n\n // Remains on the same row/column.\n if (orientation === 'both') {\n const prevRow = floor(prevIndex / cols);\n if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {\n stop && stopEvent(event);\n if (prevIndex % cols !== cols - 1) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex,\n disabledIndices\n });\n if (loop && isDifferentRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n } else if (loop) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n if (isDifferentRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {\n stop && stopEvent(event);\n if (prevIndex % cols !== 0) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex,\n decrement: true,\n disabledIndices\n });\n if (loop && isDifferentRow(nextIndex, cols, prevRow)) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n } else if (loop) {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n if (isDifferentRow(nextIndex, cols, prevRow)) {\n nextIndex = prevIndex;\n }\n }\n const lastRow = floor(maxIndex / cols) === prevRow;\n if (isIndexOutOfBounds(elementsRef, nextIndex)) {\n if (loop && lastRow) {\n nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledIndex(elementsRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n } else {\n nextIndex = prevIndex;\n }\n }\n }\n return nextIndex;\n}\n\n/** For each cell index, gets the item index that occupies that cell */\nfunction buildCellMap(sizes, cols, dense) {\n const cellMap = [];\n let startIndex = 0;\n sizes.forEach((_ref2, index) => {\n let {\n width,\n height\n } = _ref2;\n if (width > cols) {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error(\"[Floating UI]: Invalid grid - item width at index \" + index + \" is greater than grid columns\");\n }\n }\n let itemPlaced = false;\n if (dense) {\n startIndex = 0;\n }\n while (!itemPlaced) {\n const targetCells = [];\n for (let i = 0; i < width; i++) {\n for (let j = 0; j < height; j++) {\n targetCells.push(startIndex + i + j * cols);\n }\n }\n if (startIndex % cols + width <= cols && targetCells.every(cell => cellMap[cell] == null)) {\n targetCells.forEach(cell => {\n cellMap[cell] = index;\n });\n itemPlaced = true;\n } else {\n startIndex++;\n }\n }\n });\n\n // convert into a non-sparse array\n return [...cellMap];\n}\n\n/** Gets cell index of an item's corner or -1 when index is -1. */\nfunction getCellIndexOfCorner(index, sizes, cellMap, cols, corner) {\n if (index === -1) return -1;\n const firstCellIndex = cellMap.indexOf(index);\n const sizeItem = sizes[index];\n switch (corner) {\n case 'tl':\n return firstCellIndex;\n case 'tr':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + sizeItem.width - 1;\n case 'bl':\n if (!sizeItem) {\n return firstCellIndex;\n }\n return firstCellIndex + (sizeItem.height - 1) * cols;\n case 'br':\n return cellMap.lastIndexOf(index);\n }\n}\n\n/** Gets all cell indices that correspond to the specified indices */\nfunction getCellIndices(indices, cellMap) {\n return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);\n}\nfunction isDisabled(list, index, disabledIndices) {\n if (disabledIndices) {\n return disabledIndices.includes(index);\n }\n const element = list[index];\n return element == null || element.hasAttribute('disabled') || element.getAttribute('aria-disabled') === 'true';\n}\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\nfunction sortByDocumentPosition(a, b) {\n const position = a.compareDocumentPosition(b);\n if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return -1;\n }\n if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {\n return 1;\n }\n return 0;\n}\nfunction areMapsEqual(map1, map2) {\n if (map1.size !== map2.size) {\n return false;\n }\n for (const [key, value] of map1.entries()) {\n if (value !== map2.get(key)) {\n return false;\n }\n }\n return true;\n}\nconst FloatingListContext = /*#__PURE__*/React.createContext({\n register: () => {},\n unregister: () => {},\n map: /*#__PURE__*/new Map(),\n elementsRef: {\n current: []\n }\n});\n/**\n * Provides context for a list of items within the floating element.\n * @see https://floating-ui.com/docs/FloatingList\n */\nfunction FloatingList(props) {\n const {\n children,\n elementsRef,\n labelsRef\n } = props;\n const [map, setMap] = React.useState(() => new Map());\n const register = React.useCallback(node => {\n setMap(prevMap => new Map(prevMap).set(node, null));\n }, []);\n const unregister = React.useCallback(node => {\n setMap(prevMap => {\n const map = new Map(prevMap);\n map.delete(node);\n return map;\n });\n }, []);\n index(() => {\n const newMap = new Map(map);\n const nodes = Array.from(newMap.keys()).sort(sortByDocumentPosition);\n nodes.forEach((node, index) => {\n newMap.set(node, index);\n });\n if (!areMapsEqual(map, newMap)) {\n setMap(newMap);\n }\n }, [map]);\n return /*#__PURE__*/React.createElement(FloatingListContext.Provider, {\n value: React.useMemo(() => ({\n register,\n unregister,\n map,\n elementsRef,\n labelsRef\n }), [register, unregister, map, elementsRef, labelsRef])\n }, children);\n}\n/**\n * Used to register a list item and its index (DOM position) in the\n * `FloatingList`.\n * @see https://floating-ui.com/docs/FloatingList#uselistitem\n */\nfunction useListItem(props) {\n if (props === void 0) {\n props = {};\n }\n const {\n label\n } = props;\n const {\n register,\n unregister,\n map,\n elementsRef,\n labelsRef\n } = React.useContext(FloatingListContext);\n const [index$1, setIndex] = React.useState(null);\n const componentRef = React.useRef(null);\n const ref = React.useCallback(node => {\n componentRef.current = node;\n if (index$1 !== null) {\n elementsRef.current[index$1] = node;\n if (labelsRef) {\n var _node$textContent;\n const isLabelDefined = label !== undefined;\n labelsRef.current[index$1] = isLabelDefined ? label : (_node$textContent = node == null ? void 0 : node.textContent) != null ? _node$textContent : null;\n }\n }\n }, [index$1, elementsRef, labelsRef, label]);\n index(() => {\n const node = componentRef.current;\n if (node) {\n register(node);\n return () => {\n unregister(node);\n };\n }\n }, [register, unregister]);\n index(() => {\n const index = componentRef.current ? map.get(componentRef.current) : null;\n if (index != null) {\n setIndex(index);\n }\n }, [map]);\n return React.useMemo(() => ({\n ref,\n index: index$1 == null ? -1 : index$1\n }), [index$1, ref]);\n}\n\nfunction renderJsx(render, computedProps) {\n if (typeof render === 'function') {\n return render(computedProps);\n }\n if (render) {\n return /*#__PURE__*/React.cloneElement(render, computedProps);\n }\n return /*#__PURE__*/React.createElement(\"div\", computedProps);\n}\nconst CompositeContext = /*#__PURE__*/React.createContext({\n activeIndex: 0,\n onNavigate: () => {}\n});\nconst horizontalKeys = [ARROW_LEFT, ARROW_RIGHT];\nconst verticalKeys = [ARROW_UP, ARROW_DOWN];\nconst allKeys = [...horizontalKeys, ...verticalKeys];\n\n/**\n * Creates a single tab stop whose items are navigated by arrow keys, which\n * provides list navigation outside of floating element contexts.\n *\n * This is useful to enable navigation of a list of items that aren’t part of a\n * floating element. A menubar is an example of a composite, with each reference\n * element being an item.\n * @see https://floating-ui.com/docs/Composite\n */\nconst Composite = /*#__PURE__*/React.forwardRef(function Composite(props, forwardedRef) {\n const {\n render,\n orientation = 'both',\n loop = true,\n rtl = false,\n cols = 1,\n disabledIndices,\n activeIndex: externalActiveIndex,\n onNavigate: externalSetActiveIndex,\n itemSizes,\n dense = false,\n ...domProps\n } = props;\n const [internalActiveIndex, internalSetActiveIndex] = React.useState(0);\n const activeIndex = externalActiveIndex != null ? externalActiveIndex : internalActiveIndex;\n const onNavigate = useEffectEvent(externalSetActiveIndex != null ? externalSetActiveIndex : internalSetActiveIndex);\n const elementsRef = React.useRef([]);\n const renderElementProps = render && typeof render !== 'function' ? render.props : {};\n const contextValue = React.useMemo(() => ({\n activeIndex,\n onNavigate\n }), [activeIndex, onNavigate]);\n const isGrid = cols > 1;\n function handleKeyDown(event) {\n if (!allKeys.includes(event.key)) return;\n let nextIndex = activeIndex;\n const minIndex = getMinIndex(elementsRef, disabledIndices);\n const maxIndex = getMaxIndex(elementsRef, disabledIndices);\n const horizontalEndKey = rtl ? ARROW_LEFT : ARROW_RIGHT;\n const horizontalStartKey = rtl ? ARROW_RIGHT : ARROW_LEFT;\n if (isGrid) {\n const sizes = itemSizes || Array.from({\n length: elementsRef.current.length\n }, () => ({\n width: 1,\n height: 1\n }));\n // To calculate movements on the grid, we use hypothetical cell indices\n // as if every item was 1x1, then convert back to real indices.\n const cellMap = buildCellMap(sizes, cols, dense);\n const minGridIndex = cellMap.findIndex(index => index != null && !isDisabled(elementsRef.current, index, disabledIndices));\n // last enabled index\n const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isDisabled(elementsRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);\n const maybeNextIndex = cellMap[getGridNavigatedIndex({\n current: cellMap.map(itemIndex => itemIndex ? elementsRef.current[itemIndex] : null)\n }, {\n event,\n orientation,\n loop,\n rtl,\n cols,\n // treat undefined (empty grid spaces) as disabled indices so we\n // don't end up in them\n disabledIndices: getCellIndices([...(disabledIndices || elementsRef.current.map((_, index) => isDisabled(elementsRef.current, index) ? index : undefined)), undefined], cellMap),\n minIndex: minGridIndex,\n maxIndex: maxGridIndex,\n prevIndex: getCellIndexOfCorner(activeIndex > maxIndex ? minIndex : activeIndex, sizes, cellMap, cols,\n // use a corner matching the edge closest to the direction we're\n // moving in so we don't end up in the same item. Prefer\n // top/left over bottom/right.\n event.key === ARROW_DOWN ? 'bl' : event.key === horizontalEndKey ? 'tr' : 'tl')\n })];\n if (maybeNextIndex != null) {\n nextIndex = maybeNextIndex;\n }\n }\n const toEndKeys = {\n horizontal: [horizontalEndKey],\n vertical: [ARROW_DOWN],\n both: [horizontalEndKey, ARROW_DOWN]\n }[orientation];\n const toStartKeys = {\n horizontal: [horizontalStartKey],\n vertical: [ARROW_UP],\n both: [horizontalStartKey, ARROW_UP]\n }[orientation];\n const preventedKeys = isGrid ? allKeys : {\n horizontal: horizontalKeys,\n vertical: verticalKeys,\n both: allKeys\n }[orientation];\n if (nextIndex === activeIndex && [...toEndKeys, ...toStartKeys].includes(event.key)) {\n if (loop && nextIndex === maxIndex && toEndKeys.includes(event.key)) {\n nextIndex = minIndex;\n } else if (loop && nextIndex === minIndex && toStartKeys.includes(event.key)) {\n nextIndex = maxIndex;\n } else {\n nextIndex = findNonDisabledIndex(elementsRef, {\n startingIndex: nextIndex,\n decrement: toStartKeys.includes(event.key),\n disabledIndices\n });\n }\n }\n if (nextIndex !== activeIndex && !isIndexOutOfBounds(elementsRef, nextIndex)) {\n var _elementsRef$current$;\n event.stopPropagation();\n if (preventedKeys.includes(event.key)) {\n event.preventDefault();\n }\n onNavigate(nextIndex);\n (_elementsRef$current$ = elementsRef.current[nextIndex]) == null || _elementsRef$current$.focus();\n }\n }\n const computedProps = {\n ...domProps,\n ...renderElementProps,\n ref: forwardedRef,\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n onKeyDown(e) {\n domProps.onKeyDown == null || domProps.onKeyDown(e);\n renderElementProps.onKeyDown == null || renderElementProps.onKeyDown(e);\n handleKeyDown(e);\n }\n };\n return /*#__PURE__*/React.createElement(CompositeContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(FloatingList, {\n elementsRef: elementsRef\n }, renderJsx(render, computedProps)));\n});\n/**\n * @see https://floating-ui.com/docs/Composite\n */\nconst CompositeItem = /*#__PURE__*/React.forwardRef(function CompositeItem(props, forwardedRef) {\n const {\n render,\n ...domProps\n } = props;\n const renderElementProps = render && typeof render !== 'function' ? render.props : {};\n const {\n activeIndex,\n onNavigate\n } = React.useContext(CompositeContext);\n const {\n ref,\n index\n } = useListItem();\n const mergedRef = useMergeRefs([ref, forwardedRef, renderElementProps.ref]);\n const isActive = activeIndex === index;\n const computedProps = {\n ...domProps,\n ...renderElementProps,\n ref: mergedRef,\n tabIndex: isActive ? 0 : -1,\n 'data-active': isActive ? '' : undefined,\n onFocus(e) {\n domProps.onFocus == null || domProps.onFocus(e);\n renderElementProps.onFocus == null || renderElementProps.onFocus(e);\n onNavigate(index);\n }\n };\n return renderJsx(render, computedProps);\n});\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nlet serverHandoffComplete = false;\nlet count = 0;\nconst genId = () => // Ensure the id is unique with multiple independent versions of Floating UI\n// on serverHandoffComplete ? genId() : undefined);\n index(() => {\n if (id == null) {\n setId(genId());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n React.useEffect(() => {\n serverHandoffComplete = true;\n }, []);\n return id;\n}\nconst useReactId = SafeReact.useId;\n\n/**\n * Uses React 18's built-in `useId()` when available, or falls back to a\n * slightly less performant (requiring a double render) implementation for\n * earlier React versions.\n * @see https://floating-ui.com/docs/react-utils#useid\n */\nconst useId = useReactId || useFloatingId;\n\nlet devMessageSet;\nif (process.env.NODE_ENV !== \"production\") {\n devMessageSet = /*#__PURE__*/new Set();\n}\nfunction warn() {\n var _devMessageSet;\n for (var _len = arguments.length, messages = new Array(_len), _key = 0; _key < _len; _key++) {\n messages[_key] = arguments[_key];\n }\n const message = \"Floating UI: \" + messages.join(' ');\n if (!((_devMessageSet = devMessageSet) != null && _devMessageSet.has(message))) {\n var _devMessageSet2;\n (_devMessageSet2 = devMessageSet) == null || _devMessageSet2.add(message);\n console.warn(message);\n }\n}\nfunction error() {\n var _devMessageSet3;\n for (var _len2 = arguments.length, messages = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n messages[_key2] = arguments[_key2];\n }\n const message = \"Floating UI: \" + messages.join(' ');\n if (!((_devMessageSet3 = devMessageSet) != null && _devMessageSet3.has(message))) {\n var _devMessageSet4;\n (_devMessageSet4 = devMessageSet) == null || _devMessageSet4.add(message);\n console.error(message);\n }\n}\n\n/**\n * Renders a pointing arrow triangle.\n * @see https://floating-ui.com/docs/FloatingArrow\n */\nconst FloatingArrow = /*#__PURE__*/React.forwardRef(function FloatingArrow(props, ref) {\n const {\n context: {\n placement,\n elements: {\n floating\n },\n middlewareData: {\n arrow,\n shift\n }\n },\n width = 14,\n height = 7,\n tipRadius = 0,\n strokeWidth = 0,\n staticOffset,\n stroke,\n d,\n style: {\n transform,\n ...restStyle\n } = {},\n ...rest\n } = props;\n if (process.env.NODE_ENV !== \"production\") {\n if (!ref) {\n warn('The `ref` prop is required for `FloatingArrow`.');\n }\n }\n const clipPathId = useId();\n const [isRTL, setIsRTL] = React.useState(false);\n\n // https://github.com/floating-ui/floating-ui/issues/2932\n index(() => {\n if (!floating) return;\n const isRTL = getComputedStyle(floating).direction === 'rtl';\n if (isRTL) {\n setIsRTL(true);\n }\n }, [floating]);\n if (!floating) {\n return null;\n }\n const [side, alignment] = placement.split('-');\n const isVerticalSide = side === 'top' || side === 'bottom';\n let computedStaticOffset = staticOffset;\n if (isVerticalSide && shift != null && shift.x || !isVerticalSide && shift != null && shift.y) {\n computedStaticOffset = null;\n }\n\n // Strokes must be double the border width, this ensures the stroke's width\n // works as you'd expect.\n const computedStrokeWidth = strokeWidth * 2;\n const halfStrokeWidth = computedStrokeWidth / 2;\n const svgX = width / 2 * (tipRadius / -8 + 1);\n const svgY = height / 2 * tipRadius / 4;\n const isCustomShape = !!d;\n const yOffsetProp = computedStaticOffset && alignment === 'end' ? 'bottom' : 'top';\n let xOffsetProp = computedStaticOffset && alignment === 'end' ? 'right' : 'left';\n if (computedStaticOffset && isRTL) {\n xOffsetProp = alignment === 'end' ? 'left' : 'right';\n }\n const arrowX = (arrow == null ? void 0 : arrow.x) != null ? computedStaticOffset || arrow.x : '';\n const arrowY = (arrow == null ? void 0 : arrow.y) != null ? computedStaticOffset || arrow.y : '';\n const dValue = d || 'M0,0' + (\" H\" + width) + (\" L\" + (width - svgX) + \",\" + (height - svgY)) + (\" Q\" + width / 2 + \",\" + height + \" \" + svgX + \",\" + (height - svgY)) + ' Z';\n const rotation = {\n top: isCustomShape ? 'rotate(180deg)' : '',\n left: isCustomShape ? 'rotate(90deg)' : 'rotate(-90deg)',\n bottom: isCustomShape ? '' : 'rotate(180deg)',\n right: isCustomShape ? 'rotate(-90deg)' : 'rotate(90deg)'\n }[side];\n return /*#__PURE__*/React.createElement(\"svg\", _extends({}, rest, {\n \"aria-hidden\": true,\n ref: ref,\n width: isCustomShape ? width : width + computedStrokeWidth,\n height: width,\n viewBox: \"0 0 \" + width + \" \" + (height > width ? height : width),\n style: {\n position: 'absolute',\n pointerEvents: 'none',\n [xOffsetProp]: arrowX,\n [yOffsetProp]: arrowY,\n [side]: isVerticalSide || isCustomShape ? '100%' : \"calc(100% - \" + computedStrokeWidth / 2 + \"px)\",\n transform: [rotation, transform].filter(t => !!t).join(' '),\n ...restStyle\n }\n }), computedStrokeWidth > 0 && /*#__PURE__*/React.createElement(\"path\", {\n clipPath: \"url(#\" + clipPathId + \")\",\n fill: \"none\",\n stroke: stroke\n // Account for the stroke on the fill path rendered below.\n ,\n strokeWidth: computedStrokeWidth + (d ? 0 : 1),\n d: dValue\n }), /*#__PURE__*/React.createElement(\"path\", {\n stroke: computedStrokeWidth && !d ? rest.fill : 'none',\n d: dValue\n }), /*#__PURE__*/React.createElement(\"clipPath\", {\n id: clipPathId\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: -halfStrokeWidth,\n y: halfStrokeWidth * (isCustomShape ? -1 : 1),\n width: width + computedStrokeWidth,\n height: width\n })));\n});\n\nfunction createPubSub() {\n const map = new Map();\n return {\n emit(event, data) {\n var _map$get;\n (_map$get = map.get(event)) == null || _map$get.forEach(handler => handler(data));\n },\n on(event, listener) {\n map.set(event, [...(map.get(event) || []), listener]);\n },\n off(event, listener) {\n var _map$get2;\n map.set(event, ((_map$get2 = map.get(event)) == null ? void 0 : _map$get2.filter(l => l !== listener)) || []);\n }\n };\n}\n\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the parent node id for nested floating elements, if available.\n * Returns `null` for top-level floating elements.\n */\nconst useFloatingParentNodeId = () => {\n var _React$useContext;\n return ((_React$useContext = React.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;\n};\n\n/**\n * Returns the nearest floating tree context, if available.\n */\nconst useFloatingTree = () => React.useContext(FloatingTreeContext);\n\n/**\n * Registers a node into the `FloatingTree`, returning its id.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nfunction useFloatingNodeId(customParentId) {\n const id = useId();\n const tree = useFloatingTree();\n const reactParentId = useFloatingParentNodeId();\n const parentId = customParentId || reactParentId;\n index(() => {\n const node = {\n id,\n parentId\n };\n tree == null || tree.addNode(node);\n return () => {\n tree == null || tree.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n}\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nfunction FloatingNode(props) {\n const {\n children,\n id\n } = props;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/React.createElement(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId])\n }, children);\n}\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM.\n * This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:\n * - The `bubbles` option in the `useDismiss()` Hook\n * - Nested virtual list navigation\n * - Nested floating elements that each open on hover\n * - Custom communication between parent and child floating elements\n * @see https://floating-ui.com/docs/FloatingTree\n */\nfunction FloatingTree(props) {\n const {\n children\n } = props;\n const nodesRef = React.useRef([]);\n const addNode = React.useCallback(node => {\n nodesRef.current = [...nodesRef.current, node];\n }, []);\n const removeNode = React.useCallback(node => {\n nodesRef.current = nodesRef.current.filter(n => n !== node);\n }, []);\n const events = React.useState(() => createPubSub())[0];\n return /*#__PURE__*/React.createElement(FloatingTreeContext.Provider, {\n value: React.useMemo(() => ({\n nodesRef,\n addNode,\n removeNode,\n events\n }), [addNode, removeNode, events])\n }, children);\n}\n\nfunction createAttribute(name) {\n return \"data-floating-ui-\" + name;\n}\n\nfunction useLatestRef(value) {\n const ref = useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\nconst safePolygonIdentifier = /*#__PURE__*/createAttribute('safe-polygon');\nfunction getDelay(value, prop, pointerType) {\n if (pointerType && !isMouseLikePointerType(pointerType)) {\n return 0;\n }\n if (typeof value === 'number') {\n return value;\n }\n return value == null ? void 0 : value[prop];\n}\n/**\n * Opens the floating element while hovering over the reference element, like\n * CSS `:hover`.\n * @see https://floating-ui.com/docs/useHover\n */\nfunction useHover(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n dataRef,\n events,\n elements\n } = context;\n const {\n enabled = true,\n delay = 0,\n handleClose = null,\n mouseOnly = false,\n restMs = 0,\n move = true\n } = props;\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n const handleCloseRef = useLatestRef(handleClose);\n const delayRef = useLatestRef(delay);\n const openRef = useLatestRef(open);\n const pointerTypeRef = React.useRef();\n const timeoutRef = React.useRef(-1);\n const handlerRef = React.useRef();\n const restTimeoutRef = React.useRef(-1);\n const blockMouseMoveRef = React.useRef(true);\n const performedPointerEventsMutationRef = React.useRef(false);\n const unbindMouseMoveRef = React.useRef(() => {});\n const restTimeoutPendingRef = React.useRef(false);\n const isHoverOpen = React.useCallback(() => {\n var _dataRef$current$open;\n const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;\n return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';\n }, [dataRef]);\n\n // When closing before opening, clear the delay timeouts to cancel it\n // from showing.\n React.useEffect(() => {\n if (!enabled) return;\n function onOpenChange(_ref) {\n let {\n open\n } = _ref;\n if (!open) {\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n blockMouseMoveRef.current = true;\n restTimeoutPendingRef.current = false;\n }\n }\n events.on('openchange', onOpenChange);\n return () => {\n events.off('openchange', onOpenChange);\n };\n }, [enabled, events]);\n React.useEffect(() => {\n if (!enabled) return;\n if (!handleCloseRef.current) return;\n if (!open) return;\n function onLeave(event) {\n if (isHoverOpen()) {\n onOpenChange(false, event, 'hover');\n }\n }\n const html = getDocument(elements.floating).documentElement;\n html.addEventListener('mouseleave', onLeave);\n return () => {\n html.removeEventListener('mouseleave', onLeave);\n };\n }, [elements.floating, open, onOpenChange, enabled, handleCloseRef, isHoverOpen]);\n const closeWithDelay = React.useCallback(function (event, runElseBranch, reason) {\n if (runElseBranch === void 0) {\n runElseBranch = true;\n }\n if (reason === void 0) {\n reason = 'hover';\n }\n const closeDelay = getDelay(delayRef.current, 'close', pointerTypeRef.current);\n if (closeDelay && !handlerRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => onOpenChange(false, event, reason), closeDelay);\n } else if (runElseBranch) {\n clearTimeout(timeoutRef.current);\n onOpenChange(false, event, reason);\n }\n }, [delayRef, onOpenChange]);\n const cleanupMouseMoveHandler = useEffectEvent(() => {\n unbindMouseMoveRef.current();\n handlerRef.current = undefined;\n });\n const clearPointerEvents = useEffectEvent(() => {\n if (performedPointerEventsMutationRef.current) {\n const body = getDocument(elements.floating).body;\n body.style.pointerEvents = '';\n body.removeAttribute(safePolygonIdentifier);\n performedPointerEventsMutationRef.current = false;\n }\n });\n const isClickLikeOpenEvent = useEffectEvent(() => {\n return dataRef.current.openEvent ? ['click', 'mousedown'].includes(dataRef.current.openEvent.type) : false;\n });\n\n // Registering the mouse events on the reference directly to bypass React's\n // delegation system. If the cursor was on a disabled element and then entered\n // the reference (no gap), `mouseenter` doesn't fire in the delegation system.\n React.useEffect(() => {\n if (!enabled) return;\n function onMouseEnter(event) {\n clearTimeout(timeoutRef.current);\n blockMouseMoveRef.current = false;\n if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current) || restMs > 0 && !getDelay(delayRef.current, 'open')) {\n return;\n }\n const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);\n if (openDelay) {\n timeoutRef.current = window.setTimeout(() => {\n if (!openRef.current) {\n onOpenChange(true, event, 'hover');\n }\n }, openDelay);\n } else if (!open) {\n onOpenChange(true, event, 'hover');\n }\n }\n function onMouseLeave(event) {\n if (isClickLikeOpenEvent()) return;\n unbindMouseMoveRef.current();\n const doc = getDocument(elements.floating);\n clearTimeout(restTimeoutRef.current);\n restTimeoutPendingRef.current = false;\n if (handleCloseRef.current && dataRef.current.floatingContext) {\n // Prevent clearing `onScrollMouseLeave` timeout.\n if (!open) {\n clearTimeout(timeoutRef.current);\n }\n handlerRef.current = handleCloseRef.current({\n ...dataRef.current.floatingContext,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n if (!isClickLikeOpenEvent()) {\n closeWithDelay(event, true, 'safe-polygon');\n }\n }\n });\n const handler = handlerRef.current;\n doc.addEventListener('mousemove', handler);\n unbindMouseMoveRef.current = () => {\n doc.removeEventListener('mousemove', handler);\n };\n return;\n }\n\n // Allow interactivity without `safePolygon` on touch devices. With a\n // pointer, a short close delay is an alternative, so it should work\n // consistently.\n const shouldClose = pointerTypeRef.current === 'touch' ? !contains(elements.floating, event.relatedTarget) : true;\n if (shouldClose) {\n closeWithDelay(event);\n }\n }\n\n // Ensure the floating element closes after scrolling even if the pointer\n // did not move.\n // https://github.com/floating-ui/floating-ui/discussions/1692\n function onScrollMouseLeave(event) {\n if (isClickLikeOpenEvent()) return;\n if (!dataRef.current.floatingContext) return;\n handleCloseRef.current == null || handleCloseRef.current({\n ...dataRef.current.floatingContext,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n if (!isClickLikeOpenEvent()) {\n closeWithDelay(event);\n }\n }\n })(event);\n }\n if (isElement(elements.domReference)) {\n var _elements$floating;\n const ref = elements.domReference;\n open && ref.addEventListener('mouseleave', onScrollMouseLeave);\n (_elements$floating = elements.floating) == null || _elements$floating.addEventListener('mouseleave', onScrollMouseLeave);\n move && ref.addEventListener('mousemove', onMouseEnter, {\n once: true\n });\n ref.addEventListener('mouseenter', onMouseEnter);\n ref.addEventListener('mouseleave', onMouseLeave);\n return () => {\n var _elements$floating2;\n open && ref.removeEventListener('mouseleave', onScrollMouseLeave);\n (_elements$floating2 = elements.floating) == null || _elements$floating2.removeEventListener('mouseleave', onScrollMouseLeave);\n move && ref.removeEventListener('mousemove', onMouseEnter);\n ref.removeEventListener('mouseenter', onMouseEnter);\n ref.removeEventListener('mouseleave', onMouseLeave);\n };\n }\n }, [elements, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, openRef, tree, delayRef, handleCloseRef, dataRef, isClickLikeOpenEvent]);\n\n // Block pointer-events of every element other than the reference and floating\n // while the floating element is open and has a `handleClose` handler. Also\n // handles nested floating elements.\n // https://github.com/floating-ui/floating-ui/issues/1722\n index(() => {\n var _handleCloseRef$curre;\n if (!enabled) return;\n if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && _handleCloseRef$curre.__options.blockPointerEvents && isHoverOpen()) {\n performedPointerEventsMutationRef.current = true;\n const floatingEl = elements.floating;\n if (isElement(elements.domReference) && floatingEl) {\n var _tree$nodesRef$curren;\n const body = getDocument(elements.floating).body;\n body.setAttribute(safePolygonIdentifier, '');\n const ref = elements.domReference;\n const parentFloating = tree == null || (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null || (_tree$nodesRef$curren = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren.elements.floating;\n if (parentFloating) {\n parentFloating.style.pointerEvents = '';\n }\n body.style.pointerEvents = 'none';\n ref.style.pointerEvents = 'auto';\n floatingEl.style.pointerEvents = 'auto';\n return () => {\n body.style.pointerEvents = '';\n ref.style.pointerEvents = '';\n floatingEl.style.pointerEvents = '';\n };\n }\n }\n }, [enabled, open, parentId, elements, tree, handleCloseRef, isHoverOpen]);\n index(() => {\n if (!open) {\n pointerTypeRef.current = undefined;\n restTimeoutPendingRef.current = false;\n cleanupMouseMoveHandler();\n clearPointerEvents();\n }\n }, [open, cleanupMouseMoveHandler, clearPointerEvents]);\n React.useEffect(() => {\n return () => {\n cleanupMouseMoveHandler();\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n clearPointerEvents();\n };\n }, [enabled, elements.domReference, cleanupMouseMoveHandler, clearPointerEvents]);\n const reference = React.useMemo(() => {\n function setPointerRef(event) {\n pointerTypeRef.current = event.pointerType;\n }\n return {\n onPointerDown: setPointerRef,\n onPointerEnter: setPointerRef,\n onMouseMove(event) {\n const {\n nativeEvent\n } = event;\n function handleMouseMove() {\n if (!blockMouseMoveRef.current && !openRef.current) {\n onOpenChange(true, nativeEvent, 'hover');\n }\n }\n if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current)) {\n return;\n }\n if (open || restMs === 0) {\n return;\n }\n\n // Ignore insignificant movements to account for tremors.\n if (restTimeoutPendingRef.current && event.movementX ** 2 + event.movementY ** 2 < 2) {\n return;\n }\n clearTimeout(restTimeoutRef.current);\n if (pointerTypeRef.current === 'touch') {\n handleMouseMove();\n } else {\n restTimeoutPendingRef.current = true;\n restTimeoutRef.current = window.setTimeout(handleMouseMove, restMs);\n }\n }\n };\n }, [mouseOnly, onOpenChange, open, openRef, restMs]);\n const floating = React.useMemo(() => ({\n onMouseEnter() {\n clearTimeout(timeoutRef.current);\n },\n onMouseLeave(event) {\n if (!isClickLikeOpenEvent()) {\n closeWithDelay(event.nativeEvent, false);\n }\n }\n }), [closeWithDelay, isClickLikeOpenEvent]);\n return React.useMemo(() => enabled ? {\n reference,\n floating\n } : {}, [enabled, reference, floating]);\n}\n\nconst NOOP = () => {};\nconst FloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n delay: 0,\n initialDelay: 0,\n timeoutMs: 0,\n currentId: null,\n setCurrentId: NOOP,\n setState: NOOP,\n isInstantPhase: false\n});\n\n/**\n * @deprecated\n * Use the return value of `useDelayGroup()` instead.\n */\nconst useDelayGroupContext = () => React.useContext(FloatingDelayGroupContext);\n/**\n * Provides context for a group of floating elements that should share a\n * `delay`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\nfunction FloatingDelayGroup(props) {\n const {\n children,\n delay,\n timeoutMs = 0\n } = props;\n const [state, setState] = React.useReducer((prev, next) => ({\n ...prev,\n ...next\n }), {\n delay,\n timeoutMs,\n initialDelay: delay,\n currentId: null,\n isInstantPhase: false\n });\n const initialCurrentIdRef = React.useRef(null);\n const setCurrentId = React.useCallback(currentId => {\n setState({\n currentId\n });\n }, []);\n index(() => {\n if (state.currentId) {\n if (initialCurrentIdRef.current === null) {\n initialCurrentIdRef.current = state.currentId;\n } else if (!state.isInstantPhase) {\n setState({\n isInstantPhase: true\n });\n }\n } else {\n if (state.isInstantPhase) {\n setState({\n isInstantPhase: false\n });\n }\n initialCurrentIdRef.current = null;\n }\n }, [state.currentId, state.isInstantPhase]);\n return /*#__PURE__*/React.createElement(FloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({\n ...state,\n setState,\n setCurrentId\n }), [state, setCurrentId])\n }, children);\n}\n/**\n * Enables grouping when called inside a component that's a child of a\n * `FloatingDelayGroup`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\nfunction useDelayGroup(context, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n open,\n onOpenChange,\n floatingId\n } = context;\n const {\n id: optionId,\n enabled = true\n } = options;\n const id = optionId != null ? optionId : floatingId;\n const groupContext = useDelayGroupContext();\n const {\n currentId,\n setCurrentId,\n initialDelay,\n setState,\n timeoutMs\n } = groupContext;\n index(() => {\n if (!enabled) return;\n if (!currentId) return;\n setState({\n delay: {\n open: 1,\n close: getDelay(initialDelay, 'close')\n }\n });\n if (currentId !== id) {\n onOpenChange(false);\n }\n }, [enabled, id, onOpenChange, setState, currentId, initialDelay]);\n index(() => {\n function unset() {\n onOpenChange(false);\n setState({\n delay: initialDelay,\n currentId: null\n });\n }\n if (!enabled) return;\n if (!currentId) return;\n if (!open && currentId === id) {\n if (timeoutMs) {\n const timeout = window.setTimeout(unset, timeoutMs);\n return () => {\n clearTimeout(timeout);\n };\n }\n unset();\n }\n }, [enabled, open, setState, currentId, id, onOpenChange, initialDelay, timeoutMs]);\n index(() => {\n if (!enabled) return;\n if (setCurrentId === NOOP || !open) return;\n setCurrentId(id);\n }, [enabled, open, setCurrentId, id]);\n return groupContext;\n}\n\nlet rafId = 0;\nfunction enqueueFocus(el, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n preventScroll = false,\n cancelPrevious = true,\n sync = false\n } = options;\n cancelPrevious && cancelAnimationFrame(rafId);\n const exec = () => el == null ? void 0 : el.focus({\n preventScroll\n });\n if (sync) {\n exec();\n } else {\n rafId = requestAnimationFrame(exec);\n }\n}\n\nfunction getAncestors(nodes, id) {\n var _nodes$find;\n let allAncestors = [];\n let currentParentId = (_nodes$find = nodes.find(node => node.id === id)) == null ? void 0 : _nodes$find.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode == null ? void 0 : currentNode.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}\n\nfunction getChildren(nodes, id) {\n let allChildren = nodes.filter(node => {\n var _node$context;\n return node.parentId === id && ((_node$context = node.context) == null ? void 0 : _node$context.open);\n });\n let currentChildren = allChildren;\n while (currentChildren.length) {\n currentChildren = nodes.filter(node => {\n var _currentChildren;\n return (_currentChildren = currentChildren) == null ? void 0 : _currentChildren.some(n => {\n var _node$context2;\n return node.parentId === n.id && ((_node$context2 = node.context) == null ? void 0 : _node$context2.open);\n });\n });\n allChildren = allChildren.concat(currentChildren);\n }\n return allChildren;\n}\nfunction getDeepestNode(nodes, id) {\n let deepestNodeId;\n let maxDepth = -1;\n function findDeepest(nodeId, depth) {\n if (depth > maxDepth) {\n deepestNodeId = nodeId;\n maxDepth = depth;\n }\n const children = getChildren(nodes, nodeId);\n children.forEach(child => {\n findDeepest(child.id, depth + 1);\n });\n }\n findDeepest(id, 0);\n return nodes.find(node => node.id === deepestNodeId);\n}\n\n// Modified to add conditional `aria-hidden` support:\n// https://github.com/theKashey/aria-hidden/blob/9220c8f4a4fd35f63bee5510a9f41a37264382d4/src/index.ts\nlet counterMap = /*#__PURE__*/new WeakMap();\nlet uncontrolledElementsSet = /*#__PURE__*/new WeakSet();\nlet markerMap = {};\nlet lockCount$1 = 0;\nconst supportsInert = () => typeof HTMLElement !== 'undefined' && 'inert' in HTMLElement.prototype;\nconst unwrapHost = node => node && (node.host || unwrapHost(node.parentNode));\nconst correctElements = (parent, targets) => targets.map(target => {\n if (parent.contains(target)) {\n return target;\n }\n const correctedTarget = unwrapHost(target);\n if (parent.contains(correctedTarget)) {\n return correctedTarget;\n }\n return null;\n}).filter(x => x != null);\nfunction applyAttributeToOthers(uncorrectedAvoidElements, body, ariaHidden, inert) {\n const markerName = 'data-floating-ui-inert';\n const controlAttribute = inert ? 'inert' : ariaHidden ? 'aria-hidden' : null;\n const avoidElements = correctElements(body, uncorrectedAvoidElements);\n const elementsToKeep = new Set();\n const elementsToStop = new Set(avoidElements);\n const hiddenElements = [];\n if (!markerMap[markerName]) {\n markerMap[markerName] = new WeakMap();\n }\n const markerCounter = markerMap[markerName];\n avoidElements.forEach(keep);\n deep(body);\n elementsToKeep.clear();\n function keep(el) {\n if (!el || elementsToKeep.has(el)) {\n return;\n }\n elementsToKeep.add(el);\n el.parentNode && keep(el.parentNode);\n }\n function deep(parent) {\n if (!parent || elementsToStop.has(parent)) {\n return;\n }\n [].forEach.call(parent.children, node => {\n if (getNodeName(node) === 'script') return;\n if (elementsToKeep.has(node)) {\n deep(node);\n } else {\n const attr = controlAttribute ? node.getAttribute(controlAttribute) : null;\n const alreadyHidden = attr !== null && attr !== 'false';\n const counterValue = (counterMap.get(node) || 0) + 1;\n const markerValue = (markerCounter.get(node) || 0) + 1;\n counterMap.set(node, counterValue);\n markerCounter.set(node, markerValue);\n hiddenElements.push(node);\n if (counterValue === 1 && alreadyHidden) {\n uncontrolledElementsSet.add(node);\n }\n if (markerValue === 1) {\n node.setAttribute(markerName, '');\n }\n if (!alreadyHidden && controlAttribute) {\n node.setAttribute(controlAttribute, 'true');\n }\n }\n });\n }\n lockCount$1++;\n return () => {\n hiddenElements.forEach(element => {\n const counterValue = (counterMap.get(element) || 0) - 1;\n const markerValue = (markerCounter.get(element) || 0) - 1;\n counterMap.set(element, counterValue);\n markerCounter.set(element, markerValue);\n if (!counterValue) {\n if (!uncontrolledElementsSet.has(element) && controlAttribute) {\n element.removeAttribute(controlAttribute);\n }\n uncontrolledElementsSet.delete(element);\n }\n if (!markerValue) {\n element.removeAttribute(markerName);\n }\n });\n lockCount$1--;\n if (!lockCount$1) {\n counterMap = new WeakMap();\n counterMap = new WeakMap();\n uncontrolledElementsSet = new WeakSet();\n markerMap = {};\n }\n };\n}\nfunction markOthers(avoidElements, ariaHidden, inert) {\n if (ariaHidden === void 0) {\n ariaHidden = false;\n }\n if (inert === void 0) {\n inert = false;\n }\n const body = getDocument(avoidElements[0]).body;\n return applyAttributeToOthers(avoidElements.concat(Array.from(body.querySelectorAll('[aria-live]'))), body, ariaHidden, inert);\n}\n\nconst getTabbableOptions = () => ({\n getShadowRoot: true,\n displayCheck:\n // JSDOM does not support the `tabbable` library. To solve this we can\n // check if `ResizeObserver` is a real function (not polyfilled), which\n // determines if the current environment is JSDOM-like.\n typeof ResizeObserver === 'function' && ResizeObserver.toString().includes('[native code]') ? 'full' : 'none'\n});\nfunction getTabbableIn(container, direction) {\n const allTabbable = tabbable(container, getTabbableOptions());\n if (direction === 'prev') {\n allTabbable.reverse();\n }\n const activeIndex = allTabbable.indexOf(activeElement(getDocument(container)));\n const nextTabbableElements = allTabbable.slice(activeIndex + 1);\n return nextTabbableElements[0];\n}\nfunction getNextTabbable() {\n return getTabbableIn(document.body, 'next');\n}\nfunction getPreviousTabbable() {\n return getTabbableIn(document.body, 'prev');\n}\nfunction isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nfunction disableFocusInside(container) {\n const tabbableElements = tabbable(container, getTabbableOptions());\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nfunction enableFocusInside(container) {\n const elements = container.querySelectorAll('[data-tabindex]');\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}\n\n// See Diego Haz's Sandbox for making this logic work well on Safari/iOS:\n// https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/FocusTrap.tsx\n\nconst HIDDEN_STYLES = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'fixed',\n whiteSpace: 'nowrap',\n width: '1px',\n top: 0,\n left: 0\n};\nlet timeoutId;\nfunction setActiveElementOnTab(event) {\n if (event.key === 'Tab') {\n event.target;\n clearTimeout(timeoutId);\n }\n}\nconst FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const [role, setRole] = React.useState();\n index(() => {\n if (isSafari()) {\n // Unlike other screen readers such as NVDA and JAWS, the virtual cursor\n // on VoiceOver does trigger the onFocus event, so we can use the focus\n // trap element. On Safari, only buttons trigger the onFocus event.\n // NB: \"group\" role in the Sandbox no longer appears to work, must be a\n // button role.\n setRole('button');\n }\n document.addEventListener('keydown', setActiveElementOnTab);\n return () => {\n document.removeEventListener('keydown', setActiveElementOnTab);\n };\n }, []);\n const restProps = {\n ref,\n tabIndex: 0,\n // Role is only for VoiceOver\n role,\n 'aria-hidden': role ? undefined : true,\n [createAttribute('focus-guard')]: '',\n style: HIDDEN_STYLES\n };\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, props, restProps));\n});\n\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nconst attr = /*#__PURE__*/createAttribute('portal');\n/**\n * @see https://floating-ui.com/docs/FloatingPortal#usefloatingportalnode\n */\nfunction useFloatingPortalNode(props) {\n if (props === void 0) {\n props = {};\n }\n const {\n id,\n root\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const [portalNode, setPortalNode] = React.useState(null);\n const portalNodeRef = React.useRef(null);\n index(() => {\n return () => {\n portalNode == null || portalNode.remove();\n // Allow the subsequent layout effects to create a new node on updates.\n // The portal node will still be cleaned up on unmount.\n // https://github.com/floating-ui/floating-ui/issues/2454\n queueMicrotask(() => {\n portalNodeRef.current = null;\n });\n };\n }, [portalNode]);\n index(() => {\n // Wait for the uniqueId to be generated before creating the portal node in\n // React <18 (using `useFloatingId` instead of the native `useId`).\n // https://github.com/floating-ui/floating-ui/issues/2778\n if (!uniqueId) return;\n if (portalNodeRef.current) return;\n const existingIdRoot = id ? document.getElementById(id) : null;\n if (!existingIdRoot) return;\n const subRoot = document.createElement('div');\n subRoot.id = uniqueId;\n subRoot.setAttribute(attr, '');\n existingIdRoot.appendChild(subRoot);\n portalNodeRef.current = subRoot;\n setPortalNode(subRoot);\n }, [id, uniqueId]);\n index(() => {\n // Wait for the root to exist before creating the portal node. The root must\n // be stored in state, not a ref, for this to work reactively.\n if (root === null) return;\n if (!uniqueId) return;\n if (portalNodeRef.current) return;\n let container = root || (portalContext == null ? void 0 : portalContext.portalNode);\n if (container && !isElement(container)) container = container.current;\n container = container || document.body;\n let idWrapper = null;\n if (id) {\n idWrapper = document.createElement('div');\n idWrapper.id = id;\n container.appendChild(idWrapper);\n }\n const subRoot = document.createElement('div');\n subRoot.id = uniqueId;\n subRoot.setAttribute(attr, '');\n container = idWrapper || container;\n container.appendChild(subRoot);\n portalNodeRef.current = subRoot;\n setPortalNode(subRoot);\n }, [id, root, uniqueId, portalContext]);\n return portalNode;\n}\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n */\nfunction FloatingPortal(props) {\n const {\n children,\n id,\n root,\n preserveTabOrder = true\n } = props;\n const portalNode = useFloatingPortalNode({\n id,\n root\n });\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const modal = focusManagerState == null ? void 0 : focusManagerState.modal;\n const open = focusManagerState == null ? void 0 : focusManagerState.open;\n const shouldRenderGuards =\n // The FocusManager and therefore floating element are currently open/\n // rendered.\n !!focusManagerState &&\n // Guards are only for non-modal focus management.\n !focusManagerState.modal &&\n // Don't render if unmount is transitioning.\n focusManagerState.open && preserveTabOrder && !!(root || portalNode);\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || !preserveTabOrder || modal) {\n return;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && isOutsideEvent(event)) {\n const focusing = event.type === 'focusin';\n const manageFocus = focusing ? enableFocusInside : disableFocusInside;\n manageFocus(portalNode);\n }\n }\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n portalNode.addEventListener('focusin', onFocus, true);\n portalNode.addEventListener('focusout', onFocus, true);\n return () => {\n portalNode.removeEventListener('focusin', onFocus, true);\n portalNode.removeEventListener('focusout', onFocus, true);\n };\n }, [portalNode, preserveTabOrder, modal]);\n React.useEffect(() => {\n if (!portalNode) return;\n if (open) return;\n enableFocusInside(portalNode);\n }, [open, portalNode]);\n return /*#__PURE__*/React.createElement(PortalContext.Provider, {\n value: React.useMemo(() => ({\n preserveTabOrder,\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [preserveTabOrder, portalNode])\n }, shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _beforeInsideRef$curr;\n (_beforeInsideRef$curr = beforeInsideRef.current) == null || _beforeInsideRef$curr.focus();\n } else {\n const prevTabbable = getPreviousTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);\n prevTabbable == null || prevTabbable.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(\"span\", {\n \"aria-owns\": portalNode.id,\n style: HIDDEN_STYLES\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _afterInsideRef$curre;\n (_afterInsideRef$curre = afterInsideRef.current) == null || _afterInsideRef$curre.focus();\n } else {\n const nextTabbable = getNextTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);\n nextTabbable == null || nextTabbable.focus();\n (focusManagerState == null ? void 0 : focusManagerState.closeOnFocusOut) && (focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false, event.nativeEvent, 'focus-out'));\n }\n }\n }));\n}\nconst usePortalContext = () => React.useContext(PortalContext);\n\nconst FOCUSABLE_ATTRIBUTE = 'data-floating-ui-focusable';\nfunction getFloatingFocusElement(floatingElement) {\n if (!floatingElement) {\n return null;\n }\n // Try to find the element that has `{...getFloatingProps()}` spread on it.\n // This indicates the floating element is acting as a positioning wrapper, and\n // so focus should be managed on the child element with the event handlers and\n // aria props.\n return floatingElement.hasAttribute(FOCUSABLE_ATTRIBUTE) ? floatingElement : floatingElement.querySelector(\"[\" + FOCUSABLE_ATTRIBUTE + \"]\") || floatingElement;\n}\n\nconst LIST_LIMIT = 20;\nlet previouslyFocusedElements = [];\nfunction addPreviouslyFocusedElement(element) {\n previouslyFocusedElements = previouslyFocusedElements.filter(el => el.isConnected);\n let tabbableEl = element;\n if (!tabbableEl || getNodeName(tabbableEl) === 'body') return;\n if (!isTabbable(tabbableEl, getTabbableOptions())) {\n const tabbableChild = tabbable(tabbableEl, getTabbableOptions())[0];\n if (tabbableChild) {\n tabbableEl = tabbableChild;\n }\n }\n previouslyFocusedElements.push(tabbableEl);\n if (previouslyFocusedElements.length > LIST_LIMIT) {\n previouslyFocusedElements = previouslyFocusedElements.slice(-LIST_LIMIT);\n }\n}\nfunction getPreviouslyFocusedElement() {\n return previouslyFocusedElements.slice().reverse().find(el => el.isConnected);\n}\nconst VisuallyHiddenDismiss = /*#__PURE__*/React.forwardRef(function VisuallyHiddenDismiss(props, ref) {\n return /*#__PURE__*/React.createElement(\"button\", _extends({}, props, {\n type: \"button\",\n ref: ref,\n tabIndex: -1,\n style: HIDDEN_STYLES\n }));\n});\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n */\nfunction FloatingFocusManager(props) {\n const {\n context,\n children,\n disabled = false,\n order = ['content'],\n guards: _guards = true,\n initialFocus = 0,\n returnFocus = true,\n restoreFocus = false,\n modal = true,\n visuallyHiddenDismiss = false,\n closeOnFocusOut = true\n } = props;\n const {\n open,\n refs,\n nodeId,\n onOpenChange,\n events,\n dataRef,\n floatingId,\n elements: {\n domReference,\n floating\n }\n } = context;\n const ignoreInitialFocus = typeof initialFocus === 'number' && initialFocus < 0;\n // If the reference is a combobox and is typeable (e.g. input/textarea),\n // there are different focus semantics. The guards should not be rendered, but\n // aria-hidden should be applied to all nodes still. Further, the visually\n // hidden dismiss button should only appear at the end of the list, not the\n // start.\n const isUntrappedTypeableCombobox = isTypeableCombobox(domReference) && ignoreInitialFocus;\n\n // Force the guards to be rendered if the `inert` attribute is not supported.\n const guards = supportsInert() ? _guards : true;\n const orderRef = useLatestRef(order);\n const initialFocusRef = useLatestRef(initialFocus);\n const returnFocusRef = useLatestRef(returnFocus);\n const tree = useFloatingTree();\n const portalContext = usePortalContext();\n const startDismissButtonRef = React.useRef(null);\n const endDismissButtonRef = React.useRef(null);\n const preventReturnFocusRef = React.useRef(false);\n const isPointerDownRef = React.useRef(false);\n const tabbableIndexRef = React.useRef(-1);\n const isInsidePortal = portalContext != null;\n const floatingFocusElement = getFloatingFocusElement(floating);\n const getTabbableContent = useEffectEvent(function (container) {\n if (container === void 0) {\n container = floatingFocusElement;\n }\n return container ? tabbable(container, getTabbableOptions()) : [];\n });\n const getTabbableElements = useEffectEvent(container => {\n const content = getTabbableContent(container);\n return orderRef.current.map(type => {\n if (domReference && type === 'reference') {\n return domReference;\n }\n if (floatingFocusElement && type === 'floating') {\n return floatingFocusElement;\n }\n return content;\n }).filter(Boolean).flat();\n });\n React.useEffect(() => {\n if (disabled) return;\n if (!modal) return;\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (contains(floatingFocusElement, activeElement(getDocument(floatingFocusElement))) && getTabbableContent().length === 0 && !isUntrappedTypeableCombobox) {\n stopEvent(event);\n }\n const els = getTabbableElements();\n const target = getTarget(event);\n if (orderRef.current[0] === 'reference' && target === domReference) {\n stopEvent(event);\n if (event.shiftKey) {\n enqueueFocus(els[els.length - 1]);\n } else {\n enqueueFocus(els[1]);\n }\n }\n if (orderRef.current[1] === 'floating' && target === floatingFocusElement && event.shiftKey) {\n stopEvent(event);\n enqueueFocus(els[0]);\n }\n }\n }\n const doc = getDocument(floatingFocusElement);\n doc.addEventListener('keydown', onKeyDown);\n return () => {\n doc.removeEventListener('keydown', onKeyDown);\n };\n }, [disabled, domReference, floatingFocusElement, modal, orderRef, isUntrappedTypeableCombobox, getTabbableContent, getTabbableElements]);\n React.useEffect(() => {\n if (disabled) return;\n if (!floating) return;\n function handleFocusIn(event) {\n const target = getTarget(event);\n const tabbableContent = getTabbableContent();\n const tabbableIndex = tabbableContent.indexOf(target);\n if (tabbableIndex !== -1) {\n tabbableIndexRef.current = tabbableIndex;\n }\n }\n floating.addEventListener('focusin', handleFocusIn);\n return () => {\n floating.removeEventListener('focusin', handleFocusIn);\n };\n }, [disabled, floating, getTabbableContent]);\n React.useEffect(() => {\n if (disabled) return;\n if (!closeOnFocusOut) return;\n\n // In Safari, buttons lose focus when pressing them.\n function handlePointerDown() {\n isPointerDownRef.current = true;\n setTimeout(() => {\n isPointerDownRef.current = false;\n });\n }\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n queueMicrotask(() => {\n const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext == null ? void 0 : portalContext.portalNode, relatedTarget) || relatedTarget != null && relatedTarget.hasAttribute(createAttribute('focus-guard')) || tree && (getChildren(tree.nodesRef.current, nodeId).find(node => {\n var _node$context, _node$context2;\n return contains((_node$context = node.context) == null ? void 0 : _node$context.elements.floating, relatedTarget) || contains((_node$context2 = node.context) == null ? void 0 : _node$context2.elements.domReference, relatedTarget);\n }) || getAncestors(tree.nodesRef.current, nodeId).find(node => {\n var _node$context3, _node$context4;\n return ((_node$context3 = node.context) == null ? void 0 : _node$context3.elements.floating) === relatedTarget || ((_node$context4 = node.context) == null ? void 0 : _node$context4.elements.domReference) === relatedTarget;\n })));\n\n // Restore focus to the previous tabbable element index to prevent\n // focus from being lost outside the floating tree.\n if (restoreFocus && movedToUnrelatedNode && activeElement(getDocument(floatingFocusElement)) === getDocument(floatingFocusElement).body) {\n // Let `FloatingPortal` effect knows that focus is still inside the\n // floating tree.\n if (isHTMLElement(floatingFocusElement)) {\n floatingFocusElement.focus();\n }\n const prevTabbableIndex = tabbableIndexRef.current;\n const tabbableContent = getTabbableContent();\n const nodeToFocus = tabbableContent[prevTabbableIndex] || tabbableContent[tabbableContent.length - 1] || floatingFocusElement;\n if (isHTMLElement(nodeToFocus)) {\n nodeToFocus.focus();\n }\n }\n\n // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n if ((isUntrappedTypeableCombobox ? true : !modal) && relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current &&\n // Fix React 18 Strict Mode returnFocus due to double rendering.\n relatedTarget !== getPreviouslyFocusedElement()) {\n preventReturnFocusRef.current = true;\n onOpenChange(false, event, 'focus-out');\n }\n });\n }\n if (floating && isHTMLElement(domReference)) {\n domReference.addEventListener('focusout', handleFocusOutside);\n domReference.addEventListener('pointerdown', handlePointerDown);\n floating.addEventListener('focusout', handleFocusOutside);\n return () => {\n domReference.removeEventListener('focusout', handleFocusOutside);\n domReference.removeEventListener('pointerdown', handlePointerDown);\n floating.removeEventListener('focusout', handleFocusOutside);\n };\n }\n }, [disabled, domReference, floating, floatingFocusElement, modal, nodeId, tree, portalContext, onOpenChange, closeOnFocusOut, restoreFocus, getTabbableContent, isUntrappedTypeableCombobox]);\n React.useEffect(() => {\n var _portalContext$portal;\n if (disabled) return;\n\n // Don't hide portals nested within the parent portal.\n const portalNodes = Array.from((portalContext == null || (_portalContext$portal = portalContext.portalNode) == null ? void 0 : _portalContext$portal.querySelectorAll(\"[\" + createAttribute('portal') + \"]\")) || []);\n if (floating) {\n const insideElements = [floating, ...portalNodes, startDismissButtonRef.current, endDismissButtonRef.current, orderRef.current.includes('reference') || isUntrappedTypeableCombobox ? domReference : null].filter(x => x != null);\n const cleanup = modal || isUntrappedTypeableCombobox ? markOthers(insideElements, guards, !guards) : markOthers(insideElements);\n return () => {\n cleanup();\n };\n }\n }, [disabled, domReference, floating, modal, orderRef, portalContext, isUntrappedTypeableCombobox, guards]);\n index(() => {\n if (disabled || !isHTMLElement(floatingFocusElement)) return;\n const doc = getDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n\n // Wait for any layout effect state setters to execute to set `tabIndex`.\n queueMicrotask(() => {\n const focusableElements = getTabbableElements(floatingFocusElement);\n const initialFocusValue = initialFocusRef.current;\n const elToFocus = (typeof initialFocusValue === 'number' ? focusableElements[initialFocusValue] : initialFocusValue.current) || floatingFocusElement;\n const focusAlreadyInsideFloatingEl = contains(floatingFocusElement, previouslyFocusedElement);\n if (!ignoreInitialFocus && !focusAlreadyInsideFloatingEl && open) {\n enqueueFocus(elToFocus, {\n preventScroll: elToFocus === floatingFocusElement\n });\n }\n });\n }, [disabled, open, floatingFocusElement, ignoreInitialFocus, getTabbableElements, initialFocusRef]);\n index(() => {\n if (disabled || !floatingFocusElement) return;\n let preventReturnFocusScroll = false;\n const doc = getDocument(floatingFocusElement);\n const previouslyFocusedElement = activeElement(doc);\n const contextData = dataRef.current;\n let openEvent = contextData.openEvent;\n addPreviouslyFocusedElement(previouslyFocusedElement);\n\n // Dismissing via outside press should always ignore `returnFocus` to\n // prevent unwanted scrolling.\n function onOpenChange(_ref) {\n let {\n open,\n reason,\n event,\n nested\n } = _ref;\n if (open) {\n openEvent = event;\n }\n if (reason === 'escape-key' && refs.domReference.current) {\n addPreviouslyFocusedElement(refs.domReference.current);\n }\n if (reason === 'hover' && event.type === 'mouseleave') {\n preventReturnFocusRef.current = true;\n }\n if (reason !== 'outside-press') return;\n if (nested) {\n preventReturnFocusRef.current = false;\n preventReturnFocusScroll = true;\n } else {\n preventReturnFocusRef.current = !(isVirtualClick(event) || isVirtualPointerEvent(event));\n }\n }\n events.on('openchange', onOpenChange);\n const fallbackEl = doc.createElement('span');\n fallbackEl.setAttribute('tabindex', '-1');\n fallbackEl.setAttribute('aria-hidden', 'true');\n Object.assign(fallbackEl.style, HIDDEN_STYLES);\n if (isInsidePortal && domReference) {\n domReference.insertAdjacentElement('afterend', fallbackEl);\n }\n function getReturnElement() {\n if (typeof returnFocusRef.current === 'boolean') {\n return getPreviouslyFocusedElement() || fallbackEl;\n }\n return returnFocusRef.current.current || fallbackEl;\n }\n return () => {\n events.off('openchange', onOpenChange);\n const activeEl = activeElement(doc);\n const isFocusInsideFloatingTree = contains(floating, activeEl) || tree && getChildren(tree.nodesRef.current, nodeId).some(node => {\n var _node$context5;\n return contains((_node$context5 = node.context) == null ? void 0 : _node$context5.elements.floating, activeEl);\n });\n const shouldFocusReference = isFocusInsideFloatingTree || openEvent && ['click', 'mousedown'].includes(openEvent.type);\n if (shouldFocusReference && refs.domReference.current) {\n addPreviouslyFocusedElement(refs.domReference.current);\n }\n const returnElement = getReturnElement();\n queueMicrotask(() => {\n if (\n // eslint-disable-next-line react-hooks/exhaustive-deps\n returnFocusRef.current && !preventReturnFocusRef.current && isHTMLElement(returnElement) && (\n // If the focus moved somewhere else after mount, avoid returning focus\n // since it likely entered a different element which should be\n // respected: https://github.com/floating-ui/floating-ui/issues/2607\n returnElement !== activeEl && activeEl !== doc.body ? isFocusInsideFloatingTree : true)) {\n returnElement.focus({\n preventScroll: preventReturnFocusScroll\n });\n }\n fallbackEl.remove();\n });\n };\n }, [disabled, floating, floatingFocusElement, returnFocusRef, dataRef, refs, events, tree, nodeId, isInsidePortal, domReference]);\n React.useEffect(() => {\n // The `returnFocus` cleanup behavior is inside a microtask; ensure we\n // wait for it to complete before resetting the flag.\n queueMicrotask(() => {\n preventReturnFocusRef.current = false;\n });\n }, [disabled]);\n\n // Synchronize the `context` & `modal` value to the FloatingPortal context.\n // It will decide whether or not it needs to render its own guards.\n index(() => {\n if (disabled) return;\n if (!portalContext) return;\n portalContext.setFocusManagerState({\n modal,\n closeOnFocusOut,\n open,\n onOpenChange,\n refs\n });\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [disabled, portalContext, modal, open, onOpenChange, refs, closeOnFocusOut]);\n index(() => {\n if (disabled) return;\n if (!floatingFocusElement) return;\n if (typeof MutationObserver !== 'function') return;\n if (ignoreInitialFocus) return;\n const handleMutation = () => {\n const tabIndex = floatingFocusElement.getAttribute('tabindex');\n const tabbableContent = getTabbableContent();\n const activeEl = activeElement(getDocument(floating));\n const tabbableIndex = tabbableContent.indexOf(activeEl);\n if (tabbableIndex !== -1) {\n tabbableIndexRef.current = tabbableIndex;\n }\n if (orderRef.current.includes('floating') || activeEl !== refs.domReference.current && tabbableContent.length === 0) {\n if (tabIndex !== '0') {\n floatingFocusElement.setAttribute('tabindex', '0');\n }\n } else if (tabIndex !== '-1') {\n floatingFocusElement.setAttribute('tabindex', '-1');\n }\n };\n handleMutation();\n const observer = new MutationObserver(handleMutation);\n observer.observe(floatingFocusElement, {\n childList: true,\n subtree: true,\n attributes: true\n });\n return () => {\n observer.disconnect();\n };\n }, [disabled, floating, floatingFocusElement, refs, orderRef, getTabbableContent, ignoreInitialFocus]);\n function renderDismissButton(location) {\n if (disabled || !visuallyHiddenDismiss || !modal) {\n return null;\n }\n return /*#__PURE__*/React.createElement(VisuallyHiddenDismiss, {\n ref: location === 'start' ? startDismissButtonRef : endDismissButtonRef,\n onClick: event => onOpenChange(false, event.nativeEvent)\n }, typeof visuallyHiddenDismiss === 'string' ? visuallyHiddenDismiss : 'Dismiss');\n }\n const shouldRenderGuards = !disabled && guards && (modal ? !isUntrappedTypeableCombobox : true) && (isInsidePortal || modal);\n return /*#__PURE__*/React.createElement(React.Fragment, null, shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"inside\",\n ref: portalContext == null ? void 0 : portalContext.beforeInsideRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableElements();\n enqueueFocus(order[0] === 'reference' ? els[0] : els[els.length - 1]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n preventReturnFocusRef.current = false;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable() || domReference;\n nextTabbable == null || nextTabbable.focus();\n } else {\n var _portalContext$before;\n (_portalContext$before = portalContext.beforeOutsideRef.current) == null || _portalContext$before.focus();\n }\n }\n }\n }), !isUntrappedTypeableCombobox && renderDismissButton('start'), children, renderDismissButton('end'), shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"inside\",\n ref: portalContext == null ? void 0 : portalContext.afterInsideRef,\n onFocus: event => {\n if (modal) {\n enqueueFocus(getTabbableElements()[0]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n if (closeOnFocusOut) {\n preventReturnFocusRef.current = true;\n }\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable() || domReference;\n prevTabbable == null || prevTabbable.focus();\n } else {\n var _portalContext$afterO;\n (_portalContext$afterO = portalContext.afterOutsideRef.current) == null || _portalContext$afterO.focus();\n }\n }\n }\n }));\n}\n\nlet lockCount = 0;\nfunction enableScrollLock() {\n const isIOS = /iP(hone|ad|od)|iOS/.test(getPlatform());\n const bodyStyle = document.body.style;\n // RTL scrollbar\n const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;\n const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n const scrollX = bodyStyle.left ? parseFloat(bodyStyle.left) : window.scrollX;\n const scrollY = bodyStyle.top ? parseFloat(bodyStyle.top) : window.scrollY;\n bodyStyle.overflow = 'hidden';\n if (scrollbarWidth) {\n bodyStyle[paddingProp] = scrollbarWidth + \"px\";\n }\n\n // Only iOS doesn't respect `overflow: hidden` on document.body, and this\n // technique has fewer side effects.\n if (isIOS) {\n var _window$visualViewpor, _window$visualViewpor2;\n // iOS 12 does not support `visualViewport`.\n const offsetLeft = ((_window$visualViewpor = window.visualViewport) == null ? void 0 : _window$visualViewpor.offsetLeft) || 0;\n const offsetTop = ((_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetTop) || 0;\n Object.assign(bodyStyle, {\n position: 'fixed',\n top: -(scrollY - Math.floor(offsetTop)) + \"px\",\n left: -(scrollX - Math.floor(offsetLeft)) + \"px\",\n right: '0'\n });\n }\n return () => {\n Object.assign(bodyStyle, {\n overflow: '',\n [paddingProp]: ''\n });\n if (isIOS) {\n Object.assign(bodyStyle, {\n position: '',\n top: '',\n left: '',\n right: ''\n });\n window.scrollTo(scrollX, scrollY);\n }\n };\n}\nlet cleanup = () => {};\n\n/**\n * Provides base styling for a fixed overlay element to dim content or block\n * pointer events behind a floating element.\n * It's a regular `
`, so it can be styled via any CSS solution you prefer.\n * @see https://floating-ui.com/docs/FloatingOverlay\n */\nconst FloatingOverlay = /*#__PURE__*/React.forwardRef(function FloatingOverlay(props, ref) {\n const {\n lockScroll = false,\n ...rest\n } = props;\n index(() => {\n if (!lockScroll) return;\n lockCount++;\n if (lockCount === 1) {\n cleanup = enableScrollLock();\n }\n return () => {\n lockCount--;\n if (lockCount === 0) {\n cleanup();\n }\n };\n }, [lockScroll]);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref\n }, rest, {\n style: {\n position: 'fixed',\n overflow: 'auto',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...rest.style\n }\n }));\n});\n\nfunction isButtonTarget(event) {\n return isHTMLElement(event.target) && event.target.tagName === 'BUTTON';\n}\nfunction isSpaceIgnored(element) {\n return isTypeableElement(element);\n}\n/**\n * Opens or closes the floating element when clicking the reference element.\n * @see https://floating-ui.com/docs/useClick\n */\nfunction useClick(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n dataRef,\n elements: {\n domReference\n }\n } = context;\n const {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n keyboardHandlers = true,\n stickIfOpen = true\n } = props;\n const pointerTypeRef = React.useRef();\n const didKeyDownRef = React.useRef(false);\n const reference = React.useMemo(() => ({\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onMouseDown(event) {\n const pointerType = pointerTypeRef.current;\n\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0) return;\n if (eventOption === 'click') return;\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;\n if (open && toggle && (dataRef.current.openEvent && stickIfOpen ? dataRef.current.openEvent.type === 'mousedown' : true)) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n // Prevent stealing focus from the floating element\n event.preventDefault();\n onOpenChange(true, event.nativeEvent, 'click');\n }\n },\n onClick(event) {\n const pointerType = pointerTypeRef.current;\n if (eventOption === 'mousedown' && pointerTypeRef.current) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;\n if (open && toggle && (dataRef.current.openEvent && stickIfOpen ? dataRef.current.openEvent.type === 'click' : true)) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n onOpenChange(true, event.nativeEvent, 'click');\n }\n },\n onKeyDown(event) {\n pointerTypeRef.current = undefined;\n if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event)) {\n return;\n }\n if (event.key === ' ' && !isSpaceIgnored(domReference)) {\n // Prevent scrolling\n event.preventDefault();\n didKeyDownRef.current = true;\n }\n if (event.key === 'Enter') {\n if (open && toggle) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n onOpenChange(true, event.nativeEvent, 'click');\n }\n }\n },\n onKeyUp(event) {\n if (event.defaultPrevented || !keyboardHandlers || isButtonTarget(event) || isSpaceIgnored(domReference)) {\n return;\n }\n if (event.key === ' ' && didKeyDownRef.current) {\n didKeyDownRef.current = false;\n if (open && toggle) {\n onOpenChange(false, event.nativeEvent, 'click');\n } else {\n onOpenChange(true, event.nativeEvent, 'click');\n }\n }\n }\n }), [dataRef, domReference, eventOption, ignoreMouse, keyboardHandlers, onOpenChange, open, stickIfOpen, toggle]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nfunction createVirtualElement(domElement, data) {\n let offsetX = null;\n let offsetY = null;\n let isAutoUpdateEvent = false;\n return {\n contextElement: domElement || undefined,\n getBoundingClientRect() {\n var _data$dataRef$current;\n const domRect = (domElement == null ? void 0 : domElement.getBoundingClientRect()) || {\n width: 0,\n height: 0,\n x: 0,\n y: 0\n };\n const isXAxis = data.axis === 'x' || data.axis === 'both';\n const isYAxis = data.axis === 'y' || data.axis === 'both';\n const canTrackCursorOnAutoUpdate = ['mouseenter', 'mousemove'].includes(((_data$dataRef$current = data.dataRef.current.openEvent) == null ? void 0 : _data$dataRef$current.type) || '') && data.pointerType !== 'touch';\n let width = domRect.width;\n let height = domRect.height;\n let x = domRect.x;\n let y = domRect.y;\n if (offsetX == null && data.x && isXAxis) {\n offsetX = domRect.x - data.x;\n }\n if (offsetY == null && data.y && isYAxis) {\n offsetY = domRect.y - data.y;\n }\n x -= offsetX || 0;\n y -= offsetY || 0;\n width = 0;\n height = 0;\n if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {\n width = data.axis === 'y' ? domRect.width : 0;\n height = data.axis === 'x' ? domRect.height : 0;\n x = isXAxis && data.x != null ? data.x : x;\n y = isYAxis && data.y != null ? data.y : y;\n } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) {\n height = data.axis === 'x' ? domRect.height : height;\n width = data.axis === 'y' ? domRect.width : width;\n }\n isAutoUpdateEvent = true;\n return {\n width,\n height,\n x,\n y,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x\n };\n }\n };\n}\nfunction isMouseBasedEvent(event) {\n return event != null && event.clientX != null;\n}\n/**\n * Positions the floating element relative to a client point (in the viewport),\n * such as the mouse position. By default, it follows the mouse cursor.\n * @see https://floating-ui.com/docs/useClientPoint\n */\nfunction useClientPoint(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n dataRef,\n elements: {\n floating,\n domReference\n },\n refs\n } = context;\n const {\n enabled = true,\n axis = 'both',\n x = null,\n y = null\n } = props;\n const initialRef = React.useRef(false);\n const cleanupListenerRef = React.useRef(null);\n const [pointerType, setPointerType] = React.useState();\n const [reactive, setReactive] = React.useState([]);\n const setReference = useEffectEvent((x, y) => {\n if (initialRef.current) return;\n\n // Prevent setting if the open event was not a mouse-like one\n // (e.g. focus to open, then hover over the reference element).\n // Only apply if the event exists.\n if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {\n return;\n }\n refs.setPositionReference(createVirtualElement(domReference, {\n x,\n y,\n axis,\n dataRef,\n pointerType\n }));\n });\n const handleReferenceEnterOrMove = useEffectEvent(event => {\n if (x != null || y != null) return;\n if (!open) {\n setReference(event.clientX, event.clientY);\n } else if (!cleanupListenerRef.current) {\n // If there's no cleanup, there's no listener, but we want to ensure\n // we add the listener if the cursor landed on the floating element and\n // then back on the reference (i.e. it's interactive).\n setReactive([]);\n }\n });\n\n // If the pointer is a mouse-like pointer, we want to continue following the\n // mouse even if the floating element is transitioning out. On touch\n // devices, this is undesirable because the floating element will move to\n // the dismissal touch point.\n const openCheck = isMouseLikePointerType(pointerType) ? floating : open;\n const addListener = React.useCallback(() => {\n // Explicitly specified `x`/`y` coordinates shouldn't add a listener.\n if (!openCheck || !enabled || x != null || y != null) return;\n const win = getWindow(floating);\n function handleMouseMove(event) {\n const target = getTarget(event);\n if (!contains(floating, target)) {\n setReference(event.clientX, event.clientY);\n } else {\n win.removeEventListener('mousemove', handleMouseMove);\n cleanupListenerRef.current = null;\n }\n }\n if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {\n win.addEventListener('mousemove', handleMouseMove);\n const cleanup = () => {\n win.removeEventListener('mousemove', handleMouseMove);\n cleanupListenerRef.current = null;\n };\n cleanupListenerRef.current = cleanup;\n return cleanup;\n }\n refs.setPositionReference(domReference);\n }, [openCheck, enabled, x, y, floating, dataRef, refs, domReference, setReference]);\n React.useEffect(() => {\n return addListener();\n }, [addListener, reactive]);\n React.useEffect(() => {\n if (enabled && !floating) {\n initialRef.current = false;\n }\n }, [enabled, floating]);\n React.useEffect(() => {\n if (!enabled && open) {\n initialRef.current = true;\n }\n }, [enabled, open]);\n index(() => {\n if (enabled && (x != null || y != null)) {\n initialRef.current = false;\n setReference(x, y);\n }\n }, [enabled, x, y, setReference]);\n const reference = React.useMemo(() => {\n function setPointerTypeRef(_ref) {\n let {\n pointerType\n } = _ref;\n setPointerType(pointerType);\n }\n return {\n onPointerDown: setPointerTypeRef,\n onPointerEnter: setPointerTypeRef,\n onMouseMove: handleReferenceEnterOrMove,\n onMouseEnter: handleReferenceEnterOrMove\n };\n }, [handleReferenceEnterOrMove]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nconst bubbleHandlerKeys = {\n pointerdown: 'onPointerDown',\n mousedown: 'onMouseDown',\n click: 'onClick'\n};\nconst captureHandlerKeys = {\n pointerdown: 'onPointerDownCapture',\n mousedown: 'onMouseDownCapture',\n click: 'onClickCapture'\n};\nconst normalizeProp = normalizable => {\n var _normalizable$escapeK, _normalizable$outside;\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : (_normalizable$escapeK = normalizable == null ? void 0 : normalizable.escapeKey) != null ? _normalizable$escapeK : false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : (_normalizable$outside = normalizable == null ? void 0 : normalizable.outsidePress) != null ? _normalizable$outside : true\n };\n};\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nfunction useDismiss(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n elements,\n dataRef\n } = context;\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: unstable_outsidePress = true,\n outsidePressEvent = 'pointerdown',\n referencePress = false,\n referencePressEvent = 'pointerdown',\n ancestorScroll = false,\n bubbles,\n capture\n } = props;\n const tree = useFloatingTree();\n const outsidePressFn = useEffectEvent(typeof unstable_outsidePress === 'function' ? unstable_outsidePress : () => false);\n const outsidePress = typeof unstable_outsidePress === 'function' ? outsidePressFn : unstable_outsidePress;\n const insideReactTreeRef = React.useRef(false);\n const endedOrStartedInsideRef = React.useRef(false);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const {\n escapeKey: escapeKeyCapture,\n outsidePress: outsidePressCapture\n } = normalizeProp(capture);\n const isComposingRef = React.useRef(false);\n const closeOnEscapeKeyDown = useEffectEvent(event => {\n var _dataRef$current$floa;\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element.\n if (isComposingRef.current) {\n return;\n }\n const nodeId = (_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.nodeId;\n const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];\n if (!escapeKeyBubbles) {\n event.stopPropagation();\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context;\n if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n }\n onOpenChange(false, isReactEvent(event) ? event.nativeEvent : event, 'escape-key');\n });\n const closeOnEscapeKeyDownCapture = useEffectEvent(event => {\n var _getTarget2;\n const callback = () => {\n var _getTarget;\n closeOnEscapeKeyDown(event);\n (_getTarget = getTarget(event)) == null || _getTarget.removeEventListener('keydown', callback);\n };\n (_getTarget2 = getTarget(event)) == null || _getTarget2.addEventListener('keydown', callback);\n });\n const closeOnPressOutside = useEffectEvent(event => {\n var _dataRef$current$floa2;\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = insideReactTreeRef.current;\n insideReactTreeRef.current = false;\n\n // When click outside is lazy (`click` event), handle dragging.\n // Don't close if:\n // - The click started inside the floating element.\n // - The click ended inside the floating element.\n const endedOrStartedInside = endedOrStartedInsideRef.current;\n endedOrStartedInsideRef.current = false;\n if (outsidePressEvent === 'click' && endedOrStartedInside) {\n return;\n }\n if (insideReactTree) {\n return;\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n const target = getTarget(event);\n const inertSelector = \"[\" + createAttribute('inert') + \"]\";\n const markers = getDocument(elements.floating).querySelectorAll(inertSelector);\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, elements.floating) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n Array.from(markers).every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n if (isHTMLElement(target) && floating) {\n // In Firefox, `target.scrollWidth > target.clientWidth` for inline\n // elements.\n const canScrollX = target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n let xCond = canScrollY && event.offsetX > target.clientWidth;\n\n // In some browsers it is possible to change the (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n if (canScrollY) {\n const isRTL = getComputedStyle(target).direction === 'rtl';\n if (isRTL) {\n xCond = event.offsetX <= target.offsetWidth - target.clientWidth;\n }\n }\n if (xCond || canScrollX && event.offsetY > target.clientHeight) {\n return;\n }\n }\n const nodeId = (_dataRef$current$floa2 = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa2.nodeId;\n const targetIsInsideChildren = tree && getChildren(tree.nodesRef.current, nodeId).some(node => {\n var _node$context;\n return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);\n });\n if (isEventTargetWithin(event, elements.floating) || isEventTargetWithin(event, elements.domReference) || targetIsInsideChildren) {\n return;\n }\n const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context2;\n if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n onOpenChange(false, event, 'outside-press');\n });\n const closeOnPressOutsideCapture = useEffectEvent(event => {\n var _getTarget4;\n const callback = () => {\n var _getTarget3;\n closeOnPressOutside(event);\n (_getTarget3 = getTarget(event)) == null || _getTarget3.removeEventListener(outsidePressEvent, callback);\n };\n (_getTarget4 = getTarget(event)) == null || _getTarget4.addEventListener(outsidePressEvent, callback);\n });\n React.useEffect(() => {\n if (!open || !enabled) {\n return;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n let compositionTimeout = -1;\n function onScroll(event) {\n onOpenChange(false, event, 'ancestor-scroll');\n }\n function handleCompositionStart() {\n window.clearTimeout(compositionTimeout);\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n compositionTimeout = window.setTimeout(() => {\n isComposingRef.current = false;\n },\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n isWebKit() ? 5 : 0);\n }\n const doc = getDocument(elements.floating);\n if (escapeKey) {\n doc.addEventListener('keydown', escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);\n doc.addEventListener('compositionstart', handleCompositionStart);\n doc.addEventListener('compositionend', handleCompositionEnd);\n }\n outsidePress && doc.addEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);\n let ancestors = [];\n if (ancestorScroll) {\n if (isElement(elements.domReference)) {\n ancestors = getOverflowAncestors(elements.domReference);\n }\n if (isElement(elements.floating)) {\n ancestors = ancestors.concat(getOverflowAncestors(elements.floating));\n }\n if (!isElement(elements.reference) && elements.reference && elements.reference.contextElement) {\n ancestors = ancestors.concat(getOverflowAncestors(elements.reference.contextElement));\n }\n }\n\n // Ignore the visual viewport for scrolling dismissal (allow pinch-zoom)\n ancestors = ancestors.filter(ancestor => {\n var _doc$defaultView;\n return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);\n });\n ancestors.forEach(ancestor => {\n ancestor.addEventListener('scroll', onScroll, {\n passive: true\n });\n });\n return () => {\n if (escapeKey) {\n doc.removeEventListener('keydown', escapeKeyCapture ? closeOnEscapeKeyDownCapture : closeOnEscapeKeyDown, escapeKeyCapture);\n doc.removeEventListener('compositionstart', handleCompositionStart);\n doc.removeEventListener('compositionend', handleCompositionEnd);\n }\n outsidePress && doc.removeEventListener(outsidePressEvent, outsidePressCapture ? closeOnPressOutsideCapture : closeOnPressOutside, outsidePressCapture);\n ancestors.forEach(ancestor => {\n ancestor.removeEventListener('scroll', onScroll);\n });\n window.clearTimeout(compositionTimeout);\n };\n }, [dataRef, elements, escapeKey, outsidePress, outsidePressEvent, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, escapeKeyCapture, closeOnEscapeKeyDownCapture, closeOnPressOutside, outsidePressCapture, closeOnPressOutsideCapture]);\n React.useEffect(() => {\n insideReactTreeRef.current = false;\n }, [outsidePress, outsidePressEvent]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n [bubbleHandlerKeys[referencePressEvent]]: event => {\n if (referencePress) {\n onOpenChange(false, event.nativeEvent, 'reference-press');\n }\n }\n }), [closeOnEscapeKeyDown, onOpenChange, referencePress, referencePressEvent]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onMouseDown() {\n endedOrStartedInsideRef.current = true;\n },\n onMouseUp() {\n endedOrStartedInsideRef.current = true;\n },\n [captureHandlerKeys[outsidePressEvent]]: () => {\n insideReactTreeRef.current = true;\n }\n }), [closeOnEscapeKeyDown, outsidePressEvent]);\n return React.useMemo(() => enabled ? {\n reference,\n floating\n } : {}, [enabled, reference, floating]);\n}\n\nfunction useFloatingRootContext(options) {\n const {\n open = false,\n onOpenChange: onOpenChangeProp,\n elements: elementsProp\n } = options;\n const floatingId = useId();\n const dataRef = React.useRef({});\n const [events] = React.useState(() => createPubSub());\n const nested = useFloatingParentNodeId() != null;\n if (process.env.NODE_ENV !== \"production\") {\n const optionDomReference = elementsProp.reference;\n if (optionDomReference && !isElement(optionDomReference)) {\n error('Cannot pass a virtual element to the `elements.reference` option,', 'as it must be a real DOM element. Use `refs.setPositionReference()`', 'instead.');\n }\n }\n const [positionReference, setPositionReference] = React.useState(elementsProp.reference);\n const onOpenChange = useEffectEvent((open, event, reason) => {\n dataRef.current.openEvent = open ? event : undefined;\n events.emit('openchange', {\n open,\n event,\n reason,\n nested\n });\n onOpenChangeProp == null || onOpenChangeProp(open, event, reason);\n });\n const refs = React.useMemo(() => ({\n setPositionReference\n }), []);\n const elements = React.useMemo(() => ({\n reference: positionReference || elementsProp.reference || null,\n floating: elementsProp.floating || null,\n domReference: elementsProp.reference\n }), [positionReference, elementsProp.reference, elementsProp.floating]);\n return React.useMemo(() => ({\n dataRef,\n open,\n onOpenChange,\n elements,\n events,\n floatingId,\n refs\n }), [open, onOpenChange, elements, events, floatingId, refs]);\n}\n\n/**\n * Provides data to position a floating element and context to add interactions.\n * @see https://floating-ui.com/docs/useFloating\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n nodeId\n } = options;\n const internalRootContext = useFloatingRootContext({\n ...options,\n elements: {\n reference: null,\n floating: null,\n ...options.elements\n }\n });\n const rootContext = options.rootContext || internalRootContext;\n const computedElements = rootContext.elements;\n const [_domReference, setDomReference] = React.useState(null);\n const [positionReference, _setPositionReference] = React.useState(null);\n const optionDomReference = computedElements == null ? void 0 : computedElements.domReference;\n const domReference = optionDomReference || _domReference;\n const domReferenceRef = React.useRef(null);\n const tree = useFloatingTree();\n index(() => {\n if (domReference) {\n domReferenceRef.current = domReference;\n }\n }, [domReference]);\n const position = useFloating$1({\n ...options,\n elements: {\n ...computedElements,\n ...(positionReference && {\n reference: positionReference\n })\n }\n });\n const setPositionReference = React.useCallback(node => {\n const computedPositionReference = isElement(node) ? {\n getBoundingClientRect: () => node.getBoundingClientRect(),\n contextElement: node\n } : node;\n // Store the positionReference in state if the DOM reference is specified externally via the\n // `elements.reference` option. This ensures that it won't be overridden on future renders.\n _setPositionReference(computedPositionReference);\n position.refs.setReference(computedPositionReference);\n }, [position.refs]);\n const setReference = React.useCallback(node => {\n if (isElement(node) || node === null) {\n domReferenceRef.current = node;\n setDomReference(node);\n }\n\n // Backwards-compatibility for passing a virtual element to `reference`\n // after it has set the DOM reference.\n if (isElement(position.refs.reference.current) || position.refs.reference.current === null ||\n // Don't allow setting virtual elements using the old technique back to\n // `null` to support `positionReference` + an unstable `reference`\n // callback ref.\n node !== null && !isElement(node)) {\n position.refs.setReference(node);\n }\n }, [position.refs]);\n const refs = React.useMemo(() => ({\n ...position.refs,\n setReference,\n setPositionReference,\n domReference: domReferenceRef\n }), [position.refs, setReference, setPositionReference]);\n const elements = React.useMemo(() => ({\n ...position.elements,\n domReference: domReference\n }), [position.elements, domReference]);\n const context = React.useMemo(() => ({\n ...position,\n ...rootContext,\n refs,\n elements,\n nodeId\n }), [position, refs, elements, nodeId, rootContext]);\n index(() => {\n rootContext.dataRef.current.floatingContext = context;\n const node = tree == null ? void 0 : tree.nodesRef.current.find(node => node.id === nodeId);\n if (node) {\n node.context = context;\n }\n });\n return React.useMemo(() => ({\n ...position,\n context,\n refs,\n elements\n }), [position, refs, elements, context]);\n}\n\n/**\n * Opens the floating element while the reference element has focus, like CSS\n * `:focus`.\n * @see https://floating-ui.com/docs/useFocus\n */\nfunction useFocus(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n onOpenChange,\n events,\n dataRef,\n elements\n } = context;\n const {\n enabled = true,\n visibleOnly = true\n } = props;\n const blockFocusRef = React.useRef(false);\n const timeoutRef = React.useRef();\n const keyboardModalityRef = React.useRef(true);\n React.useEffect(() => {\n if (!enabled) return;\n const win = getWindow(elements.domReference);\n\n // If the reference was focused and the user left the tab/window, and the\n // floating element was not open, the focus should be blocked when they\n // return to the tab/window.\n function onBlur() {\n if (!open && isHTMLElement(elements.domReference) && elements.domReference === activeElement(getDocument(elements.domReference))) {\n blockFocusRef.current = true;\n }\n }\n function onKeyDown() {\n keyboardModalityRef.current = true;\n }\n win.addEventListener('blur', onBlur);\n win.addEventListener('keydown', onKeyDown, true);\n return () => {\n win.removeEventListener('blur', onBlur);\n win.removeEventListener('keydown', onKeyDown, true);\n };\n }, [elements.domReference, open, enabled]);\n React.useEffect(() => {\n if (!enabled) return;\n function onOpenChange(_ref) {\n let {\n reason\n } = _ref;\n if (reason === 'reference-press' || reason === 'escape-key') {\n blockFocusRef.current = true;\n }\n }\n events.on('openchange', onOpenChange);\n return () => {\n events.off('openchange', onOpenChange);\n };\n }, [events, enabled]);\n React.useEffect(() => {\n return () => {\n clearTimeout(timeoutRef.current);\n };\n }, []);\n const reference = React.useMemo(() => ({\n onPointerDown(event) {\n if (isVirtualPointerEvent(event.nativeEvent)) return;\n keyboardModalityRef.current = false;\n },\n onMouseLeave() {\n blockFocusRef.current = false;\n },\n onFocus(event) {\n if (blockFocusRef.current) return;\n const target = getTarget(event.nativeEvent);\n if (visibleOnly && isElement(target)) {\n try {\n // Mac Safari unreliably matches `:focus-visible` on the reference\n // if focus was outside the page initially - use the fallback\n // instead.\n if (isSafari() && isMac()) throw Error();\n if (!target.matches(':focus-visible')) return;\n } catch (e) {\n // Old browsers will throw an error when using `:focus-visible`.\n if (!keyboardModalityRef.current && !isTypeableElement(target)) {\n return;\n }\n }\n }\n onOpenChange(true, event.nativeEvent, 'focus');\n },\n onBlur(event) {\n blockFocusRef.current = false;\n const relatedTarget = event.relatedTarget;\n const nativeEvent = event.nativeEvent;\n\n // Hit the non-modal focus management portal guard. Focus will be\n // moved into the floating element immediately after.\n const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute('focus-guard')) && relatedTarget.getAttribute('data-type') === 'outside';\n\n // Wait for the window blur listener to fire.\n timeoutRef.current = window.setTimeout(() => {\n var _dataRef$current$floa;\n const activeEl = activeElement(elements.domReference ? elements.domReference.ownerDocument : document);\n\n // Focus left the page, keep it open.\n if (!relatedTarget && activeEl === elements.domReference) return;\n\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n // We can not rely on relatedTarget to point to the correct element\n // as it will only point to the shadow host of the newly focused element\n // and not the element that actually has received focus if it is located\n // inside a shadow root.\n if (contains((_dataRef$current$floa = dataRef.current.floatingContext) == null ? void 0 : _dataRef$current$floa.refs.floating.current, activeEl) || contains(elements.domReference, activeEl) || movedToFocusGuard) {\n return;\n }\n onOpenChange(false, nativeEvent, 'focus');\n });\n }\n }), [dataRef, elements.domReference, onOpenChange, visibleOnly]);\n return React.useMemo(() => enabled ? {\n reference\n } : {}, [enabled, reference]);\n}\n\nconst ACTIVE_KEY = 'active';\nconst SELECTED_KEY = 'selected';\nfunction mergeProps(userProps, propsList, elementKey) {\n const map = new Map();\n const isItem = elementKey === 'item';\n let domUserProps = userProps;\n if (isItem && userProps) {\n const {\n [ACTIVE_KEY]: _,\n [SELECTED_KEY]: __,\n ...validProps\n } = userProps;\n domUserProps = validProps;\n }\n return {\n ...(elementKey === 'floating' && {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n }),\n ...domUserProps,\n ...propsList.map(value => {\n const propsOrGetProps = value ? value[elementKey] : null;\n if (typeof propsOrGetProps === 'function') {\n return userProps ? propsOrGetProps(userProps) : null;\n }\n return propsOrGetProps;\n }).concat(userProps).reduce((acc, props) => {\n if (!props) {\n return acc;\n }\n Object.entries(props).forEach(_ref => {\n let [key, value] = _ref;\n if (isItem && [ACTIVE_KEY, SELECTED_KEY].includes(key)) {\n return;\n }\n if (key.indexOf('on') === 0) {\n if (!map.has(key)) {\n map.set(key, []);\n }\n if (typeof value === 'function') {\n var _map$get;\n (_map$get = map.get(key)) == null || _map$get.push(value);\n acc[key] = function () {\n var _map$get2;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.map(fn => fn(...args)).find(val => val !== undefined);\n };\n }\n } else {\n acc[key] = value;\n }\n });\n return acc;\n }, {})\n };\n}\n/**\n * Merges an array of interaction hooks' props into prop getters, allowing\n * event handler functions to be composed together without overwriting one\n * another.\n * @see https://floating-ui.com/docs/useInteractions\n */\nfunction useInteractions(propsList) {\n if (propsList === void 0) {\n propsList = [];\n }\n const referenceDeps = propsList.map(key => key == null ? void 0 : key.reference);\n const floatingDeps = propsList.map(key => key == null ? void 0 : key.floating);\n const itemDeps = propsList.map(key => key == null ? void 0 : key.item);\n const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n referenceDeps);\n const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n floatingDeps);\n const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n itemDeps);\n return React.useMemo(() => ({\n getReferenceProps,\n getFloatingProps,\n getItemProps\n }), [getReferenceProps, getFloatingProps, getItemProps]);\n}\n\nlet isPreventScrollSupported = false;\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key === ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n return doSwitch(orientation, vertical, horizontal);\n}\n/**\n * Adds arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nfunction useListNavigation(context, props) {\n const {\n open,\n onOpenChange,\n elements\n } = context;\n const {\n listRef,\n activeIndex,\n onNavigate: unstable_onNavigate = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loop = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n cols = 1,\n scrollItemIntoView = true,\n virtualItemRef,\n itemSizes,\n dense = false\n } = props;\n if (process.env.NODE_ENV !== \"production\") {\n if (allowEscape) {\n if (!loop) {\n warn('`useListNavigation` looping must be enabled to allow escaping.');\n }\n if (!virtual) {\n warn('`useListNavigation` must be virtual to allow escaping.');\n }\n }\n if (orientation === 'vertical' && cols > 1) {\n warn('In grid list navigation mode (`cols` > 1), the `orientation` should', 'be either \"horizontal\" or \"both\".');\n }\n }\n const floatingFocusElement = getFloatingFocusElement(elements.floating);\n const floatingFocusElementRef = useLatestRef(floatingFocusElement);\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree();\n const onNavigate = useEffectEvent(unstable_onNavigate);\n const typeableComboboxReference = isTypeableCombobox(elements.domReference);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex != null ? selectedIndex : -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const previousOnNavigateRef = React.useRef(onNavigate);\n const previousMountedRef = React.useRef(!!elements.floating);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocus = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const disabledIndicesRef = useLatestRef(disabledIndices);\n const latestOpenRef = useLatestRef(open);\n const scrollItemIntoViewRef = useLatestRef(scrollItemIntoView);\n const selectedIndexRef = useLatestRef(selectedIndex);\n const [activeId, setActiveId] = React.useState();\n const [virtualId, setVirtualId] = React.useState();\n const focusItem = useEffectEvent(function (listRef, indexRef, forceScrollIntoView) {\n if (forceScrollIntoView === void 0) {\n forceScrollIntoView = false;\n }\n function runFocus(item) {\n if (virtual) {\n setActiveId(item.id);\n tree == null || tree.events.emit('virtualfocus', item);\n if (virtualItemRef) {\n virtualItemRef.current = item;\n }\n } else {\n enqueueFocus(item, {\n preventScroll: true,\n // Mac Safari does not move the virtual cursor unless the focus call\n // is sync. However, for the very first focus call, we need to wait\n // for the position to be ready in order to prevent unwanted\n // scrolling. This means the virtual cursor will not move to the first\n // item when first opening the floating element, but will on\n // subsequent calls. `preventScroll` is supported in modern Safari,\n // so we can use that instead.\n // iOS Safari must be async or the first item will not be focused.\n sync: isMac() && isSafari() ? isPreventScrollSupported || forceSyncFocus.current : false\n });\n }\n }\n const initialItem = listRef.current[indexRef.current];\n if (initialItem) {\n runFocus(initialItem);\n }\n requestAnimationFrame(() => {\n const waitedItem = listRef.current[indexRef.current] || initialItem;\n if (!waitedItem) return;\n if (!initialItem) {\n runFocus(waitedItem);\n }\n const scrollIntoViewOptions = scrollItemIntoViewRef.current;\n const shouldScrollIntoView = scrollIntoViewOptions && item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n waitedItem.scrollIntoView == null || waitedItem.scrollIntoView(typeof scrollIntoViewOptions === 'boolean' ? {\n block: 'nearest',\n inline: 'nearest'\n } : scrollIntoViewOptions);\n }\n });\n });\n index(() => {\n document.createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n }, []);\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n index(() => {\n if (!enabled) return;\n if (open && elements.floating) {\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n indexRef.current = selectedIndex;\n onNavigate(selectedIndex);\n }\n } else if (previousMountedRef.current) {\n // Since the user can specify `onNavigate` conditionally\n // (onNavigate: open ? setActiveIndex : setSelectedIndex),\n // we store and call the previous function.\n indexRef.current = -1;\n previousOnNavigateRef.current(null);\n }\n }, [enabled, open, elements.floating, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n index(() => {\n if (!enabled) return;\n if (open && elements.floating) {\n if (activeIndex == null) {\n forceSyncFocus.current = false;\n if (selectedIndexRef.current != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousMountedRef.current) {\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n }\n\n // Initial sync.\n if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n let runs = 0;\n const waitForListPopulated = () => {\n if (listRef.current[0] == null) {\n // Avoid letting the browser paint if possible on the first try,\n // otherwise use rAF. Don't try more than twice, since something\n // is wrong otherwise.\n if (runs < 2) {\n const scheduler = runs ? requestAnimationFrame : queueMicrotask;\n scheduler(waitForListPopulated);\n }\n runs++;\n } else {\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinIndex(listRef, disabledIndicesRef.current) : getMaxIndex(listRef, disabledIndicesRef.current);\n keyRef.current = null;\n onNavigate(indexRef.current);\n }\n };\n waitForListPopulated();\n }\n } else if (!isIndexOutOfBounds(listRef, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem(listRef, indexRef, forceScrollIntoViewRef.current);\n forceScrollIntoViewRef.current = false;\n }\n }\n }, [enabled, open, elements.floating, activeIndex, selectedIndexRef, nested, listRef, orientation, rtl, onNavigate, focusItem, disabledIndicesRef]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n index(() => {\n var _nodes$find;\n if (!enabled || elements.floating || !tree || virtual || !previousMountedRef.current) {\n return;\n }\n const nodes = tree.nodesRef.current;\n const parent = (_nodes$find = nodes.find(node => node.id === parentId)) == null || (_nodes$find = _nodes$find.context) == null ? void 0 : _nodes$find.elements.floating;\n const activeEl = activeElement(getDocument(elements.floating));\n const treeContainsActiveEl = nodes.some(node => node.context && contains(node.context.elements.floating, activeEl));\n if (parent && !treeContainsActiveEl && isPointerModalityRef.current) {\n parent.focus({\n preventScroll: true\n });\n }\n }, [enabled, elements.floating, tree, parentId, virtual]);\n index(() => {\n if (!enabled) return;\n if (!tree) return;\n if (!virtual) return;\n if (parentId) return;\n function handleVirtualFocus(item) {\n setVirtualId(item.id);\n if (virtualItemRef) {\n virtualItemRef.current = item;\n }\n }\n tree.events.on('virtualfocus', handleVirtualFocus);\n return () => {\n tree.events.off('virtualfocus', handleVirtualFocus);\n };\n }, [enabled, tree, virtual, parentId, virtualItemRef]);\n index(() => {\n previousOnNavigateRef.current = onNavigate;\n previousMountedRef.current = !!elements.floating;\n });\n index(() => {\n if (!open) {\n keyRef.current = null;\n }\n }, [open]);\n index(() => {\n previousOpenRef.current = open;\n }, [open]);\n const hasActiveIndex = activeIndex != null;\n const item = React.useMemo(() => {\n function syncCurrentTarget(currentTarget) {\n if (!open) return;\n const index = listRef.current.indexOf(currentTarget);\n if (index !== -1) {\n onNavigate(index);\n }\n }\n const props = {\n onFocus(_ref) {\n let {\n currentTarget\n } = _ref;\n syncCurrentTarget(currentTarget);\n },\n onClick: _ref2 => {\n let {\n currentTarget\n } = _ref2;\n return currentTarget.focus({\n preventScroll: true\n });\n },\n // Safari\n ...(focusItemOnHover && {\n onMouseMove(_ref3) {\n let {\n currentTarget\n } = _ref3;\n syncCurrentTarget(currentTarget);\n },\n onPointerLeave(_ref4) {\n let {\n pointerType\n } = _ref4;\n if (!isPointerModalityRef.current || pointerType === 'touch') {\n return;\n }\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n onNavigate(null);\n if (!virtual) {\n enqueueFocus(floatingFocusElementRef.current, {\n preventScroll: true\n });\n }\n }\n })\n };\n return props;\n }, [open, floatingFocusElementRef, focusItem, focusItemOnHover, listRef, onNavigate, virtual]);\n const commonOnKeyDown = useEffectEvent(event => {\n isPointerModalityRef.current = false;\n forceSyncFocus.current = true;\n\n // When composing a character, Chrome fires ArrowDown twice. Firefox/Safari\n // don't appear to suffer from this. `event.isComposing` is avoided due to\n // Safari not supporting it properly (although it's not needed in the first\n // place for Safari, just avoiding any possible issues).\n if (event.which === 229) {\n return;\n }\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl)) {\n stopEvent(event);\n onOpenChange(false, event.nativeEvent, 'list-navigation');\n if (isHTMLElement(elements.domReference)) {\n if (virtual) {\n tree == null || tree.events.emit('virtualfocus', elements.domReference);\n } else {\n elements.domReference.focus();\n }\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinIndex(listRef, disabledIndices);\n const maxIndex = getMaxIndex(listRef, disabledIndices);\n if (!typeableComboboxReference) {\n if (event.key === 'Home') {\n stopEvent(event);\n indexRef.current = minIndex;\n onNavigate(indexRef.current);\n }\n if (event.key === 'End') {\n stopEvent(event);\n indexRef.current = maxIndex;\n onNavigate(indexRef.current);\n }\n }\n\n // Grid navigation.\n if (cols > 1) {\n const sizes = itemSizes || Array.from({\n length: listRef.current.length\n }, () => ({\n width: 1,\n height: 1\n }));\n // To calculate movements on the grid, we use hypothetical cell indices\n // as if every item was 1x1, then convert back to real indices.\n const cellMap = buildCellMap(sizes, cols, dense);\n const minGridIndex = cellMap.findIndex(index => index != null && !isDisabled(listRef.current, index, disabledIndices));\n // last enabled index\n const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isDisabled(listRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);\n const index = cellMap[getGridNavigatedIndex({\n current: cellMap.map(itemIndex => itemIndex != null ? listRef.current[itemIndex] : null)\n }, {\n event,\n orientation,\n loop,\n rtl,\n cols,\n // treat undefined (empty grid spaces) as disabled indices so we\n // don't end up in them\n disabledIndices: getCellIndices([...(disabledIndices || listRef.current.map((_, index) => isDisabled(listRef.current, index) ? index : undefined)), undefined], cellMap),\n minIndex: minGridIndex,\n maxIndex: maxGridIndex,\n prevIndex: getCellIndexOfCorner(indexRef.current > maxIndex ? minIndex : indexRef.current, sizes, cellMap, cols,\n // use a corner matching the edge closest to the direction\n // we're moving in so we don't end up in the same item. Prefer\n // top/left over bottom/right.\n event.key === ARROW_DOWN ? 'bl' : event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT) ? 'tr' : 'tl'),\n stopEvent: true\n })];\n if (index != null) {\n indexRef.current = index;\n onNavigate(indexRef.current);\n }\n if (orientation === 'both') {\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(indexRef.current);\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loop) {\n indexRef.current = currentIndex >= maxIndex ? allowEscape && currentIndex !== listRef.current.length ? -1 : minIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n });\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else {\n if (loop) {\n indexRef.current = currentIndex <= minIndex ? allowEscape && currentIndex !== -1 ? listRef.current.length : maxIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n }\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n onNavigate(null);\n } else {\n onNavigate(indexRef.current);\n }\n }\n });\n const ariaActiveDescendantProp = React.useMemo(() => {\n return virtual && open && hasActiveIndex && {\n 'aria-activedescendant': virtualId || activeId\n };\n }, [virtual, open, hasActiveIndex, virtualId, activeId]);\n const floating = React.useMemo(() => {\n return {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...(!isTypeableCombobox(elements.domReference) && ariaActiveDescendantProp),\n onKeyDown: commonOnKeyDown,\n onPointerMove() {\n isPointerModalityRef.current = true;\n }\n };\n }, [ariaActiveDescendantProp, commonOnKeyDown, elements.domReference, orientation]);\n const reference = React.useMemo(() => {\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n return {\n ...ariaActiveDescendantProp,\n onKeyDown(event) {\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.startsWith('Arrow');\n const isHomeOrEndKey = ['Home', 'End'].includes(event.key);\n const isMoveKey = isArrowKey || isHomeOrEndKey;\n const isCrossOpenKey = isCrossOrientationOpenKey(event.key, orientation, rtl);\n const isCrossCloseKey = isCrossOrientationCloseKey(event.key, orientation, rtl);\n const isMainKey = isMainOrientationKey(event.key, orientation);\n const isNavigationKey = (nested ? isCrossOpenKey : isMainKey) || event.key === 'Enter' || event.key.trim() === '';\n if (virtual && open) {\n const rootNode = tree == null ? void 0 : tree.nodesRef.current.find(node => node.parentId == null);\n const deepestNode = tree && rootNode ? getDeepestNode(tree.nodesRef.current, rootNode.id) : null;\n if (isMoveKey && deepestNode && virtualItemRef) {\n const eventObject = new KeyboardEvent('keydown', {\n key: event.key,\n bubbles: true\n });\n if (isCrossOpenKey || isCrossCloseKey) {\n var _deepestNode$context, _deepestNode$context2;\n const isCurrentTarget = ((_deepestNode$context = deepestNode.context) == null ? void 0 : _deepestNode$context.elements.domReference) === event.currentTarget;\n const dispatchItem = isCrossCloseKey && !isCurrentTarget ? (_deepestNode$context2 = deepestNode.context) == null ? void 0 : _deepestNode$context2.elements.domReference : isCrossOpenKey ? listRef.current.find(item => (item == null ? void 0 : item.id) === activeId) : null;\n if (dispatchItem) {\n stopEvent(event);\n dispatchItem.dispatchEvent(eventObject);\n setVirtualId(undefined);\n }\n }\n if ((isMainKey || isHomeOrEndKey) && deepestNode.context) {\n if (deepestNode.context.open && deepestNode.parentId && event.currentTarget !== deepestNode.context.elements.domReference) {\n var _deepestNode$context$;\n stopEvent(event);\n (_deepestNode$context$ = deepestNode.context.elements.domReference) == null || _deepestNode$context$.dispatchEvent(eventObject);\n return;\n }\n }\n }\n return commonOnKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!open && !openOnArrowKeyDown && isArrowKey) {\n return;\n }\n if (isNavigationKey) {\n keyRef.current = nested && isMainKey ? null : event.key;\n }\n if (nested) {\n if (isCrossOpenKey) {\n stopEvent(event);\n if (open) {\n indexRef.current = getMinIndex(listRef, disabledIndicesRef.current);\n onNavigate(indexRef.current);\n } else {\n onOpenChange(true, event.nativeEvent, 'list-navigation');\n }\n }\n return;\n }\n if (isMainKey) {\n if (selectedIndex != null) {\n indexRef.current = selectedIndex;\n }\n stopEvent(event);\n if (!open && openOnArrowKeyDown) {\n onOpenChange(true, event.nativeEvent, 'list-navigation');\n } else {\n commonOnKeyDown(event);\n }\n if (open) {\n onNavigate(indexRef.current);\n }\n }\n },\n onFocus() {\n if (open && !virtual) {\n onNavigate(null);\n }\n },\n onPointerDown: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n };\n }, [activeId, ariaActiveDescendantProp, commonOnKeyDown, disabledIndicesRef, focusItemOnOpen, listRef, nested, onNavigate, onOpenChange, open, openOnArrowKeyDown, orientation, rtl, selectedIndex, tree, virtual, virtualItemRef]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item\n } : {}, [enabled, reference, floating, item]);\n}\n\nconst componentRoleToAriaRoleMap = /*#__PURE__*/new Map([['select', 'listbox'], ['combobox', 'listbox'], ['label', false]]);\n\n/**\n * Adds base screen reader props to the reference and floating elements for a\n * given floating element `role`.\n * @see https://floating-ui.com/docs/useRole\n */\nfunction useRole(context, props) {\n var _componentRoleToAriaR;\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n floatingId\n } = context;\n const {\n enabled = true,\n role = 'dialog'\n } = props;\n const ariaRole = (_componentRoleToAriaR = componentRoleToAriaRoleMap.get(role)) != null ? _componentRoleToAriaR : role;\n const referenceId = useId();\n const parentId = useFloatingParentNodeId();\n const isNested = parentId != null;\n const reference = React.useMemo(() => {\n if (ariaRole === 'tooltip' || role === 'label') {\n return {\n [\"aria-\" + (role === 'label' ? 'labelledby' : 'describedby')]: open ? floatingId : undefined\n };\n }\n return {\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': ariaRole === 'alertdialog' ? 'dialog' : ariaRole,\n 'aria-controls': open ? floatingId : undefined,\n ...(ariaRole === 'listbox' && {\n role: 'combobox'\n }),\n ...(ariaRole === 'menu' && {\n id: referenceId\n }),\n ...(ariaRole === 'menu' && isNested && {\n role: 'menuitem'\n }),\n ...(role === 'select' && {\n 'aria-autocomplete': 'none'\n }),\n ...(role === 'combobox' && {\n 'aria-autocomplete': 'list'\n })\n };\n }, [ariaRole, floatingId, isNested, open, referenceId, role]);\n const floating = React.useMemo(() => {\n const floatingProps = {\n id: floatingId,\n ...(ariaRole && {\n role: ariaRole\n })\n };\n if (ariaRole === 'tooltip' || role === 'label') {\n return floatingProps;\n }\n return {\n ...floatingProps,\n ...(ariaRole === 'menu' && {\n 'aria-labelledby': referenceId\n })\n };\n }, [ariaRole, floatingId, referenceId, role]);\n const item = React.useCallback(_ref => {\n let {\n active,\n selected\n } = _ref;\n const commonProps = {\n role: 'option',\n ...(active && {\n id: floatingId + \"-option\"\n })\n };\n\n // For `menu`, we are unable to tell if the item is a `menuitemradio`\n // or `menuitemcheckbox`. For backwards-compatibility reasons, also\n // avoid defaulting to `menuitem` as it may overwrite custom role props.\n switch (role) {\n case 'select':\n return {\n ...commonProps,\n 'aria-selected': active && selected\n };\n case 'combobox':\n {\n return {\n ...commonProps,\n ...(active && {\n 'aria-selected': true\n })\n };\n }\n }\n return {};\n }, [floatingId, role]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n item\n } : {}, [enabled, reference, floating, item]);\n}\n\n// Converts a JS style key like `backgroundColor` to a CSS transition-property\n// like `background-color`.\nconst camelCaseToKebabCase = str => str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());\nfunction execWithArgsOrReturn(valueOrFn, args) {\n return typeof valueOrFn === 'function' ? valueOrFn(args) : valueOrFn;\n}\nfunction useDelayUnmount(open, durationMs) {\n const [isMounted, setIsMounted] = React.useState(open);\n if (open && !isMounted) {\n setIsMounted(true);\n }\n React.useEffect(() => {\n if (!open && isMounted) {\n const timeout = setTimeout(() => setIsMounted(false), durationMs);\n return () => clearTimeout(timeout);\n }\n }, [open, isMounted, durationMs]);\n return isMounted;\n}\n/**\n * Provides a status string to apply CSS transitions to a floating element,\n * correctly handling placement-aware transitions.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstatus\n */\nfunction useTransitionStatus(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n open,\n elements: {\n floating\n }\n } = context;\n const {\n duration = 250\n } = props;\n const isNumberDuration = typeof duration === 'number';\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n const [status, setStatus] = React.useState('unmounted');\n const isMounted = useDelayUnmount(open, closeDuration);\n if (!isMounted && status === 'close') {\n setStatus('unmounted');\n }\n index(() => {\n if (!floating) return;\n if (open) {\n setStatus('initial');\n const frame = requestAnimationFrame(() => {\n setStatus('open');\n });\n return () => {\n cancelAnimationFrame(frame);\n };\n }\n setStatus('close');\n }, [open, floating]);\n return {\n isMounted,\n status\n };\n}\n/**\n * Provides styles to apply CSS transitions to a floating element, correctly\n * handling placement-aware transitions. Wrapper around `useTransitionStatus`.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstyles\n */\nfunction useTransitionStyles(context, props) {\n if (props === void 0) {\n props = {};\n }\n const {\n initial: unstable_initial = {\n opacity: 0\n },\n open: unstable_open,\n close: unstable_close,\n common: unstable_common,\n duration = 250\n } = props;\n const placement = context.placement;\n const side = placement.split('-')[0];\n const fnArgs = React.useMemo(() => ({\n side,\n placement\n }), [side, placement]);\n const isNumberDuration = typeof duration === 'number';\n const openDuration = (isNumberDuration ? duration : duration.open) || 0;\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n const [styles, setStyles] = React.useState(() => ({\n ...execWithArgsOrReturn(unstable_common, fnArgs),\n ...execWithArgsOrReturn(unstable_initial, fnArgs)\n }));\n const {\n isMounted,\n status\n } = useTransitionStatus(context, {\n duration\n });\n const initialRef = useLatestRef(unstable_initial);\n const openRef = useLatestRef(unstable_open);\n const closeRef = useLatestRef(unstable_close);\n const commonRef = useLatestRef(unstable_common);\n index(() => {\n const initialStyles = execWithArgsOrReturn(initialRef.current, fnArgs);\n const closeStyles = execWithArgsOrReturn(closeRef.current, fnArgs);\n const commonStyles = execWithArgsOrReturn(commonRef.current, fnArgs);\n const openStyles = execWithArgsOrReturn(openRef.current, fnArgs) || Object.keys(initialStyles).reduce((acc, key) => {\n acc[key] = '';\n return acc;\n }, {});\n if (status === 'initial') {\n setStyles(styles => ({\n transitionProperty: styles.transitionProperty,\n ...commonStyles,\n ...initialStyles\n }));\n }\n if (status === 'open') {\n setStyles({\n transitionProperty: Object.keys(openStyles).map(camelCaseToKebabCase).join(','),\n transitionDuration: openDuration + \"ms\",\n ...commonStyles,\n ...openStyles\n });\n }\n if (status === 'close') {\n const styles = closeStyles || initialStyles;\n setStyles({\n transitionProperty: Object.keys(styles).map(camelCaseToKebabCase).join(','),\n transitionDuration: closeDuration + \"ms\",\n ...commonStyles,\n ...styles\n });\n }\n }, [closeDuration, closeRef, initialRef, openRef, commonRef, openDuration, status, fnArgs]);\n return {\n isMounted,\n styles\n };\n}\n\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nfunction useTypeahead(context, props) {\n var _ref;\n const {\n open,\n dataRef\n } = context;\n const {\n listRef,\n activeIndex,\n onMatch: unstable_onMatch,\n onTypingChange: unstable_onTypingChange,\n enabled = true,\n findMatch = null,\n resetMs = 750,\n ignoreKeys = [],\n selectedIndex = null\n } = props;\n const timeoutIdRef = React.useRef();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef((_ref = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref : -1);\n const matchIndexRef = React.useRef(null);\n const onMatch = useEffectEvent(unstable_onMatch);\n const onTypingChange = useEffectEvent(unstable_onTypingChange);\n const findMatchRef = useLatestRef(findMatch);\n const ignoreKeysRef = useLatestRef(ignoreKeys);\n index(() => {\n if (open) {\n clearTimeout(timeoutIdRef.current);\n matchIndexRef.current = null;\n stringRef.current = '';\n }\n }, [open]);\n index(() => {\n // Sync arrow key navigation but not typeahead navigation.\n if (open && stringRef.current === '') {\n var _ref2;\n prevIndexRef.current = (_ref2 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref2 : -1;\n }\n }, [open, selectedIndex, activeIndex]);\n const setTypingChange = useEffectEvent(value => {\n if (value) {\n if (!dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange(value);\n }\n } else {\n if (dataRef.current.typing) {\n dataRef.current.typing = value;\n onTypingChange(value);\n }\n }\n });\n const onKeyDown = useEffectEvent(event => {\n function getMatchingIndex(list, orderedList, string) {\n const str = findMatchRef.current ? findMatchRef.current(orderedList, string) : orderedList.find(text => (text == null ? void 0 : text.toLocaleLowerCase().indexOf(string.toLocaleLowerCase())) === 0);\n return str ? list.indexOf(str) : -1;\n }\n const listContent = listRef.current;\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n if (getMatchingIndex(listContent, listContent, stringRef.current) === -1) {\n setTypingChange(false);\n } else if (event.key === ' ') {\n stopEvent(event);\n }\n }\n if (listContent == null || ignoreKeysRef.current.includes(event.key) ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n if (open && event.key !== ' ') {\n stopEvent(event);\n setTypingChange(true);\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too.\n const allowRapidSuccessionOfFirstLetter = listContent.every(text => {\n var _text$, _text$2;\n return text ? ((_text$ = text[0]) == null ? void 0 : _text$.toLocaleLowerCase()) !== ((_text$2 = text[1]) == null ? void 0 : _text$2.toLocaleLowerCase()) : true;\n });\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n clearTimeout(timeoutIdRef.current);\n timeoutIdRef.current = setTimeout(() => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n setTypingChange(false);\n }, resetMs);\n const prevIndex = prevIndexRef.current;\n const index = getMatchingIndex(listContent, [...listContent.slice((prevIndex || 0) + 1), ...listContent.slice(0, (prevIndex || 0) + 1)], stringRef.current);\n if (index !== -1) {\n onMatch(index);\n matchIndexRef.current = index;\n } else if (event.key !== ' ') {\n stringRef.current = '';\n setTypingChange(false);\n }\n });\n const reference = React.useMemo(() => ({\n onKeyDown\n }), [onKeyDown]);\n const floating = React.useMemo(() => {\n return {\n onKeyDown,\n onKeyUp(event) {\n if (event.key === ' ') {\n setTypingChange(false);\n }\n }\n };\n }, [onKeyDown, setTypingChange]);\n return React.useMemo(() => enabled ? {\n reference,\n floating\n } : {}, [enabled, reference, floating]);\n}\n\nfunction getArgsWithCustomFloatingHeight(state, height) {\n return {\n ...state,\n rects: {\n ...state.rects,\n floating: {\n ...state.rects.floating,\n height\n }\n }\n };\n}\n/**\n * Positions the floating element such that an inner element inside of it is\n * anchored to the reference element.\n * @see https://floating-ui.com/docs/inner\n */\nconst inner = props => ({\n name: 'inner',\n options: props,\n async fn(state) {\n const {\n listRef,\n overflowRef,\n onFallbackChange,\n offset: innerOffset = 0,\n index = 0,\n minItemsVisible = 4,\n referenceOverflowThreshold = 0,\n scrollRef,\n ...detectOverflowOptions\n } = evaluate(props, state);\n const {\n rects,\n elements: {\n floating\n }\n } = state;\n const item = listRef.current[index];\n const scrollEl = (scrollRef == null ? void 0 : scrollRef.current) || floating;\n\n // Valid combinations:\n // 1. Floating element is the scrollRef and has a border (default)\n // 2. Floating element is not the scrollRef, floating element has a border\n // 3. Floating element is not the scrollRef, scrollRef has a border\n // Floating > {...getFloatingProps()} wrapper > scrollRef > items is not\n // allowed as VoiceOver doesn't work.\n const clientTop = floating.clientTop || scrollEl.clientTop;\n const floatingIsBordered = floating.clientTop !== 0;\n const scrollElIsBordered = scrollEl.clientTop !== 0;\n const floatingIsScrollEl = floating === scrollEl;\n if (process.env.NODE_ENV !== \"production\") {\n if (!state.placement.startsWith('bottom')) {\n warn('`placement` side must be \"bottom\" when using the `inner`', 'middleware.');\n }\n }\n if (!item) {\n return {};\n }\n const nextArgs = {\n ...state,\n ...(await offset(-item.offsetTop - floating.clientTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(state))\n };\n const overflow = await detectOverflow(getArgsWithCustomFloatingHeight(nextArgs, scrollEl.scrollHeight + clientTop + floating.clientTop), detectOverflowOptions);\n const refOverflow = await detectOverflow(nextArgs, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const diffY = max(0, overflow.top);\n const nextY = nextArgs.y + diffY;\n const isScrollable = scrollEl.scrollHeight > scrollEl.clientHeight;\n const rounder = isScrollable ? v => v : round;\n const maxHeight = rounder(max(0, scrollEl.scrollHeight + (floatingIsBordered && floatingIsScrollEl || scrollElIsBordered ? clientTop * 2 : 0) - diffY - max(0, overflow.bottom)));\n scrollEl.style.maxHeight = maxHeight + \"px\";\n scrollEl.scrollTop = diffY;\n\n // There is not enough space, fallback to standard anchored positioning\n if (onFallbackChange) {\n const shouldFallback = scrollEl.offsetHeight < item.offsetHeight * min(minItemsVisible, listRef.current.length) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold;\n ReactDOM.flushSync(() => onFallbackChange(shouldFallback));\n }\n if (overflowRef) {\n overflowRef.current = await detectOverflow(getArgsWithCustomFloatingHeight({\n ...nextArgs,\n y: nextY\n }, scrollEl.offsetHeight + clientTop + floating.clientTop), detectOverflowOptions);\n }\n return {\n y: nextY\n };\n }\n});\n/**\n * Changes the `inner` middleware's `offset` upon a `wheel` event to\n * expand the floating element's height, revealing more list items.\n * @see https://floating-ui.com/docs/inner\n */\nfunction useInnerOffset(context, props) {\n const {\n open,\n elements\n } = context;\n const {\n enabled = true,\n overflowRef,\n scrollRef,\n onChange: unstable_onChange\n } = props;\n const onChange = useEffectEvent(unstable_onChange);\n const controlledScrollingRef = React.useRef(false);\n const prevScrollTopRef = React.useRef(null);\n const initialOverflowRef = React.useRef(null);\n React.useEffect(() => {\n if (!enabled) return;\n function onWheel(e) {\n if (e.ctrlKey || !el || overflowRef.current == null) {\n return;\n }\n const dY = e.deltaY;\n const isAtTop = overflowRef.current.top >= -0.5;\n const isAtBottom = overflowRef.current.bottom >= -0.5;\n const remainingScroll = el.scrollHeight - el.clientHeight;\n const sign = dY < 0 ? -1 : 1;\n const method = dY < 0 ? 'max' : 'min';\n if (el.scrollHeight <= el.clientHeight) {\n return;\n }\n if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {\n e.preventDefault();\n ReactDOM.flushSync(() => {\n onChange(d => d + Math[method](dY, remainingScroll * sign));\n });\n } else if (/firefox/i.test(getUserAgent())) {\n // Needed to propagate scrolling during momentum scrolling phase once\n // it gets limited by the boundary. UX improvement, not critical.\n el.scrollTop += dY;\n }\n }\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (open && el) {\n el.addEventListener('wheel', onWheel);\n\n // Wait for the position to be ready.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n if (overflowRef.current != null) {\n initialOverflowRef.current = {\n ...overflowRef.current\n };\n }\n });\n return () => {\n prevScrollTopRef.current = null;\n initialOverflowRef.current = null;\n el.removeEventListener('wheel', onWheel);\n };\n }\n }, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);\n const floating = React.useMemo(() => ({\n onKeyDown() {\n controlledScrollingRef.current = true;\n },\n onWheel() {\n controlledScrollingRef.current = false;\n },\n onPointerMove() {\n controlledScrollingRef.current = false;\n },\n onScroll() {\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (!overflowRef.current || !el || !controlledScrollingRef.current) {\n return;\n }\n if (prevScrollTopRef.current !== null) {\n const scrollDiff = el.scrollTop - prevScrollTopRef.current;\n if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {\n ReactDOM.flushSync(() => onChange(d => d + scrollDiff));\n }\n }\n\n // [Firefox] Wait for the height change to have been applied.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n });\n }\n }), [elements.floating, onChange, overflowRef, scrollRef]);\n return React.useMemo(() => enabled ? {\n floating\n } : {}, [enabled, floating]);\n}\n\nfunction isPointInPolygon(point, polygon) {\n const [x, y] = point;\n let isInside = false;\n const length = polygon.length;\n for (let i = 0, j = length - 1; i < length; j = i++) {\n const [xi, yi] = polygon[i] || [0, 0];\n const [xj, yj] = polygon[j] || [0, 0];\n const intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\nfunction isInside(point, rect) {\n return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n}\n/**\n * Generates a safe polygon area that the user can traverse without closing the\n * floating element once leaving the reference element.\n * @see https://floating-ui.com/docs/useHover#safepolygon\n */\nfunction safePolygon(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n buffer = 0.5,\n blockPointerEvents = false,\n requireIntent = true\n } = options;\n let timeoutId;\n let hasLanded = false;\n let lastX = null;\n let lastY = null;\n let lastCursorTime = performance.now();\n function getCursorSpeed(x, y) {\n const currentTime = performance.now();\n const elapsedTime = currentTime - lastCursorTime;\n if (lastX === null || lastY === null || elapsedTime === 0) {\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return null;\n }\n const deltaX = x - lastX;\n const deltaY = y - lastY;\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n const speed = distance / elapsedTime; // px / ms\n\n lastX = x;\n lastY = y;\n lastCursorTime = currentTime;\n return speed;\n }\n const fn = _ref => {\n let {\n x,\n y,\n placement,\n elements,\n onClose,\n nodeId,\n tree\n } = _ref;\n return function onMouseMove(event) {\n function close() {\n clearTimeout(timeoutId);\n onClose();\n }\n clearTimeout(timeoutId);\n if (!elements.domReference || !elements.floating || placement == null || x == null || y == null) {\n return;\n }\n const {\n clientX,\n clientY\n } = event;\n const clientPoint = [clientX, clientY];\n const target = getTarget(event);\n const isLeave = event.type === 'mouseleave';\n const isOverFloatingEl = contains(elements.floating, target);\n const isOverReferenceEl = contains(elements.domReference, target);\n const refRect = elements.domReference.getBoundingClientRect();\n const rect = elements.floating.getBoundingClientRect();\n const side = placement.split('-')[0];\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;\n const isOverReferenceRect = isInside(clientPoint, refRect);\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n const left = (isFloatingWider ? refRect : rect).left;\n const right = (isFloatingWider ? refRect : rect).right;\n const top = (isFloatingTaller ? refRect : rect).top;\n const bottom = (isFloatingTaller ? refRect : rect).bottom;\n if (isOverFloatingEl) {\n hasLanded = true;\n if (!isLeave) {\n return;\n }\n }\n if (isOverReferenceEl) {\n hasLanded = false;\n }\n if (isOverReferenceEl && !isLeave) {\n hasLanded = true;\n return;\n }\n\n // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n if (isLeave && isElement(event.relatedTarget) && contains(elements.floating, event.relatedTarget)) {\n return;\n }\n\n // If any nested child is open, abort.\n if (tree && getChildren(tree.nodesRef.current, nodeId).some(_ref2 => {\n let {\n context\n } = _ref2;\n return context == null ? void 0 : context.open;\n })) {\n return;\n }\n\n // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n return close();\n }\n\n // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n let rectPoly = [];\n switch (side) {\n case 'top':\n rectPoly = [[left, refRect.top + 1], [left, rect.bottom - 1], [right, rect.bottom - 1], [right, refRect.top + 1]];\n break;\n case 'bottom':\n rectPoly = [[left, rect.top + 1], [left, refRect.bottom - 1], [right, refRect.bottom - 1], [right, rect.top + 1]];\n break;\n case 'left':\n rectPoly = [[rect.right - 1, bottom], [rect.right - 1, top], [refRect.left + 1, top], [refRect.left + 1, bottom]];\n break;\n case 'right':\n rectPoly = [[refRect.right - 1, bottom], [refRect.right - 1, top], [rect.left + 1, top], [rect.left + 1, bottom]];\n break;\n }\n function getPolygon(_ref3) {\n let [x, y] = _ref3;\n switch (side) {\n case 'top':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'bottom':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'left':\n {\n const cursorPointOne = [x + buffer + 1, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x + buffer + 1, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];\n return [...commonPoints, cursorPointOne, cursorPointTwo];\n }\n case 'right':\n {\n const cursorPointOne = [x - buffer, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x - buffer, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n }\n }\n if (isPointInPolygon([clientX, clientY], rectPoly)) {\n return;\n }\n if (hasLanded && !isOverReferenceRect) {\n return close();\n }\n if (!isLeave && requireIntent) {\n const cursorSpeed = getCursorSpeed(event.clientX, event.clientY);\n const cursorSpeedThreshold = 0.1;\n if (cursorSpeed !== null && cursorSpeed < cursorSpeedThreshold) {\n return close();\n }\n }\n if (!isPointInPolygon([clientX, clientY], getPolygon([x, y]))) {\n close();\n } else if (!hasLanded && requireIntent) {\n timeoutId = window.setTimeout(close, 40);\n }\n };\n };\n fn.__options = {\n blockPointerEvents\n };\n return fn;\n}\n\nexport { Composite, CompositeItem, FloatingArrow, FloatingDelayGroup, FloatingFocusManager, FloatingList, FloatingNode, FloatingOverlay, FloatingPortal, FloatingTree, inner, safePolygon, useClick, useClientPoint, useDelayGroup, useDelayGroupContext, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingPortalNode, useFloatingRootContext, useFloatingTree, useFocus, useHover, useId, useInnerOffset, useInteractions, useListItem, useListNavigation, useMergeRefs, useRole, useTransitionStatus, useTransitionStyles, useTypeahead };\n","import { p as isWindowDefined, e as isFunction, q as SWRConfigContext, m as mergeObjects, d as defaultConfig, s as serialize, a as SWRGlobalState, o as cache, i as isUndefined, I as IS_SERVER, t as mergeConfigs } from '../config-context-ext53wcz.mjs';\nexport { j as IS_REACT_LEGACY, O as OBJECT, S as SWRConfig, U as UNDEFINED, v as compare, c as createCacheHelper, w as defaultConfigOptions, g as getTimestamp, x as hasRequestAnimationFrame, y as initCache, f as internalMutate, z as isDocumentDefined, A as isLegacyDeno, b as isPromiseLike, k as mutate, n as noop, B as preset, r as rAF, C as revalidateEvents, D as slowConnection, G as stableHash, l as unload, u as useIsomorphicLayoutEffect } from '../config-context-ext53wcz.mjs';\nimport { INFINITE_PREFIX } from './constants.mjs';\nimport React, { useContext, useMemo } from 'react';\n\n// @ts-expect-error\nconst enableDevtools = isWindowDefined && window.__SWR_DEVTOOLS_USE__;\nconst use = enableDevtools ? window.__SWR_DEVTOOLS_USE__ : [];\nconst setupDevTools = ()=>{\n if (enableDevtools) {\n // @ts-expect-error\n window.__SWR_DEVTOOLS_REACT__ = React;\n }\n};\n\nconst normalize = (args)=>{\n return isFunction(args[1]) ? [\n args[0],\n args[1],\n args[2] || {}\n ] : [\n args[0],\n null,\n (args[1] === null ? args[2] : args[1]) || {}\n ];\n};\n\nconst useSWRConfig = ()=>{\n const parentConfig = useContext(SWRConfigContext);\n const mergedConfig = useMemo(()=>mergeObjects(defaultConfig, parentConfig), [\n parentConfig\n ]);\n return mergedConfig;\n};\n\nconst preload = (key_, fetcher)=>{\n // preload should be a no-op on the server\n if (IS_SERVER) {\n return undefined;\n }\n const [key, fnArg] = serialize(key_);\n const [, , , PRELOAD] = SWRGlobalState.get(cache);\n // Prevent preload to be called multiple times before used.\n if (PRELOAD[key]) {\n return PRELOAD[key];\n }\n const req = fetcher(fnArg);\n PRELOAD[key] = req;\n return req;\n};\nconst middleware = (useSWRNext)=>(key_, fetcher_, config)=>{\n // fetcher might be a sync function, so this should not be an async function\n const fetcher = fetcher_ && ((...args)=>{\n const [key] = serialize(key_);\n const [, , , PRELOAD] = SWRGlobalState.get(cache);\n if (key.startsWith(INFINITE_PREFIX)) {\n // we want the infinite fetcher to be called.\n // handling of the PRELOAD cache happens there.\n return fetcher_(...args);\n }\n const req = PRELOAD[key];\n if (isUndefined(req)) return fetcher_(...args);\n delete PRELOAD[key];\n return req;\n });\n return useSWRNext(key_, fetcher, config);\n };\n\nconst BUILT_IN_MIDDLEWARE = use.concat(middleware);\n\n// It's tricky to pass generic types as parameters, so we just directly override\n// the types here.\nconst withArgs = (hook)=>{\n return function useSWRArgs(...args) {\n // Get the default and inherited configuration.\n const fallbackConfig = useSWRConfig();\n // Normalize arguments.\n const [key, fn, _config] = normalize(args);\n // Merge configurations.\n const config = mergeConfigs(fallbackConfig, _config);\n // Apply middleware\n let next = hook;\n const { use } = config;\n const middleware = (use || []).concat(BUILT_IN_MIDDLEWARE);\n for(let i = middleware.length; i--;){\n next = middleware[i](next);\n }\n return next(key, fn || config.fetcher || null, config);\n };\n};\n\n// Add a callback function to a list of keyed callback functions and return\n// the unsubscribe function.\nconst subscribeCallback = (key, callbacks, callback)=>{\n const keyedRevalidators = callbacks[key] || (callbacks[key] = []);\n keyedRevalidators.push(callback);\n return ()=>{\n const index = keyedRevalidators.indexOf(callback);\n if (index >= 0) {\n // O(1): faster than splice\n keyedRevalidators[index] = keyedRevalidators[keyedRevalidators.length - 1];\n keyedRevalidators.pop();\n }\n };\n};\n\n// Create a custom hook with a middleware\nconst withMiddleware = (useSWR, middleware)=>{\n return (...args)=>{\n const [key, fn, config] = normalize(args);\n const uses = (config.use || []).concat(middleware);\n return useSWR(key, fn, {\n ...config,\n use: uses\n });\n };\n};\n\nsetupDevTools();\n\nexport { INFINITE_PREFIX, IS_SERVER, SWRGlobalState, cache, defaultConfig, isFunction, isUndefined, isWindowDefined, mergeConfigs, mergeObjects, normalize, preload, serialize, subscribeCallback, useSWRConfig, withArgs, withMiddleware };\n","'use strict';\n\nimport bind from './helpers/bind.js';\n\n// utils is a library of generic helper functions non-specific to axios\n\nconst { toString } = Object.prototype;\nconst { getPrototypeOf } = Object;\nconst { iterator, toStringTag } = Symbol;\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (\n ({ hasOwnProperty }) =>\n (obj, prop) =>\n hasOwnProperty.call(obj, prop)\n)(Object.prototype);\n\nconst isUnsafeObjectKey = (prop) =>\n typeof prop === 'string' &&\n (prop === '__proto__' || prop === 'constructor' || prop === 'prototype');\n\n/**\n * Determine whether an inherited object must be treated as a shared-prototype\n * boundary. Cross-realm Object.prototype objects cannot be distinguished\n * reliably from application-created null-prototype objects because their\n * properties are mutable, so all inherited terminal prototypes are excluded\n * as a fail-closed boundary. A null-prototype source still keeps its own\n * properties, as produced by mergeConfig and other safe materialization paths.\n *\n * @param {*} obj The object to inspect\n * @param {*} prototype The object's prototype\n * @param {boolean} source Whether obj is the original traversal source\n *\n * @returns {boolean} True when obj is a safe prototype traversal boundary\n */\nconst isPrototypeBoundary = (obj, prototype, source) =>\n obj === Object.prototype || (!source && prototype === null);\n\n/**\n * Determine whether an object can retain its identity through code paths that\n * add, replace, and remove config properties without bypassing unsafe-key\n * filtering. Immutable objects, unsafe-key-bearing objects, and objects with\n * accessor or restricted data properties must be materialized instead.\n *\n * @param {*} obj The object to inspect\n *\n * @returns {boolean} True when every own property is safe and fully mutable\n */\nconst isSafeAndFullyMutable = (obj) => {\n if (!Object.isExtensible(obj)) {\n return false;\n }\n\n const props = Object.getOwnPropertyNames(obj);\n\n if (Object.getOwnPropertySymbols) {\n props.push(...Object.getOwnPropertySymbols(obj));\n }\n\n return props.every((prop) => {\n if (isUnsafeObjectKey(prop)) {\n return false;\n }\n\n const descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n\n return !!descriptor && descriptor.configurable && descriptor.writable === true;\n });\n};\n\n/**\n * Walk the prototype chain (excluding the source realm's Object.prototype)\n * looking for an own `prop`. This distinguishes genuine own/inherited members\n * — including class accessors and template prototypes — from members injected\n * via Object.prototype pollution (e.g. `Object.prototype.username = '...'`),\n * which live on Object.prototype itself and are therefore never matched.\n *\n * @param {*} thing The value whose chain to inspect\n * @param {string|symbol} prop The property key to look for\n *\n * @returns {boolean} True when `prop` is owned below Object.prototype\n */\nconst hasOwnInPrototypeChain = (thing, prop) => {\n let obj = thing;\n const seen = [];\n\n while (obj != null) {\n if (seen.indexOf(obj) !== -1) {\n return false;\n }\n seen.push(obj);\n\n const prototype = getPrototypeOf(obj);\n\n if (isPrototypeBoundary(obj, prototype, obj === thing)) {\n return false;\n }\n\n if (hasOwnProperty(obj, prop)) {\n return true;\n }\n obj = prototype;\n }\n return false;\n};\n\n/**\n * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own\n * properties and members inherited from a non-Object.prototype source (a class\n * instance or template object) are honored; a value reachable only through a\n * polluted Object.prototype is ignored and `undefined` is returned.\n *\n * @param {*} obj The source object\n * @param {string|symbol} prop The property key to read\n *\n * @returns {*} The resolved value, or undefined when unsafe/absent\n */\nconst getSafeProp = (obj, prop) =>\n obj != null && hasOwnInPrototypeChain(obj, prop) ? obj[prop] : undefined;\n\n/**\n * Flatten an object and its application-defined prototype chain into a\n * null-prototype object. Members inherited only from the source realm's\n * Object.prototype are deliberately excluded, while class/template members\n * below that boundary are preserved.\n *\n * @param {*} thing The value to flatten\n *\n * @returns {*} A null-prototype copy, or the original value when it is already\n * structurally safe or is not an object\n */\nconst toSafeFlatObject = (thing) => {\n if (thing == null || (typeof thing !== 'object' && typeof thing !== 'function')) {\n return thing;\n }\n\n const sourcePrototype = getPrototypeOf(thing);\n\n if (sourcePrototype === null && isSafeAndFullyMutable(thing)) {\n return thing;\n }\n\n const result = Object.create(null);\n const merged = Object.create(null);\n const seen = [];\n let current = thing;\n\n while (current != null) {\n if (seen.indexOf(current) !== -1) {\n break;\n }\n\n seen.push(current);\n\n const prototype = current === thing ? sourcePrototype : getPrototypeOf(current);\n\n if (isPrototypeBoundary(current, prototype, current === thing)) {\n break;\n }\n\n const props = Object.getOwnPropertyNames(current);\n\n if (Object.getOwnPropertySymbols) {\n props.push(...Object.getOwnPropertySymbols(current));\n }\n\n for (const prop of props) {\n if (isUnsafeObjectKey(prop)) {\n continue;\n }\n\n if (!hasOwnProperty(merged, prop)) {\n result[prop] = thing[prop];\n merged[prop] = true;\n }\n }\n\n current = prototype;\n }\n\n return result;\n};\n\nconst kindOf = ((cache) => (thing) => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type;\n};\n\nconst typeOfTest = (type) => (thing) => typeof thing === type;\n\n/**\n * Determine if a value is a non-null object\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst { isArray } = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return (\n val !== null &&\n !isUndefined(val) &&\n val.constructor !== null &&\n !isUndefined(val.constructor) &&\n isFunction(val.constructor.isBuffer) &&\n val.constructor.isBuffer(val)\n );\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {\n result = ArrayBuffer.isView(val);\n } else {\n result = val && val.buffer && isArrayBuffer(val.buffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = (thing) => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (!isObject(val)) {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (\n (prototype === null || prototype === Object.prototype || getPrototypeOf(prototype) === null) &&\n // Treat safe own/inherited Symbol.toStringTag or Symbol.iterator members as\n // evidence the value is tagged/iterable, while ignoring members reachable\n // only through shared or terminal prototype boundaries.\n !hasOwnInPrototypeChain(val, toStringTag) &&\n !hasOwnInPrototypeChain(val, iterator)\n );\n};\n\n/**\n * Determine if a value is an empty object (safely handles Buffers)\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an empty object, otherwise false\n */\nconst isEmptyObject = (val) => {\n // Early return for non-objects or Buffers to prevent RangeError\n if (!isObject(val) || isBuffer(val)) {\n return false;\n }\n\n try {\n return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype;\n } catch (e) {\n // Fallback for any other objects that might cause RangeError with Object.keys()\n return false;\n }\n};\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a React Native Blob\n * React Native \"blob\": an object with a `uri` attribute. Optionally, it can\n * also have a `name` and `type` attribute to specify filename and content type\n *\n * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71\n *\n * @param {*} value The value to test\n *\n * @returns {boolean} True if value is a React Native Blob, otherwise false\n */\nconst isReactNativeBlob = (value) => {\n return !!(value && typeof value.uri !== 'undefined');\n};\n\n/**\n * Determine if environment is React Native\n * ReactNative `FormData` has a non-standard `getParts()` method\n *\n * @param {*} formData The formData to test\n *\n * @returns {boolean} True if environment is React Native, otherwise false\n */\nconst isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a FileList, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\nconst isSet = kindOfTest('Set');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined') return globalThis;\n if (typeof self !== 'undefined') return self;\n if (typeof window !== 'undefined') return window;\n if (typeof global !== 'undefined') return global;\n return {};\n}\n\nconst G = getGlobal();\nconst FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;\n\nconst isFormData = (thing) => {\n if (!thing) return false;\n if (FormDataCtor && thing instanceof FormDataCtor) return true;\n // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.\n const proto = getPrototypeOf(thing);\n if (!proto || proto === Object.prototype) return false;\n if (!isFunction(thing.append)) return false;\n const kind = kindOf(thing);\n return (\n kind === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n );\n};\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = [\n 'ReadableStream',\n 'Request',\n 'Response',\n 'Headers',\n].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => {\n return str.trim ? str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n};\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Object} [options]\n * @param {Boolean} [options.allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, { allOwnKeys = false } = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Buffer check\n if (isBuffer(obj)) {\n return;\n }\n\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\n/**\n * Finds a key in an object, case-insensitive, returning the actual key name.\n * Returns null if the object is a Buffer or if no match is found.\n *\n * @param {Object} obj - The object to search.\n * @param {string} key - The key to find (case-insensitive).\n * @returns {?string} The actual key name if found, otherwise null.\n */\nfunction findKey(obj, key) {\n if (isBuffer(obj)) {\n return null;\n }\n\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== 'undefined') return globalThis;\n return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : global;\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * const result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(...objs) {\n const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};\n const result = {};\n const assignValue = (val, key) => {\n // Skip dangerous property names to prevent prototype pollution\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return;\n }\n\n // findKey lowercases the key, so caseless lookup only applies to strings —\n // symbol keys are identity-matched.\n const targetKey = (caseless && typeof key === 'string' && findKey(result, key)) || key;\n // Read via own-prop only — a bare `result[targetKey]` walks the prototype\n // chain, so a polluted Object.prototype value could surface here and get\n // copied into the merged result.\n const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;\n if (isPlainObject(existing) && isPlainObject(val)) {\n result[targetKey] = merge(existing, val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else if (!skipUndefined || !isUndefined(val)) {\n result[targetKey] = val;\n }\n };\n\n for (let i = 0, l = objs.length; i < l; i++) {\n const source = objs[i];\n if (!source || isBuffer(source)) {\n continue;\n }\n\n forEach(source, assignValue);\n\n if (typeof source !== 'object' || isArray(source)) {\n continue;\n }\n\n const symbols = Object.getOwnPropertySymbols(source);\n for (let j = 0; j < symbols.length; j++) {\n const symbol = symbols[j];\n if (propertyIsEnumerable.call(source, symbol)) {\n assignValue(source[symbol], symbol);\n }\n }\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Object} [options]\n * @param {Boolean} [options.allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, { allOwnKeys } = {}) => {\n forEach(\n b,\n (val, key) => {\n if (thisArg && isFunction(val)) {\n Object.defineProperty(a, key, {\n // Null-proto descriptor so a polluted Object.prototype.get cannot\n // hijack defineProperty's accessor-vs-data resolution.\n __proto__: null,\n value: bind(val, thisArg),\n writable: true,\n enumerable: true,\n configurable: true,\n });\n } else {\n Object.defineProperty(a, key, {\n __proto__: null,\n value: val,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n }\n },\n { allOwnKeys }\n );\n return a;\n};\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xfeff) {\n content = content.slice(1);\n }\n return content;\n};\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n Object.defineProperty(constructor.prototype, 'constructor', {\n __proto__: null,\n value: constructor,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n Object.defineProperty(constructor, 'super', {\n __proto__: null,\n value: superConstructor.prototype,\n });\n props && Object.assign(constructor.prototype, props);\n};\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n};\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n};\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n};\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = ((TypedArray) => {\n // eslint-disable-next-line func-names\n return (thing) => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[iterator];\n\n const _iterator = generator.call(obj);\n\n let result;\n\n while ((result = _iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n};\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n};\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = (str) => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g, function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n });\n};\n\nconst { propertyIsEnumerable } = Object.prototype;\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n};\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].includes(name)) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error(\"Can not rewrite read-only method '\" + name + \"'\");\n };\n }\n });\n};\n\n/**\n * Converts an array or a delimited string into an object set with values as keys and true as values.\n * Useful for fast membership checks.\n *\n * @param {Array|string} arrayOrString - The array or string to convert.\n * @param {string} delimiter - The delimiter to use if input is a string.\n * @returns {Object} An object with keys from the array or string, values set to true.\n */\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach((value) => {\n obj[value] = true;\n });\n };\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n};\n\nconst noop = () => {};\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite((value = +value)) ? value : defaultValue;\n};\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(\n thing &&\n isFunction(thing.append) &&\n thing[toStringTag] === 'FormData' &&\n thing[iterator]\n );\n}\n\n/**\n * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.\n *\n * @param {Object} obj - The object to convert.\n * @returns {Object} The JSON-compatible object.\n */\nconst toJSONObject = (obj) => {\n const visited = new WeakSet();\n\n const visit = (source) => {\n if (isObject(source)) {\n if (visited.has(source)) {\n return;\n }\n\n //Buffer check\n if (isBuffer(source)) {\n return source;\n }\n\n if (!('toJSON' in source)) {\n // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).\n visited.add(source);\n\n let target;\n\n if (isSet(source)) {\n target = [];\n for (const value of source) {\n const reducedValue = visit(value);\n !isUndefined(reducedValue) && target.push(reducedValue);\n }\n } else {\n target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n }\n\n visited.delete(source);\n\n return target;\n }\n }\n\n return source;\n };\n\n return visit(obj);\n};\n\n/**\n * Determines if a value is an async function.\n *\n * @param {*} thing - The value to test.\n * @returns {boolean} True if value is an async function, otherwise false.\n */\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\n/**\n * Determines if a value is thenable (has then and catch methods).\n *\n * @param {*} thing - The value to test.\n * @returns {boolean} True if value is thenable, otherwise false.\n */\nconst isThenable = (thing) =>\n thing &&\n (isObject(thing) || isFunction(thing)) &&\n isFunction(thing.then) &&\n isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\n/**\n * Provides a cross-platform setImmediate implementation.\n * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.\n *\n * @param {boolean} setImmediateSupported - Whether setImmediate is supported.\n * @param {boolean} postMessageSupported - Whether postMessage is supported.\n * @returns {Function} A function to schedule a callback asynchronously.\n */\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported\n ? ((token, callbacks) => {\n _global.addEventListener(\n 'message',\n ({ source, data }) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n },\n false\n );\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, '*');\n };\n })(`axios@${Math.random()}`, [])\n : (cb) => setTimeout(cb);\n})(typeof setImmediate === 'function', isFunction(_global.postMessage));\n\n/**\n * Schedules a microtask or asynchronous callback as soon as possible.\n * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.\n *\n * @type {Function}\n */\nconst asap =\n typeof queueMicrotask !== 'undefined'\n ? queueMicrotask.bind(_global)\n : (typeof process !== 'undefined' && process.nextTick) || _setImmediate;\n\n// *********************\n\nconst isIterable = (thing) => thing != null && isFunction(thing[iterator]);\n\n/**\n * Determine if a value is iterable via an iterator that is NOT sourced solely\n * from a polluted Object.prototype. Use this instead of `isIterable` whenever\n * the iterable comes from untrusted input (e.g. user-supplied header sources),\n * so `Object.prototype[Symbol.iterator] = ...` cannot turn an ordinary object\n * into an attacker-controlled entries iterator.\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value has a non-polluted iterator\n */\nconst isSafeIterable = (thing) =>\n thing != null && hasOwnInPrototypeChain(thing, iterator) && isIterable(thing);\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isEmptyObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isReactNativeBlob,\n isReactNative,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n hasOwnInPrototypeChain,\n getSafeProp,\n toSafeFlatObject,\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap,\n isIterable,\n isSafeIterable,\n};\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv\n ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n })(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n )\n : () => true;\n","export default function memoize(func, resolver) {\n const cache = new Map();\n return function memoized() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n const key = resolver(...args);\n if (cache.has(key)) return cache.get(key);\n const result = func.apply(this, args);\n cache.set(key, result);\n return result;\n };\n}","// This file is autogenerated. It's used to publish ESM to npm.\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\nvar trimLeft = /^\\s+/;\nvar trimRight = /\\s+$/;\nfunction tinycolor(color, opts) {\n color = color ? color : \"\";\n opts = opts || {};\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n var rgb = inputToRGB(color);\n this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) this._r = Math.round(this._r);\n if (this._g < 1) this._g = Math.round(this._g);\n if (this._b < 1) this._b = Math.round(this._b);\n this._ok = rgb.ok;\n}\ntinycolor.prototype = {\n isDark: function isDark() {\n return this.getBrightness() < 128;\n },\n isLight: function isLight() {\n return !this.isDark();\n },\n isValid: function isValid() {\n return this._ok;\n },\n getOriginalInput: function getOriginalInput() {\n return this._originalInput;\n },\n getFormat: function getFormat() {\n return this._format;\n },\n getAlpha: function getAlpha() {\n return this._a;\n },\n getBrightness: function getBrightness() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function getLuminance() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r / 255;\n GsRGB = rgb.g / 255;\n BsRGB = rgb.b / 255;\n if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n },\n setAlpha: function setAlpha(value) {\n this._a = boundAlpha(value);\n this._roundA = Math.round(100 * this._a) / 100;\n return this;\n },\n toHsv: function toHsv() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return {\n h: hsv.h * 360,\n s: hsv.s,\n v: hsv.v,\n a: this._a\n };\n },\n toHsvString: function toHsvString() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = Math.round(hsv.h * 360),\n s = Math.round(hsv.s * 100),\n v = Math.round(hsv.v * 100);\n return this._a == 1 ? \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" : \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \" + this._roundA + \")\";\n },\n toHsl: function toHsl() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return {\n h: hsl.h * 360,\n s: hsl.s,\n l: hsl.l,\n a: this._a\n };\n },\n toHslString: function toHslString() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = Math.round(hsl.h * 360),\n s = Math.round(hsl.s * 100),\n l = Math.round(hsl.l * 100);\n return this._a == 1 ? \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" : \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \" + this._roundA + \")\";\n },\n toHex: function toHex(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function toHexString(allow3Char) {\n return \"#\" + this.toHex(allow3Char);\n },\n toHex8: function toHex8(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function toHex8String(allow4Char) {\n return \"#\" + this.toHex8(allow4Char);\n },\n toRgb: function toRgb() {\n return {\n r: Math.round(this._r),\n g: Math.round(this._g),\n b: Math.round(this._b),\n a: this._a\n };\n },\n toRgbString: function toRgbString() {\n return this._a == 1 ? \"rgb(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \")\" : \"rgba(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function toPercentageRgb() {\n return {\n r: Math.round(bound01(this._r, 255) * 100) + \"%\",\n g: Math.round(bound01(this._g, 255) * 100) + \"%\",\n b: Math.round(bound01(this._b, 255) * 100) + \"%\",\n a: this._a\n };\n },\n toPercentageRgbString: function toPercentageRgbString() {\n return this._a == 1 ? \"rgb(\" + Math.round(bound01(this._r, 255) * 100) + \"%, \" + Math.round(bound01(this._g, 255) * 100) + \"%, \" + Math.round(bound01(this._b, 255) * 100) + \"%)\" : \"rgba(\" + Math.round(bound01(this._r, 255) * 100) + \"%, \" + Math.round(bound01(this._g, 255) * 100) + \"%, \" + Math.round(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function toName() {\n if (this._a === 0) {\n return \"transparent\";\n }\n if (this._a < 1) {\n return false;\n }\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function toFilter(secondColor) {\n var hex8String = \"#\" + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = \"#\" + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n return \"progid:DXImageTransform.Microsoft.gradient(\" + gradientType + \"startColorstr=\" + hex8String + \",endColorstr=\" + secondHex8String + \")\";\n },\n toString: function toString(format) {\n var formatSet = !!format;\n format = format || this._format;\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n return formattedString || this.toHexString();\n },\n clone: function clone() {\n return tinycolor(this.toString());\n },\n _applyModification: function _applyModification(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function lighten() {\n return this._applyModification(_lighten, arguments);\n },\n brighten: function brighten() {\n return this._applyModification(_brighten, arguments);\n },\n darken: function darken() {\n return this._applyModification(_darken, arguments);\n },\n desaturate: function desaturate() {\n return this._applyModification(_desaturate, arguments);\n },\n saturate: function saturate() {\n return this._applyModification(_saturate, arguments);\n },\n greyscale: function greyscale() {\n return this._applyModification(_greyscale, arguments);\n },\n spin: function spin() {\n return this._applyModification(_spin, arguments);\n },\n _applyCombination: function _applyCombination(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function analogous() {\n return this._applyCombination(_analogous, arguments);\n },\n complement: function complement() {\n return this._applyCombination(_complement, arguments);\n },\n monochromatic: function monochromatic() {\n return this._applyCombination(_monochromatic, arguments);\n },\n splitcomplement: function splitcomplement() {\n return this._applyCombination(_splitcomplement, arguments);\n },\n // Disabled until https://github.com/bgrins/TinyColor/issues/254\n // polyad: function (number) {\n // return this._applyCombination(polyad, [number]);\n // },\n triad: function triad() {\n return this._applyCombination(polyad, [3]);\n },\n tetrad: function tetrad() {\n return this._applyCombination(polyad, [4]);\n }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function (color, opts) {\n if (_typeof(color) == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n } else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n var rgb = {\n r: 0,\n g: 0,\n b: 0\n };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n if (_typeof(color) == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n a = boundAlpha(a);\n return {\n ok: ok,\n format: color.format || format,\n r: Math.min(255, Math.max(rgb.r, 0)),\n g: Math.min(255, Math.max(rgb.g, 0)),\n b: Math.min(255, Math.max(rgb.b, 0)),\n a: a\n };\n}\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// \n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// \n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b) {\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n var h,\n s,\n l = (max + min) / 2;\n if (max == min) {\n h = s = 0; // achromatic\n } else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return {\n h: h,\n s: s,\n l: l\n };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n var r, g, b;\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return {\n r: r * 255,\n g: g * 255,\n b: b * 255\n };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n var h,\n s,\n v = max;\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n if (max == min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return {\n h: h,\n s: s,\n v: v\n };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hsvToRgb(h, s, v) {\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255,\n g: g * 255,\n b: b * 255\n };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];\n return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) return false;\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\ntinycolor.random = function () {\n return tinycolor.fromRatio({\n r: Math.random(),\n g: Math.random(),\n b: Math.random()\n });\n};\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// \n\nfunction _desaturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\nfunction _saturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\nfunction _greyscale(color) {\n return tinycolor(color).desaturate(100);\n}\nfunction _lighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\nfunction _brighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var rgb = tinycolor(color).toRgb();\n rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));\n rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));\n rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));\n return tinycolor(rgb);\n}\nfunction _darken(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction _spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// \n\nfunction _complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n}\nfunction polyad(color, number) {\n if (isNaN(number) || number <= 0) {\n throw new Error(\"Argument to polyad must be a positive number\");\n }\n var hsl = tinycolor(color).toHsl();\n var result = [tinycolor(color)];\n var step = 360 / number;\n for (var i = 1; i < number; i++) {\n result.push(tinycolor({\n h: (hsl.h + i * step) % 360,\n s: hsl.s,\n l: hsl.l\n }));\n }\n return result;\n}\nfunction _splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [tinycolor(color), tinycolor({\n h: (h + 72) % 360,\n s: hsl.s,\n l: hsl.l\n }), tinycolor({\n h: (h + 216) % 360,\n s: hsl.s,\n l: hsl.l\n })];\n}\nfunction _analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n}\nfunction _monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h,\n s = hsv.s,\n v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n while (results--) {\n ret.push(tinycolor({\n h: h,\n s: s,\n v: v\n }));\n v = (v + modification) % 1;\n }\n return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function (color1, color2, amount) {\n amount = amount === 0 ? 0 : amount || 50;\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n var p = amount / 100;\n var rgba = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b,\n a: (rgb2.a - rgb1.a) * p + rgb1.a\n };\n return tinycolor(rgba);\n};\n\n// Readability Functions\n// ---------------------\n// false\n// tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function (color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n out = false;\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function (baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors;\n level = args.level;\n size = args.size;\n for (var i = 0; i < colorList.length; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n if (tinycolor.isReadable(baseColor, bestColor, {\n level: level,\n size: size\n }) || !includeFallbackColors) {\n return bestColor;\n } else {\n args.includeFallbackColors = false;\n return tinycolor.mostReadable(baseColor, [\"#fff\", \"#000\"], args);\n }\n};\n\n// Big List of Colors\n// ------------------\n// \nvar names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n var flipped = {};\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n a = parseFloat(a);\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n if (isOnePointZero(n)) n = \"100%\";\n var processPercent = isPercentage(n);\n n = Math.min(max, Math.max(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if (Math.abs(n - max) < 0.000001) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return n % max / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n return Math.min(1, Math.max(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// \nfunction isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf(\".\") != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n return typeof n === \"string\" && n.indexOf(\"%\") != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n return c.length == 1 ? \"0\" + c : \"\" + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n if (n <= 1) {\n n = n * 100 + \"%\";\n }\n return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n}\nvar matchers = function () {\n // \n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // \n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n}();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing. Take in a number of formats, and output an object\n// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n color = color.replace(trimLeft, \"\").replace(trimRight, \"\").toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n } else if (color == \"transparent\") {\n return {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n format: \"name\"\n };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if (match = matchers.rgb.exec(color)) {\n return {\n r: match[1],\n g: match[2],\n b: match[3]\n };\n }\n if (match = matchers.rgba.exec(color)) {\n return {\n r: match[1],\n g: match[2],\n b: match[3],\n a: match[4]\n };\n }\n if (match = matchers.hsl.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n l: match[3]\n };\n }\n if (match = matchers.hsla.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n l: match[3],\n a: match[4]\n };\n }\n if (match = matchers.hsv.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n v: match[3]\n };\n }\n if (match = matchers.hsva.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n v: match[3],\n a: match[4]\n };\n }\n if (match = matchers.hex8.exec(color)) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if (match = matchers.hex6.exec(color)) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if (match = matchers.hex4.exec(color)) {\n return {\n r: parseIntFromHex(match[1] + \"\" + match[1]),\n g: parseIntFromHex(match[2] + \"\" + match[2]),\n b: parseIntFromHex(match[3] + \"\" + match[3]),\n a: convertHexToDecimal(match[4] + \"\" + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if (match = matchers.hex3.exec(color)) {\n return {\n r: parseIntFromHex(match[1] + \"\" + match[1]),\n g: parseIntFromHex(match[2] + \"\" + match[2]),\n b: parseIntFromHex(match[3] + \"\" + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n return false;\n}\nfunction validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\n level: \"AA\",\n size: \"small\"\n };\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\n level: level,\n size: size\n };\n}\n\nexport { tinycolor as default };\n","import React, {ReactNode} from 'react';\n\nimport {useStore, Store} from '../hooks/useStore/useStore';\nimport {createSharedInstance} from './shared';\n\nexport enum ClientPlatform {\n android = 'android',\n ios = 'ios',\n web = 'web'\n}\n\nexport enum SystemInformationRegion {\n de = 'de',\n us = 'us',\n au = 'au',\n ae = 'ae'\n}\n\nexport enum SystemInformationType {\n live = 'live',\n test = 'test'\n}\n\nexport enum SystemInformationSystemSlug {\n live = 'live',\n liveAU = 'liveAU',\n liveDE = 'liveDE',\n liveAE = 'liveAE',\n stage = 'stage',\n dev = 'dev',\n local = 'local'\n}\n\nexport interface SystemInformation {\n baseURL: string;\n region: SystemInformationRegion;\n systemSlug: SystemInformationSystemSlug;\n type: SystemInformationType;\n webURLs: {\n default: string;\n production: string;\n };\n}\n\nexport interface ClientAdapter {\n /**\n * Retrieve the current current platform\n */\n readonly platform: ClientPlatform;\n\n /**\n * Retrieve whether the current platform is Android\n */\n readonly isAndroid: boolean;\n\n /**\n * Retrieve whether the current platform is iOS\n */\n readonly isIOS: boolean;\n\n /**\n * Retrieve whether the current platform is Web\n */\n readonly isWeb: boolean;\n\n /**\n * Retrieve whether the current user agent is a native Android or iOS device\n */\n readonly isNative: boolean;\n\n /**\n * Retrieve whether the current user agent is a mobile device\n *\n * @deprecated Use CSS to write responsive components. Check out this ADR for more information:\n * https://backstage.staffbase.com/catalog/default/component/frontend/adrs?record=0004-responsive-react-components.md\n */\n readonly isMobile: boolean;\n\n /**\n * Indicates wherever the current app context is a tablet\n */\n readonly isTablet: boolean;\n\n /**\n * Retrieve whether the device you have is less than 600px wide.\n */\n readonly isCompact: boolean;\n\n /**\n * Returns information about the Staffbase system\n */\n readonly system: SystemInformation;\n}\n\nconst fallbackAdapter = {\n get platform() {\n return ClientPlatform.web;\n },\n\n get isAndroid() {\n return this.platform === ClientPlatform.android;\n },\n\n get isIOS() {\n return this.platform === ClientPlatform.ios;\n },\n\n get isWeb() {\n return this.platform === ClientPlatform.web;\n },\n\n get isNative() {\n return false;\n },\n\n get isMobile() {\n return false;\n },\n\n get isTablet() {\n return false;\n },\n\n get isCompact() {\n return true;\n },\n\n get system() {\n return {\n baseURL: 'https://staffbasedev.staffbase.dev',\n region: SystemInformationRegion.de,\n systemSlug: SystemInformationSystemSlug.dev,\n type: SystemInformationType.test,\n webURLs: {\n default: 'https://staffbasedev.staffbase.dev',\n production: 'https://staffbasedev.staffbase.dev'\n }\n };\n }\n};\n\nconst store = createSharedInstance('client', () => new Store(fallbackAdapter));\nconst ClientContext = React.createContext(fallbackAdapter);\n\n/**\n * Set the global {@link ClientAdapter}. This will update all components using it.\n * @param adapter - the new adapter\n */\nfunction setClientAdapter(adapter: ClientAdapter): void {\n store.set(adapter);\n}\n\n/**\n * Retrieve the current {@link ClientAdapter}. This must not be used inside React components. Inside React components\n * use {@link useClient} instead.\n */\nfunction getClientAdapter(): ClientAdapter {\n return store.get();\n}\n\n/**\n * A React hook to retrieve the current {@link ClientAdapter}. Outside of React use {@link getClientAdapter}.\n */\nfunction useClient(): ClientAdapter {\n const [client] = useStore(store);\n return client;\n}\n\n/**\n * Provide the {@link ClientAdapter} via context to all descendants.\n */\nfunction ClientProvider(children?: ReactNode): React.ReactElement {\n const client = useClient();\n return {children};\n}\n\n/**\n * Retrieve the {@link ClientAdapter} from the current context (should have {@link ClientProvider} as one its\n * ancestors).\n */\nconst ClientConsumer = ClientContext.Consumer;\n\nexport {ClientContext, ClientProvider, ClientConsumer, setClientAdapter, getClientAdapter, useClient};\n","import { useState, useLayoutEffect, useEffect, useRef } from \"preact/hooks\";\nexport {\n isValidElement,\n createContext,\n cloneElement,\n createElement,\n Fragment,\n} from \"preact\";\nexport {\n useMemo,\n useRef,\n useLayoutEffect as useIsomorphicLayoutEffect,\n useLayoutEffect as useInsertionEffect,\n useState,\n useContext,\n} from \"preact/hooks\";\n\n// Copied from:\n// https://github.com/facebook/react/blob/main/packages/shared/ExecutionEnvironment.js\nconst canUseDOM = !!(\n typeof window !== \"undefined\" &&\n typeof window.document !== \"undefined\" &&\n typeof window.document.createElement !== \"undefined\"\n);\n\n// TODO: switch to `export { useSyncExternalStore } from \"preact/compat\"` once we update Preact to >= 10.11.3\nfunction is(x, y) {\n return (x === y && (x !== 0 || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nexport function useSyncExternalStore(subscribe, getSnapshot, getSSRSnapshot) {\n if (getSSRSnapshot && !canUseDOM) getSnapshot = getSSRSnapshot;\n const value = getSnapshot();\n\n const [{ _instance }, forceUpdate] = useState({\n _instance: { _value: value, _getSnapshot: getSnapshot },\n });\n\n useLayoutEffect(() => {\n _instance._value = value;\n _instance._getSnapshot = getSnapshot;\n\n if (!is(_instance._value, getSnapshot())) {\n forceUpdate({ _instance });\n }\n }, [subscribe, value, getSnapshot]); // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n if (!is(_instance._value, _instance._getSnapshot())) {\n forceUpdate({ _instance });\n }\n\n return subscribe(() => {\n if (!is(_instance._value, _instance._getSnapshot())) {\n forceUpdate({ _instance });\n }\n });\n }, [subscribe]); // eslint-disable-line react-hooks/exhaustive-deps\n\n return value;\n}\n\n// provide forwardRef stub for preact\nexport function forwardRef(component) {\n // Preact passes legacy context as the second argument, not a forwarded ref.\n return (props) => component(props);\n}\n\n// Userland polyfill while we wait for the forthcoming\n// https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md\n// Note: \"A high-fidelty polyfill for useEvent is not possible because\n// there is no lifecycle or Hook in React that we can use to switch\n// .current at the right timing.\"\n// So we will have to make do with this \"close enough\" approach for now.\nexport const useEvent = (fn) => {\n const ref = useRef([fn, (...args) => ref[0](...args)]).current;\n useLayoutEffect(() => {\n ref[0] = fn;\n });\n return ref[1];\n};\n","import styled from '@emotion/styled';\nimport classNames from 'classnames';\nimport React from 'react';\n\nimport {clientSideOnly} from '../../utils';\nimport {injectIconsFont} from './staffbase-icons';\n\nclientSideOnly(({document}) => {\n injectIconsFont(document);\n});\n\nexport interface IconProps extends React.AllHTMLAttributes {\n /**\n * The char of an icon that should be displayed.\n */\n char?: string | IconName;\n\n /**\n * The name of an icon that should be displayed.\n * @deprecated - use the `char` param and enum `IconName` instead\n */\n name?: string;\n\n /**\n * A label that describes the icon - important for a11y!\n */\n label?: string;\n}\n\nexport enum IconName {\n add = '+',\n allSpaces = '\\u{E911}',\n android = 'Z',\n androidPhone = '\\u{F6}',\n apple = 'Y',\n article = 'N',\n attachment = 'j',\n attention = '!',\n back = 'b',\n backAndroid = '1',\n /** @deprecated use backIOS instead */\n backIos = '\\u{E80A}',\n backIOS = '\\u{E80A}',\n box = 'F',\n business = 'B',\n calendar = 'k',\n calendar2 = '\\u{E80F}',\n calendar3 = '\\u{E810}',\n cancel = 'c',\n chatOptOut = '\\u{E8A1}',\n checkmark = 'o',\n christmasTree = '0',\n code = 'K',\n colorPalette = '2',\n colorPalette2 = '\\u{E816}',\n colorPalette3 = '\\u{E817}',\n commentBubble = '3',\n comments = '\\u{E819}',\n companyDepartment = '5',\n companyDepartment2 = '6',\n /** @deprecated companyname is deprecated, use business */\n companyname = 'B',\n /** @deprecated companysize is deprecated, use group */\n companysize = 'g',\n connectionLost = '\\u{E881}',\n croppingIcon = '\\u{E81D}',\n croppingIcon2 = '7',\n desktop = '9',\n tablet = '\\u{E821}',\n mobile = '\\u{E822}',\n directory = '\\u{FC}',\n discussion = 'D',\n doubleCheckmark = '\\u{E887}',\n down = 'J',\n download = '(',\n dropdownArrow = '\\u{E86B}',\n edit = '\\u{E82B}',\n edit2 = 'e',\n email = 'M',\n embeddedPage = 'E',\n eventRegistration = '\\u{C4}',\n eventRegistration2 = '\\u{E82F}',\n facebook = '\\u{E852}',\n facebookThin = '\\u{E865}',\n file = '\\u{E88C}',\n filing = 'F',\n folder = 'y',\n food = 'f',\n football = '\\u{E86C}',\n forms = '\\u{DC}',\n googlePlus = '\\u{E860}',\n googlePlusThin = '\\u{E872}',\n group = 'g',\n handle = 'B',\n happiness = '\\u{DF}',\n happinessFilled = '\\u{E866}',\n happy = 'h',\n help = '?',\n home = 'H',\n identifier = 'p',\n image = 'P',\n info = 'i',\n invite = 'P',\n inviteGroup = 'G',\n iphone = '\\u{E4}',\n journey = '\\u{E917}',\n key = 'K',\n leftArrow = '\\u{E809}',\n light = 'l',\n lineStatistics = '\\u{A7}',\n link = 'q',\n linkedin = 'x',\n linkedinThin = '\\u{E868}',\n location = 'L',\n locked = '[',\n logout = '\\u{E807}',\n mail = 'M',\n map = '/',\n medium = '\\u{E830}',\n menu = 'm',\n more = '.',\n mute = '\\u{F1F7}',\n notVisible = '<',\n next = 'v',\n page = 'n',\n paperplane = 'C',\n password = 'K',\n pdfExport = '\\u{E907}',\n person = 'p',\n phone = 'T',\n picture = 'I',\n picture2 = '\\u{E912}',\n pieChart = '>',\n play = '|',\n position = 'B',\n positionWithinCompany = '\\u{E84E}',\n positionWithinCompany2 = '\\u{E84C}',\n profile = '\\u{E84D}',\n redo = '\\u{D6}',\n refresh = 'Q',\n reload = 'R',\n rightArrow = '\\u{E804}',\n ring = 'r',\n rss = '\\u{E84F}',\n sad = '\\u{E86D}',\n search = 'S',\n search2 = '\\u{E850}',\n search3 = 'S',\n settings = 'A',\n settings2 = 'a',\n shareAndroid = 's',\n shareFiles = '\\u{E800}',\n shareIos = 'O',\n sharepoint = '\\u{E803}',\n skype = '\\u{E853}',\n skypeThin = '\\u{E873}',\n slack = 'X',\n slackThin = '\\u{E86A}',\n slug = 'B',\n snowflake = '\\u{E805}',\n space = '\\u{E886}',\n spinner = '\\u{F110}',\n star = '{',\n starEmpty = '}',\n starFilled = '\\u{E867}',\n statistics = '%',\n surveymonkey = '\\u{E802}',\n survey = '\\u{E85B}',\n survey2 = '\\u{E875}',\n survey3 = '\\u{E876}',\n text = 'e',\n thumbsDown = '\\u{E85C}',\n thumbsUp = '\\u{E85D}',\n timeTracking = 'z',\n trash = 't',\n twitter = '\\u{E851}',\n twitterThin = '\\u{E864}',\n undo = 'u',\n undo2 = '\\u{E87C}',\n unlocked = ']',\n upArrow = '\\u{E87E}',\n upload = ')',\n url = 'W',\n verticalEllipsis = 'd',\n video = '\\u{E913}',\n view = 'V',\n watch = '\\u{E801}',\n whatsapp = '\\u{E862}',\n whatsappThin = '\\u{E869}',\n windows = 'w',\n world = 'W',\n xing = '\\u{E874}',\n xingThin = '\\u{E85F}'\n}\n\nexport type IconTag = keyof typeof IconName;\n\nexport const IconStyled = styled.span`\n font-family: 'staffbase-icons';\n`;\n\n// `Tag` should be `T extends keyof JSX.IntrinsicElements`, however this crashes Node, which is why we are using any\n// here for now\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction GenericIcon(Tag: any, props: IconProps) {\n const {char, name, label, children, ...attrs} = props;\n // @ts-ignore, because there is no typescript-way of doing `IconName[name]`\n const icon = char || (name && IconName[name]) || null;\n\n if (!icon) {\n return null;\n }\n\n attrs.className = classNames('we-icon', attrs.className, {\n [`we-icon-${name}`]: name\n });\n\n if (label) {\n attrs['aria-label'] = label;\n } else {\n attrs['aria-hidden'] = true;\n }\n\n return (\n \n {icon}\n {children}\n \n );\n}\n\n/**\n * A component used to show an icon from the `staffbase-icons` front.\n * @param props\n */\nexport default function Icon(props: IconProps): React.ReactElement | null {\n return GenericIcon(IconStyled, props);\n}\n\n/**\n * Create a new `Icon` component using the given `tag` as the container instead of the default `span` tag.\n * @param tag - the HTML tag that should be used as a container for the icon\n */\nIcon.withComponent = function <\n P = Record,\n NewTag extends React.ComponentType

= React.ComponentType

\n>(tag: NewTag) {\n return GenericIcon.bind(GenericIcon, IconStyled.withComponent(tag as React.ComponentType

));\n};\n","import { h as hasOwn, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isDevelopment } from './emotion-element-f0de968e.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-f0de968e.browser.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar jsx = function jsx(type, props) {\n // eslint-disable-next-line prefer-rest-params\n var args = arguments;\n\n if (props == null || !hasOwn.call(props, 'css')) {\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n }\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\n(function (_jsx) {\n var JSX;\n\n (function (_JSX) {})(JSX || (JSX = _jsx.JSX || (_jsx.JSX = {})));\n})(jsx || (jsx = {}));\n\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false;\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nfunction keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name;\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n}\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && isDevelopment) {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && isDevelopment) {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","import {useTranslation} from 'hooks';\nimport React from 'react';\nimport {Link, useParams} from 'wouter';\n\nimport {Icon, TabbedList} from '@staffbase/ui';\n\nimport {NavWrapper} from '../../pages/index.styles';\n\nexport enum Entry {\n Results,\n Planner\n}\n\ninterface MenuProps {\n selected: number;\n}\nconst Menu = ({selected}: MenuProps) => {\n const {t} = useTranslation();\n const {installationId} = useParams<{installationId: string}>();\n\n const routes = ['results', 'planner'];\n const icons = ['statistics', 'edit'];\n const renderTabContent = (selected: boolean, index: number) => (\n \n \n \n {t(`plugin.surveys.admin.${routes[index]}`)}\n \n \n );\n\n const tabs = [\n {\n data: undefined,\n renderTabContent\n },\n {\n data: undefined,\n renderTabContent\n }\n ];\n\n return (\n \n {\n /** noop **/\n }}\n />\n \n );\n};\n\nexport default Menu;\n","/* eslint-disable @typescript-eslint/no-duplicate-enum-values */\nimport styled from '@emotion/styled';\nimport {InstallationStatus} from 'api';\n\nenum StatusBackgroundColor {\n PUBLISHED = '#00A4FD',\n SCHEDULED = '#FBDF1C',\n DRAFT = '#EAEAEA',\n CLOSED = '#DBDBDB'\n}\n\nenum StatusTextColor {\n PUBLISHED = '#FFFFFF',\n SCHEDULED = '#444444',\n DRAFT = '#464B50',\n CLOSED = '#464B50'\n}\n\nenum StatusTextOpacity {\n PUBLISHED = '1.0',\n SCHEDULED = '1.0',\n DRAFT = '0.7',\n CLOSED = '1.0'\n}\n\ninterface Props {\n value: InstallationStatus;\n}\n\nexport const StatusContainer = styled.span`\n background-color: ${(props) => StatusBackgroundColor[props.value]};\n color: ${(props) => StatusTextColor[props.value]};\n opacity: ${(props) => StatusTextOpacity[props.value]};\n border-radius: 4px;\n font-size: 11px;\n font-weight: 600;\n height: 21px;\n padding: 5px 10px;\n margin: 0 0 0 8px;\n white-space: nowrap;\n`;\n","import {InstallationStatus} from 'api';\nimport {useTranslation} from 'hooks';\nimport React from 'react';\n\nimport {StatusContainer} from './index.styles';\n\nenum StatusTranslation {\n PUBLISHED = 'plugin.surveys.survey.status.published',\n SCHEDULED = 'plugin.surveys.survey.status.scheduled',\n DRAFT = 'plugin.surveys.survey.status.draft',\n CLOSED = 'plugin.surveys.survey.status.closed'\n}\n\ninterface StatusProps {\n value: InstallationStatus;\n}\n\nexport const Status = ({value}: StatusProps) => {\n const {t} = useTranslation();\n\n return {t(StatusTranslation[value])};\n};\n\nexport default Status;\n","import {css, SerializedStyles} from '@emotion/react';\nimport {withTheme} from '@emotion/react';\nimport styled from '@emotion/styled';\nimport React, {ButtonHTMLAttributes, ReactElement} from 'react';\n\nimport Icon, {IconName} from '../../atoms/Icon/Icon';\nimport {WithTheme} from '../../hooks/useTheme/useTheme';\nimport {ColorScheme} from '../../theme';\n\nexport enum ButtonFlavor {\n DEFAULT = 'default',\n NEUTRAL = 'neutral',\n POSITIVE = 'positive',\n NEGATIVE = 'negative'\n}\nexport type ButtonFlavorType = keyof typeof ButtonFlavor;\n\nexport interface ButtonProps extends ButtonHTMLAttributes {\n /**\n * The char of an icon that should be displayed.\n */\n char?: string | IconName;\n\n /**\n * A label that describes the icon - important for a11y!\n */\n label: string;\n\n /**\n * A text that is placed in \"big\" mode.\n */\n text?: string;\n\n /**\n * Modify the buttons styling with pre-defined modes. Not yet implemented!\n */\n flavor?: ButtonFlavor;\n\n /**\n * Enable the light mode for the given flavor. Defaults to false.\n */\n flavorLight?: boolean;\n}\n\ntype ButtonStyledProps = WithTheme & ButtonProps;\n\nconst getButtonStyling = (props: ButtonStyledProps): SerializedStyles => {\n const textColor = props.theme.textColor || ColorScheme.textLight;\n let mainColor = ColorScheme.buttonPrimary;\n let hoverColor = ColorScheme.buttonPrimaryHover;\n\n switch (props.flavor) {\n case ButtonFlavor.POSITIVE:\n mainColor = ColorScheme.buttonSuccess;\n hoverColor = ColorScheme.buttonSuccessHover;\n break;\n case ButtonFlavor.NEGATIVE:\n mainColor = ColorScheme.buttonCritical;\n hoverColor = ColorScheme.buttonCriticalHover;\n break;\n case ButtonFlavor.NEUTRAL:\n mainColor = ColorScheme.buttonNeutral;\n hoverColor = ColorScheme.buttonNeutralHover\n break;\n default:\n mainColor = props.theme.bgColor || ColorScheme.buttonPrimary;\n hoverColor = props.theme.bgColor || ColorScheme.buttonPrimaryHover;\n }\n\n if (props.flavorLight === true) {\n return css`\n background-color: ${ColorScheme.backgroundLevel1};\n color: ${mainColor};\n\n /* overwrite .mouse styles from the FE */\n &:active,\n &:focus,\n &:hover,\n .mouse &:active,\n .mouse &:focus,\n .mouse &:hover {\n background-color: ${ColorScheme.backgroundLevel2};\n }\n `;\n }\n\n return css`\n background-color: ${mainColor};\n color: ${textColor};\n\n /* overwrite .mouse styles from the FE */\n &:active,\n &:focus,\n &:hover,\n .mouse &:active,\n .mouse &:focus,\n .mouse &:hover {\n background-color: ${hoverColor};\n }\n `;\n};\n\nexport const ButtonStyled = withTheme(styled.button`\n display: inline-block;\n font-size: 14px;\n height: 40px;\n width: ${(props: ButtonStyledProps) => (props.text ? '' : '40px')};\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 3px;\n cursor: pointer;\n padding: 0;\n margin: 0;\n\n ${(props: ButtonStyledProps) => getButtonStyling(props)}\n\n &:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n\n body:not(.using-mouse) &:focus {\n outline: 3px auto #002133;\n outline-offset: 1px;\n }\n\n body.using-mouse &:focus {\n outline: none;\n }\n\n & .we-icon {\n font-size: 22px;\n }\n\n & .button-text {\n padding: 0 6px;\n }\n\n`);\n\n/**\n * A button with a flavor set.\n */\nexport const Button = (props: ButtonProps): ReactElement => {\n const {char, flavor, flavorLight, text, label, ...htmlProps} = props;\n if (!text) {\n htmlProps['aria-label'] = label;\n }\n if (htmlProps['tabIndex'] === undefined) {\n htmlProps['tabIndex'] = 0;\n }\n\n const classes = new Set((props.className || '').split(' '));\n if (flavorLight) {\n classes.add('light');\n }\n\n return (\n \n {char && }\n {text && {text}}\n \n );\n};\n","import {useStore, Store} from '../hooks/useStore/useStore';\nimport {createSharedInstance} from './shared';\n\nenum GrowlType {\n Success = 'success',\n Error = 'error'\n}\n\nexport interface GrowlAdapter {\n show(text: string, options: {type?: GrowlType}): void;\n}\n\nconst fallbackGrowlAdapter = {\n show(text: string, options: {type?: GrowlType} = {}) {\n options.type === GrowlType.Success ? console.log(text) : console.error(text);\n }\n};\n\nconst store = createSharedInstance('growl', () => new Store(fallbackGrowlAdapter));\n\n/**\n * Provide implementation for Growl Adapter\n */\nfunction setGrowlAdapter(adapter: GrowlAdapter): void {\n store.set(adapter);\n}\n\n/**\n * Retrieves the current Growl Adapter.\n */\nfunction getGrowlAdapter(): GrowlAdapter {\n return store.get();\n}\n\n/**\n * Use provided Growl implementation or use fallback otherwise\n */\nfunction useGrowl(): GrowlAdapter {\n const [growl] = useStore(store);\n return growl || fallbackGrowlAdapter;\n}\n\nexport {setGrowlAdapter, getGrowlAdapter, useGrowl, GrowlType};\n","import React, {useState, useEffect} from 'react';\n\nexport enum TransitionState {\n Entered = 'entered',\n Exited = 'exited'\n}\n\ninterface TransitionProps {\n /**\n * An identifier for the current content.\n */\n id?: Id;\n\n /**\n * The animation duration (determines how long the content for an old `id` is maintained).\n */\n duration?: number;\n\n /**\n * The animation type.\n * `false` - no animation (default)\n * `always` - animate all changes\n * `inOut` - animate only enter and exit\n */\n animate: false | 'always' | 'inOut';\n\n /**\n * A callback that receives the currently active `id` (might be different from the `id` property during the closing\n * animation) and should return the content that corresponds to it. Providing the children via a function allows to\n * maintain previous content during exit animations.\n */\n children: (id: Id | undefined, state: TransitionState) => React.ReactElement | null;\n}\n\n/**\n * This component is used to animate the entering and exiting of content for a given `id`. It's main purpose is to\n * maintain the content for a given `id` for the duration of an exiting animation and only render the content for a\n * new `id` once the animation has finished. For new `id`s, it also allows rendering an enter animation.\n */\nexport default function Transition({\n id,\n duration,\n animate = false,\n children\n}: TransitionProps): React.ReactElement | null {\n const [state, setState] = useState(id !== undefined ? TransitionState.Entered : TransitionState.Exited);\n const [activeId, setActiveId] = useState(id);\n\n useEffect(() => {\n if (!animate) {\n setActiveId(id);\n return;\n }\n\n // skip the enter transition for the first render\n if (activeId === id) {\n return;\n }\n\n // if we are already existed, go right to the enter animation (no need to do the exit animation first)\n if (state === TransitionState.Exited) {\n setActiveId(id);\n setState(TransitionState.Entered);\n return;\n }\n\n // if we are already entered and change the id to another valid id, don't do the exit and re-enter animation, simply\n // update the id\n if (id !== undefined && animate !== 'always') {\n setActiveId(id);\n return;\n }\n\n // otherwise, do the exit animation\n else {\n setState(TransitionState.Exited);\n\n const timeout = setTimeout(() => {\n setActiveId(id);\n if (id !== undefined) {\n setState(TransitionState.Entered);\n }\n }, duration || 500);\n\n return () => {\n clearTimeout(timeout);\n };\n }\n }, [id]);\n\n return children(activeId, state);\n}\n","import {QuestionPostRequest} from './question-model';\n\nexport interface InstallationPostRequest {\n staffbaseInstallationID: string;\n}\n\nexport interface SurveyConfiguration {\n questions: QuestionPostRequest[];\n}\n\nexport interface InstallationRecurringSettingPostRequest {\n publishedAt: Date;\n recurrenceIntervalInDays: number;\n /**\n * when set to 0, this will be equal to recurrenceIntervalInDays\n */\n durationInDays: number;\n sendPushNotifications: boolean;\n}\n\n/**\n * publishedAt and closedAt should be in the future\n * closedAt should be greater than publishedAt\n */\nexport interface InstallationOneTimeScheduleSettingPostRequest {\n publishedAt: Date;\n closedAt: Date;\n sendPushNotifications: boolean;\n}\n\n/**\n * publishedAt is not included because the survey is published\n * by the backend immediately\n */\nexport interface InstallationImmediateScheduleSettingPostRequest {\n closedAt: Date;\n sendPushNotifications: boolean;\n}\n\nexport interface InstallationModelResponse {\n id: string;\n staffbaseInstallationId: string;\n isRecurring: boolean;\n publishedAt: string | null;\n recurrenceIntervalInSeconds: number | null;\n durationInSeconds: number | null;\n nextSurveyPublishedAt: string | null;\n nextSurveyClosedAt: string | null;\n status: InstallationStatus;\n latestSurveyClosedAt: string | null;\n resultSharingEnabled: boolean;\n sendPushNotifications: boolean;\n}\n\nexport class InstallationModel {\n public id!: string;\n public staffbaseInstallationId!: string;\n public isRecurring!: boolean;\n public publishedAt!: Date | null;\n public nextSurveyPublishedAt!: Date | null;\n public nextSurveyClosedAt!: Date | null;\n public recurrenceIntervalInSeconds!: number | null;\n public durationInSeconds!: number | null;\n public status!: InstallationStatus;\n public latestSurveyClosedAt!: Date | null;\n public resultSharingEnabled!: boolean;\n public sendPushNotifications!: boolean;\n\n /**\n * creates a InstallationModel from the response body\n */\n static fromResponse(response: InstallationModelResponse): InstallationModel {\n const installation = new InstallationModel();\n installation.id = response.id;\n installation.staffbaseInstallationId = response.staffbaseInstallationId;\n installation.isRecurring = response.isRecurring;\n installation.publishedAt = (response.publishedAt && new Date(response.publishedAt)) || null;\n installation.nextSurveyPublishedAt =\n (response.nextSurveyPublishedAt && new Date(response.nextSurveyPublishedAt)) || null;\n installation.nextSurveyClosedAt = (response.nextSurveyClosedAt && new Date(response.nextSurveyClosedAt)) || null;\n installation.recurrenceIntervalInSeconds = response.recurrenceIntervalInSeconds;\n installation.durationInSeconds = response.durationInSeconds;\n installation.status = response.status;\n installation.latestSurveyClosedAt = response.latestSurveyClosedAt ? new Date(response.latestSurveyClosedAt) : null;\n installation.resultSharingEnabled = response.resultSharingEnabled;\n installation.sendPushNotifications = response.sendPushNotifications;\n\n return installation;\n }\n\n public get surveyType(): SurveyType {\n if (this.isRecurring) {\n return SurveyType.RECURRING;\n }\n return SurveyType.ONE_TIME;\n }\n}\n/**\n * represents the current status the installation is in\n */\nexport enum InstallationStatus {\n PUBLISHED = 'PUBLISHED',\n SCHEDULED = 'SCHEDULED',\n DRAFT = 'DRAFT',\n CLOSED = 'CLOSED'\n}\n\nexport enum SurveyType {\n ONE_TIME,\n RECURRING\n}\n","export enum QuestionType {\n STAR = 'STAR',\n TEXT = 'TEXT',\n SCALE = 'SCALE',\n NPS = 'NPS',\n MULTIPLE_CHOICE = 'MULTIPLE_CHOICE'\n}\n\nexport enum MaxNumOptions {\n ONE = 1,\n TWO,\n THREE,\n FOUR,\n FIVE,\n SIX,\n SEVEN,\n EIGHT,\n NINE,\n TEN,\n ELEVEN,\n TWELVE,\n THIRTEEN,\n FOURTEEN,\n FIFTEEN,\n SIXTEEN,\n SEVENTEEN,\n EIGHTEEN,\n NINETEEN,\n TWENTY\n}\n\nexport enum MaxScale {\n FOUR = 4,\n FIVE,\n SIX,\n SEVEN,\n EIGHT,\n NINE,\n TEN\n}\n\nexport interface QuestionPostContent {\n title: string;\n description?: string;\n options?: {text: string}[];\n minScaleLabel?: string;\n maxScaleLabel?: string;\n}\n\nexport interface QuestionPostRequest {\n questionType: QuestionType;\n maxNumOptions?: MaxNumOptions;\n maxScale?: MaxScale;\n content: Record;\n}\n\nexport type QuestionPatchRequest = QuestionPostRequest;\n\nexport interface QuestionContent {\n title: string;\n description: string;\n options?: {id: string; text: string}[];\n minScaleLabel?: string;\n maxScaleLabel?: string;\n}\n\nexport interface QuestionModelResponse {\n id: string;\n questionType: QuestionType;\n content: Record;\n maxScale?: MaxScale;\n maxNumOptions?: MaxNumOptions;\n}\n\ninterface BaseLocalizedContent {\n description: string;\n title: string;\n}\n\nexport type QuestionModel =\n | StarQuestionModel\n | TextQuestionModel\n | ScaleQuestionModel\n | NPSQuestionModel\n | MultipleChoiceQuestionModel;\nexport type NumericQuestionModel = StarQuestionModel | ScaleQuestionModel | NPSQuestionModel;\n\nexport const questionFromResponse = (response: QuestionModelResponse): QuestionModel => {\n let question: QuestionModel;\n switch (response.questionType) {\n case QuestionType.STAR:\n question = new StarQuestionModel();\n break;\n case QuestionType.TEXT:\n question = new TextQuestionModel();\n break;\n case QuestionType.SCALE:\n question = new ScaleQuestionModel();\n question.maxScale = response.maxScale || MaxScale.FIVE;\n break;\n case QuestionType.NPS:\n question = new NPSQuestionModel();\n break;\n case QuestionType.MULTIPLE_CHOICE:\n question = new MultipleChoiceQuestionModel();\n question.maxNumOptions = response.maxNumOptions;\n break;\n default:\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n throw new Error(`received unknown question type from api: \"${response.questionType}\"`);\n }\n\n const {id, content} = response;\n question.id = id;\n question.content = content;\n\n return question;\n};\n\nexport const getDefaultQuestionContent = (questionType?: QuestionType): QuestionPostContent => {\n const content: QuestionPostContent = {\n title: '',\n description: ''\n };\n\n if (questionType == QuestionType.MULTIPLE_CHOICE) {\n content.options = [{text: ''}, {text: ''}, {text: ''}];\n }\n\n return content;\n};\n\nclass BaseQuestionModel {\n public id!: string;\n public questionType!: QuestionType;\n}\n\nexport class StarQuestionModel extends BaseQuestionModel {\n public readonly questionType = QuestionType.STAR;\n public content!: Record;\n\n get maxNumericValue(): 5 {\n return 5;\n }\n}\n\nexport class TextQuestionModel extends BaseQuestionModel {\n public readonly questionType = QuestionType.TEXT;\n public content!: Record;\n}\n\nexport class ScaleQuestionModel extends BaseQuestionModel {\n public readonly questionType = QuestionType.SCALE;\n public maxScale!: MaxScale;\n public content!: Record<\n string,\n {\n minScaleLabel: string;\n maxScaleLabel: string;\n } & BaseLocalizedContent\n >;\n\n public get maxNumericValue(): MaxScale {\n return this.maxScale;\n }\n}\n\nexport class NPSQuestionModel extends BaseQuestionModel {\n public readonly questionType = QuestionType.NPS;\n public content!: Record<\n string,\n {\n minScaleLabel: string;\n maxScaleLabel: string;\n } & BaseLocalizedContent\n >;\n\n public get maxNumericValue(): MaxScale {\n return MaxScale.TEN;\n }\n}\n\nexport class MultipleChoiceQuestionModel extends BaseQuestionModel {\n public readonly questionType = QuestionType.MULTIPLE_CHOICE;\n public maxNumOptions?: MaxNumOptions;\n public content!: Record<\n string,\n {\n options: {id: string; text: string}[];\n } & BaseLocalizedContent\n >;\n}\n","enum FeatureFlag {\n PREMIUM = 'survey_plugin_premium',\n DISABLE_NOTIFICATIONS = 'survey_notification_disable_by_default'\n}\n\nexport default FeatureFlag;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","export enum FeedbackStar {\n ONE = 1,\n TWO,\n THREE,\n FOUR,\n FIVE\n}\n\nexport enum FeedbackScale {\n ONE = 1,\n TWO,\n THREE,\n FOUR,\n FIVE,\n SIX,\n SEVEN,\n EIGHT,\n NINE,\n TEN\n}\n\nexport enum FeedbackNPS {\n ZERO = 0,\n ONE,\n TWO,\n THREE,\n FOUR,\n FIVE,\n SIX,\n SEVEN,\n EIGHT,\n NINE,\n TEN\n}\n\ntype QuestionOptionID = string;\nexport type FeedbackMultipleChoice = QuestionOptionID[];\n","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n });\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref) {\n var name = _ref.name,\n _ref$options = _ref.options,\n options = _ref$options === void 0 ? {} : _ref$options,\n effect = _ref.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","import tippy, { createSingleton } from 'tippy.js';\nexport { default as tippy } from 'tippy.js';\nimport React, { useLayoutEffect, useEffect, useRef, useState, cloneElement, useMemo, forwardRef as forwardRef$1 } from 'react';\nimport { createPortal } from 'react-dom';\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\nfunction preserveRef(ref, node) {\n if (ref) {\n if (typeof ref === 'function') {\n ref(node);\n }\n\n if ({}.hasOwnProperty.call(ref, 'current')) {\n ref.current = node;\n }\n }\n}\nfunction ssrSafeCreateDiv() {\n return isBrowser && document.createElement('div');\n}\nfunction toDataAttributes(attrs) {\n var dataAttrs = {\n 'data-placement': attrs.placement\n };\n\n if (attrs.referenceHidden) {\n dataAttrs['data-reference-hidden'] = '';\n }\n\n if (attrs.escaped) {\n dataAttrs['data-escaped'] = '';\n }\n\n return dataAttrs;\n}\n\nfunction deepEqual(x, y) {\n if (x === y) {\n return true;\n } else if (typeof x === 'object' && x != null && typeof y === 'object' && y != null) {\n if (Object.keys(x).length !== Object.keys(y).length) {\n return false;\n }\n\n for (var prop in x) {\n if (y.hasOwnProperty(prop)) {\n if (!deepEqual(x[prop], y[prop])) {\n return false;\n }\n } else {\n return false;\n }\n }\n\n return true;\n } else {\n return false;\n }\n}\n\nfunction uniqueByShape(arr) {\n var output = [];\n arr.forEach(function (item) {\n if (!output.find(function (outputItem) {\n return deepEqual(item, outputItem);\n })) {\n output.push(item);\n }\n });\n return output;\n}\nfunction deepPreserveProps(instanceProps, componentProps) {\n var _instanceProps$popper, _componentProps$poppe;\n\n return Object.assign({}, componentProps, {\n popperOptions: Object.assign({}, instanceProps.popperOptions, componentProps.popperOptions, {\n modifiers: uniqueByShape([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))\n })\n });\n}\n\nvar useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\nfunction useMutableBox(initialValue) {\n // Using refs instead of state as it's recommended to not store imperative\n // values in state due to memory problems in React(?)\n var ref = useRef();\n\n if (!ref.current) {\n ref.current = typeof initialValue === 'function' ? initialValue() : initialValue;\n }\n\n return ref.current;\n}\n\nfunction updateClassName(box, action, classNames) {\n classNames.split(/\\s+/).forEach(function (name) {\n if (name) {\n box.classList[action](name);\n }\n });\n}\n\nvar classNamePlugin = {\n name: 'className',\n defaultValue: '',\n fn: function fn(instance) {\n var box = instance.popper.firstElementChild;\n\n var isDefaultRenderFn = function isDefaultRenderFn() {\n var _instance$props$rende;\n\n return !!((_instance$props$rende = instance.props.render) == null ? void 0 : _instance$props$rende.$$tippy);\n };\n\n function add() {\n if (instance.props.className && !isDefaultRenderFn()) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(['@tippyjs/react: Cannot use `className` prop in conjunction with', '`render` prop. Place the className on the element you are', 'rendering.'].join(' '));\n }\n\n return;\n }\n\n updateClassName(box, 'add', instance.props.className);\n }\n\n function remove() {\n if (isDefaultRenderFn()) {\n updateClassName(box, 'remove', instance.props.className);\n }\n }\n\n return {\n onCreate: add,\n onBeforeUpdate: remove,\n onAfterUpdate: add\n };\n }\n};\n\nfunction TippyGenerator(tippy) {\n function Tippy(_ref) {\n var children = _ref.children,\n content = _ref.content,\n visible = _ref.visible,\n singleton = _ref.singleton,\n render = _ref.render,\n reference = _ref.reference,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$ignoreAttributes = _ref.ignoreAttributes,\n ignoreAttributes = _ref$ignoreAttributes === void 0 ? true : _ref$ignoreAttributes,\n __source = _ref.__source,\n __self = _ref.__self,\n restOfNativeProps = _objectWithoutPropertiesLoose(_ref, [\"children\", \"content\", \"visible\", \"singleton\", \"render\", \"reference\", \"disabled\", \"ignoreAttributes\", \"__source\", \"__self\"]);\n\n var isControlledMode = visible !== undefined;\n var isSingletonMode = singleton !== undefined;\n\n var _useState = useState(false),\n mounted = _useState[0],\n setMounted = _useState[1];\n\n var _useState2 = useState({}),\n attrs = _useState2[0],\n setAttrs = _useState2[1];\n\n var _useState3 = useState(),\n singletonContent = _useState3[0],\n setSingletonContent = _useState3[1];\n\n var mutableBox = useMutableBox(function () {\n return {\n container: ssrSafeCreateDiv(),\n renders: 1\n };\n });\n var props = Object.assign({\n ignoreAttributes: ignoreAttributes\n }, restOfNativeProps, {\n content: mutableBox.container\n });\n\n if (isControlledMode) {\n if (process.env.NODE_ENV !== 'production') {\n ['trigger', 'hideOnClick', 'showOnCreate'].forEach(function (nativeStateProp) {\n if (props[nativeStateProp] !== undefined) {\n console.warn([\"@tippyjs/react: Cannot specify `\" + nativeStateProp + \"` prop in\", \"controlled mode (`visible` prop)\"].join(' '));\n }\n });\n }\n\n props.trigger = 'manual';\n props.hideOnClick = false;\n }\n\n if (isSingletonMode) {\n disabled = true;\n }\n\n var computedProps = props;\n var plugins = props.plugins || [];\n\n if (render) {\n computedProps = Object.assign({}, props, {\n plugins: isSingletonMode && singleton.data != null ? [].concat(plugins, [{\n fn: function fn() {\n return {\n onTrigger: function onTrigger(instance, event) {\n var node = singleton.data.children.find(function (_ref2) {\n var instance = _ref2.instance;\n return instance.reference === event.currentTarget;\n });\n instance.state.$$activeSingletonInstance = node.instance;\n setSingletonContent(node.content);\n }\n };\n }\n }]) : plugins,\n render: function render() {\n return {\n popper: mutableBox.container\n };\n }\n });\n }\n\n var deps = [reference].concat(children ? [children.type] : []); // CREATE\n\n useIsomorphicLayoutEffect(function () {\n var element = reference;\n\n if (reference && reference.hasOwnProperty('current')) {\n element = reference.current;\n }\n\n var instance = tippy(element || mutableBox.ref || ssrSafeCreateDiv(), Object.assign({}, computedProps, {\n plugins: [classNamePlugin].concat(props.plugins || [])\n }));\n mutableBox.instance = instance;\n\n if (disabled) {\n instance.disable();\n }\n\n if (visible) {\n instance.show();\n }\n\n if (isSingletonMode) {\n singleton.hook({\n instance: instance,\n content: content,\n props: computedProps,\n setSingletonContent: setSingletonContent\n });\n }\n\n setMounted(true);\n return function () {\n instance.destroy();\n singleton == null ? void 0 : singleton.cleanup(instance);\n };\n }, deps); // UPDATE\n\n useIsomorphicLayoutEffect(function () {\n var _instance$popperInsta;\n\n // Prevent this effect from running on 1st render\n if (mutableBox.renders === 1) {\n mutableBox.renders++;\n return;\n }\n\n var instance = mutableBox.instance;\n instance.setProps(deepPreserveProps(instance.props, computedProps)); // Fixes #264\n\n (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.forceUpdate();\n\n if (disabled) {\n instance.disable();\n } else {\n instance.enable();\n }\n\n if (isControlledMode) {\n if (visible) {\n instance.show();\n } else {\n instance.hide();\n }\n }\n\n if (isSingletonMode) {\n singleton.hook({\n instance: instance,\n content: content,\n props: computedProps,\n setSingletonContent: setSingletonContent\n });\n }\n });\n useIsomorphicLayoutEffect(function () {\n var _instance$props$poppe;\n\n if (!render) {\n return;\n }\n\n var instance = mutableBox.instance;\n instance.setProps({\n popperOptions: Object.assign({}, instance.props.popperOptions, {\n modifiers: [].concat((((_instance$props$poppe = instance.props.popperOptions) == null ? void 0 : _instance$props$poppe.modifiers) || []).filter(function (_ref3) {\n var name = _ref3.name;\n return name !== '$$tippyReact';\n }), [{\n name: '$$tippyReact',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn: function fn(_ref4) {\n var _state$modifiersData;\n\n var state = _ref4.state;\n var hideData = (_state$modifiersData = state.modifiersData) == null ? void 0 : _state$modifiersData.hide; // WARNING: this is a high-risk path that can cause an infinite\n // loop. This expression _must_ evaluate to false when required\n\n if (attrs.placement !== state.placement || attrs.referenceHidden !== (hideData == null ? void 0 : hideData.isReferenceHidden) || attrs.escaped !== (hideData == null ? void 0 : hideData.hasPopperEscaped)) {\n setAttrs({\n placement: state.placement,\n referenceHidden: hideData == null ? void 0 : hideData.isReferenceHidden,\n escaped: hideData == null ? void 0 : hideData.hasPopperEscaped\n });\n }\n\n state.attributes.popper = {};\n }\n }])\n })\n });\n }, [attrs.placement, attrs.referenceHidden, attrs.escaped].concat(deps));\n return /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/cloneElement(children, {\n ref: function ref(node) {\n mutableBox.ref = node;\n preserveRef(children.ref, node);\n }\n }) : null, mounted && /*#__PURE__*/createPortal(render ? render(toDataAttributes(attrs), singletonContent, mutableBox.instance) : content, mutableBox.container));\n }\n\n return Tippy;\n}\n\nfunction useSingletonGenerator(createSingleton) {\n return function useSingleton(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$overrides = _ref.overrides,\n overrides = _ref$overrides === void 0 ? [] : _ref$overrides;\n\n var _useState = useState(false),\n mounted = _useState[0],\n setMounted = _useState[1];\n\n var mutableBox = useMutableBox({\n children: [],\n renders: 1\n });\n useIsomorphicLayoutEffect(function () {\n if (!mounted) {\n setMounted(true);\n return;\n }\n\n var children = mutableBox.children,\n sourceData = mutableBox.sourceData;\n\n if (!sourceData) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(['@tippyjs/react: The `source` variable from `useSingleton()` has', 'not been passed to a component.'].join(' '));\n }\n\n return;\n }\n\n var instance = createSingleton(children.map(function (child) {\n return child.instance;\n }), Object.assign({}, sourceData.props, {\n popperOptions: sourceData.instance.props.popperOptions,\n overrides: overrides,\n plugins: [classNamePlugin].concat(sourceData.props.plugins || [])\n }));\n mutableBox.instance = instance;\n\n if (disabled) {\n instance.disable();\n }\n\n return function () {\n instance.destroy();\n mutableBox.children = children.filter(function (_ref2) {\n var instance = _ref2.instance;\n return !instance.state.isDestroyed;\n });\n };\n }, [mounted]);\n useIsomorphicLayoutEffect(function () {\n if (!mounted) {\n return;\n }\n\n if (mutableBox.renders === 1) {\n mutableBox.renders++;\n return;\n }\n\n var children = mutableBox.children,\n instance = mutableBox.instance,\n sourceData = mutableBox.sourceData;\n\n if (!(instance && sourceData)) {\n return;\n }\n\n var _sourceData$props = sourceData.props,\n content = _sourceData$props.content,\n props = _objectWithoutPropertiesLoose(_sourceData$props, [\"content\"]);\n\n instance.setProps(deepPreserveProps(instance.props, Object.assign({}, props, {\n overrides: overrides\n })));\n instance.setInstances(children.map(function (child) {\n return child.instance;\n }));\n\n if (disabled) {\n instance.disable();\n } else {\n instance.enable();\n }\n });\n return useMemo(function () {\n var source = {\n data: mutableBox,\n hook: function hook(data) {\n mutableBox.sourceData = data;\n mutableBox.setSingletonContent = data.setSingletonContent;\n },\n cleanup: function cleanup() {\n mutableBox.sourceData = null;\n }\n };\n var target = {\n hook: function hook(data) {\n var _mutableBox$instance, _mutableBox$instance2;\n\n mutableBox.children = mutableBox.children.filter(function (_ref3) {\n var instance = _ref3.instance;\n return data.instance !== instance;\n });\n mutableBox.children.push(data);\n\n if (((_mutableBox$instance = mutableBox.instance) == null ? void 0 : _mutableBox$instance.state.isMounted) && ((_mutableBox$instance2 = mutableBox.instance) == null ? void 0 : _mutableBox$instance2.state.$$activeSingletonInstance) === data.instance) {\n mutableBox.setSingletonContent == null ? void 0 : mutableBox.setSingletonContent(data.content);\n }\n\n if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {\n mutableBox.instance.setInstances(mutableBox.children.map(function (child) {\n return child.instance;\n }));\n }\n },\n cleanup: function cleanup(instance) {\n mutableBox.children = mutableBox.children.filter(function (data) {\n return data.instance !== instance;\n });\n\n if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {\n mutableBox.instance.setInstances(mutableBox.children.map(function (child) {\n return child.instance;\n }));\n }\n }\n };\n return [source, target];\n }, []);\n };\n}\n\nvar forwardRef = (function (Tippy, defaultProps) {\n return /*#__PURE__*/forwardRef$1(function TippyWrapper(_ref, _ref2) {\n var children = _ref.children,\n props = _objectWithoutPropertiesLoose(_ref, [\"children\"]);\n\n return (\n /*#__PURE__*/\n // If I spread them separately here, Babel adds the _extends ponyfill for\n // some reason\n React.createElement(Tippy, Object.assign({}, defaultProps, props), children ? /*#__PURE__*/cloneElement(children, {\n ref: function ref(node) {\n preserveRef(_ref2, node);\n preserveRef(children.ref, node);\n }\n }) : null)\n );\n });\n});\n\nvar useSingleton = /*#__PURE__*/useSingletonGenerator(createSingleton);\nvar index = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));\n\nexport default index;\nexport { useSingleton };\n//# sourceMappingURL=tippy-react.esm.js.map\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import { StyleSheet } from '@emotion/sheet';\nimport Stylis from '@emotion/stylis';\nimport '@emotion/weak-memoize';\n\n// https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet\n// inlined to avoid umd wrapper and peerDep warnings/installing stylis\n// since we use stylis after closure compiler\nvar delimiter = '/*|*/';\nvar needle = delimiter + '}';\n\nfunction toSheet(block) {\n if (block) {\n Sheet.current.insert(block + '}');\n }\n}\n\nvar Sheet = {\n current: null\n};\nvar ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {\n switch (context) {\n // property\n case 1:\n {\n switch (content.charCodeAt(0)) {\n case 64:\n {\n // @import\n Sheet.current.insert(content + ';');\n return '';\n }\n // charcode for l\n\n case 108:\n {\n // charcode for b\n // this ignores label\n if (content.charCodeAt(2) === 98) {\n return '';\n }\n }\n }\n\n break;\n }\n // selector\n\n case 2:\n {\n if (ns === 0) return content + delimiter;\n break;\n }\n // at-rule\n\n case 3:\n {\n switch (ns) {\n // @font-face, @page\n case 102:\n case 112:\n {\n Sheet.current.insert(selectors[0] + content);\n return '';\n }\n\n default:\n {\n return content + (at === 0 ? delimiter : '');\n }\n }\n }\n\n case -2:\n {\n content.split(needle).forEach(toSheet);\n }\n }\n};\n\nvar createCache = function createCache(options) {\n if (options === undefined) options = {};\n var key = options.key || 'css';\n var stylisOptions;\n\n if (options.prefix !== undefined) {\n stylisOptions = {\n prefix: options.prefix\n };\n }\n\n var stylis = new Stylis(stylisOptions);\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {}; // $FlowFixMe\n\n var container;\n\n {\n container = options.container || document.head;\n var nodes = document.querySelectorAll(\"style[data-emotion-\" + key + \"]\");\n Array.prototype.forEach.call(nodes, function (node) {\n var attrib = node.getAttribute(\"data-emotion-\" + key); // $FlowFixMe\n\n attrib.split(' ').forEach(function (id) {\n inserted[id] = true;\n });\n\n if (node.parentNode !== container) {\n container.appendChild(node);\n }\n });\n }\n\n var _insert;\n\n {\n stylis.use(options.stylisPlugins)(ruleSheet);\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n var name = serialized.name;\n Sheet.current = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n var map = serialized.map;\n Sheet.current = {\n insert: function insert(rule) {\n sheet.insert(rule + map);\n }\n };\n }\n\n stylis(selector, serialized.styles);\n\n if (shouldCache) {\n cache.inserted[name] = true;\n }\n };\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // https://esbench.com/bench/5bf7371a4cd7e6009ef61d0a\n var commentStart = /\\/\\*/g;\n var commentEnd = /\\*\\//g;\n stylis.use(function (context, content) {\n switch (context) {\n case -1:\n {\n while (commentStart.test(content)) {\n commentEnd.lastIndex = commentStart.lastIndex;\n\n if (commentEnd.test(content)) {\n commentStart.lastIndex = commentEnd.lastIndex;\n continue;\n }\n\n throw new Error('Your styles have an unterminated comment (\"/*\" without corresponding \"*/\").');\n }\n\n commentStart.lastIndex = 0;\n break;\n }\n }\n });\n stylis.use(function (context, content, selectors) {\n switch (context) {\n case -1:\n {\n var flag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n var unsafePseudoClasses = content.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses && cache.compat !== true) {\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n var ignoreRegExp = new RegExp(unsafePseudoClass + \".*\\\\/\\\\* \" + flag + \" \\\\*\\\\/\");\n var ignore = ignoreRegExp.test(content);\n\n if (unsafePseudoClass && !ignore) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n }\n });\n }\n\n break;\n }\n }\n });\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n return cache;\n};\n\nexport default createCache;\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\nimport _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';\nimport _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';\nimport React, { Component } from 'react';\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\nvar defaultProps = {\n defaultInputValue: '',\n defaultMenuIsOpen: false,\n defaultValue: null\n};\n\nvar manageState = function manageState(SelectComponent) {\n var _class, _temp;\n\n return _temp = _class = /*#__PURE__*/function (_Component) {\n _inherits(StateManager, _Component);\n\n var _super = _createSuper(StateManager);\n\n function StateManager() {\n var _this;\n\n _classCallCheck(this, StateManager);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.select = void 0;\n _this.state = {\n inputValue: _this.props.inputValue !== undefined ? _this.props.inputValue : _this.props.defaultInputValue,\n menuIsOpen: _this.props.menuIsOpen !== undefined ? _this.props.menuIsOpen : _this.props.defaultMenuIsOpen,\n value: _this.props.value !== undefined ? _this.props.value : _this.props.defaultValue\n };\n\n _this.onChange = function (value, actionMeta) {\n _this.callProp('onChange', value, actionMeta);\n\n _this.setState({\n value: value\n });\n };\n\n _this.onInputChange = function (value, actionMeta) {\n // TODO: for backwards compatibility, we allow the prop to return a new\n // value, but now inputValue is a controllable prop we probably shouldn't\n var newValue = _this.callProp('onInputChange', value, actionMeta);\n\n _this.setState({\n inputValue: newValue !== undefined ? newValue : value\n });\n };\n\n _this.onMenuOpen = function () {\n _this.callProp('onMenuOpen');\n\n _this.setState({\n menuIsOpen: true\n });\n };\n\n _this.onMenuClose = function () {\n _this.callProp('onMenuClose');\n\n _this.setState({\n menuIsOpen: false\n });\n };\n\n return _this;\n }\n\n _createClass(StateManager, [{\n key: \"focus\",\n value: function focus() {\n this.select.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.select.blur();\n } // FIXME: untyped flow code, return any\n\n }, {\n key: \"getProp\",\n value: function getProp(key) {\n return this.props[key] !== undefined ? this.props[key] : this.state[key];\n } // FIXME: untyped flow code, return any\n\n }, {\n key: \"callProp\",\n value: function callProp(name) {\n if (typeof this.props[name] === 'function') {\n var _this$props;\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n return (_this$props = this.props)[name].apply(_this$props, args);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props2 = this.props,\n defaultInputValue = _this$props2.defaultInputValue,\n defaultMenuIsOpen = _this$props2.defaultMenuIsOpen,\n defaultValue = _this$props2.defaultValue,\n props = _objectWithoutProperties(_this$props2, [\"defaultInputValue\", \"defaultMenuIsOpen\", \"defaultValue\"]);\n\n return /*#__PURE__*/React.createElement(SelectComponent, _extends({}, props, {\n ref: function ref(_ref) {\n _this2.select = _ref;\n },\n inputValue: this.getProp('inputValue'),\n menuIsOpen: this.getProp('menuIsOpen'),\n onChange: this.onChange,\n onInputChange: this.onInputChange,\n onMenuClose: this.onMenuClose,\n onMenuOpen: this.onMenuOpen,\n value: this.getProp('value')\n }));\n }\n }]);\n\n return StateManager;\n }(Component), _class.defaultProps = defaultProps, _temp;\n};\n\nexport { manageState as m };\n","import {QuestionType} from 'api';\nimport {FeatureFlag, useFeatureFlags, useTranslation} from 'hooks';\nimport React from 'react';\n\nimport QuestionTypeInput from '../QuestionTypeInput';\n\nenum QUESTION_TYPE_TRANSLATION {\n STAR = 'plugin.surveys.admin.planner.question.type.star',\n TEXT = 'plugin.surveys.admin.planner.question.type.text',\n SCALE = 'plugin.surveys.admin.planner.question.type.scale',\n NPS = 'plugin.surveys.admin.planner.question.type.nps',\n MULTIPLE_CHOICE = 'plugin.surveys.admin.planner.question.type.multiple-choice'\n}\n\ninterface QuestionTypeSelectorProps {\n value: QuestionType;\n onChange: (value: QuestionType) => void;\n isEditable: boolean;\n}\nconst QuestionTypeSelector = (props: QuestionTypeSelectorProps) => {\n const {isEditable, value} = props;\n const feature = useFeatureFlags();\n const {t} = useTranslation();\n\n if (!isEditable || !feature.has(FeatureFlag.PREMIUM)) {\n return (\n <>\n {t('plugin.surveys.admin.planner.question.type')}\n {t(QUESTION_TYPE_TRANSLATION[value])}\n \n );\n }\n\n const options = [\n QuestionType.STAR,\n QuestionType.SCALE,\n QuestionType.TEXT,\n QuestionType.MULTIPLE_CHOICE,\n QuestionType.NPS\n ].map((type) => {\n return {\n label: t(QUESTION_TYPE_TRANSLATION[type]),\n value: type\n };\n });\n\n return ;\n};\n\nexport default QuestionTypeSelector;\n","import {QuestionType} from 'api';\nimport {useTranslation} from 'hooks';\nimport React from 'react';\nimport {useLocation} from 'wouter';\n\nimport {Button, Title as CardTitle, Description as CardDescription} from '../../../components/CardButton';\nimport {Title, Description, Container, Card} from './index.styles';\n\nimport {QIcon} from 'components';\n\nenum TITLE_TRANSLATION {\n STAR = 'plugin.surveys.admin.multiple-questions.add.question.title.star',\n TEXT = 'plugin.surveys.admin.multiple-questions.add.question.title.text',\n SCALE = 'plugin.surveys.admin.multiple-questions.add.question.title.scale',\n NPS = 'plugin.surveys.admin.multiple-questions.add.question.title.nps',\n MULTIPLE_CHOICE = 'plugin.surveys.admin.multiple-questions.add.question.title.multiple-choice'\n}\n\nenum DESCRIPTION_TRANSLATION {\n STAR = 'plugin.surveys.admin.multiple-questions.add.question.description.star',\n TEXT = 'plugin.surveys.admin.multiple-questions.add.question.description.text',\n SCALE = 'plugin.surveys.admin.multiple-questions.add.question.description.scale',\n NPS = 'plugin.surveys.admin.multiple-questions.add.question.description.nps',\n MULTIPLE_CHOICE = 'plugin.surveys.admin.multiple-questions.add.question.description.multiple-choice'\n}\n\nconst SelectQuestionType = () => {\n const [_, navigate] = useLocation();\n const {t} = useTranslation();\n const onClickHandler = (questionType: QuestionType) => () => {\n navigate(`/add/${questionType.toLowerCase()}`);\n };\n\n return (\n \n {t('plugin.surveys.admin.multiple-questions.add.question.caption')}\n \n {t('plugin.surveys.admin.multiple-questions.add.question.hint')}\n {[QuestionType.STAR, QuestionType.SCALE, QuestionType.TEXT, QuestionType.MULTIPLE_CHOICE, QuestionType.NPS].map(\n (questionType) => (\n \n \n \n

{t(TITLE_TRANSLATION[questionType])}

\n \n {t(DESCRIPTION_TRANSLATION[questionType])}\n \n )\n )}\n \n \n );\n};\nexport default SelectQuestionType;\n","import React, {Fragment, useCallback, useState, useEffect, useRef} from 'react';\n\nimport {useTranslations} from '../../adapters/I18nAdapter';\nimport {useNavigation} from '../../adapters/NavigationAdapter';\nimport {\n ArrowFirst,\n ArrowBack,\n ArrowNext,\n ArrowLast,\n PaginationContainer,\n ColLeft,\n ColRight,\n PageForm,\n PageInput,\n Seperator,\n PageSizeSelect,\n PageSpinner\n} from './Pagination.styled';\n\n/**\n * Different types that are used to adjust the locals the {@link Pagination} component renders.\n */\nexport enum PaginationItemType {\n Comments = 'comments',\n Companies = 'companies',\n Groups = 'groups',\n Items = 'items',\n PendingUsers = 'pendingUsers',\n Posts = 'posts',\n Spaces = 'spaces',\n Tokens = 'tokens',\n Users = 'users'\n}\n\ninterface PaginationProps {\n /**\n * The item type is used to determine the locals used. Default: items\n */\n itemType?: PaginationItemType;\n\n /**\n * The total amount of items the pagination component is used to navigate through. This value is e.g. used to\n * determine the total amount of pages.\n */\n total: number;\n\n /**\n * Set the page the is initially opened.\n */\n defaultPage?: number;\n\n /**\n * This callback is called on on initial load, and on every page or page size change. It should be used to load the\n * items that are currently displayed. The callback receives an `offset` and `limit`, where the offset is the amount\n * of items to skip and limit the amount of items to fetch and display. If a `Promise` is returned, a loading\n * indicator is shown until the `Promise` resolves; additionally, a ascendent `Suspense` can be used to show a\n * top level loading indicator for the initial load.\n */\n onChange?: (offset: number, limit: number) => Promise | undefined;\n\n /**\n * Override the available page sizes. Default: `[10, 25, 50, 100]`\n */\n pageSizes?: number[];\n\n /**\n * The base url used to update the URL to reflect the currently opened page.\n */\n baseUrl: string;\n\n /**\n * When enabled, the currently opened page will not be reflected to the URL.\n */\n silent?: boolean;\n}\n\n/**\n * A component to render controls that can be used to navigate between pages. The amount of available pages is\n * automatically determined by the given `total` property in relation to the default or provided `pageSizes`.\n * The Pagination control takes control of reflecting the current page into the URL by adding `/{page}` at the end of\n * the given `baseUrl` (this behavior can be disabled by setting `silent`). After the initial render and on page\n * changes, the `onChange` handlers is called with updated `offset` and `limit` arguments that can then be used to load\n * data for the new page. Additionally, by changing the `itemType`, one can adjust the locals the pagination component\n * renders.\n * @param props\n * @constructor\n */\nexport default function Pagination(props: PaginationProps): JSX.Element | null {\n const t = useTranslations();\n const nav = useNavigation();\n\n // Load/initialize the current page. It can be set by the optional `defaultPage` property. Otherwise, it is loaded\n // from the current URL or falls back to page 1.\n const [currentPage, setCurrentPage] = useState(() => {\n if (props.defaultPage) {\n return props.defaultPage;\n }\n\n let baseUrl = props.baseUrl;\n if (baseUrl[0] === '/') {\n // removing leading slash\n baseUrl = baseUrl.slice(1);\n }\n\n let page: number | string = nav.getCurrentURL();\n if (page.indexOf(baseUrl) === 0) {\n page = page.slice(baseUrl.length + 1); // `+1` to remove forward slash as well\n page = parseInt(page, 10);\n if (!isNaN(page)) {\n return page;\n }\n }\n\n return 1;\n });\n\n // This value is used inside the page input and has to be different from `currentPage` to allow invalid states (like\n // non existing pages, non numbers, or similar).\n const [pageValue, setPageValue] = useState(currentPage);\n\n // On initialization, the active page size is the first on configured in the `pageSizes` property (or from the\n // `pageSizes` default value).\n const pageSizes = props.pageSizes || [10, 25, 50, 100];\n const [pageSize, setPageSize] = useState(pageSizes[0] || 10);\n\n // Keep track of whether we are currently loading data (for both the initial page load and for each page change), as\n // well as keeping track of a promise used for the initial load, which is used to show the fallback (which is in most\n // cases a loading indicator) of a descendent `Suspense`.\n const [isLoading, setIsLoading] = useState(false);\n const promise = useRef | undefined>(undefined);\n\n // Calculate/derive other variables used in the following ...\n const itemType = props.itemType || PaginationItemType.Items;\n const totalPages = Math.ceil(props.total / pageSize);\n const from = (currentPage - 1) * pageSize + 1;\n const to = Math.min(from + pageSize - 1, props.total);\n\n const onChange = useCallback(\n (offset, limit, suspend) => {\n if (!props.onChange) {\n return;\n }\n\n let p = props.onChange(offset, limit);\n if (p instanceof Promise) {\n setIsLoading(true);\n p = p.then(() => {\n setIsLoading(false);\n promise.current = undefined;\n });\n\n // we only want to trigger the fallback if a descendent `Suspense` for the initial load\n if (suspend) {\n promise.current = p;\n }\n } else {\n setIsLoading(false);\n }\n },\n [props.onChange]\n );\n\n // run the first `onChange` event for initialization (this effect is only run once)\n useEffect(() => {\n onChange((currentPage - 1) * pageSize, pageSize, true);\n }, []);\n\n // reflect the current page in URL (by e.g. appending `/2` for page 2)\n useEffect(() => {\n if (props.silent) {\n return;\n }\n\n let url = props.baseUrl;\n if (url[0] !== '/') {\n // ensure leading forward slash\n url = '/' + url;\n }\n\n if (currentPage > 1) {\n // ensure trailing forward slash\n if (url[url.length - 1] !== '/') {\n url += '/';\n }\n\n url += currentPage;\n }\n\n nav.goTo('/admin' + url);\n }, [currentPage, props.baseUrl, props.silent]);\n\n //used to update the last page after deletion of some previous page(s) on the last page\n useEffect(() => {\n if (totalPages > 0 && currentPage > totalPages) {\n setCurrentPage(totalPages);\n setPageValue(totalPages);\n onChange((totalPages - 1) * pageSize, pageSize, false);\n }\n }, [totalPages]);\n\n // handler used to change pages on navigation arrow clicks and page input changes\n const changePage = useCallback(\n (page: number | string) => {\n if (typeof page === 'string') {\n page = parseInt(page, 10);\n }\n if (isNaN(page) || page < 1) {\n page = 1;\n }\n if (page > totalPages) {\n page = totalPages;\n }\n setCurrentPage(page);\n setPageValue(page);\n onChange((page - 1) * pageSize, pageSize, false);\n },\n [pageSize, totalPages, props.onChange]\n );\n\n // handler used for the page size selection\n const handlePageSizeChange = useCallback(\n (e) => {\n const size = parseInt(e.target.value, 10);\n if (!isNaN(size) && size > 0 && pageSizes.includes(size)) {\n setPageSize(size);\n setCurrentPage(1);\n setPageValue(1);\n if (props.onChange) {\n props.onChange(0, size);\n }\n }\n },\n [pageSizes, props.onChange]\n );\n\n // intercept Enter presses inside the page input\n const handleKeyDown = useCallback(\n (e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n changePage(e.target.value);\n }\n },\n [changePage]\n );\n\n // Throwing the promise will trigger the fallback of the closest ascendent `Suspense`\n if (isLoading && promise.current) {\n throw promise.current;\n }\n\n if (props.total === 0) {\n return null;\n }\n return (\n \n \n changePage(1)} disabled={currentPage === 1} />\n changePage(currentPage - 1)}\n disabled={currentPage === 1}\n />\n\n \n {t('pagination.switcher.page')}\n setPageValue(e.target.value)}\n onBlur={(e) => changePage(e.target.value)}\n onKeyDown={handleKeyDown}\n />\n {t('pagination.switcher.total', totalPages)}\n \n\n changePage(currentPage + 1)}\n disabled={currentPage === totalPages}\n />\n changePage(totalPages)}\n disabled={currentPage === totalPages}\n />\n\n {isLoading && }\n \n \n \n\n {props.total > pageSizes[0] && (\n \n \n\n \n {pageSizes.map((size) => (\n \n ))}\n \n\n {t('pagination.info.per-page', t('pagination.type.' + itemType))}\n \n )}\n \n \n );\n}\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nexport default basePropertyOf;\n","import {SurveyType} from 'api';\n\nexport enum SurveyFrequency {\n ONE_WEEK = 7,\n TWO_WEEKS = 14,\n THREE_WEEKS = 21,\n FOUR_WEEKS = 28,\n SIX_WEEKS = 42,\n EIGHT_WEEKS = 56\n}\n\nexport const frequencyOptions = [\n SurveyFrequency.ONE_WEEK,\n SurveyFrequency.TWO_WEEKS,\n SurveyFrequency.THREE_WEEKS,\n SurveyFrequency.FOUR_WEEKS,\n SurveyFrequency.SIX_WEEKS,\n SurveyFrequency.EIGHT_WEEKS\n];\n\nexport enum SurveyDuration {\n UNTIL_NEXT_SURVEY = 0,\n ONE_DAY,\n TWO_DAYS,\n THREE_DAYS,\n FOUR_DAYS,\n FIVE_DAYS,\n SIX_DAYS,\n ONE_WEEK,\n TWO_WEEKS = 14,\n THREE_WEEKS = 21,\n FOUR_WEEKS = 28\n}\n\nexport const durationOptions = [\n SurveyDuration.UNTIL_NEXT_SURVEY,\n SurveyDuration.ONE_DAY,\n SurveyDuration.TWO_DAYS,\n SurveyDuration.THREE_DAYS,\n SurveyDuration.FOUR_DAYS,\n SurveyDuration.FIVE_DAYS,\n SurveyDuration.SIX_DAYS,\n SurveyDuration.ONE_WEEK,\n SurveyDuration.TWO_WEEKS,\n SurveyDuration.THREE_WEEKS,\n SurveyDuration.FOUR_WEEKS\n];\n\nexport interface SurveySchedulerFormValues {\n readonly surveyType: SurveyType;\n readonly startDate: string;\n readonly startTime: string;\n readonly endDate: string;\n readonly endTime: string;\n readonly frequency: string;\n readonly duration: string;\n readonly sendPushNotifications: boolean;\n}\n","/* eslint react/no-did-mount-set-state: 0 */\nimport { PureComponent, createRef } from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst emptyRect = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n width: 0,\n height: 0\n};\nexport default function withBoundingRects(BaseComponent) {\n return class WrappedComponent extends PureComponent {\n static displayName = (() => `withBoundingRects(${BaseComponent.displayName || ''})`)();\n constructor(props) {\n super(props);\n this.state = {\n rect: undefined,\n parentRect: undefined\n };\n this.nodeRef = /*#__PURE__*/createRef();\n this.getRects = this.getRects.bind(this);\n }\n componentDidMount() {\n this.node = this.nodeRef?.current || null;\n this.setState(() => this.getRects());\n }\n getRects() {\n if (!this.node) return this.state;\n const {\n node\n } = this;\n const parentNode = node.parentNode;\n const rect = node.getBoundingClientRect ? node.getBoundingClientRect() : emptyRect;\n const parentRect = parentNode?.getBoundingClientRect ? parentNode.getBoundingClientRect() : emptyRect;\n return {\n rect,\n parentRect\n };\n }\n render() {\n return /*#__PURE__*/_jsx(BaseComponent, {\n nodeRef: this.nodeRef,\n getRects: this.getRects,\n ...this.state,\n ...this.props\n });\n }\n };\n}","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar isDevelopment = false;\n\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n var componentSelector = interpolation;\n\n if (componentSelector.__emotion_styles !== undefined) {\n\n return componentSelector;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n var keyframes = interpolation;\n\n if (keyframes.anim === 1) {\n cursor = {\n name: keyframes.name,\n styles: keyframes.styles,\n next: cursor\n };\n return keyframes.name;\n }\n\n var serializedStyles = interpolation;\n\n if (serializedStyles.styles !== undefined) {\n var next = serializedStyles.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = serializedStyles.styles + \";\";\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n }\n\n break;\n }\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n var asString = interpolation;\n\n if (registered == null) {\n return asString;\n }\n\n var cached = registered[asString];\n return cached !== undefined ? cached : asString;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var key in obj) {\n var value = obj[key];\n\n if (typeof value !== 'object') {\n var asString = value;\n\n if (registered != null && registered[asString] !== undefined) {\n string += key + \"{\" + registered[asString] + \"}\";\n } else if (isProcessableValue(asString)) {\n string += processStyleName(key) + \":\" + processStyleValue(key, asString) + \";\";\n }\n } else {\n if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(key) + \":\" + processStyleValue(key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n\n string += key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;{]+)\\s*(;|$)/g; // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\nvar cursor;\nfunction serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n var asTemplateStringsArr = strings;\n\n styles += asTemplateStringsArr[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n var templateStringsArr = strings;\n\n styles += templateStringsArr[i];\n }\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n}\n\nexport { serializeStyles };\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n","import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n locale = formatLocale(definition);\n format = locale.format;\n formatPrefix = locale.formatPrefix;\n return locale;\n}\n","// src/utils/env.ts\nvar NOTHING = Symbol.for(\"immer-nothing\");\nvar DRAFTABLE = Symbol.for(\"immer-draftable\");\nvar DRAFT_STATE = Symbol.for(\"immer-state\");\n\n// src/utils/errors.ts\nvar errors = process.env.NODE_ENV !== \"production\" ? [\n // All error codes, starting by 0:\n function(plugin) {\n return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`;\n },\n function(thing) {\n return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`;\n },\n \"This object has been frozen and should not be mutated\",\n function(data) {\n return \"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" + data;\n },\n \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n \"Immer forbids circular references\",\n \"The first or second argument to `produce` must be a function\",\n \"The third argument to `produce` must be a function or undefined\",\n \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n function(thing) {\n return `'current' expects a draft, got: ${thing}`;\n },\n \"Object.defineProperty() cannot be used on an Immer draft\",\n \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n \"Immer only supports deleting array indices\",\n \"Immer only supports setting array indices and the 'length' property\",\n function(thing) {\n return `'original' expects a draft, got: ${thing}`;\n }\n // Note: if more errors are added, the errorOffset in Patches.ts should be increased\n // See Patches.ts for additional errors\n] : [];\nfunction die(error, ...args) {\n if (process.env.NODE_ENV !== \"production\") {\n const e = errors[error];\n const msg = isFunction(e) ? e.apply(null, args) : e;\n throw new Error(`[Immer] ${msg}`);\n }\n throw new Error(\n `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n );\n}\n\n// src/utils/common.ts\nvar O = Object;\nvar getPrototypeOf = O.getPrototypeOf;\nvar CONSTRUCTOR = \"constructor\";\nvar PROTOTYPE = \"prototype\";\nvar CONFIGURABLE = \"configurable\";\nvar ENUMERABLE = \"enumerable\";\nvar WRITABLE = \"writable\";\nvar VALUE = \"value\";\nvar isDraft = (value) => !!value && !!value[DRAFT_STATE];\nfunction isDraftable(value) {\n if (!value)\n return false;\n return isPlainObject(value) || isArray(value) || !!value[DRAFTABLE] || !!value[CONSTRUCTOR]?.[DRAFTABLE] || isMap(value) || isSet(value);\n}\nvar objectCtorString = O[PROTOTYPE][CONSTRUCTOR].toString();\nvar cachedCtorStrings = /* @__PURE__ */ new WeakMap();\nfunction isPlainObject(value) {\n if (!value || !isObjectish(value))\n return false;\n const proto = getPrototypeOf(value);\n if (proto === null || proto === O[PROTOTYPE])\n return true;\n const Ctor = O.hasOwnProperty.call(proto, CONSTRUCTOR) && proto[CONSTRUCTOR];\n if (Ctor === Object)\n return true;\n if (!isFunction(Ctor))\n return false;\n let ctorString = cachedCtorStrings.get(Ctor);\n if (ctorString === void 0) {\n ctorString = Function.toString.call(Ctor);\n cachedCtorStrings.set(Ctor, ctorString);\n }\n return ctorString === objectCtorString;\n}\nfunction original(value) {\n if (!isDraft(value))\n die(15, value);\n return value[DRAFT_STATE].base_;\n}\nfunction each(obj, iter, strict = true) {\n if (getArchtype(obj) === 0 /* Object */) {\n const keys = strict ? Reflect.ownKeys(obj) : O.keys(obj);\n keys.forEach((key) => {\n iter(key, obj[key], obj);\n });\n } else {\n obj.forEach((entry, index) => iter(index, entry, obj));\n }\n}\nfunction getArchtype(thing) {\n const state = thing[DRAFT_STATE];\n return state ? state.type_ : isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;\n}\nvar has = (thing, prop, type = getArchtype(thing)) => type === 2 /* Map */ ? thing.has(prop) : O[PROTOTYPE].hasOwnProperty.call(thing, prop);\nvar get = (thing, prop, type = getArchtype(thing)) => (\n // @ts-ignore\n type === 2 /* Map */ ? thing.get(prop) : thing[prop]\n);\nvar set = (thing, propOrOldValue, value, type = getArchtype(thing)) => {\n if (type === 2 /* Map */)\n thing.set(propOrOldValue, value);\n else if (type === 3 /* Set */) {\n thing.add(value);\n } else\n thing[propOrOldValue] = value;\n};\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nvar isArray = Array.isArray;\nvar isMap = (target) => target instanceof Map;\nvar isSet = (target) => target instanceof Set;\nvar isObjectish = (target) => typeof target === \"object\";\nvar isFunction = (target) => typeof target === \"function\";\nvar isBoolean = (target) => typeof target === \"boolean\";\nfunction isArrayIndex(value) {\n const n = +value;\n return Number.isInteger(n) && String(n) === value;\n}\nvar getProxyDraft = (value) => {\n if (!isObjectish(value))\n return null;\n return value?.[DRAFT_STATE];\n};\nvar latest = (state) => state.copy_ || state.base_;\nvar getValue = (value) => {\n const proxyDraft = getProxyDraft(value);\n return proxyDraft ? getFinalValue(proxyDraft) : value;\n};\nvar getFinalValue = (state) => state.modified_ ? state.copy_ : state.base_;\nfunction shallowCopy(base, strict) {\n if (isMap(base)) {\n return new Map(base);\n }\n if (isSet(base)) {\n return new Set(base);\n }\n if (isArray(base))\n return Array[PROTOTYPE].slice.call(base);\n const isPlain = isPlainObject(base);\n if (strict === true || strict === \"class_only\" && !isPlain) {\n const descriptors = O.getOwnPropertyDescriptors(base);\n delete descriptors[DRAFT_STATE];\n let keys = Reflect.ownKeys(descriptors);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const desc = descriptors[key];\n if (desc[WRITABLE] === false) {\n desc[WRITABLE] = true;\n desc[CONFIGURABLE] = true;\n }\n if (desc.get || desc.set)\n descriptors[key] = {\n [CONFIGURABLE]: true,\n [WRITABLE]: true,\n // could live with !!desc.set as well here...\n [ENUMERABLE]: desc[ENUMERABLE],\n [VALUE]: base[key]\n };\n }\n return O.create(getPrototypeOf(base), descriptors);\n } else {\n const proto = getPrototypeOf(base);\n if (proto !== null && isPlain) {\n return { ...base };\n }\n const obj = O.create(proto);\n return O.assign(obj, base);\n }\n}\nfunction freeze(obj, deep = false) {\n if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))\n return obj;\n if (getArchtype(obj) > 1) {\n O.defineProperties(obj, {\n set: dontMutateMethodOverride,\n add: dontMutateMethodOverride,\n clear: dontMutateMethodOverride,\n delete: dontMutateMethodOverride\n });\n }\n O.freeze(obj);\n if (deep)\n each(\n obj,\n (_key, value) => {\n freeze(value, true);\n },\n false\n );\n return obj;\n}\nfunction dontMutateFrozenCollections() {\n die(2);\n}\nvar dontMutateMethodOverride = {\n [VALUE]: dontMutateFrozenCollections\n};\nfunction isFrozen(obj) {\n if (obj === null || !isObjectish(obj))\n return true;\n return O.isFrozen(obj);\n}\n\n// src/utils/plugins.ts\nvar PluginMapSet = \"MapSet\";\nvar PluginPatches = \"Patches\";\nvar PluginArrayMethods = \"ArrayMethods\";\nvar plugins = {};\nfunction getPlugin(pluginKey) {\n const plugin = plugins[pluginKey];\n if (!plugin) {\n die(0, pluginKey);\n }\n return plugin;\n}\nvar isPluginLoaded = (pluginKey) => !!plugins[pluginKey];\nfunction loadPlugin(pluginKey, implementation) {\n if (!plugins[pluginKey])\n plugins[pluginKey] = implementation;\n}\n\n// src/core/scope.ts\nvar currentScope;\nvar getCurrentScope = () => currentScope;\nvar createScope = (parent_, immer_) => ({\n drafts_: [],\n parent_,\n immer_,\n // Whenever the modified draft contains a draft from another scope, we\n // need to prevent auto-freezing so the unowned draft can be finalized.\n canAutoFreeze_: true,\n unfinalizedDrafts_: 0,\n handledSet_: /* @__PURE__ */ new Set(),\n processedForPatches_: /* @__PURE__ */ new Set(),\n mapSetPlugin_: isPluginLoaded(PluginMapSet) ? getPlugin(PluginMapSet) : void 0,\n arrayMethodsPlugin_: isPluginLoaded(PluginArrayMethods) ? getPlugin(PluginArrayMethods) : void 0\n});\nfunction usePatchesInScope(scope, patchListener) {\n if (patchListener) {\n scope.patchPlugin_ = getPlugin(PluginPatches);\n scope.patches_ = [];\n scope.inversePatches_ = [];\n scope.patchListener_ = patchListener;\n }\n}\nfunction revokeScope(scope) {\n leaveScope(scope);\n scope.drafts_.forEach(revokeDraft);\n scope.drafts_ = null;\n}\nfunction leaveScope(scope) {\n if (scope === currentScope) {\n currentScope = scope.parent_;\n }\n}\nvar enterScope = (immer2) => currentScope = createScope(currentScope, immer2);\nfunction revokeDraft(draft) {\n const state = draft[DRAFT_STATE];\n if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)\n state.revoke_();\n else\n state.revoked_ = true;\n}\n\n// src/core/finalize.ts\nfunction processResult(result, scope) {\n scope.unfinalizedDrafts_ = scope.drafts_.length;\n const baseDraft = scope.drafts_[0];\n const isReplaced = result !== void 0 && result !== baseDraft;\n if (isReplaced) {\n if (baseDraft[DRAFT_STATE].modified_) {\n revokeScope(scope);\n die(4);\n }\n if (isDraftable(result)) {\n result = finalize(scope, result);\n }\n const { patchPlugin_ } = scope;\n if (patchPlugin_) {\n patchPlugin_.generateReplacementPatches_(\n baseDraft[DRAFT_STATE].base_,\n result,\n scope\n );\n }\n } else {\n result = finalize(scope, baseDraft);\n }\n maybeFreeze(scope, result, true);\n revokeScope(scope);\n if (scope.patches_) {\n scope.patchListener_(scope.patches_, scope.inversePatches_);\n }\n return result !== NOTHING ? result : void 0;\n}\nfunction finalize(rootScope, value) {\n if (isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n if (!state) {\n const finalValue = handleValue(value, rootScope.handledSet_, rootScope);\n return finalValue;\n }\n if (!isSameScope(state, rootScope)) {\n return value;\n }\n if (!state.modified_) {\n return state.base_;\n }\n if (!state.finalized_) {\n const { callbacks_ } = state;\n if (callbacks_) {\n while (callbacks_.length > 0) {\n const callback = callbacks_.pop();\n callback(rootScope);\n }\n }\n generatePatchesAndFinalize(state, rootScope);\n }\n return state.copy_;\n}\nfunction maybeFreeze(scope, value, deep = false) {\n if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n freeze(value, deep);\n }\n}\nfunction markStateFinalized(state) {\n state.finalized_ = true;\n state.scope_.unfinalizedDrafts_--;\n}\nvar isSameScope = (state, rootScope) => state.scope_ === rootScope;\nvar EMPTY_LOCATIONS_RESULT = [];\nfunction updateDraftInParent(parent, draftValue, finalizedValue, originalKey) {\n const parentCopy = latest(parent);\n const parentType = parent.type_;\n if (originalKey !== void 0) {\n const currentValue = get(parentCopy, originalKey, parentType);\n if (currentValue === draftValue) {\n set(parentCopy, originalKey, finalizedValue, parentType);\n return;\n }\n }\n if (!parent.draftLocations_) {\n const draftLocations = parent.draftLocations_ = /* @__PURE__ */ new Map();\n each(parentCopy, (key, value) => {\n if (isDraft(value)) {\n const keys = draftLocations.get(value) || [];\n keys.push(key);\n draftLocations.set(value, keys);\n }\n });\n }\n const locations = parent.draftLocations_.get(draftValue) ?? EMPTY_LOCATIONS_RESULT;\n for (const location of locations) {\n set(parentCopy, location, finalizedValue, parentType);\n }\n}\nfunction registerChildFinalizationCallback(parent, child, key) {\n parent.callbacks_.push(function childCleanup(rootScope) {\n const state = child;\n if (!state || !isSameScope(state, rootScope)) {\n return;\n }\n rootScope.mapSetPlugin_?.fixSetContents(state);\n const finalizedValue = getFinalValue(state);\n updateDraftInParent(parent, state.draft_ ?? state, finalizedValue, key);\n generatePatchesAndFinalize(state, rootScope);\n });\n}\nfunction generatePatchesAndFinalize(state, rootScope) {\n const shouldFinalize = state.modified_ && !state.finalized_ && (state.type_ === 3 /* Set */ || state.type_ === 1 /* Array */ && state.allIndicesReassigned_ || (state.assigned_?.size ?? 0) > 0);\n if (shouldFinalize) {\n const { patchPlugin_ } = rootScope;\n if (patchPlugin_) {\n const basePath = patchPlugin_.getPath(state);\n if (basePath) {\n patchPlugin_.generatePatches_(state, basePath, rootScope);\n }\n }\n markStateFinalized(state);\n }\n}\nfunction handleCrossReference(target, key, value) {\n const { scope_ } = target;\n if (isDraft(value)) {\n const state = value[DRAFT_STATE];\n if (isSameScope(state, scope_)) {\n state.callbacks_.push(function crossReferenceCleanup() {\n prepareCopy(target);\n const finalizedValue = getFinalValue(state);\n updateDraftInParent(target, value, finalizedValue, key);\n });\n }\n } else if (isDraftable(value)) {\n target.callbacks_.push(function nestedDraftCleanup() {\n const targetCopy = latest(target);\n if (target.type_ === 3 /* Set */) {\n if (targetCopy.has(value)) {\n handleValue(value, scope_.handledSet_, scope_);\n }\n } else {\n if (get(targetCopy, key, target.type_) === value) {\n if (scope_.drafts_.length > 1 && (target.assigned_.get(key) ?? false) === true && target.copy_) {\n handleValue(\n get(target.copy_, key, target.type_),\n scope_.handledSet_,\n scope_\n );\n }\n }\n }\n });\n }\n}\nfunction handleValue(target, handledSet, rootScope) {\n if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n return target;\n }\n if (isDraft(target) || handledSet.has(target) || !isDraftable(target) || isFrozen(target)) {\n return target;\n }\n handledSet.add(target);\n each(target, (key, value) => {\n if (isDraft(value)) {\n const state = value[DRAFT_STATE];\n if (isSameScope(state, rootScope)) {\n const updatedValue = getFinalValue(state);\n set(target, key, updatedValue, target.type_);\n markStateFinalized(state);\n }\n } else if (isDraftable(value)) {\n handleValue(value, handledSet, rootScope);\n }\n });\n return target;\n}\n\n// src/core/proxy.ts\nfunction createProxyProxy(base, parent) {\n const baseIsArray = isArray(base);\n const state = {\n type_: baseIsArray ? 1 /* Array */ : 0 /* Object */,\n // Track which produce call this is associated with.\n scope_: parent ? parent.scope_ : getCurrentScope(),\n // True for both shallow and deep changes.\n modified_: false,\n // Used during finalization.\n finalized_: false,\n // Track which properties have been assigned (true) or deleted (false).\n // actually instantiated in `prepareCopy()`\n assigned_: void 0,\n // The parent draft state.\n parent_: parent,\n // The base state.\n base_: base,\n // The base proxy.\n draft_: null,\n // set below\n // The base copy with any updated values.\n copy_: null,\n // Called by the `produce` function.\n revoke_: null,\n isManual_: false,\n // `callbacks` actually gets assigned in `createProxy`\n callbacks_: void 0\n };\n let target = state;\n let traps = objectTraps;\n if (baseIsArray) {\n target = [state];\n traps = arrayTraps;\n }\n const { revoke, proxy } = Proxy.revocable(target, traps);\n state.draft_ = proxy;\n state.revoke_ = revoke;\n return [proxy, state];\n}\nvar objectTraps = {\n get(state, prop) {\n if (prop === DRAFT_STATE)\n return state;\n let arrayPlugin = state.scope_.arrayMethodsPlugin_;\n const isArrayWithStringProp = state.type_ === 1 /* Array */ && typeof prop === \"string\";\n if (isArrayWithStringProp) {\n if (arrayPlugin?.isArrayOperationMethod(prop)) {\n return arrayPlugin.createMethodInterceptor(state, prop);\n }\n }\n const source = latest(state);\n if (!has(source, prop, state.type_)) {\n return readPropFromProto(state, source, prop);\n }\n const value = source[prop];\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (isArrayWithStringProp && state.operationMethod && arrayPlugin?.isMutatingArrayMethod(\n state.operationMethod\n ) && isArrayIndex(prop)) {\n return value;\n }\n if (value === peek(state.base_, prop) || isRelocatedBaseRef(state, prop, value)) {\n prepareCopy(state);\n const childKey = state.type_ === 1 /* Array */ ? +prop : prop;\n const childDraft = createProxy(state.scope_, value, state, childKey);\n return state.copy_[childKey] = childDraft;\n }\n return value;\n },\n has(state, prop) {\n return prop in latest(state);\n },\n ownKeys(state) {\n return Reflect.ownKeys(latest(state));\n },\n set(state, prop, value) {\n const desc = getDescriptorFromProto(latest(state), prop);\n if (desc?.set) {\n desc.set.call(state.draft_, value);\n return true;\n }\n if (!state.modified_) {\n const current2 = peek(latest(state), prop);\n const currentState = current2?.[DRAFT_STATE];\n if (currentState && currentState.base_ === value) {\n state.copy_[prop] = value;\n state.assigned_.set(prop, false);\n return true;\n }\n if (is(value, current2) && (value !== void 0 || has(state.base_, prop, state.type_)))\n return true;\n prepareCopy(state);\n markChanged(state);\n }\n if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'\n (value !== void 0 || has(state.copy_, prop, state.type_)) || // special case: NaN\n Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n return true;\n state.copy_[prop] = value;\n state.assigned_.set(prop, true);\n handleCrossReference(state, prop, value);\n return true;\n },\n deleteProperty(state, prop) {\n prepareCopy(state);\n if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n state.assigned_.set(prop, false);\n markChanged(state);\n } else {\n state.assigned_.delete(prop);\n }\n if (state.copy_) {\n delete state.copy_[prop];\n }\n return true;\n },\n // Note: We never coerce `desc.value` into an Immer draft, because we can't make\n // the same guarantee in ES5 mode.\n getOwnPropertyDescriptor(state, prop) {\n const owner = latest(state);\n const desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n if (!desc)\n return desc;\n return {\n [WRITABLE]: true,\n [CONFIGURABLE]: state.type_ !== 1 /* Array */ || prop !== \"length\",\n [ENUMERABLE]: desc[ENUMERABLE],\n [VALUE]: owner[prop]\n };\n },\n defineProperty() {\n die(11);\n },\n getPrototypeOf(state) {\n return getPrototypeOf(state.base_);\n },\n setPrototypeOf() {\n die(12);\n }\n};\nvar arrayTraps = {};\nfor (let key in objectTraps) {\n let fn = objectTraps[key];\n arrayTraps[key] = function() {\n const args = arguments;\n args[0] = args[0][0];\n return fn.apply(this, args);\n };\n}\narrayTraps.deleteProperty = function(state, prop) {\n if (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop)))\n die(13);\n return arrayTraps.set.call(this, state, prop, void 0);\n};\narrayTraps.set = function(state, prop, value) {\n if (process.env.NODE_ENV !== \"production\" && prop !== \"length\" && isNaN(parseInt(prop)))\n die(14);\n return objectTraps.set.call(this, state[0], prop, value, state[0]);\n};\nfunction peek(draft, prop) {\n const state = draft[DRAFT_STATE];\n const source = state ? latest(state) : draft;\n return source[prop];\n}\nfunction isRelocatedBaseRef(state, prop, value) {\n if (state.type_ !== 1 /* Array */ || !state.allIndicesReassigned_ || state.assigned_?.get(prop) || !isDraftable(value) || value[DRAFT_STATE]) {\n return false;\n }\n return state.baseRefs_.has(value);\n}\nfunction readPropFromProto(state, source, prop) {\n const desc = getDescriptorFromProto(source, prop);\n return desc ? VALUE in desc ? desc[VALUE] : (\n // This is a very special case, if the prop is a getter defined by the\n // prototype, we should invoke it with the draft as context!\n desc.get?.call(state.draft_)\n ) : void 0;\n}\nfunction getDescriptorFromProto(source, prop) {\n if (!(prop in source))\n return void 0;\n let proto = getPrototypeOf(source);\n while (proto) {\n const desc = Object.getOwnPropertyDescriptor(proto, prop);\n if (desc)\n return desc;\n proto = getPrototypeOf(proto);\n }\n return void 0;\n}\nfunction markChanged(state) {\n if (!state.modified_) {\n state.modified_ = true;\n if (state.parent_) {\n markChanged(state.parent_);\n }\n }\n}\nfunction prepareCopy(state) {\n if (!state.copy_) {\n state.assigned_ = /* @__PURE__ */ new Map();\n state.copy_ = shallowCopy(\n state.base_,\n state.scope_.immer_.useStrictShallowCopy_\n );\n }\n}\n\n// src/core/immerClass.ts\nvar Immer2 = class {\n constructor(config) {\n this.autoFreeze_ = true;\n this.useStrictShallowCopy_ = false;\n this.useStrictIteration_ = false;\n /**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\n this.produce = (base, recipe, patchListener) => {\n if (isFunction(base) && !isFunction(recipe)) {\n const defaultBase = recipe;\n recipe = base;\n const self = this;\n return function curriedProduce(base2 = defaultBase, ...args) {\n return self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n };\n }\n if (!isFunction(recipe))\n die(6);\n if (patchListener !== void 0 && !isFunction(patchListener))\n die(7);\n let result;\n if (isDraftable(base)) {\n const scope = enterScope(this);\n const proxy = createProxy(scope, base, void 0);\n let hasError = true;\n try {\n result = recipe(proxy);\n hasError = false;\n } finally {\n if (hasError)\n revokeScope(scope);\n else\n leaveScope(scope);\n }\n usePatchesInScope(scope, patchListener);\n return processResult(result, scope);\n } else if (!base || !isObjectish(base)) {\n result = recipe(base);\n if (result === void 0)\n result = base;\n if (result === NOTHING)\n result = void 0;\n if (this.autoFreeze_)\n freeze(result, true);\n if (patchListener) {\n const p = [];\n const ip = [];\n getPlugin(PluginPatches).generateReplacementPatches_(base, result, {\n patches_: p,\n inversePatches_: ip\n });\n patchListener(p, ip);\n }\n return result;\n } else\n die(1, base);\n };\n this.produceWithPatches = (base, recipe) => {\n if (isFunction(base)) {\n return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n }\n let patches, inversePatches;\n const result = this.produce(base, recipe, (p, ip) => {\n patches = p;\n inversePatches = ip;\n });\n return [result, patches, inversePatches];\n };\n if (isBoolean(config?.autoFreeze))\n this.setAutoFreeze(config.autoFreeze);\n if (isBoolean(config?.useStrictShallowCopy))\n this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n if (isBoolean(config?.useStrictIteration))\n this.setUseStrictIteration(config.useStrictIteration);\n }\n createDraft(base) {\n if (!isDraftable(base))\n die(8);\n if (isDraft(base))\n base = current(base);\n const scope = enterScope(this);\n const proxy = createProxy(scope, base, void 0);\n proxy[DRAFT_STATE].isManual_ = true;\n leaveScope(scope);\n return proxy;\n }\n finishDraft(draft, patchListener) {\n const state = draft && draft[DRAFT_STATE];\n if (!state || !state.isManual_)\n die(9);\n const { scope_: scope } = state;\n usePatchesInScope(scope, patchListener);\n return processResult(void 0, scope);\n }\n /**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is enabled.\n */\n setAutoFreeze(value) {\n this.autoFreeze_ = value;\n }\n /**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\n setUseStrictShallowCopy(value) {\n this.useStrictShallowCopy_ = value;\n }\n /**\n * Pass false to use faster iteration that skips non-enumerable properties\n * but still handles symbols for compatibility.\n *\n * By default, strict iteration is enabled (includes all own properties).\n */\n setUseStrictIteration(value) {\n this.useStrictIteration_ = value;\n }\n shouldUseStrictIteration() {\n return this.useStrictIteration_;\n }\n applyPatches(base, patches) {\n let i;\n for (i = patches.length - 1; i >= 0; i--) {\n const patch = patches[i];\n if (patch.path.length === 0 && patch.op === \"replace\") {\n base = patch.value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const applyPatchesImpl = getPlugin(PluginPatches).applyPatches_;\n if (isDraft(base)) {\n return applyPatchesImpl(base, patches);\n }\n return this.produce(\n base,\n (draft) => applyPatchesImpl(draft, patches)\n );\n }\n};\nfunction createProxy(rootScope, value, parent, key) {\n const [draft, state] = isMap(value) ? getPlugin(PluginMapSet).proxyMap_(value, parent) : isSet(value) ? getPlugin(PluginMapSet).proxySet_(value, parent) : createProxyProxy(value, parent);\n const scope = parent?.scope_ ?? getCurrentScope();\n scope.drafts_.push(draft);\n state.callbacks_ = parent?.callbacks_ ?? [];\n state.key_ = key;\n if (parent && key !== void 0) {\n registerChildFinalizationCallback(parent, state, key);\n } else {\n state.callbacks_.push(function rootDraftCleanup(rootScope2) {\n rootScope2.mapSetPlugin_?.fixSetContents(state);\n const { patchPlugin_ } = rootScope2;\n if (state.modified_ && patchPlugin_) {\n patchPlugin_.generatePatches_(state, [], rootScope2);\n }\n });\n }\n return draft;\n}\n\n// src/core/current.ts\nfunction current(value) {\n if (!isDraft(value))\n die(10, value);\n return currentImpl(value);\n}\nfunction currentImpl(value) {\n if (!isDraftable(value) || isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n let copy;\n let strict = true;\n if (state) {\n if (!state.modified_)\n return state.base_;\n state.finalized_ = true;\n copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n strict = state.scope_.immer_.shouldUseStrictIteration();\n } else {\n copy = shallowCopy(value, true);\n }\n each(\n copy,\n (key, childValue) => {\n set(copy, key, currentImpl(childValue));\n },\n strict\n );\n if (state) {\n state.finalized_ = false;\n }\n return copy;\n}\n\n// src/plugins/patches.ts\nfunction enablePatches() {\n const errorOffset = 16;\n if (process.env.NODE_ENV !== \"production\") {\n errors.push(\n 'Sets cannot have \"replace\" patches.',\n function(op) {\n return \"Unsupported patch operation: \" + op;\n },\n function(path) {\n return \"Cannot apply patch, path doesn't resolve: \" + path;\n },\n \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n );\n }\n function getPath(state, path = []) {\n if (state.key_ !== void 0) {\n const parentCopy = state.parent_.copy_ ?? state.parent_.base_;\n const proxyDraft = getProxyDraft(get(parentCopy, state.key_));\n const valueAtKey = get(parentCopy, state.key_);\n if (valueAtKey === void 0) {\n return null;\n }\n if (valueAtKey !== state.draft_ && valueAtKey !== state.base_ && valueAtKey !== state.copy_) {\n return null;\n }\n if (proxyDraft != null && proxyDraft.base_ !== state.base_) {\n return null;\n }\n const isSet2 = state.parent_.type_ === 3 /* Set */;\n let key;\n if (isSet2) {\n const setParent = state.parent_;\n key = Array.from(setParent.drafts_.keys()).indexOf(state.key_);\n } else {\n key = state.key_;\n }\n if (!(isSet2 && parentCopy.size > key || has(parentCopy, key))) {\n return null;\n }\n path.push(key);\n }\n if (state.parent_) {\n return getPath(state.parent_, path);\n }\n path.reverse();\n try {\n resolvePath(state.copy_, path);\n } catch (e) {\n return null;\n }\n return path;\n }\n function resolvePath(base, path) {\n let current2 = base;\n for (let i = 0; i < path.length - 1; i++) {\n const key = path[i];\n current2 = get(current2, key);\n if (!isObjectish(current2) || current2 === null) {\n throw new Error(`Cannot resolve path at '${path.join(\"/\")}'`);\n }\n }\n return current2;\n }\n const REPLACE = \"replace\";\n const ADD = \"add\";\n const REMOVE = \"remove\";\n function generatePatches_(state, basePath, scope) {\n if (state.scope_.processedForPatches_.has(state)) {\n return;\n }\n state.scope_.processedForPatches_.add(state);\n const { patches_, inversePatches_ } = scope;\n switch (state.type_) {\n case 0 /* Object */:\n case 2 /* Map */:\n return generatePatchesFromAssigned(\n state,\n basePath,\n patches_,\n inversePatches_\n );\n case 1 /* Array */:\n return generateArrayPatches(\n state,\n basePath,\n patches_,\n inversePatches_\n );\n case 3 /* Set */:\n return generateSetPatches(\n state,\n basePath,\n patches_,\n inversePatches_\n );\n }\n }\n function generateArrayPatches(state, basePath, patches, inversePatches) {\n let { base_, assigned_ } = state;\n let copy_ = state.copy_;\n if (copy_.length < base_.length) {\n ;\n [base_, copy_] = [copy_, base_];\n [patches, inversePatches] = [inversePatches, patches];\n }\n const allReassigned = state.allIndicesReassigned_ === true;\n for (let i = 0; i < base_.length; i++) {\n const copiedItem = copy_[i];\n const baseItem = base_[i];\n const isAssigned = allReassigned || assigned_?.get(i.toString());\n if (isAssigned && copiedItem !== baseItem) {\n const childState = copiedItem?.[DRAFT_STATE];\n if (childState && childState.modified_) {\n continue;\n }\n const path = basePath.concat([i]);\n patches.push({\n op: REPLACE,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copiedItem)\n });\n inversePatches.push({\n op: REPLACE,\n path,\n value: clonePatchValueIfNeeded(baseItem)\n });\n }\n }\n for (let i = base_.length; i < copy_.length; i++) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n }\n for (let i = copy_.length - 1; base_.length <= i; --i) {\n const path = basePath.concat([i]);\n inversePatches.push({\n op: REMOVE,\n path\n });\n }\n }\n function generatePatchesFromAssigned(state, basePath, patches, inversePatches) {\n const { base_, copy_, type_ } = state;\n each(state.assigned_, (key, assignedValue) => {\n const origValue = get(base_, key, type_);\n const value = get(copy_, key, type_);\n const op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD;\n if (origValue === value && op === REPLACE)\n return;\n const path = basePath.concat(key);\n patches.push(\n op === REMOVE ? { op, path } : { op, path, value: clonePatchValueIfNeeded(value) }\n );\n inversePatches.push(\n op === ADD ? { op: REMOVE, path } : op === REMOVE ? { op: ADD, path, value: clonePatchValueIfNeeded(origValue) } : { op: REPLACE, path, value: clonePatchValueIfNeeded(origValue) }\n );\n });\n }\n function generateSetPatches(state, basePath, patches, inversePatches) {\n let { base_, copy_ } = state;\n let i = 0;\n base_.forEach((value) => {\n if (!copy_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: REMOVE,\n path,\n value\n });\n inversePatches.unshift({\n op: ADD,\n path,\n value\n });\n }\n i++;\n });\n i = 0;\n copy_.forEach((value) => {\n if (!base_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n value\n });\n inversePatches.unshift({\n op: REMOVE,\n path,\n value\n });\n }\n i++;\n });\n }\n function generateReplacementPatches_(baseValue, replacement, scope) {\n const { patches_, inversePatches_ } = scope;\n patches_.push({\n op: REPLACE,\n path: [],\n value: replacement === NOTHING ? void 0 : replacement\n });\n inversePatches_.push({\n op: REPLACE,\n path: [],\n value: baseValue\n });\n }\n function applyPatches_(draft, patches) {\n patches.forEach((patch) => {\n const { path, op } = patch;\n let base = draft;\n for (let i = 0; i < path.length - 1; i++) {\n const parentType = getArchtype(base);\n let p = path[i];\n if (typeof p !== \"string\" && typeof p !== \"number\") {\n p = \"\" + p;\n }\n if ((parentType === 0 /* Object */ || parentType === 1 /* Array */) && (p === \"__proto__\" || p === CONSTRUCTOR))\n die(errorOffset + 3);\n if (isFunction(base) && p === PROTOTYPE)\n die(errorOffset + 3);\n base = get(base, p);\n if (base === null || !isObjectish(base))\n die(errorOffset + 2, path.join(\"/\"));\n }\n const type = getArchtype(base);\n const value = deepClonePatchValue(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case REPLACE:\n switch (type) {\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n die(errorOffset);\n default:\n return base[key] = value;\n }\n case ADD:\n switch (type) {\n case 1 /* Array */:\n return key === \"-\" ? base.push(value) : base.splice(key, 0, value);\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n return base.add(value);\n default:\n return base[key] = value;\n }\n case REMOVE:\n switch (type) {\n case 1 /* Array */:\n return base.splice(key, 1);\n case 2 /* Map */:\n return base.delete(key);\n case 3 /* Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n die(errorOffset + 1, op);\n }\n });\n return draft;\n }\n function deepClonePatchValue(obj) {\n if (!isDraftable(obj))\n return obj;\n if (isArray(obj))\n return obj.map(deepClonePatchValue);\n if (isMap(obj))\n return new Map(\n Array.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)])\n );\n if (isSet(obj))\n return new Set(Array.from(obj).map(deepClonePatchValue));\n const cloned = Object.create(getPrototypeOf(obj));\n for (const key in obj)\n cloned[key] = deepClonePatchValue(obj[key]);\n if (has(obj, DRAFTABLE))\n cloned[DRAFTABLE] = obj[DRAFTABLE];\n return cloned;\n }\n function clonePatchValueIfNeeded(obj) {\n if (isDraft(obj)) {\n return deepClonePatchValue(obj);\n } else\n return obj;\n }\n loadPlugin(PluginPatches, {\n applyPatches_,\n generatePatches_,\n generateReplacementPatches_,\n getPath\n });\n}\n\n// src/plugins/mapset.ts\nvar _globalIterator = globalThis.Iterator;\nvar hasIteratorFrom = typeof _globalIterator?.from === \"function\";\nfunction enableMapSet() {\n class DraftMap extends Map {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 2 /* Map */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n assigned_: void 0,\n base_: target,\n draft_: this,\n isManual_: false,\n revoked_: false,\n callbacks_: []\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(key) {\n return latest(this[DRAFT_STATE]).has(key);\n }\n set(key, value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!latest(state).has(key) || latest(state).get(key) !== value) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_.set(key, true);\n state.copy_.set(key, value);\n state.assigned_.set(key, true);\n handleCrossReference(state, key, value);\n }\n return this;\n }\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareMapCopy(state);\n markChanged(state);\n if (state.base_.has(key)) {\n state.assigned_.set(key, false);\n } else {\n state.assigned_.delete(key);\n }\n state.copy_.delete(key);\n return true;\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_ = /* @__PURE__ */ new Map();\n each(state.base_, (key) => {\n state.assigned_.set(key, false);\n });\n state.copy_.clear();\n }\n }\n forEach(cb, thisArg) {\n const state = this[DRAFT_STATE];\n latest(state).forEach((_value, key, _map) => {\n cb.call(thisArg, this.get(key), key, this);\n });\n }\n get(key) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n const value = latest(state).get(key);\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value !== state.base_.get(key)) {\n return value;\n }\n const draft = createProxy(state.scope_, value, state, key);\n prepareMapCopy(state);\n state.copy_.set(key, draft);\n return draft;\n }\n keys() {\n return latest(this[DRAFT_STATE]).keys();\n }\n values() {\n const iterator = this.keys();\n return iteratorFrom({\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value\n };\n }\n });\n }\n entries() {\n const iterator = this.keys();\n return iteratorFrom({\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value: [r.value, value]\n };\n }\n });\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.entries();\n }\n }\n function iteratorFrom(iterable) {\n if (hasIteratorFrom) {\n return _globalIterator.from(iterable);\n }\n const iterator = {\n ...iterable,\n [Symbol.iterator]: () => iterator\n };\n return iterator;\n }\n function proxyMap_(target, parent) {\n const map = new DraftMap(target, parent);\n return [map, map[DRAFT_STATE]];\n }\n function prepareMapCopy(state) {\n if (!state.copy_) {\n state.assigned_ = /* @__PURE__ */ new Map();\n state.copy_ = new Map(state.base_);\n }\n }\n class DraftSet extends Set {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 3 /* Set */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n base_: target,\n draft_: this,\n drafts_: /* @__PURE__ */ new Map(),\n revoked_: false,\n isManual_: false,\n assigned_: void 0,\n callbacks_: []\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!state.copy_) {\n return state.base_.has(value);\n }\n if (state.copy_.has(value))\n return true;\n if (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value)))\n return true;\n return false;\n }\n add(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!this.has(value)) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.add(value);\n handleCrossReference(state, value, value);\n }\n return this;\n }\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n markChanged(state);\n return state.copy_.delete(value) || (state.drafts_.has(value) ? state.copy_.delete(state.drafts_.get(value)) : (\n /* istanbul ignore next */\n false\n ));\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.clear();\n }\n }\n values() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.values();\n }\n entries() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.entries();\n }\n keys() {\n return this.values();\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.values();\n }\n forEach(cb, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n cb.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n }\n }\n function proxySet_(target, parent) {\n const set2 = new DraftSet(target, parent);\n return [set2, set2[DRAFT_STATE]];\n }\n function prepareSetCopy(state) {\n if (!state.copy_) {\n state.copy_ = /* @__PURE__ */ new Set();\n state.base_.forEach((value) => {\n if (isDraftable(value)) {\n const draft = createProxy(state.scope_, value, state, value);\n state.drafts_.set(value, draft);\n state.copy_.add(draft);\n } else {\n state.copy_.add(value);\n }\n });\n }\n }\n function assertUnrevoked(state) {\n if (state.revoked_)\n die(3, JSON.stringify(latest(state)));\n }\n function fixSetContents(target) {\n if (target.type_ === 3 /* Set */ && target.copy_) {\n const copy = new Set(target.copy_);\n target.copy_.clear();\n copy.forEach((value) => {\n target.copy_.add(getValue(value));\n });\n }\n }\n loadPlugin(PluginMapSet, { proxyMap_, proxySet_, fixSetContents });\n}\n\n// src/plugins/arrayMethods.ts\nfunction enableArrayMethods() {\n const SHIFTING_METHODS = /* @__PURE__ */ new Set([\"shift\", \"unshift\"]);\n const QUEUE_METHODS = /* @__PURE__ */ new Set([\"push\", \"pop\"]);\n const RESULT_RETURNING_METHODS = /* @__PURE__ */ new Set([\n ...QUEUE_METHODS,\n ...SHIFTING_METHODS\n ]);\n const REORDERING_METHODS = /* @__PURE__ */ new Set([\"reverse\", \"sort\"]);\n const MUTATING_METHODS = /* @__PURE__ */ new Set([\n ...RESULT_RETURNING_METHODS,\n ...REORDERING_METHODS,\n \"splice\"\n ]);\n const FIND_METHODS = /* @__PURE__ */ new Set([\"find\", \"findLast\"]);\n const NON_MUTATING_METHODS = /* @__PURE__ */ new Set([\n \"filter\",\n \"slice\",\n \"concat\",\n \"flat\",\n ...FIND_METHODS,\n \"findIndex\",\n \"findLastIndex\",\n \"some\",\n \"every\",\n \"indexOf\",\n \"lastIndexOf\",\n \"includes\",\n \"join\",\n \"toString\",\n \"toLocaleString\"\n ]);\n function isMutatingArrayMethod(method) {\n return MUTATING_METHODS.has(method);\n }\n function isNonMutatingArrayMethod(method) {\n return NON_MUTATING_METHODS.has(method);\n }\n function isArrayOperationMethod(method) {\n return isMutatingArrayMethod(method) || isNonMutatingArrayMethod(method);\n }\n function enterOperation(state, method) {\n state.operationMethod = method;\n }\n function exitOperation(state) {\n state.operationMethod = void 0;\n }\n function executeArrayMethod(state, operation, markLength = true) {\n prepareCopy(state);\n const result = operation();\n markArrayChanged(state, markLength);\n return result;\n }\n function markArrayChanged(state, markLength = true) {\n markChanged(state);\n if (markLength)\n state.assigned_.set(\"length\", true);\n }\n function markAllIndicesReassigned(state) {\n state.allIndicesReassigned_ = true;\n state.baseRefs_ = new Set(state.base_);\n }\n function normalizeSliceIndex(index, length) {\n if (index < 0) {\n return Math.max(length + index, 0);\n }\n return Math.min(index, length);\n }\n function handleInsertedValues(state, startIndex, values) {\n for (let i = 0; i < values.length; i++) {\n const index = \"\" + (startIndex + i);\n state.assigned_.set(index, true);\n handleCrossReference(state, index, values[i]);\n }\n }\n function handleSimpleOperation(state, method, args) {\n const isInsert = method === \"push\" || method === \"unshift\";\n if (isInsert ? args.length === 0 : latest(state).length === 0) {\n return isInsert ? latest(state).length : void 0;\n }\n prepareCopy(state);\n const lengthBefore = state.copy_.length;\n const result = state.copy_[method](...args);\n markArrayChanged(state);\n if (SHIFTING_METHODS.has(method)) {\n markAllIndicesReassigned(state);\n }\n if (method === \"push\") {\n handleInsertedValues(state, lengthBefore, args);\n } else if (method === \"unshift\") {\n handleInsertedValues(state, 0, args);\n }\n return RESULT_RETURNING_METHODS.has(method) ? result : state.draft_;\n }\n function handleReorderingOperation(state, method, args) {\n if (latest(state).length <= 1)\n return state.draft_;\n return executeArrayMethod(\n state,\n () => {\n ;\n state.copy_[method](...args);\n markAllIndicesReassigned(state);\n return state.draft_;\n },\n false\n );\n }\n function createMethodInterceptor(state, originalMethod) {\n return function interceptedMethod(...args) {\n const method = originalMethod;\n enterOperation(state, method);\n try {\n if (isMutatingArrayMethod(method)) {\n if (RESULT_RETURNING_METHODS.has(method)) {\n return handleSimpleOperation(state, method, args);\n }\n if (REORDERING_METHODS.has(method)) {\n return handleReorderingOperation(state, method, args);\n }\n if (method === \"splice\") {\n const insertCount = args.length > 2 ? args.length - 2 : 0;\n if (insertCount === 0) {\n const length = latest(state).length;\n if (args.length === 0 || normalizeSliceIndex(args[0] ?? 0, length) === length || args.length > 1 && !(args[1] >= 1)) {\n return [];\n }\n }\n prepareCopy(state);\n const res = state.copy_.splice(\n ...args\n );\n if (res.length === 0 && insertCount === 0) {\n return res;\n }\n markArrayChanged(state);\n markAllIndicesReassigned(state);\n if (insertCount > 0) {\n const startIndex = normalizeSliceIndex(\n args[0] ?? 0,\n state.copy_.length\n );\n handleInsertedValues(state, startIndex, args.slice(2));\n }\n return res;\n }\n } else {\n return handleNonMutatingOperation(state, method, args);\n }\n } finally {\n exitOperation(state);\n }\n };\n }\n function handleNonMutatingOperation(state, method, args) {\n const source = latest(state);\n if (method === \"filter\") {\n const predicate = args[0];\n const result = [];\n for (let i = 0; i < source.length; i++) {\n if (predicate(source[i], i, source)) {\n result.push(state.draft_[i]);\n }\n }\n return result;\n }\n if (FIND_METHODS.has(method)) {\n const predicate = args[0];\n const isForward = method === \"find\";\n const step = isForward ? 1 : -1;\n const start = isForward ? 0 : source.length - 1;\n for (let i = start; i >= 0 && i < source.length; i += step) {\n if (predicate(source[i], i, source)) {\n return state.draft_[i];\n }\n }\n return void 0;\n }\n if (method === \"slice\") {\n const rawStart = args[0] ?? 0;\n const rawEnd = args[1] ?? source.length;\n const start = normalizeSliceIndex(rawStart, source.length);\n const end = normalizeSliceIndex(rawEnd, source.length);\n const result = [];\n for (let i = start; i < end; i++) {\n result.push(state.draft_[i]);\n }\n return result;\n }\n return source[method](...args);\n }\n loadPlugin(PluginArrayMethods, {\n createMethodInterceptor,\n isArrayOperationMethod,\n isMutatingArrayMethod\n });\n}\n\n// src/immer.ts\nvar immer = new Immer2();\nvar produce = immer.produce;\nvar produceWithPatches = /* @__PURE__ */ immer.produceWithPatches.bind(immer);\nvar setAutoFreeze = /* @__PURE__ */ immer.setAutoFreeze.bind(immer);\nvar setUseStrictShallowCopy = /* @__PURE__ */ immer.setUseStrictShallowCopy.bind(immer);\nvar setUseStrictIteration = /* @__PURE__ */ immer.setUseStrictIteration.bind(immer);\nvar applyPatches = /* @__PURE__ */ immer.applyPatches.bind(immer);\nvar createDraft = /* @__PURE__ */ immer.createDraft.bind(immer);\nvar finishDraft = /* @__PURE__ */ immer.finishDraft.bind(immer);\nvar castDraft = (value) => value;\nvar castImmutable = (value) => value;\nexport {\n Immer2 as Immer,\n applyPatches,\n castDraft,\n castImmutable,\n createDraft,\n current,\n enableArrayMethods,\n enableMapSet,\n enablePatches,\n finishDraft,\n freeze,\n DRAFTABLE as immerable,\n isDraft,\n isDraftable,\n NOTHING as nothing,\n original,\n produce,\n produceWithPatches,\n setAutoFreeze,\n setUseStrictIteration,\n setUseStrictShallowCopy\n};\n//# sourceMappingURL=immer.mjs.map","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(attr|calc|counters?|url)\\(/;\n var contentValues = ['normal', 'none', 'counter', 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n console.error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar shouldWarnAboutInterpolatingClassNameFromCss = true;\n\nfunction handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n\n if (process.env.NODE_ENV !== 'production' && couldBeSelectorInterpolation && shouldWarnAboutInterpolatingClassNameFromCss && cached !== undefined) {\n console.error('Interpolating a className from css`` is not recommended and will cause problems with composition.\\n' + 'Interpolating a className from css`` will be completely unsupported in a future major version of Emotion');\n shouldWarnAboutInterpolatingClassNameFromCss = false;\n }\n\n return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i], false);\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value, false);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*;/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings, false);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(attr|calc|counters?|url)\\(/;\n var contentValues = ['normal', 'none', 'counter', 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n console.error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar shouldWarnAboutInterpolatingClassNameFromCss = true;\n\nfunction handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n\n if (process.env.NODE_ENV !== 'production' && couldBeSelectorInterpolation && shouldWarnAboutInterpolatingClassNameFromCss && cached !== undefined) {\n console.error('Interpolating a className from css`` is not recommended and will cause problems with composition.\\n' + 'Interpolating a className from css`` will be completely unsupported in a future major version of Emotion');\n shouldWarnAboutInterpolatingClassNameFromCss = false;\n }\n\n return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i], false);\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value, false);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*;/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings, false);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","import {InstallationStatus, SurveyType} from 'api';\nimport {useTranslation} from 'hooks';\nimport React from 'react';\n\nimport {RadioGroup} from '@staffbase/design';\n\nimport {useScheduler} from '../State/context';\n\ntype ViewProps = {\n disabled: boolean;\n format: {id: string};\n onChange: (value: 'onetime' | 'recurring') => void;\n};\n\nexport const ScheduleFormatView = (props: ViewProps) => {\n const {disabled, format, onChange} = props;\n const {t} = useTranslation();\n\n return (\n {\n if (e.target.value !== 'onetime' && e.target.value !== 'recurring') {\n console.error('unimplemented survey type');\n return;\n }\n onChange(e.target.value);\n }}\n options={[\n {\n label: t('plugin.surveys.admin.planner.scheduler.one-time'),\n name: 'frequency',\n value: 'onetime',\n checked: format.id === 'onetime'\n },\n {\n label: t('plugin.surveys.admin.planner.scheduler.recurring'),\n name: 'frequency',\n value: 'recurring',\n checked: format.id === 'recurring'\n }\n ]}\n />\n );\n};\n\n// temporary map, we'll migrate to using solely strings when we can remove the old scheduler\nconst surveyTypeMap = {\n onetime: SurveyType.ONE_TIME,\n recurring: SurveyType.RECURRING,\n [SurveyType.ONE_TIME]: {id: 'onetime'},\n [SurveyType.RECURRING]: {id: 'recurring'}\n};\n\nconst ScheduleFormat = () => {\n const {dispatch, state} = useScheduler();\n\n const disabled = state.installation.status === InstallationStatus.PUBLISHED;\n const format = surveyTypeMap[state.surveyType];\n\n const handleChange = (type: 'onetime' | 'recurring') => {\n dispatch({type: 'updateSurveyType', value: surveyTypeMap[type]});\n };\n\n return ;\n};\n\nexport default ScheduleFormat;\n","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","/**\n * A generic store that is meant to hold immutable data.\n */\nimport {Dispatch, SetStateAction, useEffect, useState, useCallback} from 'react';\n\n/**\n * A generic store used for the React hook {@link useState}. This will be a global store for most use-cases.\n */\nexport class Store {\n private state: T;\n\n /**\n * Internal API, don't use it directly\n */\n public _setters: Set>>;\n\n /**\n * @param state - the initial state of the store\n */\n public constructor(state: T) {\n this.state = state;\n this._setters = new Set();\n }\n\n /**\n * Sets a new value for the store.\n * @param data - the data the store should be set to\n */\n public set(state: T): void {\n this.state = state;\n this.notify();\n }\n\n /**\n * Returns the current data contained in the.\n */\n public get(): T {\n return this.state;\n }\n\n /**\n * Notify listeners about a possible data change.\n */\n private notify() {\n const data = this.get();\n for (const setter of this._setters) {\n setter(data);\n }\n }\n}\n\nfunction isCallableStateAction(s: T | ((prevState: T) => T)): s is (prevState: T) => T {\n return typeof s === 'function';\n}\n\n/**\n * This React hook can be used share state between React components in different DOM trees.\n *\n * @param store - the store that should be used to get from and set the state to (this will be, in most cases, a global\n * store)\n * @returns a tuple of the current data and a function to update the store\n */\nexport function useStore(store: Store): [T, Dispatch>] {\n const [data, setData] = useState(store.get());\n\n useEffect(() => {\n return () => {\n // on cleanup, remove the setter\n store._setters.delete(setData);\n };\n }, []);\n\n const setter = useCallback((s: T | ((prevState: T) => T)) => {\n if (isCallableStateAction(s)) {\n store.set(s(store.get()));\n } else {\n store.set(s);\n }\n }, []);\n\n // keep track of the setData, for future data change notifications\n if (!store._setters.has(setData)) {\n store._setters.add(setData);\n }\n\n return [data, setter];\n}\n","import React, {Suspense as ReactSuspense, SuspenseProps} from 'react';\n\n// overload signatures\nexport function clientSideOnly(\n execute: (args: {window: Window; document: Document}) => T,\n serverFallback: () => T\n): T;\nexport function clientSideOnly(execute: (args: {window: Window; document: Document}) => void): void;\n\n/**\n * Execute specific code only on the client-side and not during server-side rendering. It is possible to provide\n * fallback for SSR.\n * @param execute - the function that should be executed on the client-side only\n * @param serverFallback - the fallback that is executed during SSR instead\n */\nexport function clientSideOnly(\n execute: (args: {window: Window; document: Document}) => T,\n serverFallback?: () => T\n): T | void {\n if (typeof window === 'object' && typeof document === 'object') {\n return execute({window, document});\n } else if (serverFallback) {\n return serverFallback();\n } else {\n return;\n }\n}\n\n/**\n * A wrapper of React's `Suspense` that works with SSR (by simply ignoring the `Suspense` and its descendent and showing\n * the fallback right-away).\n */\nexport function Suspense(props: SuspenseProps): unknown | null {\n if (typeof window !== 'object') {\n // do nothing during SSR\n return props.fallback;\n }\n\n return ;\n}\n\n/**\n * A helper to pick only known keys of T\n */\nexport type PickKnownKeys = {\n [K in keyof T as string extends K ? never : number extends K ? never : K]: T[K];\n};\n","import {ApiRequestBuilder} from '../api/AbstractApi';\nimport {Store} from '../hooks/useStore/useStore';\nimport {DefaultTheme} from '../hooks/useTheme/useTheme';\nimport {clientSideOnly} from '../utils';\nimport {ClientAdapter} from './ClientAdapter';\nimport {FeatureFlagsAdapter} from './FeatureFlagsAdapter';\nimport {GrowlAdapter} from './GrowlAdapter';\nimport {I18nAdapter} from './I18nAdapter';\nimport {MediaAdapter} from './MediaAdapter';\nimport {NavigationAdapter} from './NavigationAdapter';\nimport {RuntimeAdapter} from './runtime/RuntimeAdapter';\n\ninterface SharedAdapters {\n client?: Store;\n i18n?: Store;\n navigation?: Store;\n staffbaseApiRequestBuilder?: Store;\n theme?: Store;\n growl?: Store;\n featureFlags?: Store;\n runtime?: Store;\n media?: Store;\n}\n\ndeclare global {\n interface Window {\n adapters?: SharedAdapters;\n }\n}\n\nexport function createSharedInstance>(\n key: K,\n storeFactory: () => S\n): S {\n const compat: Record = {\n client: 'clientAdapterStore',\n i18n: 'i18nAdapterStore',\n navigation: 'navigationAdapterStore',\n staffbaseApiRequestBuilder: 'staffbaseApiRequestBuilderStore',\n theme: 'themeStore',\n growl: 'GrowlStore',\n featureFlags: 'featureFlagsStore'\n };\n\n return clientSideOnly(\n ({window}) => {\n if (!window.adapters) {\n window.adapters = {};\n }\n\n if (!window.adapters[key]) {\n const oldKey = compat[key];\n //@ts-ignore - window doesn't have deprecated adapter properties\n window.adapters[key] = window[oldKey] || storeFactory();\n }\n\n return window.adapters[key] as S;\n },\n // server fallback\n () => {\n return storeFactory();\n }\n );\n}\n\n// Adapters were previously added directly to `window`, but they are now consolidated under `window.adapters.*`. Until\n// all clients have been updated to the new version, we have to provide the following compatibility layer.\ndeclare global {\n interface Window {\n clientAdapterStore: Store;\n i18nAdapterStore: Store;\n navigationAdapterStore: Store;\n staffbaseApiRequestBuilderStore: Store;\n themeStore: Store;\n GrowlStore: Store;\n featureFlagsStore: Store;\n }\n}\n","import React, {useContext} from 'react';\n\nimport {useStore, Store} from '../hooks/useStore/useStore';\nimport {createSharedInstance} from './shared';\n\nexport type I18nArgument = string | number;\nexport const DEFAULT_LOCALE = 'en_US';\n\n/**\n * A minimal adapter to interoperate with different types of i18n services.\n */\nexport interface I18nAdapter {\n /** locale of the browser (string) */\n readonly locale: string;\n /** content locale of the logged in user (string) */\n readonly contentLocale: string;\n /** has the current slug activated the informal translations (boolean) */\n readonly useInformalTranslations: boolean;\n /** method to retrieve the translation for the given key (and insert the provided args into its placeholders) */\n get(key: string, ...args: I18nArgument[]): string;\n}\n\nconst fallbackAdapter = {\n locale: DEFAULT_LOCALE,\n contentLocale: DEFAULT_LOCALE,\n useInformalTranslations: false,\n get(key: string) {\n return key.split('.').pop() || key;\n }\n};\n\nconst store = createSharedInstance('i18n', () => new Store(fallbackAdapter));\n\n/**\n * A context providing the current i18n adapter.\n */\nconst I18nContext = React.createContext(fallbackAdapter);\n\n/**\n * Set the global {@link I18nAdapter}. This will update all components using it.\n * @param adapter - the new adapter\n */\nfunction setI18nAdapter(adapter: I18nAdapter): void {\n store.set(adapter);\n}\n\n/**\n * Retrieve the current {@link I18nAdapter}. This must not be used inside React components. Inside React components\n * use {@link useI18n} instead.\n */\nfunction getI18nAdapter(): I18nAdapter {\n return store.get();\n}\n\n/**\n * A React hook to retrieve the current {@link I18nAdapter}.\n */\nfunction useI18n(): I18nAdapter {\n const fromContext = useContext(I18nContext);\n const [i18n] = useStore(store);\n\n // prefer non-fallback i18n from context to allow overriding the global one\n return fromContext !== fallbackAdapter ? fromContext : i18n;\n}\n\n/**\n * A hook to retrieve a function that can be used to access locals.\n */\nfunction useTranslations(): (key: string, ...args: I18nArgument[]) => string {\n const i18n = useI18n();\n return i18n.get.bind(i18n);\n}\n\n/**\n * Provide the {@link I18nAdapter} via context to all descendants.\n */\nfunction I18nProvider({children}: {children?: React.ReactNode}): JSX.Element {\n const i18n = useI18n();\n return {children};\n}\n\n/**\n * Retrieve the {@link I18nAdapter} from the current context (should have {@link I18nProvider} as one its\n * ancestors).\n */\nconst I18nConsumer = I18nContext.Consumer;\n\nexport {I18nContext, I18nProvider, I18nConsumer, getI18nAdapter, setI18nAdapter, useI18n, useTranslations};\n","import {useStore, Store} from '../hooks/useStore/useStore';\nimport {createSharedInstance} from './shared';\n\nexport interface FeatureFlagsAdapter {\n has(featureFlag: string): boolean;\n}\n\nconst fallbackFeatureFlagsAdapter = {\n has() {\n console.warn('No FeatureFlags Adapter provided');\n return false;\n }\n};\n\nconst store = createSharedInstance('featureFlags', () => new Store(fallbackFeatureFlagsAdapter));\n\n/**\n * Provide implementation for Feature Flags Adapter\n */\nfunction setFeatureFlagsAdapter(adapter: FeatureFlagsAdapter): void {\n store.set(adapter);\n}\n\n/**\n * Use provided Feature Flags implementation or use fallback otherwise\n */\nfunction useFeatureFlags(): FeatureFlagsAdapter {\n const [featureFlags] = useStore(store);\n return featureFlags || fallbackFeatureFlagsAdapter;\n}\n\nexport {setFeatureFlagsAdapter, useFeatureFlags};\n","import {useContext} from 'react';\n\nimport {TemporaryContext} from './TemporaryContext';\n\nconst FALLBACK_LANGUAGE = {locale: 'en_US', localizedName: 'English', direction: 'ltr'};\n\nconst useLanguage = () => {\n const {locale} = useContext(TemporaryContext);\n if (typeof we === 'undefined') {\n return {\n branchLanguages: FALLBACK_LANGUAGE,\n branchDefaultLanguage: FALLBACK_LANGUAGE,\n getLanguage: () => FALLBACK_LANGUAGE,\n availableLanguages: [],\n /*\n * this is the only value we actually need to\n * accurately satisfy in the employee context\n */\n availableLanguageValues: [locale]\n };\n }\n\n const branchLanguages = we.i18n.getBranchLanguages?.();\n const branchDefaultLanguage = we.i18n.getBranchDefaultLanguage();\n const getLanguage = we.i18n.getLanguage;\n\n const availableLanguages = Object.keys(branchLanguages).map((key) => {\n const {locale: value, localizedName: label} = branchLanguages[key];\n return {value, label};\n });\n\n const availableLanguageValues = availableLanguages.map((lang) => lang.value);\n\n return {\n branchLanguages,\n branchDefaultLanguage,\n getLanguage,\n availableLanguages,\n availableLanguageValues\n };\n};\n\nexport default useLanguage;\n","export {default as useGrowlNotification} from './src/useGrowlNotification';\nexport {default as useI18nDevMode} from './src/useI18nDevMode';\nexport {default as useTranslation} from './src/useTranslation';\nexport {default as useLocalizedContent} from './src/useLocalizedContent';\nexport {default as useApiContext} from './src/useApiContext';\nexport {default as useContainerSize} from './src/useContainerSize';\nexport {default as FeatureFlag} from './src/FeatureFlag';\nimport {default as _useFeatureFlags} from './src/useFeatureFlags';\nimport {default as _useFeatureFlagsDev} from './src/useFeatureFlagsDev';\nimport _useIsClient from './src/useIsClient';\nimport _useIsClientDev from './src/useIsClientDev';\nimport _useIsRTL from './src/useIsRTL';\nimport _useIsRTLDev from './src/useIsRTLDev';\nimport _useLanguage from './src/useLanguage';\nimport _useLanguageDev from './src/useLanguageDev';\nimport _useWebURL from './src/useWebURL';\nimport _useWebURLDev from './src/useWebURLDev';\n// Overridden in webpack.common.js based on process.env.USE_DEV_STAFFBASE_API_HOOK\nexport {default as useStaffbaseApi} from './src/useStaffbaseApiDev';\n\nexport type {Survey} from './src/useStaffbaseApi';\n\nexport let useIsClient = _useIsClient;\nif (process.env.USE_DEV_IS_CLIENT_HOOK) {\n useIsClient = _useIsClientDev;\n}\n\nexport let useIsRTL = _useIsRTL;\nif (process.env.USE_DEV_IS_RTL_HOOK) {\n useIsRTL = _useIsRTLDev;\n}\n\nexport let useLanguage = _useLanguage;\nif (process.env.USE_DEV_LANGUAGE_HOOK) {\n useLanguage = _useLanguageDev;\n}\n\nexport let useFeatureFlags = _useFeatureFlags;\nif (process.env.USE_DEV_FEATURE_FLAGS) {\n useFeatureFlags = _useFeatureFlagsDev;\n}\n\nexport let useWebURL = _useWebURL;\nif (process.env.USE_DEV_WEB_URL) {\n useWebURL = _useWebURLDev;\n}\n","import {useContext} from 'react';\n\nimport {TemporaryContext} from './TemporaryContext';\n\nconst useIsClient = () => {\n const {isClient} = useContext(TemporaryContext);\n\n return {\n isClient\n };\n};\n\nexport default useIsClient;\n","import {useContext} from 'react';\n\nimport {TemporaryContext} from './TemporaryContext';\n\nexport const useIsRTL = () => {\n const {isClient, isRTL} = useContext(TemporaryContext);\n\n if (isClient) {\n return {isRTL, directionSign: isRTL ? -1 : 1};\n }\n\n return {isRTL: false, directionSign: 1};\n};\n\nexport default useIsRTL;\n","import {useI18n} from '@staffbase/ui';\n\nimport React, {createContext, PropsWithChildren} from 'react';\n\nimport {useLanguage} from '..';\n\ninterface TemporaryInterface {\n isClient: boolean;\n isRTL: boolean;\n locale: string;\n useInformalTranslations: boolean;\n}\n\nexport const TemporaryContext = createContext({} as TemporaryInterface);\n\ntype TemporaryWrapperInterface = {\n isClient: boolean;\n isRTL?: boolean;\n locale?: string;\n useInformalTranslations?: boolean;\n};\n\nexport const TemporaryWrapper = (props: PropsWithChildren) => {\n const {locale: fallbackLocale} = useI18n();\n const {getLanguage} = useLanguage();\n const {children, isClient, locale, isRTL, useInformalTranslations = false} = props;\n\n if (!isClient) {\n return (\n // we don't use the locale in the admin context, so an empty string is fine here\n \n {children}\n \n );\n }\n\n if (isRTL !== undefined) {\n return (\n \n {children}\n \n );\n }\n\n return (\n \n {children}\n \n );\n};\n","import {createContext, useContext} from 'react';\n\ninterface ApiContextInterface {\n baseURL: string;\n apiConfig?: {\n baseURL?: string;\n branchSlug?: string;\n distributionType?: string;\n isNative?: boolean;\n platform?: string;\n version?: string;\n };\n}\n\nexport const ApiContext = createContext({} as ApiContextInterface);\n\nconst useApiContext = () => {\n const context = useContext(ApiContext);\n if (!context) {\n throw new Error('useApiContext must be used within an ApiContextProvider');\n }\n\n return context;\n};\n\nexport default useApiContext;\n","var has = Object.prototype.hasOwnProperty;\n\nexport function dequal(foo, bar) {\n\tvar ctor, len;\n\tif (foo === bar) return true;\n\n\tif (foo && bar && (ctor=foo.constructor) === bar.constructor) {\n\t\tif (ctor === Date) return foo.getTime() === bar.getTime();\n\t\tif (ctor === RegExp) return foo.toString() === bar.toString();\n\n\t\tif (ctor === Array) {\n\t\t\tif ((len=foo.length) === bar.length) {\n\t\t\t\twhile (len-- && dequal(foo[len], bar[len]));\n\t\t\t}\n\t\t\treturn len === -1;\n\t\t}\n\n\t\tif (!ctor || typeof foo === 'object') {\n\t\t\tlen = 0;\n\t\t\tfor (ctor in foo) {\n\t\t\t\tif (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;\n\t\t\t\tif (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;\n\t\t\t}\n\t\t\treturn Object.keys(bar).length === len;\n\t\t}\n\t}\n\n\treturn foo !== foo && bar !== bar;\n}\n","'use client';\nimport React, { useEffect, useLayoutEffect, createContext, useContext, useMemo, useRef, createElement } from 'react';\nimport { dequal } from 'dequal/lite';\n\nconst FOCUS_EVENT = 0;\nconst RECONNECT_EVENT = 1;\nconst MUTATE_EVENT = 2;\nconst ERROR_REVALIDATE_EVENT = 3;\nconst UNLOAD_EVENT = 4;\n\nvar events = {\n __proto__: null,\n ERROR_REVALIDATE_EVENT: ERROR_REVALIDATE_EVENT,\n FOCUS_EVENT: FOCUS_EVENT,\n MUTATE_EVENT: MUTATE_EVENT,\n RECONNECT_EVENT: RECONNECT_EVENT,\n UNLOAD_EVENT: UNLOAD_EVENT\n};\n\n// Global state used to deduplicate requests and store listeners\nconst SWRGlobalState = new WeakMap();\n\n// Shared state between server components and client components\nconst noop = ()=>{};\n// Using noop() as the undefined value as undefined can be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nconst UNDEFINED = /*#__NOINLINE__*/ noop();\nconst OBJECT = Object;\nconst isUndefined = (v)=>v === UNDEFINED;\nconst isFunction = (v)=>typeof v == 'function';\nconst mergeObjects = (a, b)=>({\n ...a,\n ...b\n });\nconst isPromiseLike = (x)=>isFunction(x.then);\n\nconst EMPTY_CACHE = {};\nconst INITIAL_CACHE = {};\nconst STR_UNDEFINED = 'undefined';\n// NOTE: Use the function to guarantee it's re-evaluated between jsdom and node runtime for tests.\nconst isWindowDefined = typeof window != STR_UNDEFINED;\nconst isDocumentDefined = typeof document != STR_UNDEFINED;\nconst isLegacyDeno = isWindowDefined && 'Deno' in window;\nconst hasRequestAnimationFrame = ()=>isWindowDefined && typeof window['requestAnimationFrame'] != STR_UNDEFINED;\nconst createCacheHelper = (cache, key)=>{\n const state = SWRGlobalState.get(cache);\n return [\n // Getter\n ()=>!isUndefined(key) && cache.get(key) || EMPTY_CACHE,\n // Setter\n (info)=>{\n if (!isUndefined(key)) {\n const prev = cache.get(key);\n // Before writing to the store, we keep the value in the initial cache\n // if it's not there yet.\n if (!(key in INITIAL_CACHE)) {\n INITIAL_CACHE[key] = prev;\n }\n state[5](key, mergeObjects(prev, info), prev || EMPTY_CACHE);\n }\n },\n // Subscriber\n state[6],\n // Get server cache snapshot\n ()=>{\n if (!isUndefined(key)) {\n // If the cache was updated on the client, we return the stored initial value.\n if (key in INITIAL_CACHE) return INITIAL_CACHE[key];\n }\n // If we haven't done any client-side updates, we return the current value.\n return !isUndefined(key) && cache.get(key) || EMPTY_CACHE;\n }\n ];\n} // export { UNDEFINED, OBJECT, isUndefined, isFunction, mergeObjects, isPromiseLike }\n;\n\n/**\n * Due to the bug https://bugs.chromium.org/p/chromium/issues/detail?id=678075,\n * it's not reliable to detect if the browser is currently online or offline\n * based on `navigator.onLine`.\n * As a workaround, we always assume it's online on the first load, and change\n * the status upon `online` or `offline` events.\n */ let online = true;\nconst isOnline = ()=>online;\n// For node and React Native, `add/removeEventListener` doesn't exist on window.\nconst [onWindowEvent, offWindowEvent] = isWindowDefined && window.addEventListener ? [\n window.addEventListener.bind(window),\n window.removeEventListener.bind(window)\n] : [\n noop,\n noop\n];\nconst isVisible = ()=>{\n const visibilityState = isDocumentDefined && document.visibilityState;\n return isUndefined(visibilityState) || visibilityState !== 'hidden';\n};\nconst initFocus = (callback)=>{\n // focus revalidate\n if (isDocumentDefined) {\n document.addEventListener('visibilitychange', callback);\n }\n onWindowEvent('focus', callback);\n return ()=>{\n if (isDocumentDefined) {\n document.removeEventListener('visibilitychange', callback);\n }\n offWindowEvent('focus', callback);\n };\n};\nconst initReconnect = (callback)=>{\n // revalidate on reconnected\n const onOnline = ()=>{\n online = true;\n callback();\n };\n // nothing to revalidate, just update the status\n const onOffline = ()=>{\n online = false;\n };\n onWindowEvent('online', onOnline);\n onWindowEvent('offline', onOffline);\n return ()=>{\n offWindowEvent('online', onOnline);\n offWindowEvent('offline', onOffline);\n };\n};\nconst preset = {\n isOnline,\n isVisible\n};\nconst defaultConfigOptions = {\n initFocus,\n initReconnect\n};\n\nconst IS_REACT_LEGACY = !React.useId;\nconst IS_SERVER = !isWindowDefined || isLegacyDeno;\n// Polyfill requestAnimationFrame\nconst rAF = (f)=>hasRequestAnimationFrame() ? window['requestAnimationFrame'](f) : setTimeout(f, 1);\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nconst useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;\n// This assignment is to extend the Navigator type to use effectiveType.\nconst navigatorConnection = typeof navigator !== 'undefined' && navigator.connection;\n// Adjust the config based on slow connection status (<= 70Kbps).\nconst slowConnection = !IS_SERVER && navigatorConnection && ([\n 'slow-2g',\n '2g'\n].includes(navigatorConnection.effectiveType) || navigatorConnection.saveData);\n\n// use WeakMap to store the object->key mapping\n// so the objects can be garbage collected.\n// WeakMap uses a hashtable under the hood, so the lookup\n// complexity is almost O(1).\nconst table = new WeakMap();\nconst getTypeName = (value)=>OBJECT.prototype.toString.call(value);\nconst isObjectTypeName = (typeName, type)=>typeName === `[object ${type}]`;\n// counter of the key\nlet counter = 0;\n// A stable hash implementation that supports:\n// - Fast and ensures unique hash properties\n// - Handles unserializable values\n// - Handles object key ordering\n// - Generates short results\n//\n// This is not a serialization function, and the result is not guaranteed to be\n// parsable.\nconst stableHash = (arg)=>{\n const type = typeof arg;\n const typeName = getTypeName(arg);\n const isDate = isObjectTypeName(typeName, 'Date');\n const isRegex = isObjectTypeName(typeName, 'RegExp');\n const isPlainObject = isObjectTypeName(typeName, 'Object');\n let result;\n let index;\n if (OBJECT(arg) === arg && !isDate && !isRegex) {\n // Object/function, not null/date/regexp. Use WeakMap to store the id first.\n // If it's already hashed, directly return the result.\n result = table.get(arg);\n if (result) return result;\n // Store the hash first for circular reference detection before entering the\n // recursive `stableHash` calls.\n // For other objects like set and map, we use this id directly as the hash.\n result = ++counter + '~';\n table.set(arg, result);\n if (Array.isArray(arg)) {\n // Array.\n result = '@';\n for(index = 0; index < arg.length; index++){\n result += stableHash(arg[index]) + ',';\n }\n table.set(arg, result);\n }\n if (isPlainObject) {\n // Object, sort keys.\n result = '#';\n const keys = OBJECT.keys(arg).sort();\n while(!isUndefined(index = keys.pop())){\n if (!isUndefined(arg[index])) {\n result += index + ':' + stableHash(arg[index]) + ',';\n }\n }\n table.set(arg, result);\n }\n } else {\n result = isDate ? arg.toJSON() : type == 'symbol' ? arg.toString() : type == 'string' ? JSON.stringify(arg) : '' + arg;\n }\n return result;\n};\n\nconst serialize = (key)=>{\n if (isFunction(key)) {\n try {\n key = key();\n } catch (err) {\n // dependencies not ready\n key = '';\n }\n }\n // Use the original key as the argument of fetcher. This can be a string or an\n // array of values.\n const args = key;\n // If key is not falsy, or not an empty array, hash it.\n key = typeof key == 'string' ? key : (Array.isArray(key) ? key.length : key) ? stableHash(key) : '';\n return [\n key,\n args\n ];\n};\n\n// Global timestamp.\nlet __timestamp = 0;\nconst getTimestamp = ()=>++__timestamp;\n\nasync function internalMutate(...args) {\n const [cache, _key, _data, _opts] = args;\n // When passing as a boolean, it's explicitly used to disable/enable\n // revalidation.\n const options = mergeObjects({\n populateCache: true,\n throwOnError: true\n }, typeof _opts === 'boolean' ? {\n revalidate: _opts\n } : _opts || {});\n let populateCache = options.populateCache;\n const rollbackOnErrorOption = options.rollbackOnError;\n let optimisticData = options.optimisticData;\n const rollbackOnError = (error)=>{\n return typeof rollbackOnErrorOption === 'function' ? rollbackOnErrorOption(error) : rollbackOnErrorOption !== false;\n };\n const throwOnError = options.throwOnError;\n // If the second argument is a key filter, return the mutation results for all\n // filtered keys.\n if (isFunction(_key)) {\n const keyFilter = _key;\n const matchedKeys = [];\n const it = cache.keys();\n for (const key of it){\n if (// Skip the special useSWRInfinite and useSWRSubscription keys.\n !/^\\$(inf|sub)\\$/.test(key) && keyFilter(cache.get(key)._k)) {\n matchedKeys.push(key);\n }\n }\n return Promise.all(matchedKeys.map(mutateByKey));\n }\n return mutateByKey(_key);\n async function mutateByKey(_k) {\n // Serialize key\n const [key] = serialize(_k);\n if (!key) return;\n const [get, set] = createCacheHelper(cache, key);\n const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache);\n const startRevalidate = ()=>{\n const revalidators = EVENT_REVALIDATORS[key];\n const revalidate = isFunction(options.revalidate) ? options.revalidate(get().data, _k) : options.revalidate !== false;\n if (revalidate) {\n // Invalidate the key by deleting the concurrent request markers so new\n // requests will not be deduped.\n delete FETCH[key];\n delete PRELOAD[key];\n if (revalidators && revalidators[0]) {\n return revalidators[0](MUTATE_EVENT).then(()=>get().data);\n }\n }\n return get().data;\n };\n // If there is no new data provided, revalidate the key with current state.\n if (args.length < 3) {\n // Revalidate and broadcast state.\n return startRevalidate();\n }\n let data = _data;\n let error;\n let isError = false;\n // Update global timestamps.\n const beforeMutationTs = getTimestamp();\n MUTATION[key] = [\n beforeMutationTs,\n 0\n ];\n const hasOptimisticData = !isUndefined(optimisticData);\n const state = get();\n // `displayedData` is the current value on screen. It could be the optimistic value\n // that is going to be overridden by a `committedData`, or get reverted back.\n // `committedData` is the validated value that comes from a fetch or mutation.\n const displayedData = state.data;\n const currentData = state._c;\n const committedData = isUndefined(currentData) ? displayedData : currentData;\n // Do optimistic data update.\n if (hasOptimisticData) {\n optimisticData = isFunction(optimisticData) ? optimisticData(committedData, displayedData) : optimisticData;\n // When we set optimistic data, backup the current committedData data in `_c`.\n set({\n data: optimisticData,\n _c: committedData\n });\n }\n if (isFunction(data)) {\n // `data` is a function, call it passing current cache value.\n try {\n data = data(committedData);\n } catch (err) {\n // If it throws an error synchronously, we shouldn't update the cache.\n error = err;\n isError = true;\n }\n }\n // `data` is a promise/thenable, resolve the final data first.\n if (data && isPromiseLike(data)) {\n // This means that the mutation is async, we need to check timestamps to\n // avoid race conditions.\n data = await data.catch((err)=>{\n error = err;\n isError = true;\n });\n // Check if other mutations have occurred since we've started this mutation.\n // If there's a race we don't update cache or broadcast the change,\n // just return the data.\n if (beforeMutationTs !== MUTATION[key][0]) {\n if (isError) throw error;\n return data;\n } else if (isError && hasOptimisticData && rollbackOnError(error)) {\n // Rollback. Always populate the cache in this case but without\n // transforming the data.\n populateCache = true;\n // Reset data to be the latest committed data, and clear the `_c` value.\n set({\n data: committedData,\n _c: UNDEFINED\n });\n }\n }\n // If we should write back the cache after request.\n if (populateCache) {\n if (!isError) {\n // Transform the result into data.\n if (isFunction(populateCache)) {\n const populateCachedData = populateCache(data, committedData);\n set({\n data: populateCachedData,\n error: UNDEFINED,\n _c: UNDEFINED\n });\n } else {\n // Only update cached data and reset the error if there's no error. Data can be `undefined` here.\n set({\n data,\n error: UNDEFINED,\n _c: UNDEFINED\n });\n }\n }\n }\n // Reset the timestamp to mark the mutation has ended.\n MUTATION[key][1] = getTimestamp();\n // Update existing SWR Hooks' internal states:\n Promise.resolve(startRevalidate()).then(()=>{\n // The mutation and revalidation are ended, we can clear it since the data is\n // not an optimistic value anymore.\n set({\n _c: UNDEFINED\n });\n });\n // Throw error or return data\n if (isError) {\n if (throwOnError) throw error;\n return;\n }\n return data;\n }\n}\n\nconst revalidateAllKeys = (revalidators, type)=>{\n for(const key in revalidators){\n if (revalidators[key][0]) revalidators[key][0](type);\n }\n};\nconst initCache = (provider, options)=>{\n // The global state for a specific provider will be used to deduplicate\n // requests and store listeners. As well as a mutate function that is bound to\n // the cache.\n // The provider's global state might be already initialized. Let's try to get the\n // global state associated with the provider first.\n if (!SWRGlobalState.has(provider)) {\n const opts = mergeObjects(defaultConfigOptions, options);\n // If there's no global state bound to the provider, create a new one with the\n // new mutate function.\n const EVENT_REVALIDATORS = Object.create(null);\n const mutate = internalMutate.bind(UNDEFINED, provider);\n let unmount = noop;\n const subscriptions = Object.create(null);\n const subscribe = (key, callback)=>{\n const subs = subscriptions[key] || [];\n subscriptions[key] = subs;\n subs.push(callback);\n return ()=>{\n const index = subs.indexOf(callback);\n if (index >= 0) {\n // O(1): swap with the last element and pop\n subs[index] = subs[subs.length - 1];\n subs.pop();\n }\n };\n };\n const setter = (key, value, prev)=>{\n provider.set(key, value);\n const subs = subscriptions[key];\n if (subs) {\n for (const fn of subs){\n fn(value, prev);\n }\n }\n };\n const unload = (unloadOptions)=>{\n const state = SWRGlobalState.get(provider);\n const [, MUTATION, FETCH, PRELOAD] = state;\n const ts = getTimestamp();\n // Bump the unload generation so in-flight writes that bypass the\n // request markers (e.g. `useSWRInfinite` page responses) know to\n // discard themselves when they resolve.\n state[8]++;\n // Invalidate all in-flight requests and mutations first, so nothing\n // that resolves after this point can write back to the cache: fetches\n // fail the concurrent request marker check, and mutations fail the\n // timestamp race check. Mutation timestamps are overwritten instead of\n // deleted because ongoing mutations read them on resolution.\n for(const key in FETCH)delete FETCH[key];\n for(const key in PRELOAD)delete PRELOAD[key];\n for(const key in MUTATION)MUTATION[key] = [\n ts,\n ts\n ];\n // Delete all entries — including the special `useSWRInfinite` and\n // `useSWRSubscription` keys — and notify the subscribers of each key\n // so mounted hooks re-render with the empty cache. Subscribers receive\n // the same empty state object that cache reads resolve to for missing\n // entries.\n const emptyState = {};\n for (const key of [\n ...provider.keys()\n ]){\n const prev = provider.get(key);\n provider.delete(key);\n const subs = subscriptions[key];\n if (subs) {\n for (const fn of subs){\n fn(emptyState, prev);\n }\n }\n }\n // The unload event runs last so the fresh requests it may start are\n // not invalidated by the cleanup above. It always fires — even without\n // revalidation — and to every hook on the key, so each one can drop\n // the previous data kept by `keepPreviousData`. Only the first hook\n // revalidates, consistent with how mutations revalidate a key.\n const revalidate = !unloadOptions || unloadOptions.revalidate !== false;\n for(const key in EVENT_REVALIDATORS){\n const revalidators = EVENT_REVALIDATORS[key];\n for(let i = 0; i < revalidators.length; i++){\n revalidators[i](UNLOAD_EVENT, {\n revalidate: revalidate && !i\n });\n }\n }\n };\n const initProvider = ()=>{\n if (!SWRGlobalState.has(provider)) {\n // Update the state if it's new, or if the provider has been extended.\n SWRGlobalState.set(provider, [\n EVENT_REVALIDATORS,\n Object.create(null),\n Object.create(null),\n Object.create(null),\n mutate,\n setter,\n subscribe,\n unload,\n 0\n ]);\n if (!IS_SERVER) {\n // When listening to the native events for auto revalidations,\n // we intentionally put a delay (setTimeout) here to make sure they are\n // fired after immediate JavaScript executions, which can be\n // React's state updates.\n // This avoids some unnecessary revalidations such as\n // https://github.com/vercel/swr/issues/1680.\n const releaseFocus = opts.initFocus(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, FOCUS_EVENT)));\n const releaseReconnect = opts.initReconnect(setTimeout.bind(UNDEFINED, revalidateAllKeys.bind(UNDEFINED, EVENT_REVALIDATORS, RECONNECT_EVENT)));\n unmount = ()=>{\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n releaseFocus && releaseFocus();\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n releaseReconnect && releaseReconnect();\n // When un-mounting, we need to remove the cache provider from the state\n // storage too because it's a side-effect. Otherwise, when re-mounting we\n // will not re-register those event listeners.\n SWRGlobalState.delete(provider);\n };\n }\n }\n };\n initProvider();\n // This is a new provider, we need to initialize it and setup DOM events\n // listeners for `focus` and `reconnect` actions.\n // We might want to inject an extra layer on top of `provider` in the future,\n // such as key serialization, auto GC, etc.\n // For now, it's just a `Map` interface without any modifications.\n return [\n provider,\n mutate,\n initProvider,\n unmount,\n unload\n ];\n }\n const state = SWRGlobalState.get(provider);\n return [\n provider,\n state[4],\n UNDEFINED,\n UNDEFINED,\n state[7]\n ];\n};\n\n// error retry\nconst onErrorRetry = (_, __, config, revalidate, opts)=>{\n const maxRetryCount = config.errorRetryCount;\n const currentRetryCount = opts.retryCount;\n // Exponential backoff\n const timeout = ~~((Math.random() + 0.5) * (1 << (currentRetryCount < 8 ? currentRetryCount : 8))) * config.errorRetryInterval;\n if (!isUndefined(maxRetryCount) && currentRetryCount > maxRetryCount) {\n return;\n }\n setTimeout(revalidate, timeout, opts);\n};\nconst compare = dequal;\n// Default cache provider\nconst [cache, mutate, , , unload] = initCache(new Map());\n// Default config\nconst defaultConfig = mergeObjects({\n // events\n onLoadingSlow: noop,\n onSuccess: noop,\n onError: noop,\n onErrorRetry,\n onDiscarded: noop,\n // switches\n revalidateOnFocus: true,\n revalidateOnReconnect: true,\n revalidateIfStale: true,\n shouldRetryOnError: true,\n // timeouts\n errorRetryInterval: slowConnection ? 10000 : 5000,\n focusThrottleInterval: 5 * 1000,\n dedupingInterval: 2 * 1000,\n loadingTimeout: slowConnection ? 5000 : 3000,\n // providers\n compare,\n isPaused: ()=>false,\n cache,\n mutate,\n unload,\n fallback: {}\n}, // use web preset by default\npreset);\n\nconst mergeConfigs = (a, b)=>{\n // Need to create a new object to avoid mutating the original here.\n const v = mergeObjects(a, b);\n // If two configs are provided, merge their `use`, `fallback`, and\n // `cacheData` options.\n if (b) {\n const { use: u1, fallback: f1, cacheData: c1 } = a;\n const { use: u2, fallback: f2, cacheData: c2 } = b;\n if (u1 && u2) {\n v.use = u1.concat(u2);\n }\n if (f1 && f2) {\n v.fallback = mergeObjects(f1, f2);\n }\n if (c1 && c2) {\n v.cacheData = mergeObjects(c1, c2);\n }\n }\n return v;\n};\n\nconst SWRConfigContext = createContext({});\nconst SWRConfig = (props)=>{\n const { value } = props;\n const parentConfig = useContext(SWRConfigContext);\n const isFunctionalConfig = isFunction(value);\n const config = useMemo(()=>isFunctionalConfig ? value(parentConfig) : value, [\n isFunctionalConfig,\n parentConfig,\n value\n ]);\n // Extend parent context values and middleware.\n const extendedConfig = useMemo(()=>isFunctionalConfig ? config : mergeConfigs(parentConfig, config), [\n isFunctionalConfig,\n parentConfig,\n config\n ]);\n // Should not use the inherited provider.\n const provider = config && config.provider;\n // initialize the cache only on first access.\n const cacheContextRef = useRef(UNDEFINED);\n if (provider && !cacheContextRef.current) {\n cacheContextRef.current = initCache(provider(extendedConfig.cache || cache), config);\n }\n const cacheContext = cacheContextRef.current;\n // Override the cache if a new provider is given.\n if (cacheContext) {\n extendedConfig.cache = cacheContext[0];\n extendedConfig.mutate = cacheContext[1];\n extendedConfig.unload = cacheContext[4];\n }\n // Unsubscribe events.\n useIsomorphicLayoutEffect(()=>{\n if (cacheContext) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n cacheContext[2] && cacheContext[2]();\n return cacheContext[3];\n }\n }, []);\n return createElement(SWRConfigContext.Provider, mergeObjects(props, {\n value: extendedConfig\n }));\n};\n\nexport { isLegacyDeno as A, preset as B, events as C, slowConnection as D, ERROR_REVALIDATE_EVENT as E, FOCUS_EVENT as F, stableHash as G, IS_SERVER as I, MUTATE_EVENT as M, OBJECT as O, RECONNECT_EVENT as R, SWRConfig as S, UNDEFINED as U, SWRGlobalState as a, isPromiseLike as b, createCacheHelper as c, defaultConfig as d, isFunction as e, internalMutate as f, getTimestamp as g, UNLOAD_EVENT as h, isUndefined as i, IS_REACT_LEGACY as j, mutate as k, unload as l, mergeObjects as m, noop as n, cache as o, isWindowDefined as p, SWRConfigContext as q, rAF as r, serialize as s, mergeConfigs as t, useIsomorphicLayoutEffect as u, compare as v, defaultConfigOptions as w, hasRequestAnimationFrame as x, initCache as y, isDocumentDefined as z };\n","import React, { useRef, useMemo, useCallback, useDebugValue } from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { withArgs, subscribeCallback } from './_internal/index.mjs';\nimport { U as UNDEFINED, O as OBJECT, S as SWRConfig$1, d as defaultConfig, a as SWRGlobalState, s as serialize, c as createCacheHelper, i as isUndefined, b as isPromiseLike, I as IS_SERVER, n as noop, g as getTimestamp, e as isFunction, E as ERROR_REVALIDATE_EVENT, f as internalMutate, u as useIsomorphicLayoutEffect, r as rAF, F as FOCUS_EVENT, R as RECONNECT_EVENT, M as MUTATE_EVENT, h as UNLOAD_EVENT, j as IS_REACT_LEGACY, m as mergeObjects } from './config-context-ext53wcz.mjs';\n\n/// \nconst use = React.use || // This extra generic is to avoid TypeScript mixing up the generic and JSX sytax\n// and emitting an error.\n// We assume that this is only for the `use(thenable)` case, not `use(context)`.\n// https://github.com/facebook/react/blob/aed00dacfb79d17c53218404c52b1c7aa59c4a89/packages/react-server/src/ReactFizzThenable.js#L45\n((thenable)=>{\n switch(thenable.status){\n case 'pending':\n throw thenable;\n case 'fulfilled':\n return thenable.value;\n case 'rejected':\n throw thenable.reason;\n default:\n thenable.status = 'pending';\n thenable.then((v)=>{\n thenable.status = 'fulfilled';\n thenable.value = v;\n }, (e)=>{\n thenable.status = 'rejected';\n thenable.reason = e;\n });\n throw thenable;\n }\n});\nconst WITH_DEDUPE = {\n dedupe: true\n};\nconst isCacheDataConsumed = (consumedCacheData, cacheData, key)=>{\n var _consumedCacheData_get;\n return cacheData ? ((_consumedCacheData_get = consumedCacheData.get(cacheData)) == null ? void 0 : _consumedCacheData_get.has(key)) === true : false;\n};\nconst markCacheDataConsumed = (consumedCacheData, cacheData, key)=>{\n if (!cacheData) return;\n let consumedKeys = consumedCacheData.get(cacheData);\n if (!consumedKeys) {\n consumedKeys = new Set();\n consumedCacheData.set(cacheData, consumedKeys);\n }\n consumedKeys.add(key);\n};\nconst commitCacheData = ({ value, getCacheData, canCommit, setCache })=>{\n const commit = (state)=>{\n if (canCommit() && isUndefined(getCacheData())) {\n setCache(state);\n }\n };\n Promise.resolve(value).then((data)=>{\n commit({\n data,\n error: UNDEFINED\n });\n }, (error)=>{\n commit({\n error\n });\n });\n};\n// React can only unwrap a thenable synchronously when it has React's thenable\n// status fields, so this fulfilled no-op keeps Suspense paths from waiting.\nconst resolvedUndef = Promise.resolve(UNDEFINED);\n// @ts-ignore modify react promise status\nresolvedUndef.status = 'fulfilled';\n// @ts-ignore modify react promise value\nresolvedUndef.value = UNDEFINED;\nconst sub = ()=>noop;\n/**\n * The core implementation of the useSWR hook.\n *\n * This is the main handler function that implements all SWR functionality including\n * data fetching, caching, revalidation, error handling, and state management.\n * It manages the complete lifecycle of SWR requests from initialization through\n * cleanup.\n *\n * Key responsibilities:\n * - Key serialization and normalization\n * - Cache state management and synchronization\n * - Automatic and manual revalidation\n * - Error handling and retry logic\n * - Suspense integration\n * - Loading state management\n * - Effect cleanup and memory management\n *\n * @template Data - The type of data returned by the fetcher\n * @template Error - The type of error that can be thrown\n *\n * @param _key - The SWR key (string, array, object, function, or falsy)\n * @param fetcher - The fetcher function to retrieve data, or null to disable fetching\n * @param config - Complete SWR configuration object with both public and internal options\n *\n * @returns SWRResponse object containing data, error, mutate function, and loading states\n *\n * @internal This is the internal implementation. Use `useSWR` instead.\n */ const useSWRHandler = (_key, fetcher, config)=>{\n const { cache, compare, suspense, fallbackData, revalidateOnMount, revalidateIfStale, refreshInterval, refreshWhenHidden, refreshWhenOffline, keepPreviousData, strictServerPrefetchWarning } = config;\n const [EVENT_REVALIDATORS, MUTATION, FETCH, PRELOAD] = SWRGlobalState.get(cache);\n // `key` is the identifier of the SWR internal state,\n // `fnArg` is the argument/arguments parsed from the key, which will be passed\n // to the fetcher.\n // All of them are derived from `_key`.\n const [key, fnArg] = serialize(_key);\n // If it's the initial render of this hook.\n const initialMountedRef = useRef(false);\n // If the hook is unmounted already. This will be used to prevent some effects\n // to be called after unmounting.\n const unmountedRef = useRef(false);\n // Refs to keep the key and config.\n const keyRef = useRef(key);\n const fetcherRef = useRef(fetcher);\n const configRef = useRef(config);\n const getConfig = ()=>configRef.current;\n const isActive = ()=>getConfig().isVisible() && getConfig().isOnline();\n const [getCache, setCache, subscribeCache, getInitialCache] = createCacheHelper(cache, key);\n const stateDependencies = useRef({}).current;\n // Resolve the fallback data from either the inline option, or the global provider.\n // If it's a promise, we simply let React suspend and resolve it for us.\n const fallback = isUndefined(fallbackData) ? isUndefined(config.fallback) ? UNDEFINED : config.fallback[key] : fallbackData;\n const serverCacheData = config.cacheData;\n const configCacheData = !key ? UNDEFINED : serverCacheData == null ? void 0 : serverCacheData[key];\n const req = key ? PRELOAD[key] : UNDEFINED;\n // `cacheData` is request-scoped data provided by a Server Component through\n // `SWRConfig`'s context. It's only used when there's no in-flight client\n // `preload()` response (`req`) for the same key.\n const hasCacheData = isUndefined(req) && !isUndefined(configCacheData);\n const preloadedData = hasCacheData ? configCacheData : req;\n const isEqual = (prev, current)=>{\n for(const _ in stateDependencies){\n const t = _;\n if (t === 'data') {\n if (!compare(prev[t], current[t])) {\n if (!isUndefined(prev[t])) {\n return false;\n }\n if (!compare(returnedData, current[t])) {\n return false;\n }\n }\n } else {\n if (current[t] !== prev[t]) {\n return false;\n }\n }\n }\n return true;\n };\n const isInitialMount = !initialMountedRef.current;\n const getSnapshot = useMemo(()=>{\n const cachedData = getCache();\n const initialData = getInitialCache();\n const getSelectedCache = (state)=>{\n // We only select the needed fields from the state.\n const snapshot = mergeObjects(state);\n delete snapshot._k;\n const shouldStartRequest = (()=>{\n if (!key) return false;\n if (!fetcher) return false;\n // If it's paused, we skip revalidation.\n if (getConfig().isPaused()) return false;\n // If `revalidateOnMount` is set, we take the value directly.\n if (isInitialMount && !isUndefined(revalidateOnMount)) return revalidateOnMount;\n const data = !isUndefined(fallback) ? fallback : snapshot.data;\n // cacheData is consumed during the initial Suspense render. Once data\n // is cached, fall through to the normal mount revalidation policy.\n if (suspense && hasCacheData && isUndefined(data)) return false;\n if (suspense) return isUndefined(data) || revalidateIfStale;\n return isUndefined(data) || revalidateIfStale;\n })();\n if (!shouldStartRequest) {\n return snapshot;\n }\n return {\n isValidating: true,\n isLoading: true,\n ...snapshot\n };\n };\n const clientSnapshot = getSelectedCache(cachedData);\n const serverSnapshot = cachedData === initialData ? clientSnapshot : getSelectedCache(initialData);\n // To make sure that we are returning the same object reference to avoid\n // unnecessary re-renders, we keep the previous snapshot and use deep\n // comparison to check if we need to return a new one.\n let memorizedSnapshot = clientSnapshot;\n return [\n ()=>{\n const newSnapshot = getSelectedCache(getCache());\n const compareResult = isEqual(newSnapshot, memorizedSnapshot);\n if (compareResult) {\n // Mentally, we should always return the `memorizedSnapshot` here\n // as there's no change between the new and old snapshots.\n // However, since the `isEqual` function only compares selected fields,\n // the values of the unselected fields might be changed. That's\n // simply because we didn't track them.\n // To support the case in https://github.com/vercel/swr/pull/2576,\n // we need to update these fields in the `memorizedSnapshot` too\n // with direct mutations to ensure the snapshot is always up-to-date\n // even for the unselected fields, but only trigger re-renders when\n // the selected fields are changed.\n memorizedSnapshot.data = newSnapshot.data;\n memorizedSnapshot.isLoading = newSnapshot.isLoading;\n memorizedSnapshot.isValidating = newSnapshot.isValidating;\n memorizedSnapshot.error = newSnapshot.error;\n return memorizedSnapshot;\n } else {\n memorizedSnapshot = newSnapshot;\n return newSnapshot;\n }\n },\n ()=>serverSnapshot\n ];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n cache,\n key\n ]);\n // Get the current state that SWR should return.\n const cached = useSyncExternalStore(useCallback((callback)=>subscribeCache(key, (current, prev)=>{\n if (!isEqual(prev, current)) callback();\n }), // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n cache,\n key\n ]), getSnapshot[0], getSnapshot[1]);\n const hasRevalidator = EVENT_REVALIDATORS[key] && EVENT_REVALIDATORS[key].length > 0;\n const cachedData = cached.data;\n let data = isUndefined(cachedData) ? fallback && isPromiseLike(fallback) ? use(fallback) : fallback : cachedData;\n const error = cached.error;\n // Use a ref to store previously returned data. Use the initial data as its initial value.\n const laggyDataRef = useRef(data);\n const consumedCacheDataRef = useRef(UNDEFINED);\n let consumedCacheData = consumedCacheDataRef.current;\n if (!consumedCacheData) {\n consumedCacheData = new WeakMap();\n consumedCacheDataRef.current = consumedCacheData;\n }\n const preloadCacheRef = useRef(null);\n let returnedData = keepPreviousData ? isUndefined(cachedData) ? isUndefined(laggyDataRef.current) ? data : laggyDataRef.current : cachedData : data;\n const hasKeyButNoData = key && isUndefined(data);\n const hydrationRef = useRef(null);\n // Note: the conditionally hook call is fine because the environment\n // `IS_SERVER` never changes.\n // @ts-expect-error -- use hydrationRef directly\n !IS_SERVER && // getServerSnapshot is only called during hydration\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSyncExternalStore(sub, ()=>{\n hydrationRef.current = false;\n return hydrationRef;\n }, ()=>{\n hydrationRef.current = true;\n return hydrationRef;\n });\n const isHydration = hydrationRef.current;\n // During the initial SSR render, warn if the key has no data pre-fetched via:\n // - fallback data\n // - preload calls\n // - initial data from the cache provider\n // We only warn once for each key during Hydration.\n if (strictServerPrefetchWarning && isHydration && !suspense && hasKeyButNoData) {\n console.warn(`Missing pre-initiated data for serialized key \"${key}\" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set \"strictServerPrefetchWarning: false\" to disable this warning.`);\n }\n // Resolve the default validating state:\n // If it's able to validate, and it should revalidate when mount, this will be true.\n // - Suspense mode and there's stale data for the initial render.\n // - Not suspense mode and there is no fallback data and `revalidateIfStale` is enabled.\n // - `revalidateIfStale` is enabled but `data` is not defined.\n const shouldDoInitialRevalidation = (()=>{\n if (!key || !fetcher) return false;\n // If it's paused, we skip revalidation.\n if (getConfig().isPaused()) return false;\n // if a key already has revalidators and also has error, we should not trigger revalidation\n if (hasRevalidator && !isUndefined(error)) return false;\n // If `revalidateOnMount` is set, we take the value directly.\n if (isInitialMount && !isUndefined(revalidateOnMount)) return revalidateOnMount;\n // cacheData satisfies the initial Suspense render without a duplicate\n // request. Cached data on a later mount follows revalidateIfStale.\n if (suspense && hasCacheData && hasKeyButNoData) return false;\n // Under suspense mode, it will always fetch on render if there is no\n // stale data so no need to revalidate immediately mount it again.\n // If data exists, only revalidate if `revalidateIfStale` is true.\n if (suspense) return isUndefined(data) ? false : revalidateIfStale;\n // If there is no stale data, we need to revalidate when mount;\n // If `revalidateIfStale` is set to true, we will always revalidate.\n return isUndefined(data) || revalidateIfStale;\n })();\n const defaultValidatingState = isInitialMount && shouldDoInitialRevalidation;\n const isValidating = isUndefined(cached.isValidating) ? defaultValidatingState : cached.isValidating;\n const isLoading = isUndefined(cached.isLoading) ? defaultValidatingState : cached.isLoading;\n // The revalidation function is a carefully crafted wrapper of the original\n // `fetcher`, to correctly handle the many edge cases.\n const revalidate = useCallback(async (revalidateOpts)=>{\n const currentFetcher = fetcherRef.current;\n if (!key || !currentFetcher || unmountedRef.current || getConfig().isPaused()) {\n return false;\n }\n let newData;\n let startAt;\n let loading = true;\n const opts = revalidateOpts || {};\n // If there is no ongoing concurrent request, or `dedupe` is not set, a\n // new request should be initiated.\n const shouldStartNewRequest = !FETCH[key] || !opts.dedupe;\n const shouldUseRSCPreload = hasCacheData && !isCacheDataConsumed(consumedCacheData, serverCacheData, key) && !isUndefined(preloadedData) && isUndefined(getCache().data);\n /*\n For React 17\n Do unmount check for calls:\n If key has changed during the revalidation, or the component has been\n unmounted, old dispatch and old event callbacks should not take any\n effect\n\n For React 18\n only check if key has changed\n https://github.com/reactwg/react-18/discussions/82\n */ const callbackSafeguard = ()=>{\n if (IS_REACT_LEGACY) {\n return !unmountedRef.current && key === keyRef.current && initialMountedRef.current;\n }\n return key === keyRef.current;\n };\n // The final state object when the request finishes.\n const finalState = {\n isValidating: false,\n isLoading: false\n };\n const finishRequestAndUpdateState = ()=>{\n setCache(finalState);\n };\n const cleanupState = ()=>{\n // Check if it's still the same request before deleting it.\n const requestInfo = FETCH[key];\n if (requestInfo && requestInfo[1] === startAt) {\n delete FETCH[key];\n }\n };\n // Start fetching. Change the `isValidating` state, update the cache.\n const initialState = {\n isValidating: true\n };\n // It is in the `isLoading` state, if and only if there is no cached data.\n // This bypasses fallback data and laggy data.\n if (isUndefined(getCache().data)) {\n initialState.isLoading = true;\n }\n try {\n if (shouldStartNewRequest) {\n setCache(initialState);\n // If no cache is being rendered currently (it shows a blank page),\n // we trigger the loading slow event.\n if (config.loadingTimeout && isUndefined(getCache().data)) {\n setTimeout(()=>{\n if (loading && callbackSafeguard()) {\n getConfig().onLoadingSlow(key, config);\n }\n }, config.loadingTimeout);\n }\n // Start the request and save the timestamp.\n // Key must be truthy if entering here.\n if (shouldUseRSCPreload) {\n markCacheDataConsumed(consumedCacheData, serverCacheData, key);\n }\n FETCH[key] = [\n shouldUseRSCPreload ? preloadedData : currentFetcher(fnArg),\n getTimestamp()\n ];\n if (shouldUseRSCPreload && PRELOAD[key]) {\n delete PRELOAD[key];\n }\n }\n // Wait until the ongoing request is done. Deduplication is also\n // considered here.\n ;\n [newData, startAt] = FETCH[key];\n newData = await newData;\n if (shouldStartNewRequest) {\n // If the request isn't interrupted, clean it up after the\n // deduplication interval.\n setTimeout(cleanupState, config.dedupingInterval);\n }\n // If there're other ongoing request(s), started after the current one,\n // we need to ignore the current one to avoid possible race conditions:\n // req1------------------>res1 (current one)\n // req2---------------->res2\n // the request that fired later will always be kept.\n // The timestamp maybe be `undefined` or a number\n if (!FETCH[key] || FETCH[key][1] !== startAt) {\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onDiscarded(key);\n }\n }\n return false;\n }\n // Clear error.\n finalState.error = UNDEFINED;\n // If there're other mutations(s), that overlapped with the current revalidation:\n // case 1:\n // req------------------>res\n // mutate------>end\n // case 2:\n // req------------>res\n // mutate------>end\n // case 3:\n // req------------------>res\n // mutate-------...---------->\n // we have to ignore the revalidation result (res) because it's no longer fresh.\n // meanwhile, a new revalidation should be triggered when the mutation ends.\n const mutationInfo = MUTATION[key];\n if (!isUndefined(mutationInfo) && // case 1\n (startAt <= mutationInfo[0] || // case 2\n startAt <= mutationInfo[1] || // case 3\n mutationInfo[1] === 0)) {\n finishRequestAndUpdateState();\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onDiscarded(key);\n }\n }\n return false;\n }\n // Deep compare with the latest state to avoid extra re-renders.\n // For local state, compare and assign.\n const cacheData = getCache().data;\n // Since the compare fn could be custom fn\n // cacheData might be different from newData even when compare fn returns True\n finalState.data = compare(cacheData, newData) ? cacheData : newData;\n // Trigger the successful callback if it's the original request.\n if (shouldStartNewRequest) {\n if (callbackSafeguard()) {\n getConfig().onSuccess(newData, key, config);\n }\n }\n } catch (err) {\n cleanupState();\n const currentConfig = getConfig();\n const { shouldRetryOnError } = currentConfig;\n // Not paused, we continue handling the error. Otherwise, discard it.\n if (!currentConfig.isPaused()) {\n // Get a new error, don't use deep comparison for errors.\n finalState.error = err;\n // Error event and retry logic. Only for the actual request, not\n // deduped ones.\n if (shouldStartNewRequest && callbackSafeguard()) {\n currentConfig.onError(err, key, currentConfig);\n if (shouldRetryOnError === true || isFunction(shouldRetryOnError) && shouldRetryOnError(err)) {\n if (!getConfig().revalidateOnFocus || !getConfig().revalidateOnReconnect || isActive()) {\n // If it's inactive, stop. It will auto-revalidate when\n // refocusing or reconnecting.\n // When retrying, deduplication is always enabled.\n currentConfig.onErrorRetry(err, key, currentConfig, (_opts)=>{\n const revalidators = EVENT_REVALIDATORS[key];\n if (revalidators && revalidators[0]) {\n revalidators[0](ERROR_REVALIDATE_EVENT, _opts);\n }\n }, {\n retryCount: (opts.retryCount || 0) + 1,\n dedupe: true\n });\n }\n }\n }\n }\n }\n // Mark loading as stopped.\n loading = false;\n // Update the current hook's state.\n finishRequestAndUpdateState();\n return true;\n }, // `setState` is immutable, and `eventsCallback`, `fnArg`, and\n // `keyValidating` are depending on `key`, so we can exclude them from\n // the deps array.\n //\n // FIXME:\n // `fn` and `config` might be changed during the lifecycle,\n // but they might be changed every render like this.\n // `useSWR('key', () => fetch('/api/'), { suspense: true })`\n // So we omit the values from the deps array\n // even though it might cause unexpected behaviors.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n key,\n cache\n ]);\n // Similar to the global mutate but bound to the current cache and key.\n // `cache` isn't allowed to change during the lifecycle.\n const boundMutate = useCallback(// Use callback to make sure `keyRef.current` returns latest result every time\n (...args)=>{\n return internalMutate(cache, keyRef.current, ...args);\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n []);\n useIsomorphicLayoutEffect(()=>{\n const preloaded = preloadCacheRef.current;\n if (!preloaded) return;\n preloadCacheRef.current = null;\n markCacheDataConsumed(consumedCacheData, preloaded.cacheData, preloaded.key);\n if (isUndefined(getCache().data)) {\n setCache({\n data: preloaded.data,\n error: UNDEFINED,\n _k: preloaded._k\n });\n }\n if (PRELOAD[preloaded.key]) {\n delete PRELOAD[preloaded.key];\n }\n });\n // The logic for updating refs.\n useIsomorphicLayoutEffect(()=>{\n fetcherRef.current = fetcher;\n configRef.current = config;\n // Handle laggy data updates. If there's cached data of the current key,\n // it'll be the correct reference.\n if (!isUndefined(cachedData)) {\n laggyDataRef.current = cachedData;\n }\n });\n useIsomorphicLayoutEffect(()=>{\n if (fetcher || !hasCacheData || isUndefined(preloadedData) || isCacheDataConsumed(consumedCacheData, serverCacheData, key) || !isUndefined(getCache().data)) {\n return;\n }\n markCacheDataConsumed(consumedCacheData, serverCacheData, key);\n const mutation = MUTATION[key];\n commitCacheData({\n value: preloadedData,\n getCacheData: ()=>getCache().data,\n canCommit: ()=>!unmountedRef.current && key === keyRef.current && MUTATION[key] === mutation,\n setCache: (state)=>setCache({\n ...state,\n _k: fnArg\n })\n });\n });\n // After mounted or key changed.\n useIsomorphicLayoutEffect(()=>{\n if (!key) return;\n const softRevalidate = revalidate.bind(UNDEFINED, WITH_DEDUPE);\n let nextFocusRevalidatedAt = 0;\n if (getConfig().revalidateOnFocus) {\n const initNow = Date.now();\n nextFocusRevalidatedAt = initNow + getConfig().focusThrottleInterval;\n }\n // Expose revalidators to global event listeners. So we can trigger\n // revalidation from the outside.\n const onRevalidate = (type, opts = {})=>{\n if (type == FOCUS_EVENT) {\n const now = Date.now();\n if (getConfig().revalidateOnFocus && now > nextFocusRevalidatedAt && isActive()) {\n nextFocusRevalidatedAt = now + getConfig().focusThrottleInterval;\n softRevalidate();\n }\n } else if (type == RECONNECT_EVENT) {\n if (getConfig().revalidateOnReconnect && isActive()) {\n softRevalidate();\n }\n } else if (type == MUTATE_EVENT) {\n return revalidate();\n } else if (type == ERROR_REVALIDATE_EVENT) {\n return revalidate(opts);\n } else if (type == UNLOAD_EVENT) {\n // The cache has been cleared: drop the previous data kept by\n // `keepPreviousData` so it can't stay on screen.\n laggyDataRef.current = UNDEFINED;\n if (opts.revalidate) {\n return revalidate();\n }\n }\n return;\n };\n const unsubEvents = subscribeCallback(key, EVENT_REVALIDATORS, onRevalidate);\n // Mark the component as mounted and update corresponding refs.\n unmountedRef.current = false;\n keyRef.current = key;\n initialMountedRef.current = true;\n // Keep the original key in the cache.\n setCache({\n _k: fnArg\n });\n // Trigger a revalidation\n if (shouldDoInitialRevalidation) {\n // Performance optimization: if a request is already in progress for this key,\n // skip the revalidation to avoid redundant work\n if (!FETCH[key]) {\n if (isUndefined(data) || IS_SERVER) {\n // Revalidate immediately.\n softRevalidate();\n } else {\n // Delay the revalidate if we have data to return so we won't block\n // rendering.\n rAF(softRevalidate);\n }\n }\n }\n return ()=>{\n // Mark it as unmounted.\n unmountedRef.current = true;\n unsubEvents();\n };\n }, [\n key\n ]);\n // Polling\n useIsomorphicLayoutEffect(()=>{\n let timer;\n function next() {\n // Use the passed interval\n // ...or invoke the function with the updated data to get the interval\n const interval = isFunction(refreshInterval) ? refreshInterval(getCache().data) : refreshInterval;\n // We only start the next interval if `refreshInterval` is not 0, and:\n // - `force` is true, which is the start of polling\n // - or `timer` is not 0, which means the effect wasn't canceled\n if (interval && timer !== -1) {\n timer = setTimeout(execute, interval);\n }\n }\n function execute() {\n // Check if it's OK to execute:\n // Only revalidate when the page is visible, online, and not errored.\n if (!getCache().error && (refreshWhenHidden || getConfig().isVisible()) && (refreshWhenOffline || getConfig().isOnline())) {\n revalidate(WITH_DEDUPE).then(next);\n } else {\n // Schedule the next interval to check again.\n next();\n }\n }\n next();\n return ()=>{\n if (timer) {\n clearTimeout(timer);\n timer = -1;\n }\n };\n }, [\n refreshInterval,\n refreshWhenHidden,\n refreshWhenOffline,\n key\n ]);\n // Display debug info in React DevTools.\n useDebugValue(returnedData);\n // In Suspense mode, we can't return the empty `data` state.\n // If there is an `error`, the `error` needs to be thrown to the error boundary.\n // If there is no `error`, the `revalidation` promise needs to be thrown to\n // the suspense boundary.\n if (suspense) {\n // SWR should throw when trying to use Suspense on the server with React 18,\n // without providing any fallback data. This causes hydration errors. See:\n // https://github.com/vercel/swr/issues/1832\n if (!IS_REACT_LEGACY && IS_SERVER && hasKeyButNoData && isUndefined(preloadedData)) {\n throw new Error('Fallback data is required when using Suspense in SSR.');\n }\n // Always update fetcher and config refs even with the Suspense mode.\n if (hasKeyButNoData) {\n fetcherRef.current = fetcher;\n configRef.current = config;\n unmountedRef.current = false;\n }\n const shouldConsumePreload = !isUndefined(preloadedData) && hasKeyButNoData;\n let preloadData = UNDEFINED;\n if (shouldConsumePreload && hasCacheData) {\n preloadData = preloadedData && isPromiseLike(preloadedData) ? use(preloadedData) : preloadedData;\n data = preloadData;\n returnedData = preloadData;\n if (!IS_SERVER) {\n preloadCacheRef.current = {\n data: preloadData,\n _k: fnArg,\n key,\n cacheData: serverCacheData\n };\n }\n } else {\n const mutateReq = shouldConsumePreload ? boundMutate(preloadedData) : resolvedUndef;\n use(mutateReq);\n }\n if (!isUndefined(error) && hasKeyButNoData) {\n throw error;\n }\n const revalidation = hasKeyButNoData && isUndefined(preloadData) ? revalidate(WITH_DEDUPE) : resolvedUndef;\n if (!isUndefined(returnedData) && hasKeyButNoData) {\n // @ts-ignore modify react promise status\n revalidation.status = 'fulfilled';\n // @ts-ignore modify react promise value\n revalidation.value = true;\n }\n use(revalidation);\n }\n const swrResponse = {\n mutate: boundMutate,\n get data () {\n stateDependencies.data = true;\n return returnedData;\n },\n get error () {\n stateDependencies.error = true;\n return error;\n },\n get isValidating () {\n stateDependencies.isValidating = true;\n return isValidating;\n },\n get isLoading () {\n stateDependencies.isLoading = true;\n return isLoading;\n }\n };\n return swrResponse;\n};\nconst SWRConfig = OBJECT.defineProperty(SWRConfig$1, 'defaultValue', {\n value: defaultConfig\n});\n/**\n * A hook to fetch data.\n *\n * @see {@link https://swr.vercel.app}\n *\n * @example\n * ```jsx\n * import useSWR from 'swr'\n * function Profile() {\n * const { data, error, isLoading } = useSWR('/api/user', fetcher)\n * if (error) return
failed to load
\n * if (isLoading) return
loading...
\n * return
hello {data.name}!
\n * }\n * ```\n */ const useSWR = withArgs(useSWRHandler);\n\nexport { SWRConfig as S, useSWR as u };\n","import dayjs from 'dayjs';\nimport {TemporaryContext} from 'hooks/src/TemporaryContext';\nimport React, {useContext} from 'react';\nimport useSWR from 'swr';\n\nimport {useI18n, DEFAULT_LOCALE} from '@staffbase/ui';\n\ninterface I18nInterface {\n translations: Record;\n}\n\nexport const I18nContext = React.createContext({translations: {}});\n\ninterface I18nContextWrapperProps {\n children: React.ReactNode;\n}\n\nexport const useLocale = () => {\n const {locale: adapterLocale, useInformalTranslations: adapterUseInformalTranslations} = useI18n();\n const {locale: contextLocale, useInformalTranslations: contextUseInformalTranslations} = useContext(TemporaryContext);\n const availableInformalTranslations = ['de_DE'];\n\n const locale = adapterLocale !== DEFAULT_LOCALE ? adapterLocale : contextLocale || adapterLocale;\n\n /*\n * the ambient `@staffbase/ui` adapter only ever reflects the live client\n * experience, not the Studio preview (which mounts the admin webcomponent\n * with isClient=false, so it never got a real informal-translations signal\n * at all) — the host explicitly passes the flag via TemporaryContext for\n * that case, so either source is honored here\n */\n const useInformalTranslations = adapterUseInformalTranslations || contextUseInformalTranslations;\n\n if (useInformalTranslations && availableInformalTranslations.includes(locale)) {\n return {locale: `${locale}_informal`};\n }\n\n return {locale};\n};\n\nexport const I18nContextWrapper: React.FC = ({children}) => {\n const {locale} = useLocale();\n\n const {\n data: translations,\n error,\n isLoading\n } = useSWR('survey-translations', () =>\n import(/* webpackChunkName: 'Translations' */ `../../locales/${locale}.json`)\n\n // import the English translations if appropriate translation file is not found\n .catch(() => {\n console.warn(`couldn't import ${locale}.json, falling back to English`);\n return import(/* webpackChunkName: 'Fallback Translation' */ '../../locales/en_US.json');\n })\n );\n\n const twoDigitLocale = locale.substring(0, 2).toLowerCase();\n import(/* webpackChunkName: 'Time Translations' */ `dayjs/locale/${twoDigitLocale}.js`)\n .then(() => {\n dayjs.locale(twoDigitLocale);\n })\n\n .catch(() => {\n console.warn(`couldn't import ${twoDigitLocale} translations. 'en' will be used as a fallback`);\n });\n\n if (error) {\n throw Error(`unexpected error when loading ${locale}.json and en_US.json:`);\n }\n\n if (isLoading) {\n return <>;\n }\n\n return {children};\n};\n","var isDevelopment = false;\n\n/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n return document.styleSheets[i];\n }\n } // this function should always return with a value\n // TS can't understand it though so we make it stop complaining here\n\n\n return undefined;\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? !isDevelopment : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n this.tags.forEach(function (tag) {\n var _tag$parentNode;\n\n return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value;\n var parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' ');\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","var weakMemoize = function weakMemoize(func) {\n var cache = new WeakMap();\n return function (arg) {\n if (cache.has(arg)) {\n // Use non-null assertion because we just checked that the cache `has` it\n // This allows us to remove `undefined` from the return value\n return cache.get(arg);\n }\n\n var ret = func(arg);\n cache.set(arg, ret);\n return ret;\n };\n};\n\nexport { weakMemoize as default };\n","var isBrowser = true;\n\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else if (className) {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n scale: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n","import * as React from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar isDevelopment = false;\n\nvar EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nvar ThemeContext = /* #__PURE__ */React.createContext({});\n\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n return mergedTheme;\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = React.useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n var WithTheme = /*#__PURE__*/React.forwardRef(function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n });\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar hasOwn = {}.hasOwnProperty;\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n\n var newProps = {};\n\n for (var _key in props) {\n if (hasOwn.call(props, _key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var _key2 in props) {\n if (hasOwn.call(props, _key2) && _key2 !== 'css' && _key2 !== typePropName && (!isDevelopment )) {\n newProps[_key2] = props[_key2];\n }\n }\n\n newProps.className = className;\n\n if (ref) {\n newProps.ref = ref;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\n\nvar Emotion$1 = Emotion;\n\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwn as h, isDevelopment as i, useTheme as u, withEmotionCache as w };\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import hoistNonReactStatics$1 from 'hoist-non-react-statics';\n\n// this file isolates this package that is not tree-shakeable\n// and if this module doesn't actually contain any logic of its own\n// then Rollup just use 'hoist-non-react-statics' directly in other chunks\n\nvar hoistNonReactStatics = (function (targetComponent, sourceComponent) {\n return hoistNonReactStatics$1(targetComponent, sourceComponent);\n});\n\nexport { hoistNonReactStatics as default };\n","/** @experimental breakpoints for display sizes **/\nexport const BREAKPOINT = {\n 480: '480px',\n 768: '768px',\n 1040: '1040px',\n 1440: '1440px'\n};\n","import tinycolor from 'tinycolor2';\n\nexport const COLOR_BASE_TONES = {\n black: '#000000',\n\n blue: {\n 900: '#001736',\n 800: '#003175',\n 700: '#004EB9',\n 600: '#006CFF',\n 500: '#2883FF',\n 400: '#539CFF',\n 300: '#85B9FF',\n 200: '#ABCFFF',\n 100: '#D0E4FF',\n 50: '#ECF4FF'\n },\n\n cyan: {\n 900: '#071A21',\n 800: '#0F3948',\n 700: '#185B74',\n 600: '#207D9F',\n 500: '#3D90AE',\n 400: '#60A4BD',\n 300: '#8CBDCF',\n 200: '#B0D2DE',\n 100: '#D3E6EC',\n 50: '#EDF5F8'\n },\n\n green: {\n 900: '#101A0A',\n 800: '#193C12',\n 700: '#1E6215',\n 600: '#1D8713',\n 500: '#469837',\n 400: '#6BAA5B',\n 300: '#95C287',\n 200: '#B6D5AB',\n 100: '#D6E7D0',\n 50: '#EFF6EC'\n },\n\n grey: {\n 900: '#171719',\n 800: '#343438',\n 700: '#545459',\n 600: '#74747B',\n 500: '#86868C',\n 400: '#9B9BA0',\n 300: '#B6B6B9',\n 200: '#CCCCCE',\n 100: '#E2E2E4',\n 50: '#F3F3F4'\n },\n\n pink: {\n 900: '#241121',\n 800: '#50254A',\n 700: '#803B76',\n 600: '#AF51A1',\n 500: '#CA5DBA',\n 400: '#E96BD6',\n 300: '#FB91EB',\n 200: '#FCB5F2',\n 100: '#FED7F8',\n 50: '#FEEFFC'\n },\n\n purple: {\n 900: '#1F102F',\n 800: '#452467',\n 700: '#6E3AA4',\n 600: '#974FE1',\n 500: '#A669E5',\n 400: '#B785EA',\n 300: '#CBA7F0',\n 200: '#DBC2F5',\n 100: '#EBDDF9',\n 50: '#F7F1FD'\n },\n\n red: {\n 900: '#281206',\n 800: '#5F210E',\n 700: '#9C2D0E',\n 600: '#D9380A',\n 500: '#E5582F',\n 400: '#F07953',\n 300: '#FB9F81',\n 200: '#FFBDA7',\n 100: '#FFDBCE',\n 50: '#FFF1EC'\n },\n\n sbBlue: {\n 900: '#002235',\n 800: '#003857',\n 700: '#00598A',\n 600: '#007ABC',\n 500: '#008DD9',\n 400: '#00A4FD',\n 300: '#50C0FE',\n 200: '#8AD5FE',\n 100: '#C0E8FF',\n 50: '#E6F6FF'\n },\n\n teal: {\n 900: '#051B18',\n 800: '#0B3C35',\n 700: '#125F54',\n 600: '#198374',\n 500: '#3A9487',\n 400: '#5EA89D',\n 300: '#8BC0B9',\n 200: '#AED3CE',\n 100: '#D2E7E4',\n 50: '#EDF5F4'\n },\n\n yellow: {\n 900: '#20160B',\n 800: '#492F17',\n 700: '#764B1E',\n 600: '#A36723',\n 500: '#BB7725',\n 400: '#D78A27',\n 300: '#F0A74E',\n 200: '#F9C284',\n 100: '#FEDDBA',\n 50: '#FFF1E3'\n },\n\n white: '#FFFFFF'\n} as const;\n\nexport const BRAND_TONES = {\n brand: 'var(--sb-brand)',\n 'brand-900': 'var(--sb-brand-900)',\n 'brand-800': 'var(--sb-brand-800)',\n 'brand-700': 'var(--sb-brand-700)',\n 'brand-600': 'var(--sb-brand-600)',\n 'brand-500': 'var(--sb-brand-500)',\n 'brand-400': 'var(--sb-brand-400)',\n 'brand-300': 'var(--sb-brand-300)',\n 'brand-200': 'var(--sb-brand-200)',\n 'brand-100': 'var(--sb-brand-100)',\n 'brand-50': 'var(--sb-brand-50)',\n brandInverse: 'var(--sb-brand-inverse)'\n};\n\nexport const PALETTE_CYAN = {\n background: {\n vivid: COLOR_BASE_TONES.cyan[600],\n 'vivid-hover': COLOR_BASE_TONES.cyan[700],\n 'vivid-pressed': COLOR_BASE_TONES.cyan[800],\n medium: COLOR_BASE_TONES.cyan[100],\n 'medium-hover': COLOR_BASE_TONES.cyan[200],\n 'medium-pressed': COLOR_BASE_TONES.cyan[300],\n weak: COLOR_BASE_TONES.cyan[50],\n 'weak-hover': COLOR_BASE_TONES.cyan[100],\n 'weak-pressed': COLOR_BASE_TONES.cyan[200],\n /** @deprecated use inverse tokens instead */\n transparent: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n /** @deprecated use inverse tokens instead */\n 'transparent-hover': COLOR_BASE_TONES.cyan[100],\n /** @deprecated use inverse tokens instead */\n 'transparent-pressed': COLOR_BASE_TONES.cyan[200],\n inverse: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n 'inverse-hover': COLOR_BASE_TONES.cyan[100],\n 'inverse-pressed': COLOR_BASE_TONES.cyan[200]\n },\n text: {\n vivid: COLOR_BASE_TONES.cyan[700],\n strong: COLOR_BASE_TONES.cyan[800],\n inverse: COLOR_BASE_TONES.white,\n 'icon-vivid': COLOR_BASE_TONES.cyan[700],\n 'icon-inverse': COLOR_BASE_TONES.white\n },\n border: COLOR_BASE_TONES.cyan[600]\n} as const;\n\nexport const PALETTE_CRITICAL = {\n background: {\n vivid: COLOR_BASE_TONES.red[600],\n 'vivid-hover': COLOR_BASE_TONES.red[700],\n 'vivid-pressed': COLOR_BASE_TONES.red[800],\n medium: COLOR_BASE_TONES.red[100],\n 'medium-hover': COLOR_BASE_TONES.red[200],\n 'medium-pressed': COLOR_BASE_TONES.red[300],\n weak: COLOR_BASE_TONES.red[50],\n 'weak-hover': COLOR_BASE_TONES.red[100],\n 'weak-pressed': COLOR_BASE_TONES.red[200],\n /** @deprecated use inverse tokens instead */\n transparent: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n /** @deprecated use inverse tokens instead */\n 'transparent-hover': COLOR_BASE_TONES.red[100],\n /** @deprecated use inverse tokens instead */\n 'transparent-pressed': COLOR_BASE_TONES.red[200],\n inverse: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n 'inverse-hover': COLOR_BASE_TONES.red[100],\n 'inverse-pressed': COLOR_BASE_TONES.red[200]\n },\n text: {\n vivid: COLOR_BASE_TONES.red[700],\n strong: COLOR_BASE_TONES.red[800],\n inverse: COLOR_BASE_TONES.white,\n 'icon-vivid': COLOR_BASE_TONES.red[700],\n 'icon-inverse': COLOR_BASE_TONES.white\n },\n border: COLOR_BASE_TONES.red[600]\n} as const;\n\nexport const PALETTE_INFO = {\n background: {\n vivid: COLOR_BASE_TONES.yellow[600],\n 'vivid-hover': COLOR_BASE_TONES.yellow[700],\n 'vivid-pressed': COLOR_BASE_TONES.yellow[800],\n medium: COLOR_BASE_TONES.yellow[100],\n 'medium-hover': COLOR_BASE_TONES.yellow[200],\n 'medium-pressed': COLOR_BASE_TONES.yellow[300],\n weak: COLOR_BASE_TONES.yellow[50],\n 'weak-hover': COLOR_BASE_TONES.yellow[100],\n 'weak-pressed': COLOR_BASE_TONES.yellow[200],\n /** @deprecated use inverse tokens instead */\n transparent: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n /** @deprecated use inverse tokens instead */\n 'transparent-hover': COLOR_BASE_TONES.yellow[100],\n /** @deprecated use inverse tokens instead */\n 'transparent-pressed': COLOR_BASE_TONES.yellow[200],\n inverse: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n 'inverse-hover': COLOR_BASE_TONES.yellow[100],\n 'inverse-pressed': COLOR_BASE_TONES.yellow[200]\n },\n text: {\n vivid: COLOR_BASE_TONES.yellow[700],\n strong: COLOR_BASE_TONES.yellow[800],\n inverse: COLOR_BASE_TONES.white,\n 'icon-vivid': COLOR_BASE_TONES.yellow[700],\n 'icon-inverse': COLOR_BASE_TONES.white\n },\n border: COLOR_BASE_TONES.yellow[600]\n};\n\nexport const PALETTE_NEUTRAL = {\n background: {\n strong: COLOR_BASE_TONES.grey[900],\n 'strong-hover': COLOR_BASE_TONES.grey[800],\n 'strong-pressed': COLOR_BASE_TONES.grey[700],\n medium: COLOR_BASE_TONES.grey[100],\n 'medium-hover': COLOR_BASE_TONES.grey[200],\n 'medium-pressed': COLOR_BASE_TONES.grey[300],\n base: COLOR_BASE_TONES.grey[50],\n 'base-hover': COLOR_BASE_TONES.grey[100],\n 'base-pressed': COLOR_BASE_TONES.grey[200],\n surface: COLOR_BASE_TONES.white,\n 'surface-hover': COLOR_BASE_TONES.grey[50],\n 'surface-pressed': COLOR_BASE_TONES.grey[100]\n },\n text: {\n strong: COLOR_BASE_TONES.grey[900],\n medium: COLOR_BASE_TONES.grey[700],\n placeholder: COLOR_BASE_TONES.grey[400],\n inverse: COLOR_BASE_TONES.white,\n 'icon-strong': COLOR_BASE_TONES.grey[900],\n 'icon-medium': COLOR_BASE_TONES.grey[600],\n 'icon-weak': COLOR_BASE_TONES.grey[300],\n 'icon-inverse': COLOR_BASE_TONES.white\n },\n border: {\n weak: COLOR_BASE_TONES.grey[100],\n medium: COLOR_BASE_TONES.grey[600],\n strong: COLOR_BASE_TONES.grey[900]\n }\n} as const;\n\nexport const PALETTE_PRIMARY = {\n background: {\n vivid: BRAND_TONES['brand-600'],\n 'vivid-hover': BRAND_TONES['brand-700'],\n 'vivid-pressed': BRAND_TONES['brand-800'],\n medium: BRAND_TONES['brand-100'],\n 'medium-hover': BRAND_TONES['brand-200'],\n 'medium-pressed': BRAND_TONES['brand-300'],\n weak: BRAND_TONES['brand-50'],\n 'weak-hover': BRAND_TONES['brand-100'],\n 'weak-pressed': BRAND_TONES['brand-200'],\n /** @deprecated use inverse tokens instead */\n transparent: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n /** @deprecated use inverse tokens instead */\n 'transparent-hover': COLOR_BASE_TONES.blue[100],\n /** @deprecated use inverse tokens instead */\n 'transparent-pressed': COLOR_BASE_TONES.blue[200],\n inverse: BRAND_TONES.brandInverse,\n 'inverse-hover': BRAND_TONES['brand-50'],\n 'inverse-pressed': BRAND_TONES['brand-100']\n },\n text: {\n vivid: BRAND_TONES['brand-700'],\n strong: BRAND_TONES['brand-800'],\n inverse: BRAND_TONES.brandInverse,\n 'icon-vivid': BRAND_TONES['brand-700'],\n 'icon-inverse': BRAND_TONES.brandInverse\n },\n border: BRAND_TONES['brand-600']\n} as const;\n\nexport const PALETTE_PINK = {\n background: {\n vivid: COLOR_BASE_TONES.pink[600],\n 'vivid-hover': COLOR_BASE_TONES.pink[700],\n 'vivid-pressed': COLOR_BASE_TONES.pink[800],\n medium: COLOR_BASE_TONES.pink[100],\n 'medium-hover': COLOR_BASE_TONES.pink[200],\n 'medium-pressed': COLOR_BASE_TONES.pink[300],\n weak: COLOR_BASE_TONES.pink[50],\n 'weak-hover': COLOR_BASE_TONES.pink[100],\n 'weak-pressed': COLOR_BASE_TONES.pink[200],\n /** @deprecated use inverse tokens instead */\n transparent: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n /** @deprecated use inverse tokens instead */\n 'transparent-hover': COLOR_BASE_TONES.pink[100],\n /** @deprecated use inverse tokens instead */\n 'transparent-pressed': COLOR_BASE_TONES.pink[200],\n inverse: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n 'inverse-hover': COLOR_BASE_TONES.pink[100],\n 'inverse-pressed': COLOR_BASE_TONES.pink[200]\n },\n text: {\n vivid: COLOR_BASE_TONES.pink[700],\n strong: COLOR_BASE_TONES.pink[800],\n inverse: COLOR_BASE_TONES.white,\n 'icon-vivid': COLOR_BASE_TONES.pink[700],\n 'icon-inverse': COLOR_BASE_TONES.white\n },\n border: COLOR_BASE_TONES.pink[600]\n};\n\nexport const PALETTE_PURPLE = {\n background: {\n vivid: COLOR_BASE_TONES.purple[600],\n 'vivid-hover': COLOR_BASE_TONES.purple[700],\n 'vivid-pressed': COLOR_BASE_TONES.purple[800],\n medium: COLOR_BASE_TONES.purple[100],\n 'medium-hover': COLOR_BASE_TONES.purple[200],\n 'medium-pressed': COLOR_BASE_TONES.purple[300],\n weak: COLOR_BASE_TONES.purple[50],\n 'weak-hover': COLOR_BASE_TONES.purple[100],\n 'weak-pressed': COLOR_BASE_TONES.purple[200],\n /** @deprecated use inverse tokens instead */\n transparent: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n /** @deprecated use inverse tokens instead */\n 'transparent-hover': COLOR_BASE_TONES.purple[100],\n /** @deprecated use inverse tokens instead */\n 'transparent-pressed': COLOR_BASE_TONES.purple[200],\n inverse: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n 'inverse-hover': COLOR_BASE_TONES.purple[100],\n 'inverse-pressed': COLOR_BASE_TONES.purple[200]\n },\n text: {\n vivid: COLOR_BASE_TONES.purple[700],\n strong: COLOR_BASE_TONES.purple[800],\n inverse: COLOR_BASE_TONES.white,\n 'icon-vivid': COLOR_BASE_TONES.purple[700],\n 'icon-inverse': COLOR_BASE_TONES.white\n },\n border: COLOR_BASE_TONES.purple[600]\n};\n\nexport const PALETTE_SUCCESS = {\n background: {\n vivid: COLOR_BASE_TONES.green[600],\n 'vivid-hover': COLOR_BASE_TONES.green[700],\n 'vivid-pressed': COLOR_BASE_TONES.green[800],\n medium: COLOR_BASE_TONES.green[100],\n 'medium-hover': COLOR_BASE_TONES.green[200],\n 'medium-pressed': COLOR_BASE_TONES.green[300],\n weak: COLOR_BASE_TONES.green[50],\n 'weak-hover': COLOR_BASE_TONES.green[100],\n 'weak-pressed': COLOR_BASE_TONES.green[200],\n /** @deprecated use inverse tokens instead */\n transparent: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n /** @deprecated use inverse tokens instead */\n 'transparent-hover': COLOR_BASE_TONES.green[100],\n /** @deprecated use inverse tokens instead */\n 'transparent-pressed': COLOR_BASE_TONES.green[200],\n inverse: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n 'inverse-hover': COLOR_BASE_TONES.green[100],\n 'inverse-pressed': COLOR_BASE_TONES.green[200]\n },\n text: {\n vivid: COLOR_BASE_TONES.green[700],\n strong: COLOR_BASE_TONES.green[800],\n inverse: COLOR_BASE_TONES.white,\n 'icon-vivid': COLOR_BASE_TONES.green[700],\n 'icon-inverse': COLOR_BASE_TONES.white\n },\n border: COLOR_BASE_TONES.green[600]\n};\n\nexport const PALETTE_TEAL = {\n background: {\n vivid: COLOR_BASE_TONES.teal[600],\n 'vivid-hover': COLOR_BASE_TONES.teal[700],\n 'vivid-pressed': COLOR_BASE_TONES.teal[800],\n medium: COLOR_BASE_TONES.teal[100],\n 'medium-hover': COLOR_BASE_TONES.teal[200],\n 'medium-pressed': COLOR_BASE_TONES.teal[300],\n weak: COLOR_BASE_TONES.teal[50],\n 'weak-hover': COLOR_BASE_TONES.teal[100],\n 'weak-pressed': COLOR_BASE_TONES.teal[200],\n /** @deprecated use inverse tokens instead */\n transparent: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n /** @deprecated use inverse tokens instead */\n 'transparent-hover': COLOR_BASE_TONES.teal[100],\n /** @deprecated use inverse tokens instead */\n 'transparent-pressed': COLOR_BASE_TONES.teal[200],\n inverse: tinycolor(COLOR_BASE_TONES.white).setAlpha(0).toRgbString(),\n 'inverse-hover': COLOR_BASE_TONES.teal[100],\n 'inverse-pressed': COLOR_BASE_TONES.teal[200]\n },\n text: {\n vivid: COLOR_BASE_TONES.teal[700],\n strong: COLOR_BASE_TONES.teal[800],\n inverse: COLOR_BASE_TONES.white,\n 'icon-vivid': COLOR_BASE_TONES.teal[700],\n 'icon-inverse': COLOR_BASE_TONES.white\n },\n border: COLOR_BASE_TONES.teal[600]\n};\n\nexport const MISC_PALETTE = {\n overlayDefault: tinycolor(COLOR_BASE_TONES.grey[900]).setAlpha(0.4).toRgbString(),\n overlayStrong: tinycolor(COLOR_BASE_TONES.grey[900]).setAlpha(0.8).toRgbString(),\n brandPrimary: COLOR_BASE_TONES.blue[600], //Usage: Only used on Client Experiences, not studio.\n brandSecondary: COLOR_BASE_TONES.white //Usage: Only used on Client Experiences, not studio.\n};\n\nexport const COMPONENTS = {\n badge: {\n background: {\n critical: `var(--sb-background-badge-critical-vivid, ${PALETTE_CRITICAL.background.vivid})`,\n primary: `var(--sb-background-badge-primary-vivid, ${PALETTE_PRIMARY.background.vivid})`\n },\n text: {\n critical: `var(--sb-text-badge-critical, ${PALETTE_CRITICAL.text.inverse})`,\n primary: `var(--sb-text-badge-primary, ${PALETTE_PRIMARY.text.inverse})`\n }\n },\n button: {\n background: {\n critical: `var(--sb-background-button-critical-vivid, ${PALETTE_CRITICAL.background.vivid})`,\n 'critical-hover': `var(--sb-background-button-critical-vivid-hover, ${PALETTE_CRITICAL.background['vivid-hover']})`,\n 'critical-pressed': `var(--sb-background-button-critical-vivid-pressed, ${PALETTE_CRITICAL.background['vivid-pressed']})`,\n 'critical-inverse': `var(--sb-background-button-critical-inverse, ${PALETTE_CRITICAL.background.inverse})`,\n 'critical-inverse-hover': `var(--sb-background-button-critical-inverse-hover, ${PALETTE_CRITICAL.background['inverse-hover']})`,\n 'critical-inverse-pressed': `var(--sb-background-button-critical-inverse-pressed, ${PALETTE_CRITICAL.background['inverse-pressed']})`,\n primary: `var(--sb-background-button-primary-vivid, ${PALETTE_PRIMARY.background.vivid})`,\n 'primary-hover': `var(--sb-background-button-primary-vivid-hover, ${PALETTE_PRIMARY.background['vivid-hover']})`,\n 'primary-pressed': `var(--sb-background-button-primary-vivid-pressed, ${PALETTE_PRIMARY.background['vivid-pressed']})`,\n 'primary-inverse': `var(--sb-background-button-primary-inverse, ${PALETTE_PRIMARY.background.inverse})`,\n 'primary-inverse-hover': `var(--sb-background-button-primary-inverse-hover, ${PALETTE_PRIMARY.background['inverse-hover']})`,\n 'primary-inverse-pressed': `var(--sb-background-button-primary-inverse-pressed, ${PALETTE_PRIMARY.background['inverse-pressed']})`\n },\n text: {\n critical: `var(--sb-text-button-critical-vivid, ${PALETTE_CRITICAL.text.inverse})`,\n 'critical-icon': `var(--sb-text-button-critical-icon-vivid, ${PALETTE_CRITICAL.text['icon-inverse']})`,\n 'critical-inverse': `var(--sb-text-button-critical-inverse, ${PALETTE_CRITICAL.text.vivid})`,\n 'critical-icon-inverse': `var(--sb-text-button-critical-icon-inverse, ${PALETTE_CRITICAL.text['icon-vivid']})`,\n primary: `var(--sb-text-button-primary-vivid, ${PALETTE_PRIMARY.text.inverse})`,\n 'primary-icon': `var(--sb-text-button-primary-icon-vivid, ${PALETTE_PRIMARY.text['icon-inverse']})`,\n 'primary-inverse': `var(--sb-text-button-primary-inverse, ${PALETTE_PRIMARY.text.vivid})`,\n 'primary-icon-inverse': `var(--sb-text-button-primary-icon-inverse, ${PALETTE_PRIMARY.text['icon-vivid']})`\n }\n },\n ghostButton: {\n background: {\n 'critical-hover': `var(--sb-background-ghost-button-critical-vivid-hover, ${PALETTE_CRITICAL.background['inverse-hover']})`,\n 'critical-pressed': `var(--sb-background-ghost-button-critical-vivid-pressed, ${PALETTE_CRITICAL.background['inverse-pressed']})`,\n 'critical-inverse-hover': `var(--sb-background-ghost-button-critical-inverse-hover, ${PALETTE_CRITICAL.background['vivid-hover']})`,\n 'critical-inverse-pressed': `var(--sb-background-ghost-button-critical-inverse-pressed, ${PALETTE_CRITICAL.background['vivid-pressed']})`,\n 'primary-hover': `var(--sb-background-ghost-button-primary-vivid-hover, ${PALETTE_PRIMARY.background['inverse-hover']})`,\n 'primary-pressed': `var(--sb-background-ghost-button-primary-vivid-pressed, ${PALETTE_PRIMARY.background['inverse-pressed']})`,\n 'primary-inverse-hover': `var(--sb-background-ghost-button-primary-inverse-hover, ${PALETTE_PRIMARY.background['vivid-hover']})`,\n 'primary-inverse-pressed': `var(--sb-background-ghost-button-primary-inverse-pressed, ${PALETTE_PRIMARY.background['vivid-pressed']})`\n },\n text: {\n critical: `var(--sb-text-ghost-button-critical-vivid, ${PALETTE_CRITICAL.text.vivid})`,\n 'critical-icon': `var(--sb-text-ghost-button-critical-icon-vivid, ${PALETTE_CRITICAL.text['icon-vivid']})`,\n 'critical-inverse': `var(--sb-text-ghost-button-critical-inverse, ${PALETTE_CRITICAL.text.inverse})`,\n 'critical-icon-inverse': `var(--sb-text-ghost-button-critical-icon-inverse, ${PALETTE_CRITICAL.text['icon-inverse']})`,\n 'primary-inverse': `var(--sb-text-ghost-button-primary-inverse, ${PALETTE_PRIMARY.text.inverse})`,\n primary: `var(--sb-text-ghost-button-primary-vivid, ${PALETTE_PRIMARY.text.vivid})`,\n 'primary-icon': `var(--sb-text-ghost-button-primary-icon-vivid, ${PALETTE_PRIMARY.text['icon-vivid']})`,\n 'primary-icon-inverse': `var(--sb-text-ghost-button-primary-icon-inverse, ${PALETTE_PRIMARY.text['icon-inverse']})`\n }\n },\n nav: {\n background: {\n appintranet: 'var(--sb-background-nav-appintranet)',\n 'appintranet-hover': 'var(--sb-background-nav-appintranet-hover)',\n 'appintranet-pressed': 'var(--sb-background-nav-appintranet-pressed)',\n 'appintranet-accent': 'var(--sb-background-nav-appintranet-accent)',\n 'appintranet-accent-hover': 'var(--sb-background-nav-appintranet-accent-hover)',\n 'appintranet-accent-pressed': 'var(--sb-background-nav-appintranet-accent-pressed)',\n 'appintranet-search': 'var(--sb-background-nav-appintranet-search, #1D215C)',\n 'appintranet-search-hover': 'var(--sb-background-nav-appintranet-search-hover, #31370)',\n 'appintranet-search-active': `var(--sb-background-nav-appintranet-search-active, ${PALETTE_NEUTRAL.background.surface})`\n },\n text: {\n appintranet: 'var(--sb-text-nav-appintranet)',\n 'appintranet-hover': 'var(--sb-text-nav-appintranet-hover)',\n 'appintranet-pressed': 'var(--sb-text-nav-appintranet-pressed)',\n 'appintranet-search': 'var(--sb-text-nav-appintranet-search, #FFFFFF)',\n 'appintranet-search-active': `var(--sb-text-nav-appintranet-search-active, ${PALETTE_NEUTRAL.text.strong})`\n }\n },\n link: {\n text: {\n link: `var(--sb-text-link-primary-vivid, ${PALETTE_PRIMARY.text.vivid})`\n }\n }\n};\n\nexport const CHART_PALETTE = {\n 'negative-100': COLOR_BASE_TONES.yellow[100],\n 'negative-200': COLOR_BASE_TONES.yellow[200],\n 'negative-300': COLOR_BASE_TONES.yellow[300],\n 'negative-400': COLOR_BASE_TONES.yellow[400],\n 'negative-500': COLOR_BASE_TONES.yellow[500],\n 'negative-600': COLOR_BASE_TONES.yellow[600],\n 'negative-700': COLOR_BASE_TONES.yellow[700],\n 'negative-800': COLOR_BASE_TONES.yellow[800],\n\n 'neutral-50': COLOR_BASE_TONES.grey[50],\n 'neutral-100': COLOR_BASE_TONES.grey[100],\n 'neutral-200': COLOR_BASE_TONES.grey[200],\n 'neutral-300': COLOR_BASE_TONES.grey[300],\n 'neutral-400': COLOR_BASE_TONES.grey[400],\n 'neutral-500': COLOR_BASE_TONES.grey[500],\n 'neutral-600': COLOR_BASE_TONES.grey[600],\n 'neutral-700': COLOR_BASE_TONES.grey[700],\n 'neutral-800': COLOR_BASE_TONES.grey[800],\n 'neutral-900': COLOR_BASE_TONES.grey[900],\n\n 'positive-100': COLOR_BASE_TONES.teal[100],\n 'positive-200': COLOR_BASE_TONES.teal[200],\n 'positive-300': COLOR_BASE_TONES.teal[300],\n 'positive-400': COLOR_BASE_TONES.teal[400],\n 'positive-500': COLOR_BASE_TONES.teal[500],\n 'positive-600': COLOR_BASE_TONES.teal[600],\n 'positive-700': COLOR_BASE_TONES.teal[700],\n 'positive-800': COLOR_BASE_TONES.teal[800]\n};\n","export const FONT = {\n family: {\n default: `Inter, 'Open Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`,\n epilogue: `Epilogue, 'Open Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`\n },\n\n letterspacing: {\n default: '0em',\n display: '-0.04em',\n headline: '-0.02em'\n },\n\n lineheight: {\n 16: '16px',\n 18: '18px',\n 22: '22px',\n 24: '24px',\n 26: '26px',\n 28: '28px',\n 32: '32px',\n 40: '40px',\n 42: '42px'\n },\n\n size: {\n 12: '12px',\n 14: '14px',\n 16: '16px',\n 18: '18px',\n 20: '20px',\n 24: '24px',\n 28: '28px',\n 32: '32px',\n 36: '36px'\n },\n\n weight: {\n regular: '400',\n medium: '500',\n 'semi-bold': '600',\n bold: '700'\n }\n};\n\n/* Typography tokens */\nexport const TYPE = {\n /** @experimental content typography tokens **/\n content: {\n desktop: {\n h1: `${FONT.weight['semi-bold']} ${FONT.size['36']} / ${FONT.lineheight['42']} ${FONT.family.default}`,\n h2: `${FONT.weight['semi-bold']} ${FONT.size['24']} / ${FONT.lineheight['32']} ${FONT.family.default}`,\n h3: `${FONT.weight['semi-bold']} ${FONT.size['20']} / ${FONT.lineheight['28']} ${FONT.family.default}`,\n p: `${FONT.weight.regular} ${FONT.size['16']} / ${FONT.lineheight['26']} ${FONT.family.default}`,\n strong: `${FONT.weight.medium} ${FONT.size['16']} / ${FONT.lineheight['26']} ${FONT.family.default}`\n },\n mobile: {\n h1: `${FONT.weight['semi-bold']} ${FONT.size['24']} / ${FONT.lineheight['32']} ${FONT.family.default}`,\n h2: `${FONT.weight['semi-bold']} ${FONT.size['20']} / ${FONT.lineheight['28']} ${FONT.family.default}`,\n h3: `${FONT.weight['semi-bold']} ${FONT.size['18']} / ${FONT.lineheight['26']} ${FONT.family.default}`,\n p: `${FONT.weight.regular} ${FONT.size['16']} / ${FONT.lineheight['26']} ${FONT.family.default}`,\n strong: `${FONT.weight.medium} ${FONT.size['16']} / ${FONT.lineheight['26']} ${FONT.family.default}`\n }\n },\n\n ui: {\n bodyLarge: `${FONT.weight.regular} ${FONT.size['18']} / ${FONT.lineheight['24']} ${FONT.family.default}`,\n bodyMiddle: `${FONT.weight.regular} ${FONT.size['16']} / ${FONT.lineheight['22']} ${FONT.family.default}`,\n bodySmall: `${FONT.weight.regular} ${FONT.size['14']} / ${FONT.lineheight['18']} ${FONT.family.default}`,\n bodyXSmall: `${FONT.weight.regular} ${FONT.size['12']} / ${FONT.lineheight['16']} ${FONT.family.default}`,\n display: `${FONT.weight.bold} ${FONT.size['24']} / ${FONT.lineheight['32']} ${FONT.family.default}`,\n labelLarge: `${FONT.weight.medium} ${FONT.size['18']} / ${FONT.lineheight['24']} ${FONT.family.default}`,\n labelMiddle: `${FONT.weight.medium} ${FONT.size['16']} / ${FONT.lineheight['22']} ${FONT.family.default}`,\n labelSmall: `${FONT.weight.medium} ${FONT.size['14']} / ${FONT.lineheight['18']} ${FONT.family.default}`,\n labelXSmall: `${FONT.weight.medium} ${FONT.size['12']} / ${FONT.lineheight['16']} ${FONT.family.default}`,\n titleLarge: `${FONT.weight['semi-bold']} ${FONT.size['18']} / ${FONT.lineheight['24']} ${FONT.family.default}`,\n titleMiddle: `${FONT.weight['semi-bold']} ${FONT.size['16']} / ${FONT.lineheight['22']} ${FONT.family.default}`,\n titleSmall: `${FONT.weight['semi-bold']} ${FONT.size['14']} / ${FONT.lineheight['18']} ${FONT.family.default}`\n }\n};\n","export const RADIUS = {\n 4: '4px',\n 6: '6px',\n 8: '8px',\n 16: '16px'\n};\n\n/**\n * The space tokens can be utilized for padding and margins.\n * Do NOT use it for height and width.\n */\nexport const SPACE = {\n 2: '2px',\n 4: '4px',\n 8: '8px',\n 12: '12px',\n 16: '16px',\n 24: '24px',\n 32: '32px',\n 40: '40px',\n 48: '48px',\n 56: '56px',\n 64: '64px',\n 72: '72px',\n 80: '80px',\n 88: '88px',\n 96: '96px'\n};\n","import studioDefault from './studioDefault';\nimport studioTheme from './studioTheme';\nimport brandTheme from './brandTheme';\n\nimport {StaffbaseDesignTheme} from '../theme';\n\nexport type PresetThemes = 'studioDefault' | 'studioTheme' | 'brandTheme';\n\nconst ThemeMap: Record = {\n studioDefault,\n studioTheme,\n brandTheme\n};\n\nexport default ThemeMap;\n","/** @deprecated use new theme studioTheme instead */\n\nimport tinycolor from 'tinycolor2';\n\nimport {\n BREAKPOINT,\n CHART_PALETTE,\n COLOR_BASE_TONES,\n COMPONENTS,\n FONT,\n MISC_PALETTE,\n PALETTE_CRITICAL,\n PALETTE_CYAN,\n PALETTE_INFO,\n PALETTE_NEUTRAL,\n PALETTE_PINK,\n PALETTE_PRIMARY,\n PALETTE_PURPLE,\n PALETTE_SUCCESS,\n PALETTE_TEAL,\n RADIUS,\n SPACE,\n TYPE\n} from '../baseValues';\nimport {StaffbaseDesignTheme} from '../theme';\n\nconst SHADOW = {\n /** @deprecated */\n get level1(): string {\n return `0px 2px 8px 0px ${tinycolor(COLOR_BASE_TONES.grey[900])\n .setAlpha(0.08)\n .toRgbString()}, 0px 2px 4px 0px ${tinycolor(COLOR_BASE_TONES.grey[900]).setAlpha(0.08).toRgbString()}`;\n },\n /** @deprecated */\n get level2(): string {\n return `0px 0px 16px 0px ${tinycolor(COLOR_BASE_TONES.grey[900])\n .setAlpha(0.08)\n .toRgbString()}, 0px 0px 12px 0px ${tinycolor(COLOR_BASE_TONES.grey[900]).setAlpha(0.08).toRgbString()}`;\n },\n /** @deprecated */\n get focus(): string {\n return `0px 0px 0px 2px ${COLOR_BASE_TONES.white}, 0px 0px 0px 4px ${COLOR_BASE_TONES.blue[500]}`;\n }\n};\n\nconst studioDefault: StaffbaseDesignTheme = {\n breakpoint: BREAKPOINT,\n colorTones: {\n black: COLOR_BASE_TONES.black,\n\n blue900: COLOR_BASE_TONES.blue[900],\n blue800: COLOR_BASE_TONES.blue[800],\n blue700: COLOR_BASE_TONES.blue[700],\n blue600: COLOR_BASE_TONES.blue[600],\n blue500: COLOR_BASE_TONES.blue[500],\n blue400: COLOR_BASE_TONES.blue[400],\n blue300: COLOR_BASE_TONES.blue[300],\n blue200: COLOR_BASE_TONES.blue[200],\n blue100: COLOR_BASE_TONES.blue[100],\n blue50: COLOR_BASE_TONES.blue[50],\n\n cyan900: COLOR_BASE_TONES.cyan[900],\n cyan800: COLOR_BASE_TONES.cyan[800],\n cyan700: COLOR_BASE_TONES.cyan[700],\n cyan600: COLOR_BASE_TONES.cyan[600],\n cyan500: COLOR_BASE_TONES.cyan[500],\n cyan400: COLOR_BASE_TONES.cyan[400],\n cyan300: COLOR_BASE_TONES.cyan[300],\n cyan200: COLOR_BASE_TONES.cyan[200],\n cyan100: COLOR_BASE_TONES.cyan[100],\n cyan50: COLOR_BASE_TONES.cyan[50],\n\n green900: COLOR_BASE_TONES.green[900],\n green800: COLOR_BASE_TONES.green[800],\n green700: COLOR_BASE_TONES.green[700],\n green600: COLOR_BASE_TONES.green[600],\n green500: COLOR_BASE_TONES.green[500],\n green400: COLOR_BASE_TONES.green[400],\n green300: COLOR_BASE_TONES.green[300],\n green200: COLOR_BASE_TONES.green[200],\n green100: COLOR_BASE_TONES.green[100],\n green50: COLOR_BASE_TONES.green[50],\n\n grey900: COLOR_BASE_TONES.grey[900],\n grey800: COLOR_BASE_TONES.grey[800],\n grey700: COLOR_BASE_TONES.grey[700],\n grey600: COLOR_BASE_TONES.grey[600],\n grey500: COLOR_BASE_TONES.grey[500],\n grey400: COLOR_BASE_TONES.grey[400],\n grey300: COLOR_BASE_TONES.grey[300],\n grey200: COLOR_BASE_TONES.grey[200],\n grey100: COLOR_BASE_TONES.grey[100],\n grey50: COLOR_BASE_TONES.grey[50],\n\n pink900: COLOR_BASE_TONES.pink[900],\n pink800: COLOR_BASE_TONES.pink[800],\n pink700: COLOR_BASE_TONES.pink[700],\n pink600: COLOR_BASE_TONES.pink[600],\n pink500: COLOR_BASE_TONES.pink[500],\n pink400: COLOR_BASE_TONES.pink[400],\n pink300: COLOR_BASE_TONES.pink[300],\n pink200: COLOR_BASE_TONES.pink[200],\n pink100: COLOR_BASE_TONES.pink[100],\n pink50: COLOR_BASE_TONES.pink[50],\n\n purple900: COLOR_BASE_TONES.purple[900],\n purple800: COLOR_BASE_TONES.purple[800],\n purple700: COLOR_BASE_TONES.purple[700],\n purple600: COLOR_BASE_TONES.purple[600],\n purple500: COLOR_BASE_TONES.purple[500],\n purple400: COLOR_BASE_TONES.purple[400],\n purple300: COLOR_BASE_TONES.purple[300],\n purple200: COLOR_BASE_TONES.purple[200],\n purple100: COLOR_BASE_TONES.purple[100],\n purple50: COLOR_BASE_TONES.purple[50],\n\n red900: COLOR_BASE_TONES.red[900],\n red800: COLOR_BASE_TONES.red[800],\n red700: COLOR_BASE_TONES.red[700],\n red600: COLOR_BASE_TONES.red[600],\n red500: COLOR_BASE_TONES.red[500],\n red400: COLOR_BASE_TONES.red[400],\n red300: COLOR_BASE_TONES.red[300],\n red200: COLOR_BASE_TONES.red[200],\n red100: COLOR_BASE_TONES.red[100],\n red50: COLOR_BASE_TONES.red[50],\n\n sbBlue900: COLOR_BASE_TONES.sbBlue[900],\n sbBlue800: COLOR_BASE_TONES.sbBlue[800],\n sbBlue700: COLOR_BASE_TONES.sbBlue[700],\n sbBlue600: COLOR_BASE_TONES.sbBlue[600],\n sbBlue500: COLOR_BASE_TONES.sbBlue[500],\n sbBlue400: COLOR_BASE_TONES.sbBlue[400],\n sbBlue300: COLOR_BASE_TONES.sbBlue[300],\n sbBlue200: COLOR_BASE_TONES.sbBlue[200],\n sbBlue100: COLOR_BASE_TONES.sbBlue[100],\n sbBlue50: COLOR_BASE_TONES.sbBlue[50],\n\n teal900: COLOR_BASE_TONES.teal[900],\n teal800: COLOR_BASE_TONES.teal[800],\n teal700: COLOR_BASE_TONES.teal[700],\n teal600: COLOR_BASE_TONES.teal[600],\n teal500: COLOR_BASE_TONES.teal[500],\n teal400: COLOR_BASE_TONES.teal[400],\n teal300: COLOR_BASE_TONES.teal[300],\n teal200: COLOR_BASE_TONES.teal[200],\n teal100: COLOR_BASE_TONES.teal[100],\n teal50: COLOR_BASE_TONES.teal[50],\n\n yellow900: COLOR_BASE_TONES.yellow[900],\n yellow800: COLOR_BASE_TONES.yellow[800],\n yellow700: COLOR_BASE_TONES.yellow[700],\n yellow600: COLOR_BASE_TONES.yellow[600],\n yellow500: COLOR_BASE_TONES.yellow[500],\n yellow400: COLOR_BASE_TONES.yellow[400],\n yellow300: COLOR_BASE_TONES.yellow[300],\n yellow200: COLOR_BASE_TONES.yellow[200],\n yellow100: COLOR_BASE_TONES.yellow[100],\n yellow50: COLOR_BASE_TONES.yellow[50],\n\n white: COLOR_BASE_TONES.white\n },\n color: {\n /* BRAND TOKENS\n * Do not use these tokens, adding them to adhere to the StaffbaseDesignTheme structure\n */\n brand: COLOR_BASE_TONES.blue[600],\n brand900: COLOR_BASE_TONES.blue[900],\n brand800: COLOR_BASE_TONES.blue[800],\n brand700: COLOR_BASE_TONES.blue[700],\n brand600: COLOR_BASE_TONES.blue[600],\n brand500: COLOR_BASE_TONES.blue[500],\n brand400: COLOR_BASE_TONES.blue[400],\n brand300: COLOR_BASE_TONES.blue[300],\n brand200: COLOR_BASE_TONES.blue[200],\n brand100: COLOR_BASE_TONES.blue[100],\n brand50: COLOR_BASE_TONES.blue[50],\n brandInverse: COLOR_BASE_TONES.white,\n\n /* BACKGROUND TOKENS */\n criticalBackgroundVivid: PALETTE_CRITICAL.background.vivid,\n criticalBackgroundVividHover: PALETTE_CRITICAL.background['vivid-hover'],\n criticalBackgroundVividPressed: PALETTE_CRITICAL.background['vivid-pressed'],\n criticalBackgroundMedium: PALETTE_CRITICAL.background.medium,\n criticalBackgroundMediumHover: PALETTE_CRITICAL.background['medium-hover'],\n criticalBackgroundMediumPressed: PALETTE_CRITICAL.background['medium-pressed'],\n criticalBackgroundWeak: PALETTE_CRITICAL.background.weak,\n criticalBackgroundWeakHover: PALETTE_CRITICAL.background['weak-hover'],\n criticalBackgroundWeakPressed: PALETTE_CRITICAL.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n criticalBackgroundTransparent: PALETTE_CRITICAL.background.transparent,\n /** @deprecated use inverse tokens instead */\n criticalBackgroundTransparentHover: PALETTE_CRITICAL.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n criticalBackgroundTransparentPressed: PALETTE_CRITICAL.background['transparent-pressed'],\n criticalBackgroundInverse: PALETTE_CRITICAL.background.inverse,\n criticalBackgroundInverseHover: PALETTE_CRITICAL.background['inverse-hover'],\n criticalBackgroundInversePressed: PALETTE_CRITICAL.background['inverse-pressed'],\n\n cyanBackgroundVivid: PALETTE_CYAN.background.vivid,\n cyanBackgroundVividHover: PALETTE_CYAN.background['vivid-hover'],\n cyanBackgroundVividPressed: PALETTE_CYAN.background['vivid-pressed'],\n cyanBackgroundMedium: PALETTE_CYAN.background.medium,\n cyanBackgroundMediumHover: PALETTE_CYAN.background['medium-hover'],\n cyanBackgroundMediumPressed: PALETTE_CYAN.background['medium-pressed'],\n cyanBackgroundWeak: PALETTE_CYAN.background.weak,\n cyanBackgroundWeakHover: PALETTE_CYAN.background['weak-hover'],\n cyanBackgroundWeakPressed: PALETTE_CYAN.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n cyanBackgroundTransparent: PALETTE_CYAN.background.transparent,\n /** @deprecated use inverse tokens instead */\n cyanBackgroundTransparentHover: PALETTE_CYAN.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n cyanBackgroundTransparentPressed: PALETTE_CYAN.background['transparent-pressed'],\n cyanBackgroundInverse: PALETTE_CYAN.background.inverse,\n cyanBackgroundInverseHover: PALETTE_CYAN.background['inverse-hover'],\n cyanBackgroundInversePressed: PALETTE_CYAN.background['inverse-pressed'],\n\n infoBackgroundVivid: PALETTE_INFO.background.vivid,\n infoBackgroundVividHover: PALETTE_INFO.background['vivid-hover'],\n infoBackgroundVividPressed: PALETTE_INFO.background['vivid-pressed'],\n infoBackgroundMedium: PALETTE_INFO.background.medium,\n infoBackgroundMediumHover: PALETTE_INFO.background['medium-hover'],\n infoBackgroundMediumPressed: PALETTE_INFO.background['medium-pressed'],\n infoBackgroundWeak: PALETTE_INFO.background.weak,\n infoBackgroundWeakHover: PALETTE_INFO.background['weak-hover'],\n infoBackgroundWeakPressed: PALETTE_INFO.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n infoBackgroundTransparent: PALETTE_INFO.background.transparent,\n /** @deprecated use inverse tokens instead */\n infoBackgroundTransparentHover: PALETTE_INFO.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n infoBackgroundTransparentPressed: PALETTE_INFO.background['transparent-pressed'],\n infoBackgroundInverse: PALETTE_INFO.background.inverse,\n infoBackgroundInverseHover: PALETTE_INFO.background['inverse-hover'],\n infoBackgroundInversePressed: PALETTE_INFO.background['inverse-pressed'],\n\n neutralBackgroundStrong: PALETTE_NEUTRAL.background.strong,\n neutralBackgroundStrongHover: PALETTE_NEUTRAL.background['strong-hover'],\n neutralBackgroundStrongPressed: PALETTE_NEUTRAL.background['strong-pressed'],\n neutralBackgroundMedium: PALETTE_NEUTRAL.background.medium,\n neutralBackgroundMediumHover: PALETTE_NEUTRAL.background['medium-hover'],\n neutralBackgroundMediumPressed: PALETTE_NEUTRAL.background['medium-pressed'],\n neutralBackgroundBase: PALETTE_NEUTRAL.background.base,\n neutralBackgroundBaseHover: PALETTE_NEUTRAL.background['base-hover'],\n neutralBackgroundBasePressed: PALETTE_NEUTRAL.background['base-pressed'],\n neutralBackgroundSurface: PALETTE_NEUTRAL.background.surface,\n neutralBackgroundSurfaceHover: PALETTE_NEUTRAL.background['surface-hover'],\n neutralBackgroundSurfacePressed: PALETTE_NEUTRAL.background['surface-pressed'],\n\n pinkBackgroundVivid: PALETTE_PINK.background.vivid,\n pinkBackgroundVividHover: PALETTE_PINK.background['vivid-hover'],\n pinkBackgroundVividPressed: PALETTE_PINK.background['vivid-pressed'],\n pinkBackgroundMedium: PALETTE_PINK.background.medium,\n pinkBackgroundMediumHover: PALETTE_PINK.background['medium-hover'],\n pinkBackgroundMediumPressed: PALETTE_PINK.background['medium-pressed'],\n pinkBackgroundWeak: PALETTE_PINK.background.weak,\n pinkBackgroundWeakHover: PALETTE_PINK.background['weak-hover'],\n pinkBackgroundWeakPressed: PALETTE_PINK.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n pinkBackgroundTransparent: PALETTE_PINK.background.transparent,\n /** @deprecated use inverse tokens instead */\n pinkBackgroundTransparentHover: PALETTE_PINK.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n pinkBackgroundTransparentPressed: PALETTE_PINK.background['transparent-pressed'],\n pinkBackgroundInverse: PALETTE_PINK.background.inverse,\n pinkBackgroundInverseHover: PALETTE_PINK.background['inverse-hover'],\n pinkBackgroundInversePressed: PALETTE_PINK.background['inverse-pressed'],\n\n primaryBackgroundVivid: PALETTE_PRIMARY.background.vivid,\n primaryBackgroundVividHover: PALETTE_PRIMARY.background['vivid-hover'],\n primaryBackgroundVividPressed: PALETTE_PRIMARY.background['vivid-pressed'],\n primaryBackgroundMedium: PALETTE_PRIMARY.background.medium,\n primaryBackgroundMediumHover: PALETTE_PRIMARY.background['medium-hover'],\n primaryBackgroundMediumPressed: PALETTE_PRIMARY.background['medium-pressed'],\n primaryBackgroundWeak: PALETTE_PRIMARY.background.weak,\n primaryBackgroundWeakHover: PALETTE_PRIMARY.background['weak-hover'],\n primaryBackgroundWeakPressed: PALETTE_PRIMARY.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n primaryBackgroundTransparent: PALETTE_PRIMARY.background.transparent,\n /** @deprecated use inverse tokens instead */\n primaryBackgroundTransparentHover: PALETTE_PRIMARY.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n primaryBackgroundTransparentPressed: PALETTE_PRIMARY.background['transparent-pressed'],\n primaryBackgroundInverse: PALETTE_PRIMARY.background.inverse,\n primaryBackgroundInverseHover: PALETTE_PRIMARY.background['inverse-hover'],\n primaryBackgroundInversePressed: PALETTE_PRIMARY.background['inverse-pressed'],\n\n purpleBackgroundVivid: PALETTE_PURPLE.background.vivid,\n purpleBackgroundVividHover: PALETTE_PURPLE.background['vivid-hover'],\n purpleBackgroundVividPressed: PALETTE_PURPLE.background['vivid-pressed'],\n purpleBackgroundMedium: PALETTE_PURPLE.background.medium,\n purpleBackgroundMediumHover: PALETTE_PURPLE.background['medium-hover'],\n purpleBackgroundMediumPressed: PALETTE_PURPLE.background['medium-pressed'],\n purpleBackgroundWeak: PALETTE_PURPLE.background.weak,\n purpleBackgroundWeakHover: PALETTE_PURPLE.background['weak-hover'],\n purpleBackgroundWeakPressed: PALETTE_PURPLE.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n purpleBackgroundTransparent: PALETTE_PURPLE.background.transparent,\n /** @deprecated use inverse tokens instead */\n purpleBackgroundTransparentHover: PALETTE_PURPLE.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n purpleBackgroundTransparentPressed: PALETTE_PURPLE.background['transparent-pressed'],\n purpleBackgroundInverse: PALETTE_PURPLE.background.inverse,\n purpleBackgroundInverseHover: PALETTE_PURPLE.background['inverse-hover'],\n purpleBackgroundInversePressed: PALETTE_PURPLE.background['inverse-pressed'],\n\n successBackgroundVivid: PALETTE_SUCCESS.background.vivid,\n successBackgroundVividHover: PALETTE_SUCCESS.background['vivid-hover'],\n successBackgroundVividPressed: PALETTE_SUCCESS.background['vivid-pressed'],\n successBackgroundMedium: PALETTE_SUCCESS.background.medium,\n successBackgroundMediumHover: PALETTE_SUCCESS.background['medium-hover'],\n successBackgroundMediumPressed: PALETTE_SUCCESS.background['medium-pressed'],\n successBackgroundWeak: PALETTE_SUCCESS.background.weak,\n successBackgroundWeakHover: PALETTE_SUCCESS.background['weak-hover'],\n successBackgroundWeakPressed: PALETTE_SUCCESS.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n successBackgroundTransparent: PALETTE_SUCCESS.background.transparent,\n /** @deprecated use inverse tokens instead */\n successBackgroundTransparentHover: PALETTE_SUCCESS.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n successBackgroundTransparentPressed: PALETTE_SUCCESS.background['transparent-pressed'],\n successBackgroundInverse: PALETTE_SUCCESS.background.inverse,\n successBackgroundInverseHover: PALETTE_SUCCESS.background['inverse-hover'],\n successBackgroundInversePressed: PALETTE_SUCCESS.background['inverse-pressed'],\n\n tealBackgroundVivid: PALETTE_TEAL.background.vivid,\n tealBackgroundVividHover: PALETTE_TEAL.background['vivid-hover'],\n tealBackgroundVividPressed: PALETTE_TEAL.background['vivid-pressed'],\n tealBackgroundMedium: PALETTE_TEAL.background.medium,\n tealBackgroundMediumHover: PALETTE_TEAL.background['medium-hover'],\n tealBackgroundMediumPressed: PALETTE_TEAL.background['medium-pressed'],\n tealBackgroundWeak: PALETTE_TEAL.background.weak,\n tealBackgroundWeakHover: PALETTE_TEAL.background['weak-hover'],\n tealBackgroundWeakPressed: PALETTE_TEAL.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n tealBackgroundTransparent: PALETTE_TEAL.background.transparent,\n /** @deprecated use inverse tokens instead */\n tealBackgroundTransparentHover: PALETTE_TEAL.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n tealBackgroundTransparentPressed: PALETTE_TEAL.background['transparent-pressed'],\n tealBackgroundInverse: PALETTE_TEAL.background.inverse,\n tealBackgroundInverseHover: PALETTE_TEAL.background['inverse-hover'],\n tealBackgroundInversePressed: PALETTE_TEAL.background['inverse-pressed'],\n\n /* TEXT TOKENS */\n criticalTextVivid: PALETTE_CRITICAL.text.vivid,\n criticalTextStrong: PALETTE_CRITICAL.text.strong,\n criticalTextInverse: PALETTE_CRITICAL.text.inverse,\n\n cyanTextVivid: PALETTE_CYAN.text.vivid,\n cyanTextStrong: PALETTE_CYAN.text.strong,\n cyanTextInverse: PALETTE_CYAN.text.inverse,\n\n infoTextVivid: PALETTE_INFO.text.vivid,\n infoTextStrong: PALETTE_INFO.text.strong,\n infoTextInverse: PALETTE_INFO.text.inverse,\n\n neutralTextStrong: PALETTE_NEUTRAL.text.strong,\n neutralTextMedium: PALETTE_NEUTRAL.text.medium,\n neutralTextPlaceholder: PALETTE_NEUTRAL.text.placeholder,\n neutralTextInverse: PALETTE_NEUTRAL.text.inverse,\n\n pinkTextVivid: PALETTE_PINK.text.vivid,\n pinkTextStrong: PALETTE_PINK.text.strong,\n pinkTextInverse: PALETTE_PINK.text.inverse,\n\n primaryTextVivid: PALETTE_PRIMARY.text.vivid,\n primaryTextStrong: PALETTE_PRIMARY.text.strong,\n primaryTextInverse: PALETTE_PRIMARY.text.inverse,\n\n purpleTextVivid: PALETTE_PURPLE.text.vivid,\n purpleTextStrong: PALETTE_PURPLE.text.strong,\n purpleTextInverse: PALETTE_PURPLE.text.inverse,\n\n successTextVivid: PALETTE_SUCCESS.text.vivid,\n successTextStrong: PALETTE_SUCCESS.text.strong,\n successTextInverse: PALETTE_SUCCESS.text.inverse,\n\n tealTextVivid: PALETTE_TEAL.text.vivid,\n tealTextStrong: PALETTE_TEAL.text.strong,\n tealTextInverse: PALETTE_TEAL.text.inverse,\n\n /* ICON TOKENS */\n criticalIconVivid: PALETTE_CRITICAL.text['icon-vivid'],\n criticalIconInverse: PALETTE_CRITICAL.text['icon-inverse'],\n\n cyanIconVivid: PALETTE_CYAN.text['icon-vivid'],\n cyanIconInverse: PALETTE_CYAN.text['icon-inverse'],\n\n infoIconVivid: PALETTE_INFO.text['icon-vivid'],\n infoIconInverse: PALETTE_INFO.text['icon-inverse'],\n\n neutralIconStrong: PALETTE_NEUTRAL.text['icon-strong'],\n neutralIconMedium: PALETTE_NEUTRAL.text['icon-medium'],\n neutralIconWeak: PALETTE_NEUTRAL.text['icon-weak'],\n neutralIconInverse: PALETTE_NEUTRAL.text['icon-inverse'],\n\n pinkIconVivid: PALETTE_PINK.text['icon-vivid'],\n pinkIconInverse: PALETTE_PINK.text['icon-inverse'],\n\n primaryIconVivid: PALETTE_PRIMARY.text['icon-vivid'],\n primaryIconInverse: PALETTE_PRIMARY.text['icon-inverse'],\n\n purpleIconVivid: PALETTE_PURPLE.text['icon-vivid'],\n purpleIconInverse: PALETTE_PURPLE.text['icon-inverse'],\n\n successIconVivid: PALETTE_SUCCESS.text['icon-vivid'],\n successIconInverse: PALETTE_SUCCESS.text['icon-inverse'],\n\n tealIconVivid: PALETTE_TEAL.text['icon-vivid'],\n tealIconInverse: PALETTE_TEAL.text['icon-inverse'],\n\n /* BORDER TOKENS */\n criticalBorder: PALETTE_CRITICAL.border,\n\n cyanBorder: PALETTE_CYAN.border,\n\n infoBorder: PALETTE_INFO.border,\n\n neutralBorderWeak: PALETTE_NEUTRAL.border.weak,\n neutralBorderMedium: PALETTE_NEUTRAL.border.medium,\n neutralBorderStrong: PALETTE_NEUTRAL.border.strong,\n\n pinkBorder: PALETTE_PINK.border,\n\n primaryBorder: PALETTE_PRIMARY.border,\n\n purpleBorder: PALETTE_PURPLE.border,\n\n successBorder: PALETTE_SUCCESS.border,\n\n tealBorder: PALETTE_TEAL.border,\n\n /*Component Tokens */\n components: {\n //Badge\n criticalBackgroundBadge: COMPONENTS.badge.background.critical,\n primaryBackgroundBadge: COMPONENTS.badge.background.primary,\n\n criticalTextBadge: COMPONENTS.badge.text['critical'],\n primaryTextBadge: COMPONENTS.badge.text['primary'],\n\n //Button\n criticalBackgroundButton: COMPONENTS.button.background.critical,\n criticalBackgroundButtonHover: COMPONENTS.button.background['critical-hover'],\n criticalBackgroundButtonPressed: COMPONENTS.button.background['critical-pressed'],\n criticalBackgroundInverseButton: COMPONENTS.button.background['critical-inverse'],\n criticalBackgroundInverseButtonHover: COMPONENTS.button.background['critical-inverse-hover'],\n criticalBackgroundInverseButtonPressed: COMPONENTS.button.background['critical-inverse-pressed'],\n\n primaryBackgroundButton: COMPONENTS.button.background.primary,\n primaryBackgroundButtonHover: COMPONENTS.button.background['primary-hover'],\n primaryBackgroundButtonPressed: COMPONENTS.button.background['primary-pressed'],\n primaryBackgroundInverseButton: COMPONENTS.button.background['primary-inverse'],\n primaryBackgroundInverseButtonHover: COMPONENTS.button.background['primary-inverse-hover'],\n primaryBackgroundInverseButtonPressed: COMPONENTS.button.background['primary-inverse-pressed'],\n\n criticalTextButton: COMPONENTS.button.text.critical,\n criticalTextInverseButton: COMPONENTS.button.text['critical-inverse'],\n primaryTextButton: COMPONENTS.button.text.primary,\n primaryTextInverseButton: COMPONENTS.button.text['primary-inverse'],\n\n criticalIconButton: COMPONENTS.button.text['critical-icon-inverse'],\n criticalIconInverseButton: COMPONENTS.button.text['critical-icon'],\n primaryIconButton: COMPONENTS.button.text['primary-icon-inverse'],\n primaryIconInverseButton: COMPONENTS.button.text['primary-icon'],\n\n //GhostButton\n criticalBackgroundGhostButtonHover: COMPONENTS.ghostButton.background['critical-inverse-hover'],\n criticalBackgroundGhostButtonPressed: COMPONENTS.ghostButton.background['critical-inverse-pressed'],\n criticalBackgroundGhostButtonInverseHover: COMPONENTS.ghostButton.background['critical-hover'],\n criticalBackgroundGhostButtonInversePressed: COMPONENTS.ghostButton.background['critical-pressed'],\n primaryBackgroundGhostButtonHover: COMPONENTS.ghostButton.background['primary-inverse-hover'],\n primaryBackgroundGhostButtonPressed: COMPONENTS.ghostButton.background['primary-inverse-pressed'],\n primaryBackgroundGhostButtonInverseHover: COMPONENTS.ghostButton.background['primary-hover'],\n primaryBackgroundGhostButtonInversePressed: COMPONENTS.ghostButton.background['primary-pressed'],\n\n criticalTextGhostButton: COMPONENTS.ghostButton.text.critical,\n criticalTextInverseGhostButton: COMPONENTS.ghostButton.text['critical-inverse'],\n primaryTextGhostButton: COMPONENTS.ghostButton.text.primary,\n primaryTextInverseGhostButton: COMPONENTS.ghostButton.text['primary-inverse'],\n\n criticalIconGhostButton: COMPONENTS.ghostButton.text['critical-icon'],\n criticalIconInverseGhostButton: COMPONENTS.ghostButton.text['critical-icon-inverse'],\n primaryIconGhostButton: COMPONENTS.ghostButton.text['primary-icon'],\n primaryIconInverseGhostButton: COMPONENTS.ghostButton.text['primary-icon-inverse'],\n\n //Nav\n backgroundNavAppIntranet: COMPONENTS.nav.background['appintranet'],\n backgroundNavAppIntranetHover: COMPONENTS.nav.background['appintranet-hover'],\n backgroundNavAppIntranetPressed: COMPONENTS.nav.background['appintranet-pressed'],\n textNavAppIntranet: COMPONENTS.nav.text['appintranet'],\n textNavAppIntranetHover: COMPONENTS.nav.text['appintranet-hover'],\n textNavAppIntranetPressed: COMPONENTS.nav.text['appintranet-pressed'],\n accentNavAppIntranet: COMPONENTS.nav.background['appintranet-accent'],\n accentNavAppIntranetHover: COMPONENTS.nav.background['appintranet-accent-hover'],\n accentNavAppIntranetPressed: COMPONENTS.nav.background['appintranet-accent-pressed'],\n backgroundNavAppIntranetSearch: COMPONENTS.nav.background['appintranet-search'],\n backgroundNavAppIntranetSearchHover: COMPONENTS.nav.background['appintranet-search-hover'],\n backgroundNavAppIntranetSearchActive: COMPONENTS.nav.background['appintranet-search-active'],\n textNavAppIntranetSearch: COMPONENTS.nav.text['appintranet-search'],\n textNavAppIntranetSearchActive: COMPONENTS.nav.text['appintranet-search-active'],\n\n //Link\n textLink: COMPONENTS.link.text.link\n },\n ...MISC_PALETTE,\n charts: {\n negative100: CHART_PALETTE['negative-100'],\n negative200: CHART_PALETTE['negative-200'],\n negative300: CHART_PALETTE['negative-300'],\n negative400: CHART_PALETTE['negative-400'],\n negative500: CHART_PALETTE['negative-500'],\n negative600: CHART_PALETTE['negative-600'],\n negative700: CHART_PALETTE['negative-700'],\n negative800: CHART_PALETTE['negative-800'],\n\n neutral50: CHART_PALETTE['neutral-50'],\n neutral100: CHART_PALETTE['neutral-100'],\n neutral200: CHART_PALETTE['neutral-200'],\n neutral300: CHART_PALETTE['neutral-300'],\n neutral400: CHART_PALETTE['neutral-400'],\n neutral500: CHART_PALETTE['neutral-500'],\n neutral600: CHART_PALETTE['neutral-600'],\n neutral700: CHART_PALETTE['neutral-700'],\n neutral800: CHART_PALETTE['neutral-800'],\n neutral900: CHART_PALETTE['neutral-900'],\n\n positive100: CHART_PALETTE['positive-100'],\n positive200: CHART_PALETTE['positive-200'],\n positive300: CHART_PALETTE['positive-300'],\n positive400: CHART_PALETTE['positive-400'],\n positive500: CHART_PALETTE['positive-500'],\n positive600: CHART_PALETTE['positive-600'],\n positive700: CHART_PALETTE['positive-700'],\n positive800: CHART_PALETTE['positive-800']\n }\n },\n font: {\n family: FONT.family,\n letterspacing: FONT.letterspacing,\n size: FONT.size,\n lineheight: FONT.lineheight,\n weight: {\n regular: FONT.weight.regular,\n medium: FONT.weight.medium,\n semiBold: FONT.weight['semi-bold'],\n bold: FONT.weight.bold\n }\n },\n radius: RADIUS,\n shadow: SHADOW,\n space: SPACE,\n type: TYPE\n};\n\nexport default studioDefault;\n","import tinycolor from 'tinycolor2';\n\nimport {\n BREAKPOINT,\n CHART_PALETTE,\n COLOR_BASE_TONES,\n COMPONENTS,\n FONT,\n MISC_PALETTE,\n PALETTE_CRITICAL,\n PALETTE_CYAN,\n PALETTE_INFO,\n PALETTE_NEUTRAL,\n PALETTE_PINK,\n PALETTE_PRIMARY,\n PALETTE_PURPLE,\n PALETTE_SUCCESS,\n PALETTE_TEAL,\n RADIUS,\n SPACE,\n TYPE\n} from '../baseValues';\nimport {StaffbaseDesignTheme} from '../theme';\n\nconst SHADOW = {\n get level1(): string {\n return `0px 2px 8px 0px ${tinycolor(COLOR_BASE_TONES.grey[900])\n .setAlpha(0.08)\n .toRgbString()}, 0px 2px 4px 0px ${tinycolor(COLOR_BASE_TONES.grey[900]).setAlpha(0.08).toRgbString()}`;\n },\n get level2(): string {\n return `0px 0px 16px 0px ${tinycolor(COLOR_BASE_TONES.grey[900])\n .setAlpha(0.08)\n .toRgbString()}, 0px 0px 12px 0px ${tinycolor(COLOR_BASE_TONES.grey[900]).setAlpha(0.08).toRgbString()}`;\n },\n get focus(): string {\n return `0px 0px 0px 2px ${COLOR_BASE_TONES.white}, 0px 0px 0px 4px ${COLOR_BASE_TONES.blue[500]}`;\n }\n};\n\nconst studioTheme: StaffbaseDesignTheme = {\n breakpoint: BREAKPOINT,\n colorTones: {\n black: COLOR_BASE_TONES.black,\n\n blue900: COLOR_BASE_TONES.blue[900],\n blue800: COLOR_BASE_TONES.blue[800],\n blue700: COLOR_BASE_TONES.blue[700],\n blue600: COLOR_BASE_TONES.blue[600],\n blue500: COLOR_BASE_TONES.blue[500],\n blue400: COLOR_BASE_TONES.blue[400],\n blue300: COLOR_BASE_TONES.blue[300],\n blue200: COLOR_BASE_TONES.blue[200],\n blue100: COLOR_BASE_TONES.blue[100],\n blue50: COLOR_BASE_TONES.blue[50],\n\n cyan900: COLOR_BASE_TONES.cyan[900],\n cyan800: COLOR_BASE_TONES.cyan[800],\n cyan700: COLOR_BASE_TONES.cyan[700],\n cyan600: COLOR_BASE_TONES.cyan[600],\n cyan500: COLOR_BASE_TONES.cyan[500],\n cyan400: COLOR_BASE_TONES.cyan[400],\n cyan300: COLOR_BASE_TONES.cyan[300],\n cyan200: COLOR_BASE_TONES.cyan[200],\n cyan100: COLOR_BASE_TONES.cyan[100],\n cyan50: COLOR_BASE_TONES.cyan[50],\n\n green900: COLOR_BASE_TONES.green[900],\n green800: COLOR_BASE_TONES.green[800],\n green700: COLOR_BASE_TONES.green[700],\n green600: COLOR_BASE_TONES.green[600],\n green500: COLOR_BASE_TONES.green[500],\n green400: COLOR_BASE_TONES.green[400],\n green300: COLOR_BASE_TONES.green[300],\n green200: COLOR_BASE_TONES.green[200],\n green100: COLOR_BASE_TONES.green[100],\n green50: COLOR_BASE_TONES.green[50],\n\n grey900: COLOR_BASE_TONES.grey[900],\n grey800: COLOR_BASE_TONES.grey[800],\n grey700: COLOR_BASE_TONES.grey[700],\n grey600: COLOR_BASE_TONES.grey[600],\n grey500: COLOR_BASE_TONES.grey[500],\n grey400: COLOR_BASE_TONES.grey[400],\n grey300: COLOR_BASE_TONES.grey[300],\n grey200: COLOR_BASE_TONES.grey[200],\n grey100: COLOR_BASE_TONES.grey[100],\n grey50: COLOR_BASE_TONES.grey[50],\n\n pink900: COLOR_BASE_TONES.pink[900],\n pink800: COLOR_BASE_TONES.pink[800],\n pink700: COLOR_BASE_TONES.pink[700],\n pink600: COLOR_BASE_TONES.pink[600],\n pink500: COLOR_BASE_TONES.pink[500],\n pink400: COLOR_BASE_TONES.pink[400],\n pink300: COLOR_BASE_TONES.pink[300],\n pink200: COLOR_BASE_TONES.pink[200],\n pink100: COLOR_BASE_TONES.pink[100],\n pink50: COLOR_BASE_TONES.pink[50],\n\n purple900: COLOR_BASE_TONES.purple[900],\n purple800: COLOR_BASE_TONES.purple[800],\n purple700: COLOR_BASE_TONES.purple[700],\n purple600: COLOR_BASE_TONES.purple[600],\n purple500: COLOR_BASE_TONES.purple[500],\n purple400: COLOR_BASE_TONES.purple[400],\n purple300: COLOR_BASE_TONES.purple[300],\n purple200: COLOR_BASE_TONES.purple[200],\n purple100: COLOR_BASE_TONES.purple[100],\n purple50: COLOR_BASE_TONES.purple[50],\n\n red900: COLOR_BASE_TONES.red[900],\n red800: COLOR_BASE_TONES.red[800],\n red700: COLOR_BASE_TONES.red[700],\n red600: COLOR_BASE_TONES.red[600],\n red500: COLOR_BASE_TONES.red[500],\n red400: COLOR_BASE_TONES.red[400],\n red300: COLOR_BASE_TONES.red[300],\n red200: COLOR_BASE_TONES.red[200],\n red100: COLOR_BASE_TONES.red[100],\n red50: COLOR_BASE_TONES.red[50],\n\n sbBlue900: COLOR_BASE_TONES.sbBlue[900],\n sbBlue800: COLOR_BASE_TONES.sbBlue[800],\n sbBlue700: COLOR_BASE_TONES.sbBlue[700],\n sbBlue600: COLOR_BASE_TONES.sbBlue[600],\n sbBlue500: COLOR_BASE_TONES.sbBlue[500],\n sbBlue400: COLOR_BASE_TONES.sbBlue[400],\n sbBlue300: COLOR_BASE_TONES.sbBlue[300],\n sbBlue200: COLOR_BASE_TONES.sbBlue[200],\n sbBlue100: COLOR_BASE_TONES.sbBlue[100],\n sbBlue50: COLOR_BASE_TONES.sbBlue[50],\n\n teal900: COLOR_BASE_TONES.teal[900],\n teal800: COLOR_BASE_TONES.teal[800],\n teal700: COLOR_BASE_TONES.teal[700],\n teal600: COLOR_BASE_TONES.teal[600],\n teal500: COLOR_BASE_TONES.teal[500],\n teal400: COLOR_BASE_TONES.teal[400],\n teal300: COLOR_BASE_TONES.teal[300],\n teal200: COLOR_BASE_TONES.teal[200],\n teal100: COLOR_BASE_TONES.teal[100],\n teal50: COLOR_BASE_TONES.teal[50],\n\n yellow900: COLOR_BASE_TONES.yellow[900],\n yellow800: COLOR_BASE_TONES.yellow[800],\n yellow700: COLOR_BASE_TONES.yellow[700],\n yellow600: COLOR_BASE_TONES.yellow[600],\n yellow500: COLOR_BASE_TONES.yellow[500],\n yellow400: COLOR_BASE_TONES.yellow[400],\n yellow300: COLOR_BASE_TONES.yellow[300],\n yellow200: COLOR_BASE_TONES.yellow[200],\n yellow100: COLOR_BASE_TONES.yellow[100],\n yellow50: COLOR_BASE_TONES.yellow[50],\n\n white: COLOR_BASE_TONES.white\n },\n color: {\n /* BRAND TOKENS */\n brand: COLOR_BASE_TONES.blue[600],\n brand900: COLOR_BASE_TONES.blue[900],\n brand800: COLOR_BASE_TONES.blue[800],\n brand700: COLOR_BASE_TONES.blue[700],\n brand600: COLOR_BASE_TONES.blue[600],\n brand500: COLOR_BASE_TONES.blue[500],\n brand400: COLOR_BASE_TONES.blue[400],\n brand300: COLOR_BASE_TONES.blue[300],\n brand200: COLOR_BASE_TONES.blue[200],\n brand100: COLOR_BASE_TONES.blue[100],\n brand50: COLOR_BASE_TONES.blue[50],\n brandInverse: COLOR_BASE_TONES.white,\n\n /* BACKGROUND TOKENS */\n criticalBackgroundVivid: PALETTE_CRITICAL.background.vivid,\n criticalBackgroundVividHover: PALETTE_CRITICAL.background['vivid-hover'],\n criticalBackgroundVividPressed: PALETTE_CRITICAL.background['vivid-pressed'],\n criticalBackgroundMedium: PALETTE_CRITICAL.background.medium,\n criticalBackgroundMediumHover: PALETTE_CRITICAL.background['medium-hover'],\n criticalBackgroundMediumPressed: PALETTE_CRITICAL.background['medium-pressed'],\n criticalBackgroundWeak: PALETTE_CRITICAL.background.weak,\n criticalBackgroundWeakHover: PALETTE_CRITICAL.background['weak-hover'],\n criticalBackgroundWeakPressed: PALETTE_CRITICAL.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n criticalBackgroundTransparent: PALETTE_CRITICAL.background.transparent,\n /** @deprecated use inverse tokens instead */\n criticalBackgroundTransparentHover: PALETTE_CRITICAL.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n criticalBackgroundTransparentPressed: PALETTE_CRITICAL.background['transparent-pressed'],\n criticalBackgroundInverse: PALETTE_CRITICAL.background.inverse,\n criticalBackgroundInverseHover: PALETTE_CRITICAL.background['inverse-hover'],\n criticalBackgroundInversePressed: PALETTE_CRITICAL.background['inverse-pressed'],\n\n cyanBackgroundVivid: PALETTE_CYAN.background.vivid,\n cyanBackgroundVividHover: PALETTE_CYAN.background['vivid-hover'],\n cyanBackgroundVividPressed: PALETTE_CYAN.background['vivid-pressed'],\n cyanBackgroundMedium: PALETTE_CYAN.background.medium,\n cyanBackgroundMediumHover: PALETTE_CYAN.background['medium-hover'],\n cyanBackgroundMediumPressed: PALETTE_CYAN.background['medium-pressed'],\n cyanBackgroundWeak: PALETTE_CYAN.background.weak,\n cyanBackgroundWeakHover: PALETTE_CYAN.background['weak-hover'],\n cyanBackgroundWeakPressed: PALETTE_CYAN.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n cyanBackgroundTransparent: PALETTE_CYAN.background.transparent,\n /** @deprecated use inverse tokens instead */\n cyanBackgroundTransparentHover: PALETTE_CYAN.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n cyanBackgroundTransparentPressed: PALETTE_CYAN.background['transparent-pressed'],\n cyanBackgroundInverse: PALETTE_CYAN.background.inverse,\n cyanBackgroundInverseHover: PALETTE_CYAN.background['inverse-hover'],\n cyanBackgroundInversePressed: PALETTE_CYAN.background['inverse-pressed'],\n\n infoBackgroundVivid: PALETTE_INFO.background.vivid,\n infoBackgroundVividHover: PALETTE_INFO.background['vivid-hover'],\n infoBackgroundVividPressed: PALETTE_INFO.background['vivid-pressed'],\n infoBackgroundMedium: PALETTE_INFO.background.medium,\n infoBackgroundMediumHover: PALETTE_INFO.background['medium-hover'],\n infoBackgroundMediumPressed: PALETTE_INFO.background['medium-pressed'],\n infoBackgroundWeak: PALETTE_INFO.background.weak,\n infoBackgroundWeakHover: PALETTE_INFO.background['weak-hover'],\n infoBackgroundWeakPressed: PALETTE_INFO.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n infoBackgroundTransparent: PALETTE_INFO.background.transparent,\n /** @deprecated use inverse tokens instead */\n infoBackgroundTransparentHover: PALETTE_INFO.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n infoBackgroundTransparentPressed: PALETTE_INFO.background['transparent-pressed'],\n infoBackgroundInverse: PALETTE_INFO.background.inverse,\n infoBackgroundInverseHover: PALETTE_INFO.background['inverse-hover'],\n infoBackgroundInversePressed: PALETTE_INFO.background['inverse-pressed'],\n\n neutralBackgroundStrong: PALETTE_NEUTRAL.background.strong,\n neutralBackgroundStrongHover: PALETTE_NEUTRAL.background['strong-hover'],\n neutralBackgroundStrongPressed: PALETTE_NEUTRAL.background['strong-pressed'],\n neutralBackgroundMedium: PALETTE_NEUTRAL.background.medium,\n neutralBackgroundMediumHover: PALETTE_NEUTRAL.background['medium-hover'],\n neutralBackgroundMediumPressed: PALETTE_NEUTRAL.background['medium-pressed'],\n neutralBackgroundBase: PALETTE_NEUTRAL.background.base,\n neutralBackgroundBaseHover: PALETTE_NEUTRAL.background['base-hover'],\n neutralBackgroundBasePressed: PALETTE_NEUTRAL.background['base-pressed'],\n neutralBackgroundSurface: PALETTE_NEUTRAL.background.surface,\n neutralBackgroundSurfaceHover: PALETTE_NEUTRAL.background['surface-hover'],\n neutralBackgroundSurfacePressed: PALETTE_NEUTRAL.background['surface-pressed'],\n\n pinkBackgroundVivid: PALETTE_PINK.background.vivid,\n pinkBackgroundVividHover: PALETTE_PINK.background['vivid-hover'],\n pinkBackgroundVividPressed: PALETTE_PINK.background['vivid-pressed'],\n pinkBackgroundMedium: PALETTE_PINK.background.medium,\n pinkBackgroundMediumHover: PALETTE_PINK.background['medium-hover'],\n pinkBackgroundMediumPressed: PALETTE_PINK.background['medium-pressed'],\n pinkBackgroundWeak: PALETTE_PINK.background.weak,\n pinkBackgroundWeakHover: PALETTE_PINK.background['weak-hover'],\n pinkBackgroundWeakPressed: PALETTE_PINK.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n pinkBackgroundTransparent: PALETTE_PINK.background.transparent,\n /** @deprecated use inverse tokens instead */\n pinkBackgroundTransparentHover: PALETTE_PINK.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n pinkBackgroundTransparentPressed: PALETTE_PINK.background['transparent-pressed'],\n pinkBackgroundInverse: PALETTE_PINK.background.inverse,\n pinkBackgroundInverseHover: PALETTE_PINK.background['inverse-hover'],\n pinkBackgroundInversePressed: PALETTE_PINK.background['inverse-pressed'],\n\n primaryBackgroundVivid: PALETTE_PRIMARY.background.vivid,\n primaryBackgroundVividHover: PALETTE_PRIMARY.background['vivid-hover'],\n primaryBackgroundVividPressed: PALETTE_PRIMARY.background['vivid-pressed'],\n primaryBackgroundMedium: PALETTE_PRIMARY.background.medium,\n primaryBackgroundMediumHover: PALETTE_PRIMARY.background['medium-hover'],\n primaryBackgroundMediumPressed: PALETTE_PRIMARY.background['medium-pressed'],\n primaryBackgroundWeak: PALETTE_PRIMARY.background.weak,\n primaryBackgroundWeakHover: PALETTE_PRIMARY.background['weak-hover'],\n primaryBackgroundWeakPressed: PALETTE_PRIMARY.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n primaryBackgroundTransparent: PALETTE_PRIMARY.background.transparent,\n /** @deprecated use inverse tokens instead */\n primaryBackgroundTransparentHover: PALETTE_PRIMARY.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n primaryBackgroundTransparentPressed: PALETTE_PRIMARY.background['transparent-pressed'],\n primaryBackgroundInverse: PALETTE_PRIMARY.background.inverse,\n primaryBackgroundInverseHover: PALETTE_PRIMARY.background['inverse-hover'],\n primaryBackgroundInversePressed: PALETTE_PRIMARY.background['inverse-pressed'],\n\n purpleBackgroundVivid: PALETTE_PURPLE.background.vivid,\n purpleBackgroundVividHover: PALETTE_PURPLE.background['vivid-hover'],\n purpleBackgroundVividPressed: PALETTE_PURPLE.background['vivid-pressed'],\n purpleBackgroundMedium: PALETTE_PURPLE.background.medium,\n purpleBackgroundMediumHover: PALETTE_PURPLE.background['medium-hover'],\n purpleBackgroundMediumPressed: PALETTE_PURPLE.background['medium-pressed'],\n purpleBackgroundWeak: PALETTE_PURPLE.background.weak,\n purpleBackgroundWeakHover: PALETTE_PURPLE.background['weak-hover'],\n purpleBackgroundWeakPressed: PALETTE_PURPLE.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n purpleBackgroundTransparent: PALETTE_PURPLE.background.transparent,\n /** @deprecated use inverse tokens instead */\n purpleBackgroundTransparentHover: PALETTE_PURPLE.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n purpleBackgroundTransparentPressed: PALETTE_PURPLE.background['transparent-pressed'],\n purpleBackgroundInverse: PALETTE_PURPLE.background.inverse,\n purpleBackgroundInverseHover: PALETTE_PURPLE.background['inverse-hover'],\n purpleBackgroundInversePressed: PALETTE_PURPLE.background['inverse-pressed'],\n\n successBackgroundVivid: PALETTE_SUCCESS.background.vivid,\n successBackgroundVividHover: PALETTE_SUCCESS.background['vivid-hover'],\n successBackgroundVividPressed: PALETTE_SUCCESS.background['vivid-pressed'],\n successBackgroundMedium: PALETTE_SUCCESS.background.medium,\n successBackgroundMediumHover: PALETTE_SUCCESS.background['medium-hover'],\n successBackgroundMediumPressed: PALETTE_SUCCESS.background['medium-pressed'],\n successBackgroundWeak: PALETTE_SUCCESS.background.weak,\n successBackgroundWeakHover: PALETTE_SUCCESS.background['weak-hover'],\n successBackgroundWeakPressed: PALETTE_SUCCESS.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n successBackgroundTransparent: PALETTE_SUCCESS.background.transparent,\n /** @deprecated use inverse tokens instead */\n successBackgroundTransparentHover: PALETTE_SUCCESS.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n successBackgroundTransparentPressed: PALETTE_SUCCESS.background['transparent-pressed'],\n successBackgroundInverse: PALETTE_SUCCESS.background.inverse,\n successBackgroundInverseHover: PALETTE_SUCCESS.background['inverse-hover'],\n successBackgroundInversePressed: PALETTE_SUCCESS.background['inverse-pressed'],\n\n tealBackgroundVivid: PALETTE_TEAL.background.vivid,\n tealBackgroundVividHover: PALETTE_TEAL.background['vivid-hover'],\n tealBackgroundVividPressed: PALETTE_TEAL.background['vivid-pressed'],\n tealBackgroundMedium: PALETTE_TEAL.background.medium,\n tealBackgroundMediumHover: PALETTE_TEAL.background['medium-hover'],\n tealBackgroundMediumPressed: PALETTE_TEAL.background['medium-pressed'],\n tealBackgroundWeak: PALETTE_TEAL.background.weak,\n tealBackgroundWeakHover: PALETTE_TEAL.background['weak-hover'],\n tealBackgroundWeakPressed: PALETTE_TEAL.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n tealBackgroundTransparent: PALETTE_TEAL.background.transparent,\n /** @deprecated use inverse tokens instead */\n tealBackgroundTransparentHover: PALETTE_TEAL.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n tealBackgroundTransparentPressed: PALETTE_TEAL.background['transparent-pressed'],\n tealBackgroundInverse: PALETTE_TEAL.background.inverse,\n tealBackgroundInverseHover: PALETTE_TEAL.background['inverse-hover'],\n tealBackgroundInversePressed: PALETTE_TEAL.background['inverse-pressed'],\n\n /* TEXT TOKENS */\n criticalTextVivid: PALETTE_CRITICAL.text.vivid,\n criticalTextStrong: PALETTE_CRITICAL.text.strong,\n criticalTextInverse: PALETTE_CRITICAL.text.inverse,\n\n cyanTextVivid: PALETTE_CYAN.text.vivid,\n cyanTextStrong: PALETTE_CYAN.text.strong,\n cyanTextInverse: PALETTE_CYAN.text.inverse,\n\n infoTextVivid: PALETTE_INFO.text.vivid,\n infoTextStrong: PALETTE_INFO.text.strong,\n infoTextInverse: PALETTE_INFO.text.inverse,\n\n neutralTextStrong: PALETTE_NEUTRAL.text.strong,\n neutralTextMedium: PALETTE_NEUTRAL.text.medium,\n neutralTextPlaceholder: PALETTE_NEUTRAL.text.placeholder,\n neutralTextInverse: PALETTE_NEUTRAL.text.inverse,\n\n pinkTextVivid: PALETTE_PINK.text.vivid,\n pinkTextStrong: PALETTE_PINK.text.strong,\n pinkTextInverse: PALETTE_PINK.text.inverse,\n\n primaryTextVivid: PALETTE_PRIMARY.text.vivid,\n primaryTextStrong: PALETTE_PRIMARY.text.strong,\n primaryTextInverse: PALETTE_PRIMARY.text.inverse,\n\n purpleTextVivid: PALETTE_PURPLE.text.vivid,\n purpleTextStrong: PALETTE_PURPLE.text.strong,\n purpleTextInverse: PALETTE_PURPLE.text.inverse,\n\n successTextVivid: PALETTE_SUCCESS.text.vivid,\n successTextStrong: PALETTE_SUCCESS.text.strong,\n successTextInverse: PALETTE_SUCCESS.text.inverse,\n\n tealTextVivid: PALETTE_TEAL.text.vivid,\n tealTextStrong: PALETTE_TEAL.text.strong,\n tealTextInverse: PALETTE_TEAL.text.inverse,\n\n /* ICON TOKENS */\n criticalIconVivid: PALETTE_CRITICAL.text['icon-vivid'],\n criticalIconInverse: PALETTE_CRITICAL.text['icon-inverse'],\n\n cyanIconVivid: PALETTE_CYAN.text['icon-vivid'],\n cyanIconInverse: PALETTE_CYAN.text['icon-inverse'],\n\n infoIconVivid: PALETTE_INFO.text['icon-vivid'],\n infoIconInverse: PALETTE_INFO.text['icon-inverse'],\n\n neutralIconStrong: PALETTE_NEUTRAL.text['icon-strong'],\n neutralIconMedium: PALETTE_NEUTRAL.text['icon-medium'],\n neutralIconWeak: PALETTE_NEUTRAL.text['icon-weak'],\n neutralIconInverse: PALETTE_NEUTRAL.text['icon-inverse'],\n\n pinkIconVivid: PALETTE_PINK.text['icon-vivid'],\n pinkIconInverse: PALETTE_PINK.text['icon-inverse'],\n\n primaryIconVivid: PALETTE_PRIMARY.text['icon-vivid'],\n primaryIconInverse: PALETTE_PRIMARY.text['icon-inverse'],\n\n purpleIconVivid: PALETTE_PURPLE.text['icon-vivid'],\n purpleIconInverse: PALETTE_PURPLE.text['icon-inverse'],\n\n successIconVivid: PALETTE_SUCCESS.text['icon-vivid'],\n successIconInverse: PALETTE_SUCCESS.text['icon-inverse'],\n\n tealIconVivid: PALETTE_TEAL.text['icon-vivid'],\n tealIconInverse: PALETTE_TEAL.text['icon-inverse'],\n\n /* BORDER TOKENS */\n criticalBorder: PALETTE_CRITICAL.border,\n\n cyanBorder: PALETTE_CYAN.border,\n\n infoBorder: PALETTE_INFO.border,\n\n neutralBorderWeak: PALETTE_NEUTRAL.border.weak,\n neutralBorderMedium: PALETTE_NEUTRAL.border.medium,\n neutralBorderStrong: PALETTE_NEUTRAL.border.strong,\n\n pinkBorder: PALETTE_PINK.border,\n\n primaryBorder: PALETTE_PRIMARY.border,\n\n purpleBorder: PALETTE_PURPLE.border,\n\n successBorder: PALETTE_SUCCESS.border,\n\n tealBorder: PALETTE_TEAL.border,\n\n components: {\n //Badge\n criticalBackgroundBadge: COMPONENTS.badge.background.critical,\n primaryBackgroundBadge: COMPONENTS.badge.background.primary,\n\n criticalTextBadge: COMPONENTS.badge.text['critical'],\n primaryTextBadge: COMPONENTS.badge.text['primary'],\n\n //Button\n criticalBackgroundButton: COMPONENTS.button.background.critical,\n criticalBackgroundButtonHover: COMPONENTS.button.background['critical-hover'],\n criticalBackgroundButtonPressed: COMPONENTS.button.background['critical-pressed'],\n criticalBackgroundInverseButton: COMPONENTS.button.background['critical-inverse'],\n criticalBackgroundInverseButtonHover: COMPONENTS.button.background['critical-inverse-hover'],\n criticalBackgroundInverseButtonPressed: COMPONENTS.button.background['critical-inverse-pressed'],\n\n primaryBackgroundButton: COMPONENTS.button.background.primary,\n primaryBackgroundButtonHover: COMPONENTS.button.background['primary-hover'],\n primaryBackgroundButtonPressed: COMPONENTS.button.background['primary-pressed'],\n primaryBackgroundInverseButton: COMPONENTS.button.background['primary-inverse'],\n primaryBackgroundInverseButtonHover: COMPONENTS.button.background['primary-inverse-hover'],\n primaryBackgroundInverseButtonPressed: COMPONENTS.button.background['primary-inverse-pressed'],\n\n criticalTextButton: COMPONENTS.button.text.critical,\n criticalTextInverseButton: COMPONENTS.button.text['critical-inverse'],\n primaryTextButton: COMPONENTS.button.text.primary,\n primaryTextInverseButton: COMPONENTS.button.text['primary-inverse'],\n\n criticalIconButton: COMPONENTS.button.text['critical-icon-inverse'],\n criticalIconInverseButton: COMPONENTS.button.text['critical-icon'],\n primaryIconButton: COMPONENTS.button.text['primary-icon-inverse'],\n primaryIconInverseButton: COMPONENTS.button.text['primary-icon'],\n\n //GhostButton\n criticalBackgroundGhostButtonHover: COMPONENTS.ghostButton.background['critical-inverse-hover'],\n criticalBackgroundGhostButtonPressed: COMPONENTS.ghostButton.background['critical-inverse-pressed'],\n criticalBackgroundGhostButtonInverseHover: COMPONENTS.ghostButton.background['critical-hover'],\n criticalBackgroundGhostButtonInversePressed: COMPONENTS.ghostButton.background['critical-pressed'],\n primaryBackgroundGhostButtonHover: COMPONENTS.ghostButton.background['primary-inverse-hover'],\n primaryBackgroundGhostButtonPressed: COMPONENTS.ghostButton.background['primary-inverse-pressed'],\n primaryBackgroundGhostButtonInverseHover: COMPONENTS.ghostButton.background['primary-hover'],\n primaryBackgroundGhostButtonInversePressed: COMPONENTS.ghostButton.background['primary-pressed'],\n\n criticalTextGhostButton: COMPONENTS.ghostButton.text.critical,\n criticalTextInverseGhostButton: COMPONENTS.ghostButton.text['critical-inverse'],\n primaryTextGhostButton: COMPONENTS.ghostButton.text.primary,\n primaryTextInverseGhostButton: COMPONENTS.ghostButton.text['primary-inverse'],\n\n criticalIconGhostButton: COMPONENTS.ghostButton.text['critical-icon'],\n criticalIconInverseGhostButton: COMPONENTS.ghostButton.text['critical-icon-inverse'],\n primaryIconGhostButton: COMPONENTS.ghostButton.text['primary-icon'],\n primaryIconInverseGhostButton: COMPONENTS.ghostButton.text['primary-icon-inverse'],\n\n //Nav\n backgroundNavAppIntranet: COMPONENTS.nav.background['appintranet'],\n backgroundNavAppIntranetHover: COMPONENTS.nav.background['appintranet-hover'],\n backgroundNavAppIntranetPressed: COMPONENTS.nav.background['appintranet-pressed'],\n textNavAppIntranet: COMPONENTS.nav.text['appintranet'],\n textNavAppIntranetHover: COMPONENTS.nav.text['appintranet-hover'],\n textNavAppIntranetPressed: COMPONENTS.nav.text['appintranet-pressed'],\n accentNavAppIntranet: COMPONENTS.nav.background['appintranet-accent'],\n accentNavAppIntranetHover: COMPONENTS.nav.background['appintranet-accent-hover'],\n accentNavAppIntranetPressed: COMPONENTS.nav.background['appintranet-accent-pressed'],\n backgroundNavAppIntranetSearch: COMPONENTS.nav.background['appintranet-search'],\n backgroundNavAppIntranetSearchHover: COMPONENTS.nav.background['appintranet-search-hover'],\n backgroundNavAppIntranetSearchActive: COMPONENTS.nav.background['appintranet-search-active'],\n textNavAppIntranetSearch: COMPONENTS.nav.text['appintranet-search'],\n textNavAppIntranetSearchActive: COMPONENTS.nav.text['appintranet-search-active'],\n\n //Link\n textLink: COMPONENTS.link.text.link\n },\n ...MISC_PALETTE,\n charts: {\n negative100: CHART_PALETTE['negative-100'],\n negative200: CHART_PALETTE['negative-200'],\n negative300: CHART_PALETTE['negative-300'],\n negative400: CHART_PALETTE['negative-400'],\n negative500: CHART_PALETTE['negative-500'],\n negative600: CHART_PALETTE['negative-600'],\n negative700: CHART_PALETTE['negative-700'],\n negative800: CHART_PALETTE['negative-800'],\n\n neutral50: CHART_PALETTE['neutral-50'],\n neutral100: CHART_PALETTE['neutral-100'],\n neutral200: CHART_PALETTE['neutral-200'],\n neutral300: CHART_PALETTE['neutral-300'],\n neutral400: CHART_PALETTE['neutral-400'],\n neutral500: CHART_PALETTE['neutral-500'],\n neutral600: CHART_PALETTE['neutral-600'],\n neutral700: CHART_PALETTE['neutral-700'],\n neutral800: CHART_PALETTE['neutral-800'],\n neutral900: CHART_PALETTE['neutral-900'],\n\n positive100: CHART_PALETTE['positive-100'],\n positive200: CHART_PALETTE['positive-200'],\n positive300: CHART_PALETTE['positive-300'],\n positive400: CHART_PALETTE['positive-400'],\n positive500: CHART_PALETTE['positive-500'],\n positive600: CHART_PALETTE['positive-600'],\n positive700: CHART_PALETTE['positive-700'],\n positive800: CHART_PALETTE['positive-800']\n }\n },\n font: {\n family: FONT.family,\n letterspacing: FONT.letterspacing,\n size: FONT.size,\n lineheight: FONT.lineheight,\n weight: {\n regular: FONT.weight.regular,\n medium: FONT.weight.medium,\n semiBold: FONT.weight['semi-bold'],\n bold: FONT.weight.bold\n }\n },\n radius: RADIUS,\n shadow: SHADOW,\n space: SPACE,\n type: TYPE\n};\n\nexport default studioTheme;\n","import tinycolor from 'tinycolor2';\n\nimport {\n BREAKPOINT,\n CHART_PALETTE,\n COLOR_BASE_TONES,\n COMPONENTS,\n FONT,\n MISC_PALETTE,\n PALETTE_CRITICAL,\n PALETTE_CYAN,\n PALETTE_INFO,\n PALETTE_NEUTRAL,\n PALETTE_PINK,\n PALETTE_PRIMARY,\n PALETTE_PURPLE,\n PALETTE_SUCCESS,\n PALETTE_TEAL,\n RADIUS,\n SPACE,\n TYPE\n} from '../baseValues';\nimport {StaffbaseDesignTheme} from '../theme';\n\nconst SHADOW = {\n get level1(): string {\n return `0px 2px 8px 0px ${tinycolor(COLOR_BASE_TONES.grey[900])\n .setAlpha(0.08)\n .toRgbString()}, 0px 2px 4px 0px ${tinycolor(COLOR_BASE_TONES.grey[900]).setAlpha(0.08).toRgbString()}`;\n },\n get level2(): string {\n return `0px 0px 16px 0px ${tinycolor(COLOR_BASE_TONES.grey[900])\n .setAlpha(0.08)\n .toRgbString()}, 0px 0px 12px 0px ${tinycolor(COLOR_BASE_TONES.grey[900]).setAlpha(0.08).toRgbString()}`;\n },\n get focus(): string {\n return `0px 0px 0px 2px ${COLOR_BASE_TONES.white}, 0px 0px 0px 4px ${COLOR_BASE_TONES.blue[500]}`;\n }\n};\n\nconst brandTheme: StaffbaseDesignTheme = {\n breakpoint: BREAKPOINT,\n colorTones: {\n black: COLOR_BASE_TONES.black,\n\n blue900: COLOR_BASE_TONES.blue[900],\n blue800: COLOR_BASE_TONES.blue[800],\n blue700: COLOR_BASE_TONES.blue[700],\n blue600: COLOR_BASE_TONES.blue[600],\n blue500: COLOR_BASE_TONES.blue[500],\n blue400: COLOR_BASE_TONES.blue[400],\n blue300: COLOR_BASE_TONES.blue[300],\n blue200: COLOR_BASE_TONES.blue[200],\n blue100: COLOR_BASE_TONES.blue[100],\n blue50: COLOR_BASE_TONES.blue[50],\n\n cyan900: COLOR_BASE_TONES.cyan[900],\n cyan800: COLOR_BASE_TONES.cyan[800],\n cyan700: COLOR_BASE_TONES.cyan[700],\n cyan600: COLOR_BASE_TONES.cyan[600],\n cyan500: COLOR_BASE_TONES.cyan[500],\n cyan400: COLOR_BASE_TONES.cyan[400],\n cyan300: COLOR_BASE_TONES.cyan[300],\n cyan200: COLOR_BASE_TONES.cyan[200],\n cyan100: COLOR_BASE_TONES.cyan[100],\n cyan50: COLOR_BASE_TONES.cyan[50],\n\n green900: COLOR_BASE_TONES.green[900],\n green800: COLOR_BASE_TONES.green[800],\n green700: COLOR_BASE_TONES.green[700],\n green600: COLOR_BASE_TONES.green[600],\n green500: COLOR_BASE_TONES.green[500],\n green400: COLOR_BASE_TONES.green[400],\n green300: COLOR_BASE_TONES.green[300],\n green200: COLOR_BASE_TONES.green[200],\n green100: COLOR_BASE_TONES.green[100],\n green50: COLOR_BASE_TONES.green[50],\n\n grey900: COLOR_BASE_TONES.grey[900],\n grey800: COLOR_BASE_TONES.grey[800],\n grey700: COLOR_BASE_TONES.grey[700],\n grey600: COLOR_BASE_TONES.grey[600],\n grey500: COLOR_BASE_TONES.grey[500],\n grey400: COLOR_BASE_TONES.grey[400],\n grey300: COLOR_BASE_TONES.grey[300],\n grey200: COLOR_BASE_TONES.grey[200],\n grey100: COLOR_BASE_TONES.grey[100],\n grey50: COLOR_BASE_TONES.grey[50],\n\n pink900: COLOR_BASE_TONES.pink[900],\n pink800: COLOR_BASE_TONES.pink[800],\n pink700: COLOR_BASE_TONES.pink[700],\n pink600: COLOR_BASE_TONES.pink[600],\n pink500: COLOR_BASE_TONES.pink[500],\n pink400: COLOR_BASE_TONES.pink[400],\n pink300: COLOR_BASE_TONES.pink[300],\n pink200: COLOR_BASE_TONES.pink[200],\n pink100: COLOR_BASE_TONES.pink[100],\n pink50: COLOR_BASE_TONES.pink[50],\n\n purple900: COLOR_BASE_TONES.purple[900],\n purple800: COLOR_BASE_TONES.purple[800],\n purple700: COLOR_BASE_TONES.purple[700],\n purple600: COLOR_BASE_TONES.purple[600],\n purple500: COLOR_BASE_TONES.purple[500],\n purple400: COLOR_BASE_TONES.purple[400],\n purple300: COLOR_BASE_TONES.purple[300],\n purple200: COLOR_BASE_TONES.purple[200],\n purple100: COLOR_BASE_TONES.purple[100],\n purple50: COLOR_BASE_TONES.purple[50],\n\n red900: COLOR_BASE_TONES.red[900],\n red800: COLOR_BASE_TONES.red[800],\n red700: COLOR_BASE_TONES.red[700],\n red600: COLOR_BASE_TONES.red[600],\n red500: COLOR_BASE_TONES.red[500],\n red400: COLOR_BASE_TONES.red[400],\n red300: COLOR_BASE_TONES.red[300],\n red200: COLOR_BASE_TONES.red[200],\n red100: COLOR_BASE_TONES.red[100],\n red50: COLOR_BASE_TONES.red[50],\n\n sbBlue900: COLOR_BASE_TONES.sbBlue[900],\n sbBlue800: COLOR_BASE_TONES.sbBlue[800],\n sbBlue700: COLOR_BASE_TONES.sbBlue[700],\n sbBlue600: COLOR_BASE_TONES.sbBlue[600],\n sbBlue500: COLOR_BASE_TONES.sbBlue[500],\n sbBlue400: COLOR_BASE_TONES.sbBlue[400],\n sbBlue300: COLOR_BASE_TONES.sbBlue[300],\n sbBlue200: COLOR_BASE_TONES.sbBlue[200],\n sbBlue100: COLOR_BASE_TONES.sbBlue[100],\n sbBlue50: COLOR_BASE_TONES.sbBlue[50],\n\n teal900: COLOR_BASE_TONES.teal[900],\n teal800: COLOR_BASE_TONES.teal[800],\n teal700: COLOR_BASE_TONES.teal[700],\n teal600: COLOR_BASE_TONES.teal[600],\n teal500: COLOR_BASE_TONES.teal[500],\n teal400: COLOR_BASE_TONES.teal[400],\n teal300: COLOR_BASE_TONES.teal[300],\n teal200: COLOR_BASE_TONES.teal[200],\n teal100: COLOR_BASE_TONES.teal[100],\n teal50: COLOR_BASE_TONES.teal[50],\n\n yellow900: COLOR_BASE_TONES.yellow[900],\n yellow800: COLOR_BASE_TONES.yellow[800],\n yellow700: COLOR_BASE_TONES.yellow[700],\n yellow600: COLOR_BASE_TONES.yellow[600],\n yellow500: COLOR_BASE_TONES.yellow[500],\n yellow400: COLOR_BASE_TONES.yellow[400],\n yellow300: COLOR_BASE_TONES.yellow[300],\n yellow200: COLOR_BASE_TONES.yellow[200],\n yellow100: COLOR_BASE_TONES.yellow[100],\n yellow50: COLOR_BASE_TONES.yellow[50],\n\n white: COLOR_BASE_TONES.white\n },\n color: {\n /* BRAND TOKENS */\n brand: COLOR_BASE_TONES.blue[600],\n brand900: COLOR_BASE_TONES.blue[900],\n brand800: COLOR_BASE_TONES.blue[800],\n brand700: COLOR_BASE_TONES.blue[700],\n brand600: COLOR_BASE_TONES.blue[600],\n brand500: COLOR_BASE_TONES.blue[500],\n brand400: COLOR_BASE_TONES.blue[400],\n brand300: COLOR_BASE_TONES.blue[300],\n brand200: COLOR_BASE_TONES.blue[200],\n brand100: COLOR_BASE_TONES.blue[100],\n brand50: COLOR_BASE_TONES.blue[50],\n brandInverse: COLOR_BASE_TONES.white,\n\n /* BACKGROUND TOKENS */\n criticalBackgroundVivid: PALETTE_CRITICAL.background.vivid,\n criticalBackgroundVividHover: PALETTE_CRITICAL.background['vivid-hover'],\n criticalBackgroundVividPressed: PALETTE_CRITICAL.background['vivid-pressed'],\n criticalBackgroundMedium: PALETTE_CRITICAL.background.medium,\n criticalBackgroundMediumHover: PALETTE_CRITICAL.background['medium-hover'],\n criticalBackgroundMediumPressed: PALETTE_CRITICAL.background['medium-pressed'],\n criticalBackgroundWeak: PALETTE_CRITICAL.background.weak,\n criticalBackgroundWeakHover: PALETTE_CRITICAL.background['weak-hover'],\n criticalBackgroundWeakPressed: PALETTE_CRITICAL.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n criticalBackgroundTransparent: PALETTE_CRITICAL.background.transparent,\n /** @deprecated use inverse tokens instead */\n criticalBackgroundTransparentHover: PALETTE_CRITICAL.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n criticalBackgroundTransparentPressed: PALETTE_CRITICAL.background['transparent-pressed'],\n criticalBackgroundInverse: PALETTE_CRITICAL.background.inverse,\n criticalBackgroundInverseHover: PALETTE_CRITICAL.background['inverse-hover'],\n criticalBackgroundInversePressed: PALETTE_CRITICAL.background['inverse-pressed'],\n\n cyanBackgroundVivid: PALETTE_CYAN.background.vivid,\n cyanBackgroundVividHover: PALETTE_CYAN.background['vivid-hover'],\n cyanBackgroundVividPressed: PALETTE_CYAN.background['vivid-pressed'],\n cyanBackgroundMedium: PALETTE_CYAN.background.medium,\n cyanBackgroundMediumHover: PALETTE_CYAN.background['medium-hover'],\n cyanBackgroundMediumPressed: PALETTE_CYAN.background['medium-pressed'],\n cyanBackgroundWeak: PALETTE_CYAN.background.weak,\n cyanBackgroundWeakHover: PALETTE_CYAN.background['weak-hover'],\n cyanBackgroundWeakPressed: PALETTE_CYAN.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n cyanBackgroundTransparent: PALETTE_CYAN.background.transparent,\n /** @deprecated use inverse tokens instead */\n cyanBackgroundTransparentHover: PALETTE_CYAN.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n cyanBackgroundTransparentPressed: PALETTE_CYAN.background['transparent-pressed'],\n cyanBackgroundInverse: PALETTE_CYAN.background.inverse,\n cyanBackgroundInverseHover: PALETTE_CYAN.background['inverse-hover'],\n cyanBackgroundInversePressed: PALETTE_CYAN.background['inverse-pressed'],\n\n infoBackgroundVivid: PALETTE_INFO.background.vivid,\n infoBackgroundVividHover: PALETTE_INFO.background['vivid-hover'],\n infoBackgroundVividPressed: PALETTE_INFO.background['vivid-pressed'],\n infoBackgroundMedium: PALETTE_INFO.background.medium,\n infoBackgroundMediumHover: PALETTE_INFO.background['medium-hover'],\n infoBackgroundMediumPressed: PALETTE_INFO.background['medium-pressed'],\n infoBackgroundWeak: PALETTE_INFO.background.weak,\n infoBackgroundWeakHover: PALETTE_INFO.background['weak-hover'],\n infoBackgroundWeakPressed: PALETTE_INFO.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n infoBackgroundTransparent: PALETTE_INFO.background.transparent,\n /** @deprecated use inverse tokens instead */\n infoBackgroundTransparentHover: PALETTE_INFO.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n infoBackgroundTransparentPressed: PALETTE_INFO.background['transparent-pressed'],\n infoBackgroundInverse: PALETTE_INFO.background.inverse,\n infoBackgroundInverseHover: PALETTE_INFO.background['inverse-hover'],\n infoBackgroundInversePressed: PALETTE_INFO.background['inverse-pressed'],\n\n neutralBackgroundStrong: PALETTE_NEUTRAL.background.strong,\n neutralBackgroundStrongHover: PALETTE_NEUTRAL.background['strong-hover'],\n neutralBackgroundStrongPressed: PALETTE_NEUTRAL.background['strong-pressed'],\n neutralBackgroundMedium: PALETTE_NEUTRAL.background.medium,\n neutralBackgroundMediumHover: PALETTE_NEUTRAL.background['medium-hover'],\n neutralBackgroundMediumPressed: PALETTE_NEUTRAL.background['medium-pressed'],\n neutralBackgroundBase: PALETTE_NEUTRAL.background.base,\n neutralBackgroundBaseHover: PALETTE_NEUTRAL.background['base-hover'],\n neutralBackgroundBasePressed: PALETTE_NEUTRAL.background['base-pressed'],\n neutralBackgroundSurface: PALETTE_NEUTRAL.background.surface,\n neutralBackgroundSurfaceHover: PALETTE_NEUTRAL.background['surface-hover'],\n neutralBackgroundSurfacePressed: PALETTE_NEUTRAL.background['surface-pressed'],\n\n pinkBackgroundVivid: PALETTE_PINK.background.vivid,\n pinkBackgroundVividHover: PALETTE_PINK.background['vivid-hover'],\n pinkBackgroundVividPressed: PALETTE_PINK.background['vivid-pressed'],\n pinkBackgroundMedium: PALETTE_PINK.background.medium,\n pinkBackgroundMediumHover: PALETTE_PINK.background['medium-hover'],\n pinkBackgroundMediumPressed: PALETTE_PINK.background['medium-pressed'],\n pinkBackgroundWeak: PALETTE_PINK.background.weak,\n pinkBackgroundWeakHover: PALETTE_PINK.background['weak-hover'],\n pinkBackgroundWeakPressed: PALETTE_PINK.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n pinkBackgroundTransparent: PALETTE_PINK.background.transparent,\n /** @deprecated use inverse tokens instead */\n pinkBackgroundTransparentHover: PALETTE_PINK.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n pinkBackgroundTransparentPressed: PALETTE_PINK.background['transparent-pressed'],\n pinkBackgroundInverse: PALETTE_PINK.background.inverse,\n pinkBackgroundInverseHover: PALETTE_PINK.background['inverse-hover'],\n pinkBackgroundInversePressed: PALETTE_PINK.background['inverse-pressed'],\n\n primaryBackgroundVivid: PALETTE_PRIMARY.background.vivid,\n primaryBackgroundVividHover: PALETTE_PRIMARY.background['vivid-hover'],\n primaryBackgroundVividPressed: PALETTE_PRIMARY.background['vivid-pressed'],\n primaryBackgroundMedium: PALETTE_PRIMARY.background.medium,\n primaryBackgroundMediumHover: PALETTE_PRIMARY.background['medium-hover'],\n primaryBackgroundMediumPressed: PALETTE_PRIMARY.background['medium-pressed'],\n primaryBackgroundWeak: PALETTE_PRIMARY.background.weak,\n primaryBackgroundWeakHover: PALETTE_PRIMARY.background['weak-hover'],\n primaryBackgroundWeakPressed: PALETTE_PRIMARY.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n primaryBackgroundTransparent: PALETTE_PRIMARY.background.transparent,\n /** @deprecated use inverse tokens instead */\n primaryBackgroundTransparentHover: PALETTE_PRIMARY.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n primaryBackgroundTransparentPressed: PALETTE_PRIMARY.background['transparent-pressed'],\n primaryBackgroundInverse: PALETTE_PRIMARY.background.inverse,\n primaryBackgroundInverseHover: PALETTE_PRIMARY.background['inverse-hover'],\n primaryBackgroundInversePressed: PALETTE_PRIMARY.background['inverse-pressed'],\n\n purpleBackgroundVivid: PALETTE_PURPLE.background.vivid,\n purpleBackgroundVividHover: PALETTE_PURPLE.background['vivid-hover'],\n purpleBackgroundVividPressed: PALETTE_PURPLE.background['vivid-pressed'],\n purpleBackgroundMedium: PALETTE_PURPLE.background.medium,\n purpleBackgroundMediumHover: PALETTE_PURPLE.background['medium-hover'],\n purpleBackgroundMediumPressed: PALETTE_PURPLE.background['medium-pressed'],\n purpleBackgroundWeak: PALETTE_PURPLE.background.weak,\n purpleBackgroundWeakHover: PALETTE_PURPLE.background['weak-hover'],\n purpleBackgroundWeakPressed: PALETTE_PURPLE.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n purpleBackgroundTransparent: PALETTE_PURPLE.background.transparent,\n /** @deprecated use inverse tokens instead */\n purpleBackgroundTransparentHover: PALETTE_PURPLE.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n purpleBackgroundTransparentPressed: PALETTE_PURPLE.background['transparent-pressed'],\n purpleBackgroundInverse: PALETTE_PURPLE.background.inverse,\n purpleBackgroundInverseHover: PALETTE_PURPLE.background['inverse-hover'],\n purpleBackgroundInversePressed: PALETTE_PURPLE.background['inverse-pressed'],\n\n successBackgroundVivid: PALETTE_SUCCESS.background.vivid,\n successBackgroundVividHover: PALETTE_SUCCESS.background['vivid-hover'],\n successBackgroundVividPressed: PALETTE_SUCCESS.background['vivid-pressed'],\n successBackgroundMedium: PALETTE_SUCCESS.background.medium,\n successBackgroundMediumHover: PALETTE_SUCCESS.background['medium-hover'],\n successBackgroundMediumPressed: PALETTE_SUCCESS.background['medium-pressed'],\n successBackgroundWeak: PALETTE_SUCCESS.background.weak,\n successBackgroundWeakHover: PALETTE_SUCCESS.background['weak-hover'],\n successBackgroundWeakPressed: PALETTE_SUCCESS.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n successBackgroundTransparent: PALETTE_SUCCESS.background.transparent,\n /** @deprecated use inverse tokens instead */\n successBackgroundTransparentHover: PALETTE_SUCCESS.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n successBackgroundTransparentPressed: PALETTE_SUCCESS.background['transparent-pressed'],\n successBackgroundInverse: PALETTE_SUCCESS.background.inverse,\n successBackgroundInverseHover: PALETTE_SUCCESS.background['inverse-hover'],\n successBackgroundInversePressed: PALETTE_SUCCESS.background['inverse-pressed'],\n\n tealBackgroundVivid: PALETTE_TEAL.background.vivid,\n tealBackgroundVividHover: PALETTE_TEAL.background['vivid-hover'],\n tealBackgroundVividPressed: PALETTE_TEAL.background['vivid-pressed'],\n tealBackgroundMedium: PALETTE_TEAL.background.medium,\n tealBackgroundMediumHover: PALETTE_TEAL.background['medium-hover'],\n tealBackgroundMediumPressed: PALETTE_TEAL.background['medium-pressed'],\n tealBackgroundWeak: PALETTE_TEAL.background.weak,\n tealBackgroundWeakHover: PALETTE_TEAL.background['weak-hover'],\n tealBackgroundWeakPressed: PALETTE_TEAL.background['weak-pressed'],\n /** @deprecated use inverse tokens instead */\n tealBackgroundTransparent: PALETTE_TEAL.background.transparent,\n /** @deprecated use inverse tokens instead */\n tealBackgroundTransparentHover: PALETTE_TEAL.background['transparent-hover'],\n /** @deprecated use inverse tokens instead */\n tealBackgroundTransparentPressed: PALETTE_TEAL.background['transparent-pressed'],\n tealBackgroundInverse: PALETTE_TEAL.background.inverse,\n tealBackgroundInverseHover: PALETTE_TEAL.background['inverse-hover'],\n tealBackgroundInversePressed: PALETTE_TEAL.background['inverse-pressed'],\n\n /* TEXT TOKENS */\n criticalTextVivid: PALETTE_CRITICAL.text.vivid,\n criticalTextStrong: PALETTE_CRITICAL.text.strong,\n criticalTextInverse: PALETTE_CRITICAL.text.inverse,\n\n cyanTextVivid: PALETTE_CYAN.text.vivid,\n cyanTextStrong: PALETTE_CYAN.text.strong,\n cyanTextInverse: PALETTE_CYAN.text.inverse,\n\n infoTextVivid: PALETTE_INFO.text.vivid,\n infoTextStrong: PALETTE_INFO.text.strong,\n infoTextInverse: PALETTE_INFO.text.inverse,\n\n neutralTextStrong: PALETTE_NEUTRAL.text.strong,\n neutralTextMedium: PALETTE_NEUTRAL.text.medium,\n neutralTextPlaceholder: PALETTE_NEUTRAL.text.placeholder,\n neutralTextInverse: PALETTE_NEUTRAL.text.inverse,\n\n pinkTextVivid: PALETTE_PINK.text.vivid,\n pinkTextStrong: PALETTE_PINK.text.strong,\n pinkTextInverse: PALETTE_PINK.text.inverse,\n\n primaryTextVivid: PALETTE_PRIMARY.text.vivid,\n primaryTextStrong: PALETTE_PRIMARY.text.strong,\n primaryTextInverse: PALETTE_PRIMARY.text.inverse,\n\n purpleTextVivid: PALETTE_PURPLE.text.vivid,\n purpleTextStrong: PALETTE_PURPLE.text.strong,\n purpleTextInverse: PALETTE_PURPLE.text.inverse,\n\n successTextVivid: PALETTE_SUCCESS.text.vivid,\n successTextStrong: PALETTE_SUCCESS.text.strong,\n successTextInverse: PALETTE_SUCCESS.text.inverse,\n\n tealTextVivid: PALETTE_TEAL.text.vivid,\n tealTextStrong: PALETTE_TEAL.text.strong,\n tealTextInverse: PALETTE_TEAL.text.inverse,\n\n /* ICON TOKENS */\n criticalIconVivid: PALETTE_CRITICAL.text['icon-vivid'],\n criticalIconInverse: PALETTE_CRITICAL.text['icon-inverse'],\n\n cyanIconVivid: PALETTE_CYAN.text['icon-vivid'],\n cyanIconInverse: PALETTE_CYAN.text['icon-inverse'],\n\n infoIconVivid: PALETTE_INFO.text['icon-vivid'],\n infoIconInverse: PALETTE_INFO.text['icon-inverse'],\n\n neutralIconStrong: PALETTE_NEUTRAL.text['icon-strong'],\n neutralIconMedium: PALETTE_NEUTRAL.text['icon-medium'],\n neutralIconWeak: PALETTE_NEUTRAL.text['icon-weak'],\n neutralIconInverse: PALETTE_NEUTRAL.text['icon-inverse'],\n\n pinkIconVivid: PALETTE_PINK.text['icon-vivid'],\n pinkIconInverse: PALETTE_PINK.text['icon-inverse'],\n\n primaryIconVivid: PALETTE_PRIMARY.text['icon-vivid'],\n primaryIconInverse: PALETTE_PRIMARY.text['icon-inverse'],\n\n purpleIconVivid: PALETTE_PURPLE.text['icon-vivid'],\n purpleIconInverse: PALETTE_PURPLE.text['icon-inverse'],\n\n successIconVivid: PALETTE_SUCCESS.text['icon-vivid'],\n successIconInverse: PALETTE_SUCCESS.text['icon-inverse'],\n\n tealIconVivid: PALETTE_TEAL.text['icon-vivid'],\n tealIconInverse: PALETTE_TEAL.text['icon-inverse'],\n\n /* BORDER TOKENS */\n criticalBorder: PALETTE_CRITICAL.border,\n\n cyanBorder: PALETTE_CYAN.border,\n\n infoBorder: PALETTE_INFO.border,\n\n neutralBorderWeak: PALETTE_NEUTRAL.border.weak,\n neutralBorderMedium: PALETTE_NEUTRAL.border.medium,\n neutralBorderStrong: PALETTE_NEUTRAL.border.strong,\n\n pinkBorder: PALETTE_PINK.border,\n\n primaryBorder: PALETTE_PRIMARY.border,\n\n purpleBorder: PALETTE_PURPLE.border,\n\n successBorder: PALETTE_SUCCESS.border,\n\n tealBorder: PALETTE_TEAL.border,\n\n components: {\n //Badge\n criticalBackgroundBadge: COMPONENTS.badge.background.critical,\n primaryBackgroundBadge: COMPONENTS.badge.background.primary,\n\n criticalTextBadge: COMPONENTS.badge.text['critical'],\n primaryTextBadge: COMPONENTS.badge.text['primary'],\n\n //Button\n criticalBackgroundButton: COMPONENTS.button.background.critical,\n criticalBackgroundButtonHover: COMPONENTS.button.background['critical-hover'],\n criticalBackgroundButtonPressed: COMPONENTS.button.background['critical-pressed'],\n criticalBackgroundInverseButton: COMPONENTS.button.background['critical-inverse'],\n criticalBackgroundInverseButtonHover: COMPONENTS.button.background['critical-inverse-hover'],\n criticalBackgroundInverseButtonPressed: COMPONENTS.button.background['critical-inverse-pressed'],\n\n primaryBackgroundButton: COMPONENTS.button.background.primary,\n primaryBackgroundButtonHover: COMPONENTS.button.background['primary-hover'],\n primaryBackgroundButtonPressed: COMPONENTS.button.background['primary-pressed'],\n primaryBackgroundInverseButton: COMPONENTS.button.background['primary-inverse'],\n primaryBackgroundInverseButtonHover: COMPONENTS.button.background['primary-inverse-hover'],\n primaryBackgroundInverseButtonPressed: COMPONENTS.button.background['primary-inverse-pressed'],\n\n criticalTextButton: COMPONENTS.button.text.critical,\n criticalTextInverseButton: COMPONENTS.button.text['critical-inverse'],\n primaryTextButton: COMPONENTS.button.text.primary,\n primaryTextInverseButton: COMPONENTS.button.text['primary-inverse'],\n\n criticalIconButton: COMPONENTS.button.text['critical-icon-inverse'],\n criticalIconInverseButton: COMPONENTS.button.text['critical-icon'],\n primaryIconButton: COMPONENTS.button.text['primary-icon-inverse'],\n primaryIconInverseButton: COMPONENTS.button.text['primary-icon'],\n\n //GhostButton\n criticalBackgroundGhostButtonHover: COMPONENTS.ghostButton.background['critical-inverse-hover'],\n criticalBackgroundGhostButtonPressed: COMPONENTS.ghostButton.background['critical-inverse-pressed'],\n criticalBackgroundGhostButtonInverseHover: COMPONENTS.ghostButton.background['critical-hover'],\n criticalBackgroundGhostButtonInversePressed: COMPONENTS.ghostButton.background['critical-pressed'],\n primaryBackgroundGhostButtonHover: COMPONENTS.ghostButton.background['primary-inverse-hover'],\n primaryBackgroundGhostButtonPressed: COMPONENTS.ghostButton.background['primary-inverse-pressed'],\n primaryBackgroundGhostButtonInverseHover: COMPONENTS.ghostButton.background['primary-hover'],\n primaryBackgroundGhostButtonInversePressed: COMPONENTS.ghostButton.background['primary-pressed'],\n\n criticalTextGhostButton: COMPONENTS.ghostButton.text.critical,\n criticalTextInverseGhostButton: COMPONENTS.ghostButton.text['critical-inverse'],\n primaryTextGhostButton: COMPONENTS.ghostButton.text.primary,\n primaryTextInverseGhostButton: COMPONENTS.ghostButton.text['primary-inverse'],\n\n criticalIconGhostButton: COMPONENTS.ghostButton.text['critical-icon'],\n criticalIconInverseGhostButton: COMPONENTS.ghostButton.text['critical-icon-inverse'],\n primaryIconGhostButton: COMPONENTS.ghostButton.text['primary-icon'],\n primaryIconInverseGhostButton: COMPONENTS.ghostButton.text['primary-icon-inverse'],\n\n //Nav\n backgroundNavAppIntranet: COMPONENTS.nav.background['appintranet'],\n backgroundNavAppIntranetHover: COMPONENTS.nav.background['appintranet-hover'],\n backgroundNavAppIntranetPressed: COMPONENTS.nav.background['appintranet-pressed'],\n textNavAppIntranet: COMPONENTS.nav.text['appintranet'],\n textNavAppIntranetHover: COMPONENTS.nav.text['appintranet-hover'],\n textNavAppIntranetPressed: COMPONENTS.nav.text['appintranet-pressed'],\n accentNavAppIntranet: COMPONENTS.nav.background['appintranet-accent'],\n accentNavAppIntranetHover: COMPONENTS.nav.background['appintranet-accent-hover'],\n accentNavAppIntranetPressed: COMPONENTS.nav.background['appintranet-accent-pressed'],\n backgroundNavAppIntranetSearch: COMPONENTS.nav.background['appintranet-search'],\n backgroundNavAppIntranetSearchHover: COMPONENTS.nav.background['appintranet-search-hover'],\n backgroundNavAppIntranetSearchActive: COMPONENTS.nav.background['appintranet-search-active'],\n textNavAppIntranetSearch: COMPONENTS.nav.text['appintranet-search'],\n textNavAppIntranetSearchActive: COMPONENTS.nav.text['appintranet-search-active'],\n\n //Link\n textLink: COMPONENTS.link.text.link\n },\n ...MISC_PALETTE,\n charts: {\n negative100: CHART_PALETTE['negative-100'],\n negative200: CHART_PALETTE['negative-200'],\n negative300: CHART_PALETTE['negative-300'],\n negative400: CHART_PALETTE['negative-400'],\n negative500: CHART_PALETTE['negative-500'],\n negative600: CHART_PALETTE['negative-600'],\n negative700: CHART_PALETTE['negative-700'],\n negative800: CHART_PALETTE['negative-800'],\n\n neutral50: CHART_PALETTE['neutral-50'],\n neutral100: CHART_PALETTE['neutral-100'],\n neutral200: CHART_PALETTE['neutral-200'],\n neutral300: CHART_PALETTE['neutral-300'],\n neutral400: CHART_PALETTE['neutral-400'],\n neutral500: CHART_PALETTE['neutral-500'],\n neutral600: CHART_PALETTE['neutral-600'],\n neutral700: CHART_PALETTE['neutral-700'],\n neutral800: CHART_PALETTE['neutral-800'],\n neutral900: CHART_PALETTE['neutral-900'],\n\n positive100: CHART_PALETTE['positive-100'],\n positive200: CHART_PALETTE['positive-200'],\n positive300: CHART_PALETTE['positive-300'],\n positive400: CHART_PALETTE['positive-400'],\n positive500: CHART_PALETTE['positive-500'],\n positive600: CHART_PALETTE['positive-600'],\n positive700: CHART_PALETTE['positive-700'],\n positive800: CHART_PALETTE['positive-800']\n }\n },\n font: {\n family: FONT.family,\n letterspacing: FONT.letterspacing,\n size: FONT.size,\n lineheight: FONT.lineheight,\n weight: {\n regular: FONT.weight.regular,\n medium: FONT.weight.medium,\n semiBold: FONT.weight['semi-bold'],\n bold: FONT.weight.bold\n }\n },\n radius: RADIUS,\n shadow: SHADOW,\n space: SPACE,\n type: TYPE\n};\n\nexport default brandTheme;\n","import{options as r,Fragment as e}from\"preact\";export{Fragment}from\"preact\";var t=/[\"&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o=\"\",f=\"\";n {\n theme?: Partial | ((outerTheme: Theme) => Theme);\n presetName?: PresetThemes;\n children?: ReactNode;\n}\n\n/**\n * A component that provides the theme to all descendants.\n */\nfunction ThemeProvider(props: ThemeProviderProps): JSX.Element {\n const {presetName = 'studioDefault'} = props;\n\n const mergedTheme = useMemo(() => {\n const namedTheme = ThemeMap[presetName];\n\n //Deep merge with Lodash\n return merge(namedTheme, props.theme) as Theme;\n }, [presetName, props.theme]);\n\n return {props.children};\n}\n\nexport {ThemeProvider, useTheme, withTheme};\n","import {DefaultTheme} from './hooks/useTheme/useTheme';\n\nconst colors = {\n black: '#000000',\n grey800: '#333333',\n grey670: '#545454',\n grey540: '#757575',\n grey420: '#949494',\n grey150: '#D9D9D9',\n grey100: '#E5E5E5',\n grey40: '#F5F5F5',\n grey20: '#FAFAFA',\n white: '#FFFFFF'\n};\n\nexport const ColorScheme = {\n fileType: {\n default: '#808080',\n ppt: '#BC361A',\n xls: '#127139',\n doc: '#1650B5',\n pdf: '#FF1D16',\n img: '#333333'\n },\n backdrop: 'rgba(0,0,0,0.6)',\n backgroundField: colors.grey20,\n backgroundFieldLight: colors.white,\n backgroundPrimary: colors.white,\n backgroundSecondary: colors.grey40,\n backgroundTertiary: colors.grey100,\n black: colors.black,\n borderSolid: colors.grey100,\n borderTranslucent: 'rgba(0,0,0,0.1)',\n /**\n * This color is meant to be used for foreground elements and is either black or white depending on which gives the\n * better contrast when used as a foreground color for {@link clientPrimary}.\n */\n clientForeground: '#FFFFFF',\n /**\n * The customer's primary color (previously `bgColor`).\n */\n clientPrimary: '#00A4FD',\n /**\n * This is {@link clientPrimary} adjusted in contrast to give a good contrast when used as a foreground color on\n * a white background.\n */\n clientPrimaryA11y: '#00A4FD',\n /**\n * The customer's secondary color (previously `textColor`).\n */\n clientSecondary: '#FFFFFF',\n /**\n * This is {@link clientSecondary} adjusted in contrast to give a good contrast when used as a foreground color on\n * a white background.\n */\n clientSecondaryA11y: '#FFFFFF',\n textPlaceholder: colors.grey420,\n textPrimary: colors.grey800,\n textSecondary: colors.grey670,\n textTertiary: colors.grey540,\n /**\n * Active action component states for components with white background: Hover, Pressed, etc...\n */\n pressedState: colors.grey150,\n hoverState: colors.grey100,\n\n // TODO: the following colors need to be migrated to the new design system colors\n backgroundBase: '#ffffff',\n backgroundLevel1: '#fafafa',\n backgroundLevel2: '#f6f6f6',\n backgroundLevel3: '#d9d9d9',\n backgroundLevel4: '#afafaf',\n blue: '#00a4fd',\n blueDark: '#0094e4',\n blueLight: '#40b6fe',\n green: '#52b056',\n greenDark: '#499f4c',\n greenLight: '#74c078',\n grey: '#767676',\n greyDark: '#6a6a6a',\n greyLight: '#919191',\n hairline: '#ececec',\n hairlineDark: '#dddddd',\n neutral: '#555555',\n neutralDark: '#4d4d4d',\n neutralLight: '#767676',\n orange: '#f5bd66',\n orangeDark: '#f3af45',\n orangeLight: '#f7ca85',\n overlay: '#333333',\n overlayDark: 'rgba(42, 42, 42, 0.6)',\n red: '#f1493d',\n redDark: '#ef2f21',\n redLight: '#f46e65',\n text: '#333333',\n textGreyBase: '#767676',\n textGreyLevel1: '#737373',\n textGreyLevel2: '#717171',\n textGreyLevel3: '#5f5f5f',\n textGreyLevel4: '#434343',\n textLight: '#ffffff',\n warningYellow: '#F4DF79',\n\n // button variants colors to match the new design system to fix a11y colour contrast issues\n buttonNeutral: '#74747b',\n buttonNeutralHover: '#545459',\n buttonCritical: '#D9380A',\n buttonCriticalHover: '#9C2D0E',\n buttonSuccess: '#1D8713',\n buttonSuccessHover: '#1E6215',\n buttonPrimary: '#006cff',\n buttonPrimaryHover: '#004eb9',\n};\n\nexport type OptionalColor = string | undefined;\n\nexport const defaultTheme: DefaultTheme = {\n /**\n * The color palette as defined in the design system.\n *\n * @privateRemarks\n * If you need a color that is missing here, but is not defined in the design system, feel free to add it here.\n */\n colors: ColorScheme,\n\n // We keep a list of all z-index values here so that we have one single point of truth for\n // determining and updating them. This prevents not knowing which z-index values are actually used\n // and having to skim through the whole source code to find the correct z-index to use.\n zIndex: {\n header: 100,\n backdrop: 110,\n dialog: 120\n },\n\n /**\n * The custom customer background color.\n * @deprecated use `colors.clientPrimary` instead\n */\n bgColor: '#00A4FD',\n\n /**\n * The custom customer foreground color.\n */\n textColor: '#FFFFFF',\n\n bgColorDarkened1: undefined as OptionalColor,\n bgColorDarkened2: undefined as OptionalColor,\n bgColorDarkened2Opaque: undefined as OptionalColor,\n bgColorLum: undefined as OptionalColor,\n bgImg: undefined as OptionalColor,\n logoURL: undefined as OptionalColor,\n outlineColor: undefined as OptionalColor,\n tooLightBg: false\n};\n\n/**\n * This constant is used to simplify the usage of safe area inset and provide a way to easily upgrade it in the future.\n * It supports both the safe area inset variables our native app uses, as well as the env variables mobile browsers use.\n *\n * Example:\n * ```tsx\n * import {SAFE_AREA_INSET} from '@staffbase/ui'\n * const Container = styled.div`\n * padding-top: ${SAFE_AREA_INSET.top};\n * `\n */\nexport const SAFE_AREA_INSET = {\n top: 'var(--safe-area-inset-top, env(safe-area-inset-top, 0px))',\n right: 'var(--safe-area-inset-right, env(safe-area-inset-right, 0px))',\n bottom: 'var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))',\n left: 'var(--safe-area-inset-left, env(safe-area-inset-left, 0px))'\n};\n","import {Theme, ThemeProvider as EmotionThemeProvider, useTheme as useEmotionTheme, withTheme} from '@emotion/react';\nimport React, {useMemo} from 'react';\n\nimport {useClient} from '../../adapters/ClientAdapter';\nimport {createSharedInstance} from '../../adapters/shared';\nimport {defaultTheme} from '../../theme';\nimport {useStore, Store} from '../useStore/useStore';\n\nexport type DefaultTheme = Omit;\n\nconst store = createSharedInstance('theme', () => new Store(defaultTheme));\n\n/**\n * Set the global theme.\n * @param theme\n */\nfunction setTheme(theme: DefaultTheme): void {\n store.set(theme);\n}\n\nfunction getTheme(): DefaultTheme {\n return store.get();\n}\n\n/**\n * A hook to retrieve the current theme.\n */\nfunction useTheme(): Theme {\n const [globalTheme] = useStore(store);\n const contextTheme = useEmotionTheme() as DefaultTheme;\n const client = useClient();\n\n // make sure that client is part of the theme, that we fallback to the global theme and that we use the theme from\n // the current context\n return useMemo(() => ({client, ...globalTheme, ...contextTheme}), [client, globalTheme, contextTheme]);\n}\n\nexport interface ThemeProviderProps {\n theme?: Partial | ((outerTheme: Theme) => Theme);\n children?: React.ReactNode;\n}\n\n/**\n * A component that provides the theme to all descendants.\n */\nfunction ThemeProvider(props: ThemeProviderProps): JSX.Element {\n const theme = useTheme();\n return {props.children};\n}\n\nexport interface WithTheme> {\n theme: Theme & Extension;\n}\n\nexport {ThemeProvider, setTheme, getTheme, useTheme, withTheme};\n","import memoize from '@emotion/memoize';\n\n// eslint-disable-next-line no-undef\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport { isPropValid as default };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport * as React from 'react';\nimport isPropValid from '@emotion/is-prop-valid';\n\nvar isDevelopment = false;\n\nvar testOmitPropsOnStringTag = isPropValid;\n\nvar testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {\n return key !== 'theme';\n};\n\nvar getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {\n return typeof tag === 'string' && // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n};\nvar composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {\n var shouldForwardProp;\n\n if (options) {\n var optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {\n return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);\n } : optionsShouldForwardProp;\n }\n\n if (typeof shouldForwardProp !== 'function' && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n\n return shouldForwardProp;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar createStyled = function createStyled(tag, options) {\n\n var isReal = tag.__emotion_real === tag;\n var baseTag = isReal && tag.__emotion_base || tag;\n var identifierName;\n var targetClassName;\n\n if (options !== undefined) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n\n var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);\n var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);\n var shouldUseAs = !defaultShouldForwardProp('as');\n return function () {\n // eslint-disable-next-line prefer-rest-params\n var args = arguments;\n var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];\n\n if (identifierName !== undefined) {\n styles.push(\"label:\" + identifierName + \";\");\n }\n\n if (args[0] == null || args[0].raw === undefined) {\n // eslint-disable-next-line prefer-spread\n styles.push.apply(styles, args);\n } else {\n var templateStringsArr = args[0];\n\n styles.push(templateStringsArr[0]);\n var len = args.length;\n var i = 1;\n\n for (; i < len; i++) {\n\n styles.push(args[i], templateStringsArr[i]);\n }\n }\n\n var Styled = withEmotionCache(function (props, cache, ref) {\n var FinalTag = shouldUseAs && props.as || baseTag;\n var className = '';\n var classInterpolations = [];\n var mergedProps = props;\n\n if (props.theme == null) {\n mergedProps = {};\n\n for (var key in props) {\n mergedProps[key] = props[key];\n }\n\n mergedProps.theme = React.useContext(ThemeContext);\n }\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, classInterpolations, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);\n className += cache.key + \"-\" + serialized.name;\n\n if (targetClassName !== undefined) {\n className += \" \" + targetClassName;\n }\n\n var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;\n var newProps = {};\n\n for (var _key in props) {\n if (shouldUseAs && _key === 'as') continue;\n\n if (finalShouldForwardProp(_key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps.className = className;\n\n if (ref) {\n newProps.ref = ref;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof FinalTag === 'string'\n }), /*#__PURE__*/React.createElement(FinalTag, newProps));\n });\n Styled.displayName = identifierName !== undefined ? identifierName : \"Styled(\" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + \")\";\n Styled.defaultProps = tag.defaultProps;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_styles = styles;\n Styled.__emotion_forwardProp = shouldForwardProp;\n Object.defineProperty(Styled, 'toString', {\n value: function value() {\n if (targetClassName === undefined && isDevelopment) {\n return 'NO_COMPONENT_SELECTOR';\n }\n\n return \".\" + targetClassName;\n }\n });\n\n Styled.withComponent = function (nextTag, nextOptions) {\n var newStyled = createStyled(nextTag, _extends({}, options, nextOptions, {\n shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)\n }));\n return newStyled.apply(void 0, styles);\n };\n\n return Styled;\n };\n};\n\nexport { createStyled as default };\n","import createStyled from '../base/dist/emotion-styled-base.browser.esm.js';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/react';\nimport '@emotion/serialize';\nimport '@emotion/use-insertion-effect-with-fallbacks';\nimport '@emotion/utils';\nimport 'react';\nimport '@emotion/is-prop-valid';\n\nvar tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];\n\n// bind it to avoid mutating the original function\nvar styled = createStyled.bind(null);\ntags.forEach(function (tagName) {\n styled[tagName] = styled(tagName);\n});\n\nexport { styled as default };\n","import {useI18nDevMode} from 'hooks';\nimport {I18nContext} from 'i18n';\nimport {useContext} from 'react';\n\nconst useTranslation = () => {\n const {translations} = useContext(I18nContext);\n const i18nDevMode = useI18nDevMode();\n\n const t = (key: string, ...inserts: string[]) => {\n /*\n * If i18nDevMode is enabled, we just return\n * the translation key for debugging purposes\n */\n if (i18nDevMode) {\n return key;\n }\n\n if (typeof translations === 'undefined') {\n return '';\n }\n\n if (key in translations) {\n return interpolate(translations[key], inserts);\n }\n\n return key;\n };\n\n return {t};\n};\n\nconst interpolate = (translation: string, inserts: string[]) => {\n let interpolated = translation;\n inserts.length &&\n inserts.forEach((insert, index) => {\n interpolated = interpolated.replace(`{${index}}`, insert);\n });\n\n return interpolated;\n};\n\nexport default useTranslation;\n","const useI18nDevMode = () => {\n // App object doesn't exist outside of the Staffbase context\n if (process.env.USE_DEV_LANGUAGE_HOOK || typeof App === 'undefined') {\n return false;\n }\n\n /*\n * When running we.i18n.setDevMode(true) from the browser console,\n * a property prefixed with the baseURL is set as true, which we can use\n * to enable a special debugging mode for content writers\n */\n if (localStorage.getItem(`${App?.system?.baseURL}__i18n_dev_mode`) !== null) {\n return true;\n }\n\n return false;\n};\n\nexport default useI18nDevMode;\n","import { useSyncExternalStore } from \"./react-deps.js\";\n\n/**\n * History API docs @see https://developer.mozilla.org/en-US/docs/Web/API/History\n */\nconst events = [\"popstate\", \"pushState\", \"replaceState\", \"hashchange\"];\n\nlet listeners = [];\nconst onLocationChange = () => listeners.forEach((callback) => callback());\n\n// Native events can run microtasks between listeners. Notify all subscribers\n// together so React can process parent and child updates in the same batch.\nconst subscribeToLocationUpdates = (callback) => {\n if (listeners.push(callback) === 1)\n events.forEach((event) => addEventListener(event, onLocationChange));\n\n return () => {\n listeners = listeners.filter((listener) => listener !== callback);\n if (!listeners.length)\n events.forEach((event) => removeEventListener(event, onLocationChange));\n };\n};\n\nexport const useLocationProperty = (fn, ssrFn) =>\n useSyncExternalStore(subscribeToLocationUpdates, fn, ssrFn);\n\nconst currentSearch = () => location.search;\n\nexport const useSearch = ({ ssrSearch } = {}) =>\n useLocationProperty(\n currentSearch,\n // != null checks for both null and undefined, but allows empty string \"\"\n // This allows proper hydration: server renders with ssrSearch=\"?foo\",\n // client hydrates with just and reads from location.search\n ssrSearch != null ? () => ssrSearch : currentSearch\n );\n\nconst currentPathname = () => location.pathname;\n\nexport const usePathname = ({ ssrPath } = {}) =>\n useLocationProperty(\n currentPathname,\n // != null checks for both null and undefined, but allows empty string \"\"\n // This allows proper hydration: server renders with ssrPath=\"/foo\",\n // client hydrates with just and reads from location.pathname\n ssrPath != null ? () => ssrPath : currentPathname\n );\n\nconst currentHistoryState = () => history.state;\nexport const useHistoryState = () =>\n useLocationProperty(currentHistoryState, () => null);\n\nexport const navigate = (to, { replace = false, state = null } = {}) =>\n history[replace ? \"replaceState\" : \"pushState\"](state, \"\", to);\n\n// the 2nd argument of the `useBrowserLocation` return value is a function\n// that allows to perform a navigation.\nexport const useBrowserLocation = (opts) => [usePathname(opts), navigate];\n\nconst patchKey = Symbol.for(\"wouter_v3\");\n\n// While History API does have `popstate` event, the only\n// proper way to listen to changes via `push/replaceState`\n// is to monkey-patch these methods.\n//\n// See https://stackoverflow.com/a/4585031\nif (typeof history !== \"undefined\" && typeof window[patchKey] === \"undefined\") {\n for (const type of [\"pushState\", \"replaceState\"]) {\n const original = history[type];\n // TODO: we should be using unstable_batchedUpdates to avoid multiple re-renders,\n // however that will require an additional peer dependency on react-dom.\n // See: https://github.com/reactwg/react-18/discussions/86#discussioncomment-1567149\n history[type] = function () {\n const result = original.apply(this, arguments);\n const event = new Event(type);\n event.arguments = arguments;\n\n dispatchEvent(event);\n return result;\n };\n }\n\n // patch history object only once\n // See: https://github.com/molefrog/wouter/issues/167\n Object.defineProperty(window, patchKey, { value: true });\n}\n","/**\n * When basepath is `undefined` or '/' it is ignored (we assume it's empty string)\n */\nconst baseDefaults = (base = \"\") => (base === \"/\" ? \"\" : base);\n\nexport const absolutePath = (to, base) =>\n to[0] === \"~\" ? to.slice(1) : baseDefaults(base) + to;\n\n/*\n * Transforms `path` into its relative `base` version\n * If base isn't part of the path provided returns absolute path e.g. `~/app`\n */\nexport const relativePath = (base, path) => {\n base = unescape(baseDefaults(base));\n path = unescape(path);\n\n return !base ||\n (path.toLowerCase() + \"/\").startsWith(base.toLowerCase() + \"/\")\n ? path.slice(base.length) || \"/\"\n : \"~\" + path;\n};\n\n/*\n * decodes escape sequences such as %20\n */\nconst unescape = (str) => {\n try {\n return str.includes(\"%\") ? decodeURI(str) : str;\n } catch (_e) {\n // fail-safe mode: if string can't be decoded do nothing\n return str;\n }\n};\n\n/*\n * Removes leading question mark\n */\nexport const sanitizeSearch = (search) =>\n unescape(search[0] === \"?\" ? search.slice(1) : search);\n","import { parse as parsePattern } from \"regexparam\";\n\nimport {\n useBrowserLocation,\n useSearch as useBrowserSearch,\n} from \"./use-browser-location.js\";\n\nimport {\n useRef,\n useContext,\n createContext,\n isValidElement,\n cloneElement,\n createElement as h,\n Fragment,\n forwardRef,\n useIsomorphicLayoutEffect,\n useEvent,\n useMemo,\n} from \"./react-deps.js\";\nimport { absolutePath, relativePath, sanitizeSearch } from \"./paths.js\";\n\n/*\n * Router and router context. Router is a lightweight object that represents the current\n * routing options: how location is managed, base path etc.\n *\n * There is a default router present for most of the use cases, however it can be overridden\n * via the component.\n */\n\nconst defaultRouter = {\n hook: useBrowserLocation,\n searchHook: useBrowserSearch,\n parser: parsePattern,\n base: \"\",\n // this option is used to override the current location during SSR\n ssrPath: undefined,\n ssrSearch: undefined,\n // optional context to track render state during SSR\n ssrContext: undefined,\n // customizes how `href` props are transformed for \n hrefs: (x) => x,\n // wraps navigate calls, useful for view transitions\n aroundNav: (n, t, o) => n(t, o),\n};\n\nconst RouterCtx = createContext(defaultRouter);\n\n// gets the closest parent router from the context\nexport const useRouter = () => useContext(RouterCtx);\n\n/**\n * Parameters context. Used by `useParams()` to get the\n * matched params from the innermost `Route` component.\n */\n\nconst Params0 = {},\n ParamsCtx = createContext(Params0);\n\nexport const useParams = () => useContext(ParamsCtx);\n\n/*\n * Part 1, Hooks API: useRoute and useLocation\n */\n\n// Internal location hooks avoid redundant context reads and navigation callbacks.\n\nconst usePathnameFromRouter = (router, base = router.base) =>\n relativePath(base, router.hook(router)[0]);\n\nconst useLocationFromRouter = (router) => {\n const [location, navigate] = router.hook(router);\n\n // the function reference should stay the same between re-renders, so that\n // it can be passed down as an element prop without any performance concerns.\n // (This is achieved via `useEvent`.)\n return [\n relativePath(router.base, location),\n useEvent((to, opts) =>\n router.aroundNav(navigate, absolutePath(to, router.base), opts)\n ),\n ];\n};\n\nexport const useLocation = () => useLocationFromRouter(useRouter());\n\nexport const useSearch = () => {\n const router = useRouter();\n return sanitizeSearch(router.searchHook(router));\n};\n\nexport const matchRoute = (parser, route, path, loose) => {\n // if the input is a regexp, skip parsing\n const { pattern, keys } =\n route instanceof RegExp ? { pattern: route } : parser(route || \"*\", loose);\n\n const result = pattern.exec(path);\n\n if (!result) return [false, null];\n\n // Keep positional captures as well as named params, with named params taking\n // precedence (custom parsers can use numeric keys).\n const params = {};\n for (let i = 1; i < result.length; i++) params[i - 1] = result[i];\n if (keys) {\n for (let i = 0; i < keys.length; i++) params[keys[i]] = result[i + 1];\n } else {\n Object.assign(params, result.groups);\n }\n\n // In loose mode the full match is the base for nested routes:\n // pattern `/a/:b` and path `/a/1/2/3` give the base `/a/1`.\n return loose ? [true, params, result[0]] : [true, params];\n};\n\nexport const useRoute = (pattern) => {\n const router = useRouter();\n const absolute = /^~\\//.test(pattern);\n return matchRoute(\n router.parser,\n absolute ? pattern.slice(1) : pattern,\n usePathnameFromRouter(router, absolute ? \"\" : router.base)\n );\n};\n\n/*\n * Part 2, Low Carb Router API: Router, Route, Link, Switch\n */\n\nexport const Router = ({ children, ...props }) => {\n // the router we will inherit from - it is the closest router in the tree,\n // unless the custom `hook` is provided (in that case it's the default one)\n const parent_ = useRouter();\n const parent = props.hook ? defaultRouter : parent_;\n\n // holds to the context value: the router object\n let value = parent;\n\n // when `ssrPath` contains a `?` character, we can extract the search from it.\n // also, ensure ssrSearch is always defined when ssrPath is provided, so that\n // useSearch behavior matches usePathname (proper SSR hydration when client\n // renders without props after server rendered with ssrPath/ssrSearch)\n if (props.ssrPath) {\n const [path, search = props.ssrSearch ?? \"\"] = props.ssrPath.split(\"?\");\n if (path) (props.ssrSearch = search), (props.ssrPath = path);\n }\n\n // hooks can define their own `href` formatter (e.g. for hash location)\n props.hrefs = props.hrefs ?? props.hook?.hrefs;\n\n // hooks can define their own search hook (e.g. for memory location)\n props.searchHook = props.searchHook ?? props.hook?.searchHook;\n\n // what is happening below: to avoid unnecessary rerenders in child components,\n // we ensure that the router object reference is stable, unless there are any\n // changes that require reload (e.g. `base` prop changes -> all components that\n // get the router from the context should rerender, even if the component is memoized).\n // the expected behaviour is:\n //\n // 1) when the resulted router is no different from the parent, use parent\n // 2) if the custom `hook` prop is provided, we always inherit from the\n // default router instead. this resets all previously overridden options.\n // 3) when the router is customized here, it should stay stable between renders\n let ref = useRef(parent),\n prev = ref.current,\n next = prev;\n\n for (let k in parent) {\n const option =\n k === \"base\"\n ? /* base is special case, it is appended to the parent's base */\n parent[k] + (props[k] ?? \"\")\n : props[k] ?? parent[k];\n\n if (option !== next[k]) {\n if (prev === next) ref.current = next = { ...next };\n next[k] = option;\n }\n\n // the new router is no different from the parent or from the memoized value, use parent\n if (option !== parent[k] || option !== value[k]) value = next;\n }\n\n return h(RouterCtx.Provider, { value }, children);\n};\n\nconst h_route = ({ children, component }, params) => {\n // React-Router style `component` prop\n if (component) return h(component, { params });\n\n // support render prop or plain children\n return typeof children === \"function\" ? children(params) : children;\n};\n\n// Cache params object between renders if values are shallow equal\nconst useCachedParams = (value) => {\n let prev = useRef(Params0);\n const curr = prev.current,\n keys = Object.keys(value);\n return (prev.current =\n // Update cache if number of params changed or any value changed\n keys.length !== Object.keys(curr).length ||\n keys.some((k) => value[k] !== curr[k])\n ? value // Return new value if there are changes\n : curr); // Return cached value if nothing changed\n};\n\nexport function useSearchParams() {\n const [location, navigate] = useLocation();\n\n const search = useSearch();\n const searchParams = useMemo(() => new URLSearchParams(search), [search]);\n\n // cached value before next render, so you can call setSearchParams multiple times\n let tempSearchParams = searchParams;\n\n const setSearchParams = useEvent((nextInit, options) => {\n tempSearchParams = new URLSearchParams(\n typeof nextInit === \"function\" ? nextInit(tempSearchParams) : nextInit\n );\n const paramsStr = tempSearchParams.toString();\n navigate(location + (paramsStr ? \"?\" + paramsStr : \"\"), options);\n });\n\n return [searchParams, setSearchParams];\n}\n\nexport const Route = ({ path, nest, match, ...renderProps }) => {\n const router = useRouter();\n const location = usePathnameFromRouter(router);\n\n const [matches, routeParams, base] =\n // `match` is a special prop to give up control to the parent,\n // it is used by the `Switch` to avoid double matching\n match ?? matchRoute(router.parser, path, location, nest);\n\n // when `routeParams` is `null` (there was no match), the argument\n // below becomes {...null} = {}, see the Object Spread specs\n // https://tc39.es/proposal-object-rest-spread/#AbstractOperations-CopyDataProperties\n const params = useCachedParams({ ...useParams(), ...routeParams });\n\n if (!matches) return null;\n\n const children = h_route(renderProps, params);\n\n return h(\n ParamsCtx.Provider,\n { value: params },\n base ? h(Router, { base }, children) : children\n );\n};\n\nexport const Link = forwardRef((props, ref) => {\n const router = useRouter();\n const [currentPath, navigate] = useLocationFromRouter(router);\n\n const {\n to = \"\",\n href: targetPath = to,\n onClick: _onClick,\n asChild,\n children,\n className: cls,\n /* eslint-disable no-unused-vars */\n replace /* ignore nav props */,\n state /* ignore nav props */,\n transition /* ignore nav props */,\n /* eslint-enable no-unused-vars */\n\n ...linkProps\n } = props;\n\n linkProps.onClick = useEvent((event) => {\n // ignores the navigation when clicked using right mouse button or\n // by holding a special modifier key: ctrl, command, win, alt, shift\n if (\n event.ctrlKey ||\n event.metaKey ||\n event.altKey ||\n event.shiftKey ||\n event.button !== 0\n )\n return;\n\n _onClick?.(event);\n if (!event.defaultPrevented) {\n event.preventDefault();\n navigate(targetPath, props);\n }\n });\n\n // handle nested routers and absolute paths\n linkProps.href = router.hrefs(\n targetPath[0] === \"~\" ? targetPath.slice(1) : router.base + targetPath,\n router // pass router as a second argument for convinience\n );\n\n // Omitted props should preserve the child's own className and ref.\n if (cls !== undefined)\n linkProps.className = cls?.call ? cls(currentPath === targetPath) : cls;\n if (ref) linkProps.ref = ref;\n\n return asChild && isValidElement(children)\n ? cloneElement(children, linkProps)\n : h(\"a\", linkProps, children);\n});\n\nconst flattenChildren = (children, result = []) => {\n if (Array.isArray(children)) {\n for (const c of children)\n flattenChildren(c && c.type === Fragment ? c.props.children : c, result);\n } else result.push(children);\n return result;\n};\n\nexport const Switch = ({ children, location }) => {\n const router = useRouter();\n const originalLocation = usePathnameFromRouter(router);\n\n for (const element of flattenChildren(children)) {\n let match = 0;\n\n if (\n isValidElement(element) &&\n // we don't require an element to be of type Route,\n // but we do require it to contain a truthy `path` prop.\n // this allows to use different components that wrap Route\n // inside of a switch, for example .\n (match = matchRoute(\n router.parser,\n element.props.path,\n location || originalLocation,\n element.props.nest\n ))[0]\n )\n return cloneElement(element, { match });\n }\n\n return null;\n};\n\nexport const Redirect = (props) => {\n const { to, href = to } = props;\n const router = useRouter();\n const [, navigate] = useLocationFromRouter(router);\n const redirect = useEvent(() => navigate(to || href, props));\n const { ssrContext } = router;\n\n // redirect is guaranteed to be stable since it is returned from useEvent\n useIsomorphicLayoutEffect(() => {\n redirect();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n if (ssrContext) {\n ssrContext.redirectTo = to;\n }\n\n return null;\n};\n","/**\n * @param {string|RegExp} input The route pattern\n * @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input.\n */\nexport function parse(input, loose) {\n\tif (input instanceof RegExp) return { keys:false, pattern:input };\n\tvar c, o, tmp, ext, keys=[], pattern='', arr = input.split('/');\n\tarr[0] || arr.shift();\n\n\twhile (tmp = arr.shift()) {\n\t\tc = tmp[0];\n\t\tif (c === '*') {\n\t\t\tkeys.push(c);\n\t\t\tpattern += tmp[1] === '?' ? '(?:/(.*))?' : '/(.*)';\n\t\t} else if (c === ':') {\n\t\t\to = tmp.indexOf('?', 1);\n\t\t\text = tmp.indexOf('.', 1);\n\t\t\tkeys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );\n\t\t\tpattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';\n\t\t\tif (!!~ext) pattern += (!!~o ? '?' : '') + '\\\\' + tmp.substring(ext);\n\t\t} else {\n\t\t\tpattern += '/' + tmp;\n\t\t}\n\t}\n\n\treturn {\n\t\tkeys: keys,\n\t\tpattern: new RegExp('^' + pattern + (loose ? '(?=$|\\/)' : '\\/?$'), 'i')\n\t};\n}\n\nvar RGX = /(\\/|^)([:*][^/]*?)(\\?)?(?=[/.]|$)/g;\n\n// error if key missing?\nexport function inject(route, values) {\n\treturn route.replace(RGX, (x, lead, key, optional) => {\n\t\tx = values[key=='*' ? key : key.substring(1)];\n\t\treturn x ? '/'+x : (optional || key=='*') ? '' : '/' + key;\n\t});\n}\n","import fontWoff from './staffbase-icons/staffbase-icons.woff';\nimport fontWoff2 from './staffbase-icons/staffbase-icons.woff2';\n\nconst ICON_FONT_VERSION = 4;\nconst STYLE_ELEMENT_ID = 'icon-font-styles';\n\ndeclare global {\n interface Window {\n staffbaseIconFontVersion?: number;\n }\n}\n\n// We are still defining `.we-icon` for backwards compatibility\nexport const fontFace = `\n @font-face {\n font-family: 'staffbase-icons';\n src: url('${fontWoff2}') format('woff2'),\n url('${fontWoff}') format('woff');\n font-weight: normal;\n font-style: normal;\n font-display: block;\n }\n\n @font-face {\n font-family: 'we-icon';\n src: url('${fontWoff2}') format('woff2'),\n url('${fontWoff}') format('woff');\n font-weight: normal;\n font-style: normal;\n font-display: block;\n }\n\n .we-icon, .staffbase-icon {\n font-family: staffbase-icons;\n }\n \n .we-icon {\n direction: ltr;\n }\n`;\n\nexport function injectIconsFont(doc: Document): void {\n const win = doc.defaultView || window;\n if (win.staffbaseIconFontVersion !== undefined && win.staffbaseIconFontVersion >= ICON_FONT_VERSION) {\n return;\n }\n\n const style = doc.getElementById(STYLE_ELEMENT_ID) || doc.createElement('style');\n if (!style.hasAttribute('id')) {\n style.setAttribute('id', STYLE_ELEMENT_ID);\n }\n if (style.parentElement !== doc.head) {\n doc.head.appendChild(style);\n }\n style.textContent = fontFace;\n\n win.staffbaseIconFontVersion = ICON_FONT_VERSION;\n}\n","/** returns true if the passed keyboard event is for the Escape key being pressed */\nexport function isEscape(event: React.KeyboardEvent | KeyboardEvent): boolean {\n const key = event.key.toLowerCase();\n return key === 'esc' || key === 'escape';\n}\n\n/** returns true if the passed keyboard event is for the Tab key being pressed */\nexport function isTab(event: React.KeyboardEvent | KeyboardEvent): boolean {\n const key = event.key.toLowerCase();\n return key === 'tab';\n}\n\n/** returns true if the passed keyboard event is for the Tab key being pressed */\nexport function isEnter(event: React.KeyboardEvent | KeyboardEvent): boolean {\n const key = event.key.toLowerCase();\n return key === 'enter';\n}\n","import React from 'react';\n\nimport {isTab} from './keyboardEvents';\n\ninterface AccessibleButtonProps {\n role: 'button';\n tabIndex: number;\n onKeyDown: React.KeyboardEventHandler;\n onKeyUp: React.KeyboardEventHandler;\n onClick: React.MouseEventHandler;\n}\n\n/**\n * Please don't use this method.\n * @param onAction\n * @deprecated If you need to handle clicks and keyboard actions, please use a real \"\n ))}\n \n {t('cancel')}\n \n \n \n )}\n \n );\n}\n\nexport function modalPointerEvents({state}: TransitionProps): 'none' | 'all' {\n if (state === TransitionState.Exited) {\n return 'none';\n } else {\n return 'all';\n }\n}\n\nexport function modalOpacity({state}: TransitionProps): number {\n if (state === TransitionState.Exited) {\n return 0;\n } else {\n return 1;\n }\n}\n\nexport interface TransitionProps {\n state: TransitionState;\n duration: number;\n}\n\nconst Backdrop = styled.div`\n background-color: rgba(0, 0, 0, 0.3);\n position: absolute;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n z-index: ${({theme}) => theme.zIndex.backdrop};\n transition: opacity linear ${({duration}) => duration}ms;\n opacity: ${modalOpacity};\n pointer-events: ${modalPointerEvents};\n`;\n\nexport const ActionSheetContainer = styled.div`\n position: absolute;\n width: 100%;\n background-color: white;\n display: flex;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${({theme}) => theme.zIndex.dialog};\n\n transition: opacity linear ${({duration}) => duration}ms;\n opacity: ${modalOpacity};\n pointer-events: ${modalPointerEvents};\n\n flex-direction: column;\n align-items: center;\n\n border: 1px solid white;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n\n //iPhoneX+ safe area is shifted from the bottom edge so we need to adjust it\n padding-bottom: ${SAFE_AREA_INSET.bottom};\n`;\n\nexport const Button = styled.button<{color?: string}>`\n background-color: white;\n display: flex;\n width: 100%;\n border: 0 none;\n color: ${({color, theme}) => color || theme.colors.textPrimary};\n font-size: 14px;\n line-height: 18px;\n padding: 16px 32px;\n\n & > span {\n margin-right: 24px;\n }\n\n /* overwrite buttons styling from the frontend */\n &&:hover,\n &&:focus,\n &&.active {\n background: #fff;\n color: ${({color, theme}) => color || theme.colors.textPrimary};\n }\n\n &&:active {\n background-color: #f5f5f5;\n color: ${({color, theme}) => color || theme.colors.textPrimary};\n }\n`;\n\nexport const CloseButton = styled.button`\n width: calc(100% - 32px);\n margin: 8px 0 16px;\n padding: 16px;\n font-size: 14px;\n line-height: 21px;\n text-align: center;\n\n border: 1px solid ${({theme}) => theme.colors.borderSolid};\n border-radius: 4px;\n\n background-color: ${({theme}) => theme.colors.backgroundSecondary};\n color: ${({theme}) => theme.colors.textPrimary};\n\n /* overwrite buttons styling from the frontend */\n\n &&:hover {\n background-color: ${({theme}) => theme.colors.backgroundSecondary};\n color: ${({theme}) => theme.colors.textPrimary};\n }\n\n &&:focus,\n &&.active {\n background-color: ${({theme}) => theme.colors.backgroundSecondary};\n color: ${({theme}) => theme.colors.textPrimary};\n }\n\n &&:active {\n background-color: ${({theme}) => theme.colors.backgroundTertiary};\n }\n`;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport Portal from '../../atoms/Portal/Portal';\nimport {ThemeProvider} from '../../hooks/useTheme/useTheme';\nimport ConfirmationDialog from '../../organisms/ConfirmationDialog/ConfirmationDialog';\nimport {getGrowlAdapter, GrowlType} from '../GrowlAdapter';\nimport {\n ActionsOpts,\n AlertOpts,\n ConfirmOpts,\n FileHandle,\n FileRequestOpts,\n FileSelectHandler,\n FilesSelectHandler,\n isFileHandle,\n RequestData,\n RuntimeAdapter,\n RuntimeRequestData,\n RuntimeResponse,\n ShareData,\n Tab,\n TabOptions,\n UploadMethod\n} from './RuntimeAdapter';\nimport RuntimeFormData from './RuntimeFormData';\nimport {VoiceRecorderPlugin} from './VoiceRecorder';\nimport WebActionSheet from './WebActionSheet';\n\n// Extend global Navigator type to include the share function\ndeclare global {\n interface Navigator {\n share(data?: ShareData): Promise;\n }\n}\n\n/**\n * A runtime adapter meant to be used on the Web.\n */\nexport default class WebRuntime implements RuntimeAdapter {\n private inputEl: HTMLInputElement | undefined;\n private actionSheetContainer: HTMLElement | undefined;\n private confirmContainer: HTMLElement | undefined;\n\n /**\n * Does nothing on web\n * @param url\n */\n async saveFile(_url: string): Promise {\n // noop\n }\n\n /**\n * Send the request via the browser's `fetch` API.\n */\n fetch(data: RuntimeRequestData): Promise {\n return fetch(data.url.toString(), WebFileHandle.addToRequest(data));\n }\n\n /**\n * Prompt a file upload dialog that accepts one file. The `handler` is called iff a file was selected. If `handler`\n * returns a promise and if this promise is rejected with an error, the error is forwarded to `window.onerror`.\n */\n async requestFile(opts: FileRequestOpts, handler: FileSelectHandler): Promise {\n this._requestFiles(opts, false, (handles) => {\n if (handles.length > 0) {\n handler(handles[0]);\n }\n });\n }\n\n /**\n * Prompt a file upload dialog that accepts many files. The `handle` is called iff a file was selected. If `handler`\n * returns a promise and if this promise is rejected with an error, the error is forwarded to `window.onerror`.\n */\n async requestFiles(opts: FileRequestOpts, handler: FilesSelectHandler): Promise {\n this._requestFiles(opts, true, handler);\n }\n\n private async _requestFiles(opts: FileRequestOpts, multiple: boolean, handler: FilesSelectHandler) {\n // Cleanup the input from a previous call (there might still be an input from a previous call if the user did not\n // select a file during the previous call).\n if (this.inputEl) {\n this.inputEl.parentElement?.removeChild(this.inputEl);\n this.inputEl = undefined;\n }\n\n // Create an file input element, add it to the document, and click it to prompt for the upload dialog.\n // Note: Don't add the input to the document, or clicking on it via JavaScript will not work on Safari on iOS\n this.inputEl = document.createElement('input');\n this.inputEl.type = 'file';\n this.inputEl.hidden = true;\n this.inputEl.multiple = multiple;\n\n // Add a testid, but only if executed inside of a test env.\n if (process.env.NODE_ENV === 'test') {\n this.inputEl.setAttribute('data-testid', 'runtime-file-input');\n }\n\n this._applyFileRequestOptions(this.inputEl, opts);\n\n this.inputEl.addEventListener('change', () => {\n if (!this.inputEl) {\n return;\n }\n\n if (this.inputEl.files?.length ?? 0 > 0) {\n Promise.resolve(handler(Array.from(this.inputEl.files ?? []).map((file) => new WebFileHandle(file, file.name))))\n .catch((err) => {\n if (window.onerror) {\n window.onerror(err);\n } else {\n console.error(err);\n }\n })\n .then(() => {\n if (!this.inputEl) {\n return;\n }\n\n // cleanup input element\n this.inputEl.parentElement?.removeChild(this.inputEl);\n this.inputEl = undefined;\n });\n }\n });\n\n if (/MSIE|Trident/i.test(window.navigator.userAgent)) {\n // non-latest IE11 version require the element to be in the document before it is clicked\n document.body.appendChild(this.inputEl);\n setTimeout(() => this.inputEl?.click());\n } else {\n // Trigger the file upload prompt.\n this.inputEl.click();\n // For this to work on Safari on iOS, the input must be clicked before it is added to the document, but it still\n // needs to be added to the document eventually, or the `change` event will not be triggered.\n document.body.appendChild(this.inputEl);\n }\n }\n\n private _applyFileRequestOptions(inputEl: HTMLInputElement, opts: FileRequestOpts) {\n const defaultImageAccept = 'image/*,.heic';\n const defaultVideoAccept = 'video/*';\n const otherAccept = 'audio/*,application/*,text/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.ics,.txt,.csv';\n\n switch (opts.type) {\n case 'image':\n inputEl.accept = opts.imageAccept || defaultImageAccept;\n break;\n\n case 'video':\n inputEl.accept = opts.videoAccept || defaultVideoAccept;\n break;\n\n case 'media':\n inputEl.accept = 'image/*,.heic,video/*,audio/*';\n break;\n\n case 'other':\n inputEl.accept = otherAccept;\n break;\n\n case 'custom':\n inputEl.accept = opts.customAccept;\n break;\n\n default:\n inputEl.accept = `${defaultImageAccept},${defaultVideoAccept},${otherAccept}`;\n break;\n }\n }\n\n /**\n * Show an Action Sheet style modal with various options for the user to select.\n */\n showActions(opts: ActionsOpts): Promise {\n if (this.actionSheetContainer) {\n ReactDOM.unmountComponentAtNode(this.actionSheetContainer);\n } else if (!this.actionSheetContainer) {\n this.actionSheetContainer = document.createElement('div');\n }\n\n return new Promise((resolve) => {\n const handleClose = () => {\n if (this.actionSheetContainer) {\n ReactDOM.unmountComponentAtNode(this.actionSheetContainer);\n this.actionSheetContainer = undefined;\n }\n };\n\n if (this.actionSheetContainer) {\n ReactDOM.render(\n \n \n \n \n ,\n this.actionSheetContainer\n );\n }\n });\n }\n\n /**\n * Returns whether `navigator.share()` is available in the current browser (possible reasons for not being available:\n * app does not run on a mobile device, app does not run on HTTPS, Web Share API not supported by browser).\n */\n isShareAvailable(): boolean {\n return typeof window.navigator.share === 'function';\n }\n\n /**\n * Share content using the Web Share API. It is recommended to check if a native sharing dialog is available\n * via {@link isShareAvailable}.\n */\n async share(data: ShareData): Promise {\n if (!this.isShareAvailable()) {\n throw new Error('Web Share API not available');\n }\n\n return await navigator.share(data);\n }\n\n /**\n * Show a success Growl.\n */\n async toast(msg: string): Promise {\n const growl = getGrowlAdapter();\n growl.show(msg, {type: GrowlType.Success});\n }\n\n /**\n * Show an alert dialog.\n * @remarks\n * `opts.buttonTitle` and `opts.title` don't have an effect on the WebRuntime's alert implementation.\n */\n async alert(opts: AlertOpts): Promise {\n // TODO: replace with a design system alert once there is one\n // eslint-disable-next-line no-alert\n alert(opts.message);\n }\n\n /**\n * Show a confirm dialog. Returns whether the ok button (`true`) or cancel button (`false`) was clicked.\n */\n confirm(opts: ConfirmOpts): Promise {\n if (this.confirmContainer) {\n ReactDOM.unmountComponentAtNode(this.confirmContainer);\n } else if (!this.confirmContainer) {\n this.confirmContainer = document.createElement('div');\n }\n\n return new Promise((resolve) => {\n const handleClose = () => {\n if (this.confirmContainer) {\n ReactDOM.unmountComponentAtNode(this.confirmContainer);\n this.confirmContainer = undefined;\n }\n resolve(false);\n };\n\n const handleSubmit = () => {\n if (this.confirmContainer) {\n ReactDOM.unmountComponentAtNode(this.confirmContainer);\n this.confirmContainer = undefined;\n }\n resolve(true);\n };\n\n if (this.confirmContainer) {\n // ConfirmationDialog is already rendered in a portal, so no need to add another portal here\n ReactDOM.render(\n \n \n ,\n this.confirmContainer\n );\n }\n });\n }\n\n /**\n * Not implemented for Web.\n */\n openTab(_: TabOptions): Promise {\n throw new Error('WebRuntime.openTab is not available on Web');\n }\n\n /**\n * Not implemented for Web.\n */\n openLoginTab(_: TabOptions): Promise {\n throw new Error('WebRuntime.openTab is not available on Web');\n }\n\n /**\n * Close all currently open tabs.\n */\n async closeAllTabs(): Promise {\n // noop\n }\n\n /**\n * Does nothing on Web.\n */\n openDocument(_url: string): void {\n // noop\n }\n\n /**\n * Does nothing on Web.\n */\n addListener(_name: string, _handler: unknown): void {\n //noop\n }\n\n /**\n * @throws Currently not needed for web.\n */\n getVoiceRecorder(): VoiceRecorderPlugin {\n throw new Error('Method not implemented.');\n }\n\n /**\n * Does nothing on Web.\n */\n updateStatusBarColor(): Promise {\n return Promise.resolve();\n }\n}\n\n/**\n * A web-compatible {@link FileHandle}, which internally uses a {@link File} as a reference to a file.\n */\nexport class WebFileHandle implements FileHandle {\n public readonly type = 'FileHandle';\n\n private uploadMethod: UploadMethod = 'raw';\n private readonly name?: string;\n private readonly blob: Blob;\n\n public constructor(blob: Blob, name?: string) {\n this.blob = blob;\n this.name = name;\n }\n\n /**\n * The file size of the internal file in bytes.\n */\n fileSize(): number | null {\n return this.blob.size;\n }\n\n /**\n * Returns the mime-type of the internal file.\n */\n mimeType(): string {\n return this.blob.type;\n }\n\n /**\n * Returns the file name the `WebFileHandle` can optionally be constructed with.\n */\n fileName(): string | null {\n return this.name || null;\n }\n\n /**\n * Creates and returns an object URL for the internal file.\n */\n async previewUri(): Promise {\n return URL.createObjectURL(this.blob);\n }\n\n /**\n * Sets the upload method.\n */\n public setUploadMethod(method: UploadMethod): void {\n this.uploadMethod = method;\n }\n\n /**\n * Convert and return the file as a `Blob`.\n *\n * @remarks\n * This method mostly exists for compatibility with plugins. Please avoid using it for new code!\n */\n async toBlob(): Promise {\n // Create a copy of the blob to make sure that changes to the returned `Blob` are not applied to the `Blob` owned\n // by the file handle.\n return new Blob([this.blob], {type: this.blob.type});\n }\n\n /**\n * If the provided request data contains a `WebFileHandle` as a body, the handle is added, depending on its\n * upload method, either as `FormData` or directly as the body.\n */\n static addToRequest({body, headers, ...rest}: RuntimeRequestData): RequestData {\n if (WebFileHandle.isWebFileHandle(body)) {\n if (body.uploadMethod === 'raw') {\n const newHeaders = new Headers(headers);\n newHeaders.append('Content-Type', body.blob.type || 'application/octet-stream');\n return {\n ...rest,\n headers: newHeaders,\n body: body.blob\n };\n } else {\n const formData = new FormData();\n formData.append(body.uploadMethod.fieldName, body.blob);\n return {\n ...rest,\n headers,\n body: formData\n };\n }\n } else if (body && RuntimeFormData.isRuntimeFormData(body)) {\n const formData = new FormData();\n body.forEach((val, key) => {\n if (WebFileHandle.isWebFileHandle(val)) {\n let blob = val.blob;\n if (!blob.type) {\n blob = blob.slice(0, blob.size, 'application/octet-stream');\n }\n formData.append(key, blob, val.fileName() || undefined);\n } else {\n formData.append(key, val);\n }\n });\n return {\n ...rest,\n headers,\n body: formData\n };\n } else {\n return {\n ...rest,\n headers,\n body\n };\n }\n }\n\n /**\n * A type-guard to check whether a request body is a {@link WebFileHandle}.\n */\n static isWebFileHandle(body?: unknown): body is WebFileHandle {\n // We cannot use instanceof here since we might deal with a WebFileHandle from a different @staffbase/ui\n // instance.\n return isFileHandle(body) && (body as WebFileHandle).blob instanceof Blob;\n }\n}\n","import {Store, useStore} from '../../hooks/useStore/useStore';\nimport {createSharedInstance} from '../shared';\nimport {FileHandle, RuntimeAdapter} from './RuntimeAdapter';\nimport WebRuntime from './WebRuntime';\n\nconst store = createSharedInstance('runtime', () => new Store(new WebRuntime()));\n\n/**\n * Set the global {@link RuntimeAdapter}. This will update all components using it.\n * @param adapter - the new adapter\n */\nfunction setRuntimeAdapter(adapter: RuntimeAdapter): void {\n store.set(adapter);\n}\n\n/**\n * Retrieve the current {@link RuntimeAdapter}. This must not be used inside React components. Inside React components\n * use {@link useRuntimeAdapter} instead.\n */\nfunction getRuntimeAdapter(): RuntimeAdapter {\n return store.get();\n}\n\n/**\n * A React hook to retrieve the current {@link RuntimeAdapter}. Outside of React use {@link getRuntimeAdapter}.\n */\nfunction useRuntimeAdapter(): RuntimeAdapter {\n const [adapter] = useStore(store);\n return adapter;\n}\n\nexport {setRuntimeAdapter, getRuntimeAdapter, useRuntimeAdapter};\n","import React, {ReactNode} from 'react';\n\nimport {ApiRequestBuilder} from '../api/AbstractApi';\nimport {SimpleRequestBuilder} from '../api/SimpleRequestBuilder';\nimport {Store, useStore} from '../hooks/useStore/useStore';\nimport {createSharedInstance} from './shared';\n\n// If it fails, let it fail \"safely\" (without leaking data to the outside world).\nconst fallbackBuilder = new SimpleRequestBuilder({baseUrl: 'http://localhost'});\n\nconst store = createSharedInstance('staffbaseApiRequestBuilder', () => new Store(fallbackBuilder));\nconst StaffbaseApiContext = React.createContext(fallbackBuilder);\n\n/**\n * Set the global {@link ApiRequestBuilder} for use with Staffbase APIs. This will update all components using it.\n * @param requestBuilder - the new request builder\n */\nfunction setStaffbaseApi(requestBuilder: ApiRequestBuilder): void {\n store.set(requestBuilder);\n}\n\n/**\n * Retrieve the current {@link ApiRequestBuilder} for use with Staffbase APIs.\n * This must not be used inside React components. Inside React components use {@link useStaffbaseApi} instead.\n */\nfunction getStaffbaseApi(): ApiRequestBuilder {\n return store.get();\n}\n\n/**\n * A React hook to retrieve the current {@link ApiRequestBuilder} for use with Staffbase APIs.\n * Outside of React use {@link getStaffbaseApi}.\n */\nfunction useStaffbaseApi(): ApiRequestBuilder {\n const [apiRequestBuilder] = useStore(store);\n return apiRequestBuilder;\n}\n\n/**\n * Provide the {@link ApiRequestBuilder} for use with Staffbase APIs via context to all descendants.\n */\nfunction StaffbaseApiProvider(children?: ReactNode): React.ReactElement {\n const apiRequestBuilder = useStaffbaseApi();\n return {children};\n}\n\n/**\n * Retrieve the {@link ApiRequestBuilder} for use with Staffbase APIs from the current context\n * (should have {@link StaffbaseApiProvider} as one its\n * ancestors).\n */\nconst StaffbaseApiConsumer = StaffbaseApiContext.Consumer;\n\nexport {\n StaffbaseApiContext,\n StaffbaseApiProvider,\n StaffbaseApiConsumer,\n setStaffbaseApi,\n getStaffbaseApi,\n useStaffbaseApi\n};\n","import {isFileHandle, RuntimeRequestData} from '../adapters/runtime/RuntimeAdapter';\nimport RuntimeFormData from '../adapters/runtime/RuntimeFormData';\nimport {QueryParams, RequestOptions, ApiOverrides, ApiRequestBuilder} from './AbstractApi';\n\nexport interface SimpleRequestOptions {\n /**\n * The API's URL. Might be different per environment.\n */\n readonly baseUrl: string;\n}\n\nexport class SimpleRequestBuilder implements ApiRequestBuilder {\n public readonly version = 2;\n\n protected readonly requestOptions: SimpleRequestOptions;\n\n public constructor(requestOptions: SimpleRequestOptions) {\n this.requestOptions = requestOptions;\n }\n\n public buildRequest(\n requestOpts: RequestOptions & ApiOverrides\n ): RuntimeRequestData {\n const {baseUrl, body: content, endpoint, method, queryParams, signal} = requestOpts;\n const url = this.buildUrl({\n baseUrl: baseUrl,\n endpoint: endpoint || '',\n queryParams\n });\n\n const headers = new Headers(requestOpts.headers || {});\n\n let body;\n if (method.toUpperCase() === 'POST' || method.toUpperCase() === 'PUT' || method.toUpperCase() === 'PATCH') {\n if (content instanceof FormData || RuntimeFormData.isRuntimeFormData(content)) {\n body = content;\n } else if (!isFileHandle(content)) {\n if (!headers.has('Accept')) {\n headers.append('Accept', 'application/json');\n }\n if (!headers.has('Content-Type')) {\n headers.append('Content-Type', 'application/json');\n }\n if (content) {\n body = JSON.stringify(content);\n }\n } else {\n body = content;\n }\n }\n\n return {\n method,\n url,\n signal,\n headers,\n body\n };\n }\n\n protected buildUrl({\n baseUrl,\n endpoint,\n queryParams\n }: {\n baseUrl?: string;\n endpoint: string;\n queryParams?: Q;\n }): URL {\n let resolvedBaseUrl = this.requestOptions.baseUrl;\n if (baseUrl) {\n if (baseUrl.match(/^\\/[^/]/)) {\n resolvedBaseUrl += baseUrl;\n } else {\n resolvedBaseUrl = baseUrl;\n }\n }\n\n const url = new URL(`${resolvedBaseUrl}${endpoint}`);\n\n if (queryParams) {\n Object.keys(queryParams).forEach((key: string) => {\n const value = queryParams[key];\n if (value === undefined || value === null || value === '') {\n delete queryParams[key];\n }\n });\n const paramList = Object.keys(queryParams);\n paramList.sort();\n for (const key of paramList) {\n const value = queryParams[key];\n if (value instanceof Array) {\n value.forEach((subValue) => url.searchParams.append(key, subValue));\n } else {\n url.searchParams.append(key, value);\n }\n }\n }\n\n return url;\n }\n}\n","import {RuntimeRequestData} from '../adapters/runtime/RuntimeAdapter';\n\nclass ApiError extends Error {\n public readonly status: number;\n public readonly body: string | Record;\n public readonly request?: RuntimeRequestData;\n\n public constructor(\n method: string,\n endpoint: string,\n status: number,\n body = '',\n contentType?: string,\n requestData?: RuntimeRequestData\n ) {\n super(`Request '${method} ${endpoint}' failed with status ${status}`);\n this.status = status;\n\n if (body && contentType?.includes('application/json')) {\n try {\n this.body = JSON.parse(body);\n } catch (e) {\n this.body = body;\n }\n } else {\n this.body = body;\n }\n\n this.request = requestData;\n }\n}\n\nexport default ApiError;\n","class NetworkError extends Error {\n public constructor(err: unknown) {\n super(err instanceof Error ? err.message : undefined);\n }\n}\n\nexport default NetworkError;\n","import {getRuntimeAdapter} from '../adapters/runtime/AdapterStore';\nimport {FileHandle, RuntimeResponse, RuntimeRequestData, RequestData} from '../adapters/runtime/RuntimeAdapter';\nimport RuntimeFormData from '../adapters/runtime/RuntimeFormData';\nimport {getStaffbaseApi} from '../adapters/StaffbaseApiAdapter';\nimport ApiError from './ApiError';\nimport NetworkError from './NetworkError';\n\nexport type Version = '1.0' | '2.0';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type QueryParams = Record;\n\nexport interface RequestOptions {\n /**\n * The request's HTTP method.\n */\n method: RequestMethod;\n\n /**\n * The path the request should be send to - will be appended to the API's `baseUrl`\n */\n endpoint?: string;\n\n /**\n * Query params that will be added urlencoded and added to the querystring part of the URL of the request.\n */\n queryParams?: Q;\n\n /**\n * An `AbortSignal` that can be used to abort the underlying fetch request.\n */\n signal?: AbortSignal;\n\n /**\n * Headers object contains additional request headers and will be added to the request.\n */\n headers?: {[k: string]: string};\n\n /**\n * The request body.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n body?: FileHandle | RuntimeFormData | FormData | string | Record;\n\n /**\n * Whether we should not execute default error handler on error\n */\n disableDefaultErrorHandling?: boolean;\n\n /**\n * Whether Growl Behaviour should be silenced\n */\n silentFail?: boolean;\n}\n\n/**\n * HTTP request methods (intentionally restricted to common REST methods to reduce the possibility of errors).\n */\nexport type RequestMethod = 'GET' | 'HEAD' | 'OPTIONS' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n\nexport interface ApiOverrides {\n /**\n * The API's URL. If unset, the request builder decides.\n * If the URL starts with a `/` it is considered a relative URL and will be appended\n * to the BaseURL as reported by the request builder.\n */\n readonly baseUrl?: string;\n}\n\nexport interface ApiOptions extends ApiOverrides {\n /**\n * The `requestBuilder` is used to construct the base for each HTTP request.\n * Namely the URL to be used and the request to be sent. This is used to separate\n * feature specific API handling from generic API handling (like authentication and header manipulation).\n */\n readonly requestBuilder?: ApiRequestBuilder;\n\n /**\n * Additional error handler to communicate errors to users (e.g. by showing a Growl).\n */\n readonly onError?: (err: Error, silentFail?: boolean) => Promise | void;\n}\n\nexport type GetOptions = Omit, 'method' | 'body'>;\nexport type PostOptions = Omit, 'method'>;\nexport type PatchOptions = PostOptions;\nexport type PutOptions = PostOptions;\nexport type DeleteOptions = GetOptions;\n\n/**\n * @deprecated in favor of {@link RuntimeRequestData}\n */\nexport interface DeprecatedRequestData {\n url: URL;\n request: Omit;\n}\n\nexport interface ApiRequestBuilder {\n /**\n * A version used to correctly interop between different @staffbase/ui version.\n */\n readonly version: number;\n\n buildRequest(requestOpts: RequestOptions & ApiOverrides): RuntimeRequestData;\n}\n\nexport abstract class AbstractApi {\n protected readonly apiOpts: ApiOptions;\n\n protected get requestBuilder(): ApiRequestBuilder {\n return this.apiOpts.requestBuilder ? this.apiOpts.requestBuilder : getStaffbaseApi();\n }\n\n protected constructor(apiOpts: ApiOptions) {\n this.apiOpts = apiOpts;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected async get(requestOpts: GetOptions): Promise {\n return this.call({method: 'GET', ...requestOpts});\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected async post(requestOpts: PostOptions): Promise {\n return this.call({method: 'POST', ...requestOpts});\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected async patch(requestOpts: PatchOptions): Promise {\n return this.call({method: 'PATCH', ...requestOpts});\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected async put(requestOpts: PutOptions): Promise {\n return this.call({method: 'PUT', ...requestOpts});\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected async delete(requestOpts: DeleteOptions): Promise {\n return this.call({method: 'DELETE', ...requestOpts});\n }\n\n private async call(requestOpts: RequestOptions) {\n const {method, endpoint} = requestOpts;\n const requestData = this.requestBuilder.buildRequest({...requestOpts, baseUrl: this.apiOpts.baseUrl});\n\n try {\n let response: RuntimeResponse;\n let text: string;\n\n try {\n const runtimeAdapter = getRuntimeAdapter();\n response = await runtimeAdapter.fetch(requestData);\n text = await response.text();\n } catch (err) {\n if (err instanceof Error && err.name === 'AbortError') {\n // aborted requests should neither resolve nor reject, which is why we are returning a never resolving promise\n return new Promise(() => {\n // does never resolve on purpose\n });\n }\n\n throw new NetworkError(err);\n }\n\n const contentType = response.headers?.get('Content-Type');\n\n // Check whether the response is a successful one (status is in the range of 200-299)\n if (response.status < 200 || response.status >= 300) {\n throw new ApiError(method, endpoint || '', response.status, text, contentType || undefined, requestData);\n }\n\n if (!text) {\n return null;\n }\n\n if (contentType && contentType.match(/application\\/(.*\\+)?json/gm)) {\n try {\n return JSON.parse(text);\n } catch (e) {\n throw new ApiError(method, endpoint || '', response.status, e instanceof Error ? e.message : undefined);\n }\n }\n\n return text;\n } catch (err) {\n if (!requestOpts.disableDefaultErrorHandling && err instanceof Error) {\n return this.handleError(err, requestOpts.silentFail);\n } else {\n throw err;\n }\n }\n }\n\n protected handleError(err: Error, silentFail?: boolean): Promise | void {\n // eslint-disable-next-line no-undef\n if (process.env.NODE_ENV !== 'test') {\n console.error(err);\n }\n\n if (this.apiOpts.onError) {\n return this.apiOpts.onError(err, silentFail);\n } else {\n throw err;\n }\n }\n}\n\nexport {ApiError, NetworkError};\n","import {InstallationStatus} from 'api';\nimport useSWR from 'swr';\nimport useSWRMutation from 'swr/mutation';\n\nimport {AbstractApi, RequestOptions, QueryParams} from '@staffbase/ui';\n\nexport type Survey = SurveyInstallation & PluginInstallation;\n\ninterface SurveyInstallation {\n lastSurveyPublishedAt?: Date | null;\n nextSurveyPublishedAt?: Date | null;\n status?: InstallationStatus;\n}\n\nexport interface PluginInstallation {\n id: string;\n config: {\n icon?: string;\n localization: Record<\n string,\n {\n title: string;\n }\n >;\n };\n}\n\ninterface MenuItemsResponse {\n data: MenuItem[];\n}\n\nexport interface MenuItem {\n id: string;\n}\n\nexport interface ApiList {\n data?: PluginInstallation[];\n limit?: number;\n offset?: number;\n total?: number;\n}\n\nexport interface SurveysResponse {\n data: Survey[];\n total: number;\n}\n\n/**\n * TODO: Move to api package when AbstractApi is\n * bundled separately from @staffbase/ui\n */\nclass StaffbaseApi extends AbstractApi {\n public constructor() {\n super({});\n }\n\n /**\n * Used by API to be authenticated by sessionId\n * or session cookie\n */\n fetchToken = async (installationId: string): Promise<{jwt: string}> => {\n const requestOptions: RequestOptions = {\n method: 'GET',\n endpoint: `/api/installations/${installationId}/service/token`\n };\n\n return await this.get(requestOptions);\n };\n\n getInstallation = async (installationId: string): Promise => {\n const requestOptions: RequestOptions = {\n method: 'GET',\n endpoint: `/api/installations/${installationId}`\n };\n\n return await this.get(requestOptions);\n };\n\n getInstallations = async ({\n offset,\n limit,\n spaceId\n }: {\n offset: number;\n limit: number;\n spaceId: string | undefined;\n }): Promise => {\n const requestOptions: RequestOptions = {\n method: 'GET',\n endpoint: `/api/installations/administrated`,\n queryParams: {\n pluginID: 'surveys',\n spaceIDs: spaceId,\n limit: limit,\n offset: offset\n }\n };\n\n return await this.get(requestOptions);\n };\n\n getMenuItem = async (installationId: string): Promise => {\n const requestOptions: RequestOptions = {\n method: 'GET',\n endpoint: `/api/installations/${installationId}/menu/managed`\n };\n\n const menuItemsResponse: MenuItemsResponse = await this.get(requestOptions);\n\n return menuItemsResponse.data[0];\n };\n\n trackEvent = async (\n url: string,\n {arg}: {arg: {name: string; contentId?: string; contentType?: string; scope: string}}\n ) => {\n const requestOptions: RequestOptions = {\n method: 'POST',\n endpoint: url,\n body: {event: 'simple event', type: 'simple-event', payload: arg}\n };\n\n await this.post(requestOptions);\n };\n\n /**\n * TODO:\n * - the user shouldn't send this request.\n * - instead the plugin-backend should send a /self/unpublish request to the staffbase backend whenever someone cancels the schedule\n *\n * Unpublishes an installation on the Staffbase backend\n */\n unpublishInstallation = async (url: string) => {\n const requestOptions: RequestOptions = {\n method: 'POST',\n endpoint: url\n };\n\n await this.post(requestOptions);\n };\n}\n\nconst useStaffbaseApi = () => {\n const staffbaseApi = new StaffbaseApi();\n\n const {fetchToken, getInstallation, getMenuItem, trackEvent, unpublishInstallation} = staffbaseApi;\n\n return {fetchToken, getInstallation, getMenuItem, trackEvent, unpublishInstallation};\n};\n\nexport const useToken = (installationId: string) => {\n const {fetchToken} = new StaffbaseApi();\n\n return useSWR(`/api/installations/${installationId}/service/token`, () => fetchToken(installationId));\n};\n\nexport const useInstallation = (installationId: string) => {\n const {getInstallation} = new StaffbaseApi();\n\n return useSWR(`/api/installations/${installationId}`, () => getInstallation(installationId), {\n keepPreviousData: true\n });\n};\n\nexport const useInstallations = ({offset, limit, spaceId}: {offset: number; limit: number; spaceId?: string}) => {\n const {getInstallations} = new StaffbaseApi();\n\n return useSWR(\n [`/api/installations/administrated`, offset, limit, spaceId],\n () => getInstallations({offset, limit, spaceId}),\n {keepPreviousData: true}\n );\n};\n\nexport const useMenuItem = (installationId: string) => {\n const client = new StaffbaseApi();\n\n return useSWR(`/api/installations/${installationId}/menu/managed`, () => client.getMenuItem(installationId));\n};\n\nexport const useUnpublishInstallation = (installationID: string) => {\n const {unpublishInstallation} = new StaffbaseApi();\n\n return useSWRMutation(`/api/installations/${installationID}/unpublish`, unpublishInstallation);\n};\n\nexport const useTrackEvent = () => {\n const {trackEvent} = new StaffbaseApi();\n\n return useSWRMutation(`/tracking/event`, trackEvent);\n};\n\nexport default useStaffbaseApi;\n","import { u as useSWR } from '../use-swr-emll9s78.mjs';\nimport { withMiddleware } from '../_internal/index.mjs';\n\nconst immutable = (useSWRNext)=>(key, fetcher, config)=>{\n // Always override all revalidate options.\n config.revalidateOnFocus = false;\n config.revalidateIfStale = false;\n config.revalidateOnReconnect = false;\n config.refreshInterval = 0;\n return useSWRNext(key, fetcher, config);\n };\nconst useSWRImmutable = withMiddleware(useSWR, immutable);\n\nexport { useSWRImmutable as default, immutable };\n","'use strict';\n\n/**\n * Create a bound version of a function with a specified `this` context\n *\n * @param {Function} fn - The function to bind\n * @param {*} thisArg - The value to be passed as the `this` parameter\n * @returns {Function} A new function that will call the original function with the specified `this` context\n */\nexport default function bind(fn, thisArg) {\n return function wrap() {\n return fn.apply(thisArg, arguments);\n };\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age',\n 'authorization',\n 'content-length',\n 'content-type',\n 'etag',\n 'expires',\n 'from',\n 'host',\n 'if-modified-since',\n 'if-unmodified-since',\n 'last-modified',\n 'location',\n 'max-forwards',\n 'proxy-authorization',\n 'referer',\n 'retry-after',\n 'user-agent',\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default (rawHeaders) => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders &&\n rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n const hasKey = utils.hasOwnProp(parsed, key);\n\n if (!key || (hasKey && utils.hasOwnProp(ignoreDuplicateOf, key))) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (hasKey) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = hasKey ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\nfunction trimSPorHTAB(str) {\n let start = 0;\n let end = str.length;\n\n while (start < end) {\n const code = str.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = str.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === str.length ? str : str.slice(start, end);\n}\n\n// The control-code ranges are intentional: header sanitization strips C0/DEL bytes.\n// eslint-disable-next-line no-control-regex\nconst INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\\\u0000-\\\\u0008\\\\u000a-\\\\u001f\\\\u007f]+', 'g');\n// eslint-disable-next-line no-control-regex\nconst INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\\\u0009\\\\u0020-\\\\u007e\\\\u0080-\\\\u00ff]+', 'g');\n\nfunction sanitizeValue(value, invalidChars) {\n if (utils.isArray(value)) {\n return value.map((item) => sanitizeValue(item, invalidChars));\n }\n\n return trimSPorHTAB(String(value).replace(invalidChars, ''));\n}\n\nexport const sanitizeHeaderValue = (value) =>\n sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);\n\nexport const sanitizeByteStringHeaderValue = (value) =>\n sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);\n\nexport function toByteStringHeaderObject(headers) {\n const byteStringHeaders = Object.create(null);\n\n utils.forEach(headers.toJSON(), (value, header) => {\n byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);\n });\n\n return byteStringHeaders;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\nimport { sanitizeHeaderValue } from '../helpers/sanitizeHeaderValue.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst parameterNameRE = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\n\nfunction trimOWS(value) {\n let start = 0;\n let end = value.length;\n\n while (start < end) {\n const code = value.charCodeAt(start);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n start += 1;\n }\n\n while (end > start) {\n const code = value.charCodeAt(end - 1);\n\n if (code !== 0x09 && code !== 0x20) {\n break;\n }\n\n end -= 1;\n }\n\n return start === 0 && end === value.length ? value : value.slice(start, end);\n}\n\nfunction decodeQuotedString(value) {\n const last = value.length - 1;\n\n if (last < 1 || value.charCodeAt(0) !== 0x22 || value.charCodeAt(last) !== 0x22) {\n return value;\n }\n\n let decoded = '';\n\n for (let i = 1; i < last; i++) {\n const code = value.charCodeAt(i);\n\n if (code === 0x22) {\n return value;\n }\n\n if (code === 0x5c) {\n i += 1;\n\n if (i >= last) {\n return value;\n }\n }\n\n decoded += value[i];\n }\n\n return decoded;\n}\n\nfunction parseParameters(value) {\n const parameters = Object.create(null);\n const str = String(value);\n let start = 0;\n let quoted = false;\n let escaped = false;\n\n function parseParameter(end) {\n const part = trimOWS(str.slice(start, end));\n const equals = part.indexOf('=');\n\n if (equals < 1) {\n return;\n }\n\n const name = trimOWS(part.slice(0, equals));\n\n if (!parameterNameRE.test(name)) {\n return;\n }\n\n const normalizedName = name.toLowerCase();\n\n if (\n normalizedName === '__proto__' ||\n normalizedName === 'constructor' ||\n normalizedName === 'prototype'\n ) {\n return;\n }\n\n const parameterValue = trimOWS(part.slice(equals + 1));\n parameters[normalizedName] = decodeQuotedString(parameterValue);\n }\n\n for (let i = 0; i < str.length; i++) {\n const code = str.charCodeAt(i);\n\n if (quoted) {\n if (escaped) {\n escaped = false;\n } else if (code === 0x5c) {\n escaped = true;\n } else if (code === 0x22) {\n quoted = false;\n }\n } else if (code === 0x22) {\n quoted = true;\n } else if (code === 0x2c || code === 0x3b) {\n parseParameter(i);\n start = i + 1;\n }\n }\n\n parseParameter(str.length);\n\n return parameters;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header\n .trim()\n .toLowerCase()\n .replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach((methodName) => {\n Object.defineProperty(obj, methodName + accessorName, {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: function (arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true,\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n return;\n }\n\n const key = utils.findKey(self, lHeader);\n\n if (\n !key ||\n self[key] === undefined ||\n _rewrite === true ||\n (_rewrite === undefined && self[key] !== false)\n ) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite);\n } else if (utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isObject(header) && utils.isSafeIterable(header)) {\n let obj = Object.create(null),\n dest,\n key;\n for (const entry of header) {\n if (!utils.isArray(entry)) {\n throw new TypeError('Object iterator must return a key-value pair');\n }\n\n key = entry[0];\n\n if (utils.hasOwnProp(obj, key)) {\n dest = obj[key];\n obj[key] = utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]];\n } else {\n obj[key] = entry[1];\n }\n }\n\n setHeaders(obj, valueOrRewrite);\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(\n key &&\n this[key] !== undefined &&\n (!matcher || matchHeaderValue(this, this[key], key, matcher))\n );\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null &&\n value !== false &&\n (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON())\n .map(([header, value]) => header + ': ' + value)\n .join('\\n');\n }\n\n getSetCookie() {\n const value = this.get('set-cookie');\n return utils.isArray(value) ? value : value == null || value === false ? [] : [value];\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static parseParameters(value) {\n return parseParameters(value);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals =\n (this[$internals] =\n this[$internals] =\n {\n accessors: {},\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor([\n 'Content-Type',\n 'Content-Length',\n 'Accept',\n 'Accept-Encoding',\n 'User-Agent',\n 'Authorization',\n]);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n },\n };\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nexport const REDACTED = '[REDACTED ****]';\n\nfunction hasOwnOrPrototypeToJSON(source) {\n if (utils.hasOwnProp(source, 'toJSON')) {\n return true;\n }\n\n let prototype = Object.getPrototypeOf(source);\n\n while (prototype && prototype !== Object.prototype) {\n if (utils.hasOwnProp(prototype, 'toJSON')) {\n return true;\n }\n\n prototype = Object.getPrototypeOf(prototype);\n }\n\n return false;\n}\n\n// Build a plain-object snapshot of `config` and replace the value of any key\n// (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays\n// and AxiosHeaders, and short-circuits on circular references.\nfunction redactConfig(config, redactKeys) {\n const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));\n const seen = [];\n\n const visit = (source) => {\n if (source === null || typeof source !== 'object') return source;\n if (utils.isBuffer(source)) return source;\n if (seen.indexOf(source) !== -1) return undefined;\n\n if (source instanceof AxiosHeaders) {\n source = source.toJSON();\n }\n\n seen.push(source);\n\n let result;\n if (utils.isArray(source)) {\n result = [];\n source.forEach((v, i) => {\n const reducedValue = visit(v);\n if (!utils.isUndefined(reducedValue)) {\n result[i] = reducedValue;\n }\n });\n } else {\n if (!utils.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {\n seen.pop();\n return source;\n }\n\n result = Object.create(null);\n for (const [key, value] of Object.entries(source)) {\n const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);\n if (!utils.isUndefined(reducedValue)) {\n result[key] = reducedValue;\n }\n }\n }\n\n seen.pop();\n return result;\n };\n\n return visit(config);\n}\n\nfunction stringifySafely(value) {\n try {\n return String(value);\n } catch (err) {\n return '';\n }\n}\n\nfunction aggregateErrorMessage(error) {\n const message = error.errors\n .map((entry) => {\n try {\n return entry && entry.message ? stringifySafely(entry.message) : stringifySafely(entry);\n } catch (err) {\n return '';\n }\n })\n .filter(Boolean)\n .join('; ');\n\n return message || error.name || 'AggregateError';\n}\n\nclass AxiosError extends Error {\n static from(error, code, config, request, response, customProps) {\n // `AggregateError` (thrown by Node on dual-stack/Happy-Eyeballs connection\n // failures) has an empty `message`; its detail lives in `errors[]`. Without\n // this, the wrapped error surfaces with a blank message (see #6721).\n let message = error.message;\n if (!message && utils.isArray(error.errors) && error.errors.length) {\n message = aggregateErrorMessage(error);\n }\n\n const axiosError = new AxiosError(message, code || error.code, config, request, response);\n // Match native `Error` `cause` semantics: non-enumerable. The wrapped\n // error often carries circular internals (sockets, requests, agents), so\n // an enumerable `cause` makes structured loggers (pino/winston) and any\n // own-property walk throw \"Converting circular structure to JSON\".\n // Regression from #6982; see #7205. `__proto__: null` mirrors the\n // `message` descriptor below (prototype-pollution-safe descriptor).\n Object.defineProperty(axiosError, 'cause', {\n __proto__: null,\n value: error,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n axiosError.name = error.name;\n\n // Preserve status from the original error if not already set from response\n if (error.status != null && axiosError.status == null) {\n axiosError.status = error.status;\n }\n\n customProps && Object.assign(axiosError, customProps);\n return axiosError;\n }\n\n /**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\n constructor(message, code, config, request, response) {\n super(message);\n\n // Make message enumerable to maintain backward compatibility\n // The native Error constructor sets message as non-enumerable,\n // but axios < v1.13.3 had it as enumerable\n Object.defineProperty(this, 'message', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: message,\n enumerable: true,\n writable: true,\n configurable: true,\n });\n\n this.name = 'AxiosError';\n this.isAxiosError = true;\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status;\n }\n }\n\n toJSON() {\n // Opt-in redaction: when the request config carries a `redact` array, the\n // value of any matching key (case-insensitive, at any depth) is replaced\n // with REDACTED in the serialized snapshot. Undefined or empty leaves the\n // existing serialization behavior unchanged.\n const config = this.config;\n const redactKeys = config && utils.hasOwnProp(config, 'redact') ? config.redact : undefined;\n const serializedConfig =\n utils.isArray(redactKeys) && redactKeys.length > 0\n ? redactConfig(config, redactKeys)\n : utils.toJSONObject(config);\n\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: serializedConfig,\n code: this.code,\n status: this.status,\n };\n }\n}\n\n// This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.\nAxiosError.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';\nAxiosError.ERR_BAD_OPTION = 'ERR_BAD_OPTION';\nAxiosError.ECONNABORTED = 'ECONNABORTED';\nAxiosError.ETIMEDOUT = 'ETIMEDOUT';\nAxiosError.ECONNREFUSED = 'ECONNREFUSED';\nAxiosError.ERR_NETWORK = 'ERR_NETWORK';\nAxiosError.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';\nAxiosError.ERR_DEPRECATED = 'ERR_DEPRECATED';\nAxiosError.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';\nAxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';\nAxiosError.ERR_CANCELED = 'ERR_CANCELED';\nAxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';\nAxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';\nAxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';\n\nexport default AxiosError;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\nimport PlatformBuffer from '../platform/node/classes/Buffer.js';\n\n// Default nesting limit shared with the inverse transform (formDataToJSON) so\n// the FormData <-> JSON round-trip stays symmetric.\nexport const DEFAULT_FORM_DATA_MAX_DEPTH = 100;\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path\n .concat(key)\n .map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n })\n .join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n const option = (name, fallback) => {\n const value = utils.getSafeProp(options, name);\n return utils.isUndefined(value) ? fallback : value;\n };\n\n const metaTokens = option('metaTokens', true);\n // eslint-disable-next-line no-use-before-define\n const visitor = option('visitor') || defaultVisitor;\n const dots = option('dots', false);\n const indexes = option('indexes', false);\n const _Blob = option('Blob') || (typeof Blob !== 'undefined' && Blob);\n const maxDepth = option('maxDepth', DEFAULT_FORM_DATA_MAX_DEPTH);\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n const stack = [];\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (utils.isBoolean(value)) {\n return value.toString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n if (useBlob && typeof _Blob === 'function') {\n return new _Blob([value]);\n }\n if (PlatformBuffer && PlatformBuffer.isBufferAvailable()) {\n return PlatformBuffer.from(value);\n }\n throw new AxiosError(\n 'Blob is not supported. Use a Buffer instead.',\n AxiosError.ERR_NOT_SUPPORT\n );\n }\n\n return value;\n }\n\n function throwIfMaxDepthExceeded(depth) {\n if (depth > maxDepth) {\n throw new AxiosError(\n 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n }\n\n function stringifyWithDepthLimit(value, depth) {\n if (maxDepth === Infinity) {\n return JSON.stringify(value);\n }\n\n const ancestors = [];\n\n return JSON.stringify(value, function limitDepth(_key, currentValue) {\n if (!utils.isObject(currentValue)) {\n return currentValue;\n }\n\n while (ancestors.length && ancestors[ancestors.length - 1] !== this) {\n ancestors.pop();\n }\n\n ancestors.push(currentValue);\n throwIfMaxDepthExceeded(depth + ancestors.length - 1);\n\n return currentValue;\n });\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (utils.isReactNative(formData) && utils.isReactNativeBlob(value)) {\n formData.append(renderKey(path, key, dots), convertValue(value));\n return false;\n }\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = stringifyWithDepthLimit(value, 1);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value)))\n ) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) &&\n formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true\n ? renderKey([key], index, dots)\n : indexes === null\n ? key\n : key + '[]',\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable,\n });\n\n function build(value, path, depth = 0) {\n if (utils.isUndefined(value)) return;\n\n throwIfMaxDepthExceeded(depth);\n\n if (stack.indexOf(value) !== -1) {\n throw new Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result =\n !(utils.isUndefined(el) || el === null) &&\n visitor.call(formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers);\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key], depth + 1);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder\n ? (value) => encoder.call(this, value, encode)\n : encode;\n\n return this._pairs\n .map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '')\n .join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from './AxiosURLSearchParams.js';\n\n/**\n * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with\n * their plain counterparts (`:`, `$`, `,`, `+`).\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nexport function encode(val) {\n return encodeURIComponent(val)\n .replace(/%3A/gi, ':')\n .replace(/%24/g, '$')\n .replace(/%2C/gi, ',')\n .replace(/%20/g, '+');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n if (!params) {\n return url;\n }\n url = url || '';\n\n const _options = utils.isFunction(options)\n ? {\n serialize: options,\n }\n : options;\n\n // Read serializer options pollution-safely: own properties and methods on a\n // class/template prototype are honored, but values injected onto a polluted\n // Object.prototype are ignored.\n const _encode = utils.getSafeProp(_options, 'encode') || encode;\n const serializeFn = utils.getSafeProp(_options, 'serialize');\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, _options);\n } else {\n serializedParams = utils.isURLSearchParams(params)\n ? params.toString()\n : new AxiosURLSearchParams(params, _options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf('#');\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\nconst $internals = Symbol('internals');\n\n// `handlers` is public and may be replaced with a nullish value by user code;\n// `clear()` has always tolerated that. Treat it as an empty stack rather than\n// dereferencing it.\nfunction countHandlers(handlers) {\n return handlers ? handlers.length : 0;\n}\n\nfunction trimHandlers(handlers) {\n if (!handlers) {\n return;\n }\n\n while (handlers.length && handlers[handlers.length - 1] === null) {\n handlers.pop();\n }\n}\n\nfunction syncHandlerEntries(manager, internals) {\n const handlers = manager.handlers;\n const length = countHandlers(handlers);\n\n if (handlers !== internals.handlersRef) {\n internals.handlersRef = handlers;\n internals.handlerEntries.clear();\n } else if (length !== internals.handlersLength) {\n if (!length) {\n internals.handlerEntries.clear();\n } else {\n internals.handlerEntries.forEach(function removeStaleEntry(entry, id) {\n if (handlers[entry.index] !== entry.handler) {\n internals.handlerEntries.delete(id);\n }\n });\n }\n }\n\n internals.handlersLength = length;\n}\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n this[$internals] = {\n handlersRef: this.handlers,\n handlersLength: this.handlers.length,\n handlerEntries: new Map(),\n iterationDepth: 0,\n nextId: 0,\n };\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n * @param {Object} options The options for the interceptor, synchronous and runWhen\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n const handler = {\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null,\n };\n const internals = this[$internals];\n\n if (this.handlers == null) {\n this.handlers = [];\n }\n\n syncHandlerEntries(this, internals);\n\n const id = internals.nextId++;\n\n this.handlers.push(handler);\n internals.handlerEntries.set(id, {\n handler,\n index: this.handlers.length - 1,\n });\n internals.handlersLength = this.handlers.length;\n\n return id;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {void}\n */\n eject(id) {\n const internals = this[$internals];\n\n syncHandlerEntries(this, internals);\n\n const entry = internals.handlerEntries.get(id);\n\n if (entry) {\n internals.handlerEntries.delete(id);\n\n // Ignore IDs invalidated by clear or direct replacement of handlers.\n if (this.handlers[entry.index] !== entry.handler) {\n return;\n }\n\n this.handlers[entry.index] = null;\n\n // Do not reuse an index while forEach is walking its length snapshot.\n if (!internals.iterationDepth) {\n trimHandlers(this.handlers);\n internals.handlersLength = this.handlers.length;\n }\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n syncHandlerEntries(this, this[$internals]);\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n const internals = this[$internals];\n\n syncHandlerEntries(this, internals);\n\n internals.iterationDepth++;\n\n try {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n } finally {\n if (!--internals.iterationDepth) {\n syncHandlerEntries(this, internals);\n trimHandlers(this.handlers);\n internals.handlersLength = countHandlers(this.handlers);\n }\n }\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false,\n legacyInterceptorReqResOrdering: true,\n advertiseZstdAcceptEncoding: false,\n validateStatusUndefinedResolves: true,\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict';\n\nexport default typeof Blob !== 'undefined' ? Blob : null;\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = (typeof navigator === 'object' && navigator) || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv =\n hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = (hasBrowserEnv && window.location.href) || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin,\n};\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform,\n};\n","import URLSearchParams from './classes/URLSearchParams.js';\nimport FormData from './classes/FormData.js';\nimport Blob from './classes/Blob.js';\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob,\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport { DEFAULT_FORM_DATA_MAX_DEPTH } from './toFormData.js';\n\nconst MAX_DEPTH = DEFAULT_FORM_DATA_MAX_DEPTH;\n\nfunction throwIfDepthExceeded(index) {\n if (index > MAX_DEPTH) {\n throw new AxiosError(\n 'FormData field is too deeply nested (' + index + ' levels). Max depth: ' + MAX_DEPTH,\n AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED\n );\n }\n}\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z] -> ['foo', 'x', 'y', 'z']\n // foo.x.y.z -> ['foo', 'x', 'y', 'z']\n // A path is split on `.` and on `[...]` groups. A segment — whether written\n // in dot notation or captured inside brackets — may contain any character\n // except `.`, `[` and `]`, so a key like `user-name` or `user name` is kept\n // literal instead of being split (#5402). `.`, `[` and `]` keep their existing\n // meaning, e.g. `foo[bar.baz]` -> ['foo', 'bar', 'baz'] and `[]` is an array push.\n // Excluding `[` from the bracket group also makes the match fail fast at the\n // next `[`, so a malformed name cannot rescan to the end of the string from\n // every unmatched `[` — parsing stays linear in the length of the name.\n const path = [];\n const pattern = /[^.[\\]]+|\\[([^.[\\]]*)]/g;\n let match;\n\n while ((match = pattern.exec(name)) !== null) {\n throwIfDepthExceeded(path.length);\n path.push(match[0] === '[]' ? '' : match[1] || match[0]);\n }\n\n return path;\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n throwIfDepthExceeded(index);\n\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = utils.isArray(target[name])\n ? target[name].concat(value)\n : [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!utils.hasOwnProp(target, name) || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nconst methodList = Object.freeze([\n 'get',\n 'delete',\n 'head',\n 'options',\n 'post',\n 'put',\n 'patch',\n 'purge',\n 'link',\n 'unlink',\n 'query',\n]);\n\nexport default methodList;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\nimport methodList from '../core/methodList.js';\n\nconst own = (obj, key) => (obj != null && utils.hasOwnProp(obj, key) ? obj[key] : undefined);\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [\n function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n const formSerializer = own(this, 'formSerializer');\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, formSerializer).toString();\n }\n\n if (\n (isFileList = utils.isFileList(data)) ||\n contentType.indexOf('multipart/form-data') > -1\n ) {\n const env = own(this, 'env');\n const _FormData = env && env.FormData;\n\n return toFormData(\n isFileList ? { 'files[]': data } : data,\n _FormData && new _FormData(),\n formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n },\n ],\n\n transformResponse: [\n function transformResponse(data) {\n const transitional = own(this, 'transitional') || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const responseType = own(this, 'responseType');\n const JSONRequested = responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (\n data &&\n utils.isString(data) &&\n ((forcedJSONParsing && !responseType) || JSONRequested)\n ) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data, own(this, 'parseReviver'));\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));\n }\n throw e;\n }\n }\n }\n\n return data;\n },\n ],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob,\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n Accept: 'application/json, text/plain, */*',\n 'Content-Type': undefined,\n },\n },\n};\n\nutils.forEach(methodList, (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), {\n visitor: function (value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n },\n ...options,\n });\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\n\nclass CanceledError extends AxiosError {\n /**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\n constructor(message, config, request) {\n super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n this.__CANCEL__ = true;\n }\n}\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE,\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nconst urlParserControlCharacters = /[\\t\\n\\r]/g;\n\n/**\n * Match WHATWG URL preprocessing before checking a URL's protocol.\n *\n * @param {string} url\n *\n * @returns {string}\n */\nexport default function normalizeURLForProtocolCheck(url) {\n if (typeof url !== 'string') {\n return url;\n }\n\n let start = 0;\n\n while (start < url.length && url.charCodeAt(start) <= 0x20) {\n start++;\n }\n\n return url.slice(start).replace(urlParserControlCharacters, '');\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25}):(?:\\/\\/)?/.exec(url);\n return (match && match[1]) || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round((bytesCount * 1000) / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Array}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn(...args);\n };\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if (passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs);\n }, threshold - passed);\n }\n }\n };\n\n const flush = () => lastArgs && invoke(lastArgs);\n const flushWith = (...args) => invoke(args);\n\n return [throttled, flush, flushWith];\n}\n\nexport default throttle;\n","import speedometer from './speedometer.js';\nimport throttle from './throttle.js';\nimport utils from '../utils.js';\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle((e) => {\n if (!e || !utils.isNumber(e.loaded)) {\n return;\n }\n const rawLoaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const loaded = Math.max(0, total != null ? Math.min(rawLoaded, total) : rawLoaded);\n const progressBytes = Math.max(0, loaded - bytesNotified);\n const rate = _speedometer(progressBytes);\n\n bytesNotified = Math.max(bytesNotified, loaded);\n\n const data = {\n loaded,\n total,\n progress: total ? loaded / total : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true,\n };\n\n listener(data);\n }, freq);\n};\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [\n (loaded) =>\n throttled[0]({\n lengthComputable,\n total,\n loaded,\n }),\n throttled[1],\n ];\n};\n\nexport const asyncDecorator =\n (fn, scheduler = utils.asap) =>\n (...args) =>\n scheduler(() => fn(...args));\n","import utils from '../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv\n ? // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure, sameSite) {\n if (typeof document === 'undefined') return;\n\n const cookie = [`${name}=${encodeURIComponent(value)}`];\n\n if (utils.isNumber(expires)) {\n cookie.push(`expires=${new Date(expires).toUTCString()}`);\n }\n if (utils.isString(path)) {\n cookie.push(`path=${path}`);\n }\n if (utils.isString(domain)) {\n cookie.push(`domain=${domain}`);\n }\n if (secure === true) {\n cookie.push('secure');\n }\n if (utils.isString(sameSite)) {\n cookie.push(`SameSite=${sameSite}`);\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n if (typeof document === 'undefined') return null;\n // Match name=value by splitting on the semicolon separator instead of building a\n // RegExp from `name` — interpolating an unescaped string into a RegExp would let\n // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or\n // match the wrong cookie. Browsers may serialize cookie pairs as either \";\" or\n // \"; \", so ignore optional whitespace before each cookie name.\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i].replace(/^\\s+/, '');\n const eq = cookie.indexOf('=');\n if (eq !== -1 && cookie.slice(0, eq) === name) {\n try {\n return decodeURIComponent(cookie.slice(eq + 1));\n } catch (e) {\n return cookie.slice(eq + 1);\n }\n }\n }\n return null;\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000, '/');\n },\n }\n : // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {},\n };\n","'use strict';\n\nimport AxiosError, { REDACTED } from './AxiosError.js';\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\nimport normalizeURLForProtocolCheck from '../helpers/normalizeURLForProtocolCheck.js';\n\nconst malformedHttpProtocol = /^https?:(?!\\/\\/)/i;\n\n// Redact the parts of a URL that can carry secrets before it is embedded in an\n// error message. AxiosError.toJSON() serializes `message` verbatim and errors\n// are commonly logged, while the opt-in `config.redact` model only cleans\n// config keys — it cannot reach the message. Redact only the genuinely\n// sensitive substrings — userinfo (credentials), query parameter values and\n// fragment contents — with the same REDACTED marker the config redaction uses,\n// while keeping the scheme, host, path and parameter names so the offending\n// request stays accurately identifiable.\nfunction redactFragment(fragment) {\n if (!fragment) {\n return fragment;\n }\n\n return fragment.replace(/(^|&)([^=&]*=)?[^&]+/g, (match, separator, parameterName = '') => {\n return `${separator}${parameterName}${REDACTED}`;\n });\n}\n\nfunction redactSensitiveURLParts(url) {\n const redactedURL = url.replace(/^(https?:\\/{0,2})[^/?#]*@/i, `$1${REDACTED}@`);\n const fragmentIndex = redactedURL.indexOf('#');\n const urlWithoutFragment =\n fragmentIndex === -1 ? redactedURL : redactedURL.slice(0, fragmentIndex);\n const redactedURLWithoutFragment = urlWithoutFragment.replace(\n /([?&][^=&#]*=)[^&#]*/g,\n `$1${REDACTED}`\n );\n\n if (fragmentIndex === -1) {\n return redactedURLWithoutFragment;\n }\n\n return `${redactedURLWithoutFragment}#${redactFragment(redactedURL.slice(fragmentIndex + 1))}`;\n}\n\nfunction assertValidHttpProtocolURL(url, config) {\n if (typeof url === 'string') {\n const normalizedURL = normalizeURLForProtocolCheck(url);\n if (malformedHttpProtocol.test(normalizedURL)) {\n throw new AxiosError(\n `Invalid URL ${JSON.stringify(redactSensitiveURLParts(normalizedURL))}: missing \"//\" after protocol`,\n AxiosError.ERR_INVALID_URL,\n config\n );\n }\n }\n}\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls, config) {\n assertValidHttpProtocolURL(requestedURL, config);\n let isRelativeUrl = !isAbsoluteURL(requestedURL);\n if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {\n assertValidHttpProtocolURL(baseURL, config);\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n if (typeof url !== 'string') {\n return false;\n }\n\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n if (!relativeURL) {\n return baseURL;\n }\n\n let end = baseURL.length;\n\n while (end > 0 && baseURL.charCodeAt(end - 1) === 47) {\n end--;\n }\n\n return baseURL.slice(0, end) + '/' + relativeURL.replace(/^\\/+/, '');\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);\n\nconst ownEnumerableKeys = (thing) => {\n if (Object.getOwnPropertySymbols && Object.getOwnPropertyDescriptor) {\n return Object.keys(thing).concat(\n Object.getOwnPropertySymbols(thing).filter(\n (symbol) => Object.getOwnPropertyDescriptor(thing, symbol).enumerable\n )\n );\n }\n return Object.keys(thing);\n};\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config1 = config1 || {};\n config2 = config2 || {};\n\n // Use a null-prototype object so that downstream reads such as `config.auth`\n // or `config.baseURL` cannot inherit polluted values from Object.prototype.\n // `hasOwnProperty` is restored as a non-enumerable own slot to preserve\n // ergonomics for user code that relies on it.\n const config = Object.create(null);\n Object.defineProperty(config, 'hasOwnProperty', {\n // Null-proto descriptor so a polluted Object.prototype.get cannot turn\n // this data descriptor into an accessor descriptor on the way in.\n __proto__: null,\n value: Object.prototype.hasOwnProperty,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({ caseless }, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(a, b, prop, caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop, caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop, caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n function getMergedTransitionalOption(prop) {\n const transitional2 = utils.hasOwnProp(config2, 'transitional')\n ? config2.transitional\n : undefined;\n\n if (!utils.isUndefined(transitional2)) {\n if (utils.isPlainObject(transitional2)) {\n if (utils.hasOwnProp(transitional2, prop)) {\n return transitional2[prop];\n }\n } else {\n return undefined;\n }\n }\n\n const transitional1 = utils.hasOwnProp(config1, 'transitional')\n ? config1.transitional\n : undefined;\n\n if (utils.isPlainObject(transitional1) && utils.hasOwnProp(transitional1, prop)) {\n return transitional1[prop];\n }\n\n return undefined;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (utils.hasOwnProp(config2, prop)) {\n return getMergedValue(a, b);\n } else if (utils.hasOwnProp(config1, prop)) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutErrorMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n allowedSocketPaths: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b, prop) =>\n mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),\n };\n\n utils.forEach(ownEnumerableKeys({ ...config1, ...config2 }), function computeConfigValue(prop) {\n if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;\n const merge = utils.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;\n const a = utils.hasOwnProp(config1, prop) ? config1[prop] : undefined;\n const b = utils.hasOwnProp(config2, prop) ? config2[prop] : undefined;\n const configValue = merge(a, b, prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n if (\n utils.hasOwnProp(config2, 'validateStatus') &&\n utils.isUndefined(config2.validateStatus) &&\n getMergedTransitionalOption('validateStatusUndefinedResolves') === false\n ) {\n if (utils.hasOwnProp(config1, 'validateStatus')) {\n config.validateStatus = getMergedValue(undefined, config1.validateStatus);\n } else {\n delete config.validateStatus;\n }\n }\n\n return config;\n}\n","'use strict';\n\nconst FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];\n\n/**\n * Apply the headers generated by a FormData implementation to the request headers,\n * honoring the `formDataHeaderPolicy` option: with 'content-only', copy only the\n * content-* headers; otherwise merge all of them.\n *\n * @param {AxiosHeaders} headers - the request headers to mutate\n * @param {Object | null | undefined} formHeaders - headers produced by the FormData implementation\n * @param {String} [policy] - the resolved `formDataHeaderPolicy` config value\n *\n * @returns {void}\n */\nexport default function setFormDataHeaders(headers, formHeaders, policy) {\n if (policy !== 'content-only') {\n headers.set(formHeaders);\n return;\n }\n\n Object.entries(formHeaders || {}).forEach(([key, val]) => {\n if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {\n headers.set(key, val);\n }\n });\n}\n","import platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport isURLSameOrigin from './isURLSameOrigin.js';\nimport cookies from './cookies.js';\nimport buildFullPath from '../core/buildFullPath.js';\nimport mergeConfig from '../core/mergeConfig.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport setFormDataHeaders from '../core/setFormDataHeaders.js';\nimport buildURL from './buildURL.js';\n\n/**\n * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().\n * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.\n *\n * @param {string} str The string to encode\n *\n * @returns {string} UTF-8 bytes as a Latin-1 string\n */\nconst encodeUTF8 = (str) =>\n encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>\n String.fromCharCode(parseInt(hex, 16))\n );\n\nfunction resolveConfig(config) {\n const newConfig = mergeConfig({}, config);\n\n // Read only own properties to prevent prototype pollution gadgets\n // (e.g. Object.prototype.baseURL = 'https://evil.com').\n const own = (key) => (utils.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);\n\n const data = own('data');\n let withXSRFToken = own('withXSRFToken');\n const xsrfHeaderName = own('xsrfHeaderName');\n const xsrfCookieName = own('xsrfCookieName');\n let headers = own('headers');\n const auth = own('auth');\n const baseURL = own('baseURL');\n const allowAbsoluteUrls = own('allowAbsoluteUrls');\n const url = own('url');\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(\n buildFullPath(baseURL, url, allowAbsoluteUrls, newConfig),\n own('params'),\n own('paramsSerializer')\n );\n\n // HTTP basic authentication\n if (auth) {\n const username = utils.getSafeProp(auth, 'username') || '';\n const password = utils.getSafeProp(auth, 'password') || '';\n\n try {\n headers.set(\n 'Authorization',\n 'Basic ' + btoa(username + ':' + (password ? encodeUTF8(password) : ''))\n );\n } catch (e) {\n throw AxiosError.from(e, AxiosError.ERR_BAD_OPTION_VALUE, config);\n }\n }\n\n if (utils.isFormData(data)) {\n const getHeaders = utils.getSafeProp(data, 'getHeaders');\n\n if (\n platform.hasStandardBrowserEnv ||\n platform.hasStandardBrowserWebWorkerEnv ||\n utils.isReactNative(data)\n ) {\n headers.setContentType(undefined); // browser/web worker/RN handles it\n } else if (utils.isFunction(getHeaders)) {\n // Node.js FormData (like form-data package)\n setFormDataHeaders(headers, getHeaders.call(data), own('formDataHeaderPolicy'));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n if (utils.isFunction(withXSRFToken)) {\n withXSRFToken = withXSRFToken(newConfig);\n }\n\n // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)\n // and misconfigurations (e.g. \"false\") from short-circuiting the same-origin check and leaking\n // the XSRF token cross-origin.\n const shouldSendXSRF =\n withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));\n\n if (shouldSendXSRF) {\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\nexport default resolveConfig;\n","import utils from '../utils.js';\nimport settle from '../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport normalizeURLForProtocolCheck from '../helpers/normalizeURLForProtocolCheck.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport { progressEventReducer } from '../helpers/progressEventReducer.js';\nimport resolveConfig from '../helpers/resolveConfig.js';\nimport { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported &&\n function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let { responseType, onUploadProgress, onDownloadProgress } = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload, flushDownloadWithEvent;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend(event) {\n if (!request) {\n return;\n }\n\n // Status 0 means no response was received, which onerror and onabort normally\n // reject before this runs. Firefox 152 fires only readystatechange and loadend for\n // navigation-canceled requests (https://bugzilla.mozilla.org/show_bug.cgi?id=1505389),\n // leaving settle() to resolve them as an empty success. ECONNABORTED is the error\n // onabort raised on Firefox 151. Reads over file:, which some environments report as\n // status 0 on success, are excluded by the request URL's scheme after browser-style\n // preprocessing, by the page origin's scheme for relative URLs (which inherit it), or\n // by responseURL where implemented.\n if (\n request.status === 0 &&\n (parseProtocol(normalizeURLForProtocolCheck(_config.url)) ||\n parseProtocol(platform.origin)) !== 'file' &&\n !(request.responseURL && request.responseURL.startsWith('file:'))\n ) {\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n done();\n\n // Clean up request\n request = null;\n return;\n }\n\n // When loadend is still dispatching, flushing with it gives progress\n // listeners a final delivery whose event has a live target. The legacy\n // ready-state fallback has no event, so replay its pending progress.\n // A throwing listener must not block settlement; rethrow asynchronously,\n // matching how listener errors surface on the throttle timer path.\n try {\n if (event) {\n flushDownloadWithEvent && flushDownloadWithEvent(event);\n } else {\n flushDownload && flushDownload();\n }\n } catch (err) {\n setTimeout(() => {\n throw err;\n });\n }\n\n // A final progress callback can cancel the request synchronously.\n if (!request) {\n return;\n }\n\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData =\n !responseType || responseType === 'text' || responseType === 'json'\n ? request.responseText\n : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request,\n };\n\n settle(\n function _resolve(value) {\n resolve(value);\n done();\n },\n function _reject(err) {\n reject(err);\n done();\n },\n response\n );\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (\n request.status === 0 &&\n !(request.responseURL && request.responseURL.startsWith('file:'))\n ) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n done();\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError(event) {\n // Browsers deliver a ProgressEvent in XHR onerror\n // (message may be empty; when present, surface it)\n // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event\n const msg = event && event.message ? event.message : 'Network Error';\n const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);\n // attach the underlying event for consumers who want details\n err.event = event || null;\n reject(err);\n done();\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout\n ? 'timeout of ' + _config.timeout + 'ms exceeded'\n : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(\n new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request\n )\n );\n done();\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n [downloadThrottled, flushDownload, flushDownloadWithEvent] = progressEventReducer(\n onDownloadProgress,\n true\n );\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = (cancel) => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n done();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted\n ? onCanceled()\n : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && !platform.protocols.includes(protocol)) {\n reject(\n new AxiosError(\n 'Unsupported protocol ' + protocol + ':',\n AxiosError.ERR_BAD_REQUEST,\n config\n )\n );\n done();\n return;\n }\n\n // Send the request\n request.send(requestData || null);\n });\n };\n","export const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n};\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n};\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n};\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n };\n\n return new ReadableStream(\n {\n async pull(controller) {\n try {\n const { done, value } = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = (bytes += len);\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n },\n },\n {\n highWaterMark: 2,\n }\n );\n};\n","/**\n * Estimate data: URL byte lengths *without* allocating large buffers.\n * - Fetch percent-decodes a base64 body before decoding it.\n * - Node's Buffer.from(body, 'base64') sizes its backing allocation from the\n * raw body, including ignored characters and content after padding.\n * - Non-base64 data is percent-decoded and then encoded as UTF-8.\n */\nconst isHexDigit = (charCode) =>\n (charCode >= 48 && charCode <= 57) ||\n (charCode >= 65 && charCode <= 70) ||\n (charCode >= 97 && charCode <= 102);\n\nconst isPercentEncodedByte = (str, i, len) =>\n i + 2 < len && isHexDigit(str.charCodeAt(i + 1)) && isHexDigit(str.charCodeAt(i + 2));\n\nconst hexValue = (charCode) => (charCode <= 57 ? charCode - 48 : (charCode & 0xdf) - 55);\n\nconst isBase64Char = (charCode) =>\n (charCode >= 65 && charCode <= 90) || // A-Z\n (charCode >= 97 && charCode <= 122) || // a-z\n (charCode >= 48 && charCode <= 57) || // 0-9\n charCode === 43 || // +\n charCode === 47 || // /\n charCode === 45 || // - (base64url)\n charCode === 95; // _ (base64url)\n\nconst isBase64Whitespace = (charCode) =>\n charCode === 9 || charCode === 10 || charCode === 12 || charCode === 13 || charCode === 32;\n\nconst base64Bytes = (significant) => {\n const groups = Math.floor(significant / 4);\n const remainder = significant % 4;\n return groups * 3 + (remainder === 2 ? 1 : remainder === 3 ? 2 : 0);\n};\n\n// Buffer.byteLength(body, 'base64') uses the raw string length as an allocation\n// upper bound even when Buffer.from later ignores characters or stops at '='.\nconst estimateBase64BufferAllocation = (body) => {\n const len = body.length;\n let padding = 0;\n\n if (len > 0 && body.charCodeAt(len - 1) === 61 /* '=' */) {\n padding++;\n\n if (len > 1 && body.charCodeAt(len - 2) === 61 /* '=' */) {\n padding++;\n }\n }\n\n return Math.floor(((len - padding) * 3) / 4);\n};\n\nconst estimatePercentDecodedBase64Bytes = (body) => {\n const len = body.length;\n let significant = 0;\n let padding = 0;\n let invalid = false;\n\n for (let i = 0; i < len; i++) {\n let code = body.charCodeAt(i);\n\n if (code === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {\n code = hexValue(body.charCodeAt(i + 1)) * 16 + hexValue(body.charCodeAt(i + 2));\n i += 2;\n }\n\n if (isBase64Whitespace(code)) {\n continue;\n }\n\n if (code === 61 /* '=' */) {\n padding++;\n continue;\n }\n\n if (!isBase64Char(code) || padding > 0) {\n invalid = true;\n continue;\n }\n\n significant++;\n }\n\n // Fetch rejects malformed forgiving-base64 input. Returning the raw-size\n // allocation bound keeps that invalid input from becoming a pre-check bypass.\n if (\n invalid ||\n padding > 2 ||\n (padding > 0 && (significant + padding) % 4 !== 0) ||\n significant % 4 === 1\n ) {\n return estimateBase64BufferAllocation(body);\n }\n\n return base64Bytes(significant);\n};\n\nconst estimateDataURLBytes = (url, estimateBase64) => {\n if (!url || typeof url !== 'string') return 0;\n if (!url.startsWith('data:')) return 0;\n\n const comma = url.indexOf(',');\n if (comma < 0) return 0;\n\n const meta = url.slice(5, comma);\n const body = url.slice(comma + 1);\n const isBase64 = /;base64/i.test(meta);\n\n if (isBase64) {\n return estimateBase64(body);\n }\n\n // Compute UTF-8 byte length directly from UTF-16 code units without allocating\n // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).\n // Valid %XX triplets count as one decoded byte; this matches the bytes that\n // decodeURIComponent(body) would produce before Buffer re-encodes the string.\n let bytes = 0;\n for (let i = 0, len = body.length; i < len; i++) {\n const c = body.charCodeAt(i);\n if (c === 37 /* '%' */ && isPercentEncodedByte(body, i, len)) {\n bytes += 1;\n i += 2;\n } else if (c < 0x80) {\n bytes += 1;\n } else if (c < 0x800) {\n bytes += 2;\n } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {\n const next = body.charCodeAt(i + 1);\n if (next >= 0xdc00 && next <= 0xdfff) {\n bytes += 4;\n i++;\n } else {\n bytes += 3;\n }\n } else {\n bytes += 3;\n }\n }\n return bytes;\n};\n\n/**\n * Estimate the percent-decoded payload size used by Fetch data: URLs.\n *\n * @param {string} url\n * @returns {number}\n */\nexport default function estimateDataURLDecodedBytes(url) {\n // Fetch removes URL fragments before processing a data: URL.\n const fragmentIndex = typeof url === 'string' ? url.indexOf('#') : -1;\n\n return estimateDataURLBytes(\n fragmentIndex === -1 ? url : url.slice(0, fragmentIndex),\n estimatePercentDecodedBase64Bytes\n );\n}\n\n/**\n * Estimate the Buffer backing allocation used by Node's raw base64 decoder.\n *\n * @param {string} url\n * @returns {number}\n */\nexport function estimateDataURLBufferAllocation(url) {\n return estimateDataURLBytes(url, estimateBase64BufferAllocation);\n}\n","import platform from '../platform/index.js';\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport composeSignals from '../helpers/composeSignals.js';\nimport { trackStream } from '../helpers/trackStream.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {\n progressEventReducer,\n progressEventDecorator,\n asyncDecorator,\n} from '../helpers/progressEventReducer.js';\nimport resolveConfig from '../helpers/resolveConfig.js';\nimport settle from '../core/settle.js';\nimport estimateDataURLDecodedBytes from '../helpers/estimateDataURLDecodedBytes.js';\nimport { VERSION } from '../env/data.js';\nimport { toByteStringHeaderObject } from '../helpers/sanitizeHeaderValue.js';\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst DEFAULT_REQUEST_OPTIONS = {\n cache: 'default',\n redirect: 'follow',\n referrer: 'about:client',\n referrerPolicy: '',\n mode: 'cors',\n integrity: '',\n keepalive: false,\n priority: 'auto',\n window: null,\n};\n\nconst { isFunction } = utils;\n\n/**\n * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().\n * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.\n *\n * @param {string} str The string to encode\n *\n * @returns {string} UTF-8 bytes as a Latin-1 string\n */\nconst encodeUTF8 = (str) =>\n encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>\n String.fromCharCode(parseInt(hex, 16))\n );\n\n// Node's WHATWG URL parser returns `username` and `password` percent-encoded.\n// Decode before composing the `auth` option so credentials such as\n// `my%40email.com:pass` are sent as `my@email.com:pass`. Falls back to the\n// original value for malformed input so a bad encoding never throws.\nconst decodeURIComponentSafe = (value) => {\n if (!utils.isString(value)) {\n return value;\n }\n\n try {\n return decodeURIComponent(value);\n } catch (error) {\n return value;\n }\n};\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false;\n }\n};\n\nconst maybeWithAuthCredentials = (url) => {\n const protocolIndex = url.indexOf('://');\n let urlToCheck = url;\n if (protocolIndex !== -1) {\n urlToCheck = urlToCheck.slice(protocolIndex + 3);\n }\n return urlToCheck.includes('@') || urlToCheck.includes(':');\n};\n\nconst factory = (env) => {\n const globalObject =\n utils.global !== undefined && utils.global !== null ? utils.global : globalThis;\n const { ReadableStream, TextEncoder } = globalObject;\n\n env = utils.merge.call(\n {\n skipUndefined: true,\n },\n {\n Request: globalObject.Request,\n Response: globalObject.Response,\n },\n env\n );\n\n const { fetch: envFetch, Request, Response } = env;\n const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';\n const isRequestSupported = isFunction(Request);\n const isResponseSupported = isFunction(Response);\n\n if (!isFetchSupported) {\n return false;\n }\n\n const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);\n\n const encodeText =\n isFetchSupported &&\n (typeof TextEncoder === 'function'\n ? (\n (encoder) => (str) =>\n encoder.encode(str)\n )(new TextEncoder())\n : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));\n\n const supportsRequestStream =\n isRequestSupported &&\n isReadableStreamSupported &&\n test(() => {\n let duplexAccessed = false;\n\n const request = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n });\n\n const hasContentType = request.headers.has('Content-Type');\n\n if (request.body != null) {\n request.body.cancel();\n }\n\n return duplexAccessed && !hasContentType;\n });\n\n const supportsResponseStream =\n isResponseSupported &&\n isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n const resolvers = {\n stream: supportsResponseStream && ((res) => res.body),\n };\n\n isFetchSupported &&\n (() => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {\n !resolvers[type] &&\n (resolvers[type] = (res, config) => {\n let method = res && res[type];\n\n if (method) {\n return method.call(res);\n }\n\n throw new AxiosError(\n `Response type '${type}' is not supported`,\n AxiosError.ERR_NOT_SUPPORT,\n config\n );\n });\n });\n })();\n\n const getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if (utils.isBlob(body)) {\n return body.size;\n }\n\n if (utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if (utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if (utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if (utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n };\n\n const resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n };\n\n return async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions,\n maxContentLength,\n maxBodyLength,\n maxRedirects,\n } = resolveConfig(config);\n\n const hasMaxContentLength = utils.isNumber(maxContentLength) && maxContentLength > -1;\n const hasMaxBodyLength = utils.isNumber(maxBodyLength) && maxBodyLength > -1;\n const own = (key) => (utils.hasOwnProp(config, key) ? config[key] : undefined);\n\n let _fetch = envFetch || fetch;\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals(\n [signal, cancelToken && cancelToken.toAbortSignal()],\n timeout\n );\n\n let request = null;\n\n const unsubscribe =\n composedSignal &&\n composedSignal.unsubscribe &&\n (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n // AxiosError we raise while the request body is being streamed. Captured\n // by identity so the catch block can surface it directly, regardless of\n // how the runtime wraps the resulting fetch rejection (undici exposes it\n // as `err.cause`; some browsers drop the original error entirely).\n let pendingBodyError = null;\n\n const maxBodyLengthError = () =>\n new AxiosError(\n 'Request body larger than maxBodyLength limit',\n AxiosError.ERR_BAD_REQUEST,\n config,\n request\n );\n\n try {\n // HTTP basic authentication\n let auth = undefined;\n const configAuth = own('auth');\n\n if (configAuth) {\n const username = utils.getSafeProp(configAuth, 'username') || '';\n const password = utils.getSafeProp(configAuth, 'password') || '';\n auth = {\n username,\n password,\n };\n }\n\n if (maybeWithAuthCredentials(url)) {\n const parsedURL = new URL(url, platform.origin);\n\n if (!auth && (parsedURL.username || parsedURL.password)) {\n const urlUsername = decodeURIComponentSafe(parsedURL.username);\n const urlPassword = decodeURIComponentSafe(parsedURL.password);\n auth = {\n username: urlUsername,\n password: urlPassword,\n };\n }\n\n if (parsedURL.username || parsedURL.password) {\n parsedURL.username = '';\n parsedURL.password = '';\n url = parsedURL.href;\n }\n }\n\n if (auth) {\n headers.delete('authorization');\n headers.set(\n 'Authorization',\n 'Basic ' + btoa(encodeUTF8((auth.username || '') + ':' + (auth.password || '')))\n );\n }\n\n // Enforce maxContentLength for data: URLs up-front so we never materialize\n // an oversized payload. The HTTP adapter applies the same check (see http.js\n // \"if (protocol === 'data:')\" branch).\n if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {\n const estimated = estimateDataURLDecodedBytes(url);\n if (estimated > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n // Enforce maxBodyLength against known-size bodies before dispatch using\n // the body's *actual* size — never a caller-declared Content-Length,\n // which could under-report to slip an oversized body past the check.\n // Unknown-size streams return undefined here and are counted per-chunk\n // below as fetch consumes them.\n if (hasMaxBodyLength && method !== 'get' && method !== 'head') {\n const outboundLength = await getBodyLength(data);\n if (typeof outboundLength === 'number' && isFinite(outboundLength)) {\n requestContentLength = outboundLength;\n if (outboundLength > maxBodyLength) {\n throw maxBodyLengthError();\n }\n }\n }\n\n // A streamed body under maxBodyLength must be counted as fetch consumes\n // it; its size is never trusted from a caller-declared Content-Length.\n const mustEnforceStreamBody =\n hasMaxBodyLength && (utils.isReadableStream(data) || utils.isStream(data));\n\n const trackRequestStream = (stream, onProgress, flush) =>\n trackStream(\n stream,\n DEFAULT_CHUNK_SIZE,\n (loadedBytes) => {\n if (hasMaxBodyLength && loadedBytes > maxBodyLength) {\n throw (pendingBodyError = maxBodyLengthError());\n }\n onProgress && onProgress(loadedBytes);\n },\n flush\n );\n\n if (\n supportsRequestStream &&\n method !== 'get' &&\n method !== 'head' &&\n (onUploadProgress || mustEnforceStreamBody)\n ) {\n requestContentLength =\n requestContentLength == null\n ? await resolveBodyLength(headers, data)\n : requestContentLength;\n\n // A declared length of 0 is only trusted to skip the wrap when we are\n // not enforcing a stream limit (which must not rely on that header).\n if (requestContentLength !== 0 || mustEnforceStreamBody) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: 'half',\n });\n\n let contentTypeHeader;\n\n if (\n utils.isFormData(data) &&\n (contentTypeHeader = _request.headers.get('content-type'))\n ) {\n headers.setContentType(contentTypeHeader);\n }\n\n if (_request.body) {\n const [onProgress, flush] =\n (onUploadProgress &&\n progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n )) ||\n [];\n\n data = trackRequestStream(_request.body, onProgress, flush);\n }\n }\n } else if (\n mustEnforceStreamBody &&\n !isRequestSupported &&\n isReadableStreamSupported &&\n method !== 'get' &&\n method !== 'head'\n ) {\n data = trackRequestStream(data);\n } else if (\n mustEnforceStreamBody &&\n isRequestSupported &&\n !supportsRequestStream &&\n method !== 'get' &&\n method !== 'head'\n ) {\n throw new AxiosError(\n 'Stream request bodies are not supported by the current fetch implementation',\n AxiosError.ERR_NOT_SUPPORT,\n config,\n request\n );\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;\n\n // If data is FormData and Content-Type is multipart/form-data without boundary,\n // delete it so fetch can set it correctly with the boundary\n if (utils.isFormData(data)) {\n const contentType = headers.getContentType();\n if (\n contentType &&\n /^multipart\\/form-data/i.test(contentType) &&\n !/boundary=/i.test(contentType)\n ) {\n headers.delete('content-type');\n }\n }\n\n // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)\n headers.set('User-Agent', 'axios/' + VERSION, false);\n\n const safeFetchOptions =\n fetchOptions == null ? fetchOptions : Object.assign(Object.create(null), fetchOptions);\n\n if (safeFetchOptions) {\n // These options are owned by Axios and are already reflected in the\n // resolved Request passed to fetch.\n delete safeFetchOptions.body;\n delete safeFetchOptions.headers;\n delete safeFetchOptions.method;\n delete safeFetchOptions.signal;\n delete safeFetchOptions.duplex;\n delete safeFetchOptions.credentials;\n }\n\n const resolvedOptions = Object.assign(Object.create(null), safeFetchOptions, {\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: toByteStringHeaderObject(headers.normalize()),\n body: data,\n duplex: 'half',\n credentials: isCredentialsSupported ? withCredentials : undefined,\n });\n\n if (isRequestSupported) {\n utils.forEach(DEFAULT_REQUEST_OPTIONS, (value, key) => {\n if (resolvedOptions[key] === undefined) {\n resolvedOptions[key] = value;\n }\n });\n\n if (resolvedOptions.signal === undefined) {\n resolvedOptions.signal = null;\n }\n\n if (resolvedOptions.body === undefined) {\n resolvedOptions.body = null;\n }\n }\n\n if (maxRedirects === 0) {\n resolvedOptions.redirect = 'manual';\n\n if (safeFetchOptions) {\n safeFetchOptions.redirect = 'manual';\n }\n }\n\n request = isRequestSupported && new Request(url, resolvedOptions);\n\n let response = await (isRequestSupported\n ? _fetch(request, safeFetchOptions)\n : _fetch(url, resolvedOptions));\n\n const responseHeaders = AxiosHeaders.from(response.headers);\n\n // Cheap pre-check: if the server honestly declares a content-length that\n // already exceeds the cap, reject before we start streaming.\n if (hasMaxContentLength) {\n const declaredLength = utils.toFiniteNumber(responseHeaders.getContentLength());\n if (declaredLength != null && declaredLength > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n const isStreamResponse =\n supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (\n supportsResponseStream &&\n response.body &&\n (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))\n ) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach((prop) => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(responseHeaders.getContentLength());\n\n const [onProgress, flush] =\n (onDownloadProgress &&\n progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n )) ||\n [];\n\n let bytesRead = 0;\n const onChunkProgress = (loadedBytes) => {\n if (hasMaxContentLength) {\n bytesRead = loadedBytes;\n if (bytesRead > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n onProgress && onProgress(loadedBytes);\n };\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](\n response,\n config\n );\n\n // Fallback enforcement for environments without ReadableStream support\n // (legacy runtimes). Detect materialized size from typed output; skip\n // streams/Response passthrough since the user will read those themselves.\n if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {\n let materializedSize;\n if (responseData != null) {\n if (typeof responseData.byteLength === 'number') {\n materializedSize = responseData.byteLength;\n } else if (typeof responseData.size === 'number') {\n materializedSize = responseData.size;\n } else if (typeof responseData === 'string') {\n materializedSize =\n typeof TextEncoder === 'function'\n ? new TextEncoder().encode(responseData).byteLength\n : responseData.length;\n }\n }\n if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {\n throw new AxiosError(\n 'maxContentLength size of ' + maxContentLength + ' exceeded',\n AxiosError.ERR_BAD_RESPONSE,\n config,\n request\n );\n }\n }\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request,\n });\n });\n } catch (err) {\n unsubscribe && unsubscribe();\n\n // Safari can surface fetch aborts as a DOMException-like object whose\n // branded getters throw. Prefer our composed signal reason before reading\n // the caught error, preserving timeout vs cancellation semantics.\n if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) {\n const canceledError = composedSignal.reason;\n canceledError.config = config;\n request && (canceledError.request = request);\n if (err !== canceledError) {\n // Non-enumerable to match native Error `cause` semantics so loggers\n // don't recurse into circular fetch internals (see #7205).\n Object.defineProperty(canceledError, 'cause', {\n __proto__: null,\n value: err,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n }\n throw canceledError;\n }\n\n // Surface a maxBodyLength violation we raised while the request body was\n // being streamed. Matching by identity (rather than reading\n // `err.cause.isAxiosError`) keeps the error deterministic across runtimes\n // and avoids both prototype-pollution reads and mis-attributing a foreign\n // AxiosError that merely happened to land in `err.cause`.\n if (pendingBodyError) {\n request && !pendingBodyError.request && (pendingBodyError.request = request);\n throw pendingBodyError;\n }\n\n // Re-throw AxiosErrors we raised synchronously (data: URL / content-length\n // pre-checks, response size enforcement) without re-wrapping them.\n if (err instanceof AxiosError) {\n request && !err.request && (err.request = request);\n throw err;\n }\n\n if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {\n const networkError = new AxiosError(\n 'Network Error',\n AxiosError.ERR_NETWORK,\n config,\n request,\n err && err.response\n );\n // Non-enumerable to match native Error `cause` semantics so loggers\n // don't recurse into circular fetch internals (see #7205).\n Object.defineProperty(networkError, 'cause', {\n __proto__: null,\n value: err.cause || err,\n writable: true,\n enumerable: false,\n configurable: true,\n });\n throw networkError;\n }\n\n throw AxiosError.from(err, err && err.code, config, request, err && err.response);\n }\n };\n};\n\nconst seedCache = new Map();\n\nexport const getFetch = (config) => {\n let env = (config && config.env) || {};\n const { fetch, Request, Response } = env;\n const seeds = [Request, Response, fetch];\n\n let len = seeds.length,\n i = len,\n seed,\n target,\n map = seedCache;\n\n while (i--) {\n seed = seeds[i];\n target = map.get(seed);\n\n target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));\n\n map = target;\n }\n\n return target;\n};\n\nconst adapter = getFetch();\n\nexport default adapter;\n","import CanceledError from '../cancel/CanceledError.js';\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n signals = signals ? signals.filter(Boolean) : [];\n\n if (!timeout && !signals.length) {\n return;\n }\n\n const controller = new AbortController();\n\n let aborted = false;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(\n err instanceof AxiosError\n ? err\n : new CanceledError(err instanceof Error ? err.message : err)\n );\n }\n };\n\n let timer =\n timeout &&\n setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));\n }, timeout);\n\n const unsubscribe = () => {\n if (!signals) { return; }\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach((signal) => {\n signal.unsubscribe\n ? signal.unsubscribe(onabort)\n : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n };\n\n signals.forEach((signal) => {\n if (aborted) {\n return;\n }\n\n if (signal.aborted) {\n onabort.call(signal);\n return;\n }\n\n signal.addEventListener('abort', onabort, { once: true });\n });\n\n const { signal } = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n};\n\nexport default composeSignals;\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport * as fetchAdapter from './fetch.js';\nimport AxiosError from '../core/AxiosError.js';\n\n/**\n * Known adapters mapping.\n * Provides environment-specific adapters for Axios:\n * - `http` for Node.js\n * - `xhr` for browsers\n * - `fetch` for fetch API-based requests\n *\n * @type {Object}\n */\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: {\n get: fetchAdapter.getFetch,\n },\n};\n\n// Assign adapter names for easier debugging and identification\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n // Null-proto descriptors so a polluted Object.prototype.get cannot turn\n // these data descriptors into accessor descriptors on the way in.\n Object.defineProperty(fn, 'name', { __proto__: null, value });\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', { __proto__: null, value });\n }\n});\n\n/**\n * Render a rejection reason string for unknown or unsupported adapters\n *\n * @param {string} reason\n * @returns {string}\n */\nconst renderReason = (reason) => `- ${reason}`;\n\n/**\n * Check if the adapter is resolved (function, null, or false)\n *\n * @param {Function|null|false} adapter\n * @returns {boolean}\n */\nconst isResolvedHandle = (adapter) =>\n utils.isFunction(adapter) || adapter === null || adapter === false;\n\n/**\n * Get the first suitable adapter from the provided list.\n * Tries each adapter in order until a supported one is found.\n * Throws an AxiosError if no adapter is suitable.\n *\n * @param {Array|string|Function} adapters - Adapter(s) by name or function.\n * @param {Object} config - Axios request configuration\n * @throws {AxiosError} If no suitable adapter is available\n * @returns {Function} The resolved adapter function\n */\nfunction getAdapter(adapters, config) {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const { length } = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter && (utils.isFunction(adapter) || (adapter = adapter.get(config)))) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n const reasons = Object.entries(rejectedReasons).map(\n ([id, state]) =>\n `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length\n ? reasons.length > 1\n ? 'since :\\n' + reasons.map(renderReason).join('\\n')\n : ' ' + renderReason(reasons[0])\n : 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n AxiosError.ERR_NOT_SUPPORT\n );\n }\n\n return adapter;\n}\n\n/**\n * Exports Axios adapters and utility to resolve an adapter\n */\nexport default {\n /**\n * Resolve an adapter from a list of adapter names or functions.\n * @type {Function}\n */\n getAdapter,\n\n /**\n * Exposes all known adapters\n * @type {Object}\n */\n adapters: knownAdapters,\n};\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from '../adapters/adapters.js';\nimport utils from '../utils.js';\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(_config) {\n // Interceptors may replace the merged config with an ordinary object. Flatten\n // it at the dispatch boundary so shared prototype members cannot become\n // request behavior, while preserving intentional template/class members.\n const config = utils.toSafeFlatObject(_config);\n\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(utils.getSafeProp(config, 'headers'));\n\n // Transform request data\n config.data = transformData.call(config, config.transformRequest);\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);\n\n return adapter(config).then(\n function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Expose the current response on config so that transformResponse can\n // attach it to any AxiosError it throws (e.g. on JSON parse failure).\n // We clean it up afterwards to avoid polluting the config object.\n config.response = response;\n try {\n response.data = transformData.call(config, config.transformResponse, response);\n } finally {\n delete config.response;\n }\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n },\n function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n config.response = reason.response;\n try {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n } finally {\n delete config.response;\n }\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n }\n );\n}\n","'use strict';\n\nimport { VERSION } from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return (\n '[Axios v' +\n VERSION +\n \"] Transitional option '\" +\n opt +\n \"'\" +\n desc +\n (message ? '. ' + message : '')\n );\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n };\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object' || options === null) {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n // Use hasOwnProperty so a polluted Object.prototype. cannot supply\n // a non-function validator and cause a TypeError.\n const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError(\n 'option ' + opt + ' must be ' + result,\n AxiosError.ERR_BAD_OPTION_VALUE\n );\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators,\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport methodList from './methodList.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\nimport transitionalDefaults from '../defaults/transitional.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig || {};\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager(),\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n try {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n const dummyStack = dummy.stack;\n let stack = '';\n\n // slice off the Error: ... line\n if (typeof dummyStack === 'string') {\n const firstNewlineIndex = dummyStack.indexOf('\\n');\n\n stack = firstNewlineIndex === -1 ? '' : dummyStack.slice(firstNewlineIndex + 1);\n }\n\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack) {\n const firstNewlineIndex = stack.indexOf('\\n');\n const secondNewlineIndex =\n firstNewlineIndex === -1 ? -1 : stack.indexOf('\\n', firstNewlineIndex + 1);\n const stackWithoutTwoTopLines =\n secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);\n\n if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {\n err.stack += '\\n' + stack;\n }\n }\n } catch (e) {\n // Ignore failures from custom stack hooks or un-writable stack properties.\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const { transitional, paramsSerializer, headers } = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(\n transitional,\n {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean),\n legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),\n advertiseZstdAcceptEncoding: validators.transitional(validators.boolean),\n validateStatusUndefinedResolves: validators.transitional(validators.boolean),\n },\n false\n );\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer,\n };\n } else {\n validator.assertOptions(\n paramsSerializer,\n {\n encode: validators.function,\n serialize: validators.function,\n },\n true\n );\n }\n }\n\n // Set config.allowAbsoluteUrls\n if (config.allowAbsoluteUrls !== undefined) {\n // do nothing\n } else if (this.defaults.allowAbsoluteUrls !== undefined) {\n config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls;\n } else {\n config.allowAbsoluteUrls = true;\n }\n\n validator.assertOptions(\n config,\n {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken'),\n },\n true\n );\n\n // Set config.method\n config.method = (\n utils.getSafeProp(config, 'method') ||\n utils.getSafeProp(this.defaults, 'method') ||\n 'get'\n ).toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(headers.common, headers[config.method]);\n\n headers &&\n utils.forEach(methodList.concat('common'), (method) => {\n delete headers[method];\n });\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n const transitional = config.transitional || transitionalDefaults;\n const legacyInterceptorReqResOrdering =\n transitional && transitional.legacyInterceptorReqResOrdering;\n\n if (legacyInterceptorReqResOrdering) {\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n } else {\n requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n }\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift(...requestInterceptorChain);\n chain.push(...responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled ? onFulfilled(newConfig) : newConfig;\n } catch (error) {\n if (!onRejected) {\n promise = Promise.reject(error);\n break;\n }\n\n try {\n const rejectedResult = onRejected.call(this, error);\n\n if (utils.isThenable(rejectedResult)) {\n promise = Promise.resolve(rejectedResult).then(() =>\n dispatchRequest.call(this, newConfig)\n );\n }\n } catch (rejectedError) {\n promise = Promise.reject(rejectedError);\n }\n\n break;\n }\n }\n\n if (!promise) {\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n promise = Promise.reject(error);\n }\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls, config);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function (url, config) {\n return this.request(\n mergeConfig(config || {}, {\n method,\n url,\n data: config && utils.hasOwnProp(config, 'data') ? config.data : undefined,\n })\n );\n };\n});\n\nutils.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(\n mergeConfig(config || {}, {\n method,\n headers: isForm\n ? {\n 'Content-Type': 'multipart/form-data',\n }\n : {},\n url,\n data,\n })\n );\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n // QUERY is a safe/idempotent read method; multipart form bodies don't fit\n // its semantics, so no queryForm shorthand is generated.\n if (method !== 'query') {\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n }\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then((cancel) => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = (onfulfilled) => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise((resolve) => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel,\n };\n }\n}\n\nexport default CancelToken;\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n /**\n * @deprecated Use `ContentTooLarge` instead.\n */\n PayloadTooLarge: 413,\n ContentTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n /**\n * @deprecated Use `UnprocessableContent` instead.\n */\n UnprocessableEntity: 422,\n UnprocessableContent: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n WebServerReturnsAnUnknownError: 520,\n WebServerIsDown: 521,\n ConnectionTimedOut: 522,\n OriginIsUnreachable: 523,\n TimeoutOccurred: 524,\n SslHandshakeFailed: 525,\n InvalidSslCertificate: 526,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n if (HttpStatusCode[value] === undefined) {\n HttpStatusCode[value] = key;\n }\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport { VERSION } from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from './core/AxiosHeaders.js';\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, { allOwnKeys: true });\n\n // Copy context to instance\n utils.extend(instance, context, null, { allOwnKeys: true });\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = (thing) => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * const args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && payload.isAxiosError === true;\n}\n","import {InstallationStatus} from './installation-model';\nimport {questionFromResponse, QuestionModel, QuestionModelResponse} from './question-model';\n\nexport interface ActiveSurveyModelResponse {\n id?: string;\n hasFinishedSurvey: boolean;\n questions?: QuestionModelResponse[];\n installationStatus: InstallationStatus;\n resultSharingEnabled: boolean;\n}\nexport class ActiveSurveyModel {\n public id!: string | undefined;\n public hasFinishedSurvey!: boolean;\n public questions: QuestionModel[] | undefined;\n public installationStatus!: InstallationStatus;\n public resultSharingEnabled!: boolean;\n\n /**\n * creates a ActiveSurveyModel from the response body\n */\n static fromResponse(response: ActiveSurveyModelResponse): ActiveSurveyModel {\n const activeSurvey = new ActiveSurveyModel();\n activeSurvey.questions = response.questions?.map((q) => questionFromResponse(q));\n activeSurvey.id = response.id;\n activeSurvey.hasFinishedSurvey = response.hasFinishedSurvey;\n activeSurvey.installationStatus = response.installationStatus;\n activeSurvey.resultSharingEnabled = response.resultSharingEnabled;\n\n return activeSurvey;\n }\n\n public get hasNotStarted() {\n return [InstallationStatus.SCHEDULED, InstallationStatus.DRAFT].includes(this.installationStatus);\n }\n}\n\nexport interface SurveyModelResponse {\n id: string;\n createdAt: string;\n closedAt: string;\n}\n\nexport class SurveyModel {\n public id!: string | undefined;\n public createdAt!: Date;\n public closedAt!: Date;\n\n /**\n * creates a SurveyModel from the response body\n */\n static fromResponse(response: SurveyModelResponse): SurveyModel {\n const model = new SurveyModel();\n model.id = response.id;\n model.createdAt = new Date(response.createdAt);\n model.closedAt = new Date(response.closedAt);\n\n return model;\n }\n}\n","export enum NumericalResultBucket {\n ZERO = 0,\n ONE,\n TWO,\n THREE,\n FOUR,\n FIVE,\n SIX,\n SEVEN,\n EIGHT,\n NINE,\n TEN\n}\n\nexport type Participants = number;\n\nexport interface SurveySeriesItem {\n createdAt: string;\n closedAt: string;\n surveyID: string;\n hasReachedAnonymityLimit: boolean;\n totalParticipants: number;\n}\n\nexport type SurveySeriesResponse = SurveySeriesItem[];\n\nexport class SurveySeriesModel {\n public createdAt!: Date;\n public closedAt!: Date;\n public surveyId!: string;\n public hasReachedAnonymityLimit!: boolean;\n public totalParticipants!: number;\n\n static fromResponse(response: SurveySeriesItem): SurveySeriesModel {\n const model = new SurveySeriesModel();\n model.surveyId = response.surveyID;\n model.hasReachedAnonymityLimit = response.hasReachedAnonymityLimit;\n model.createdAt = new Date(response.createdAt);\n model.closedAt = new Date(response.closedAt);\n model.totalParticipants = response.totalParticipants;\n\n return model;\n }\n}\n\nexport interface SurveyAverageItem {\n createdAt: string;\n average?: number;\n surveyID: string;\n}\n\nexport interface ParticipantsResponse {\n totalParticipants: Participants;\n}\n","export interface FilterValue {\n id: string;\n value: string;\n}\n\nexport interface Filter {\n slug: string;\n labels: Record;\n values: FilterValue[];\n}\n\nexport type FiltersModelResponse = Filter[];\n\nexport class FiltersModel {\n public slug!: string;\n public labels!: Record;\n public values!: FilterValue[];\n\n static fromResponse(response: Filter) {\n const model = new FiltersModel();\n const {slug, labels, values} = response;\n model.slug = slug;\n model.labels = labels;\n model.values = values;\n return model;\n }\n}\n","import {QuestionId} from './common';\n\ninterface InstallationResultResponseItem {\n average: number;\n nps?: number;\n publishedAt: string;\n surveyId: string;\n totalParticipants: number;\n}\n\nexport interface InstallationResultItem {\n average?: number;\n nps?: number;\n publishedAt: Date;\n surveyId: string;\n totalParticipants: number;\n}\n\nexport type InstallationResultsResponse = Record;\nexport type InstallationResults = Record;\n\nexport class InstallationResultsModel {\n public results!: InstallationResults;\n\n static fromResponse(response: InstallationResultsResponse) {\n const model = new InstallationResultsModel();\n model.results = Object.entries(response).reduce((prev, [k, v]) => {\n const items: InstallationResultItem[] = v.map((survey) => {\n const {average, nps, publishedAt, surveyId, totalParticipants} = survey;\n return {\n average,\n nps,\n publishedAt: new Date(publishedAt),\n surveyId,\n totalParticipants\n };\n });\n\n return {...prev, [k]: items};\n }, {});\n\n return model;\n }\n}\n","export class InvalidTokenError extends Error {\n}\nInvalidTokenError.prototype.name = \"InvalidTokenError\";\nfunction b64DecodeUnicode(str) {\n return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {\n let code = p.charCodeAt(0).toString(16).toUpperCase();\n if (code.length < 2) {\n code = \"0\" + code;\n }\n return \"%\" + code;\n }));\n}\nfunction base64UrlDecode(str) {\n let output = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += \"==\";\n break;\n case 3:\n output += \"=\";\n break;\n default:\n throw new Error(\"base64 string is not of the correct length\");\n }\n try {\n return b64DecodeUnicode(output);\n }\n catch (err) {\n return atob(output);\n }\n}\nexport function jwtDecode(token, options) {\n if (typeof token !== \"string\") {\n throw new InvalidTokenError(\"Invalid token specified: must be a string\");\n }\n options || (options = {});\n const pos = options.header === true ? 0 : 1;\n const part = token.split(\".\")[pos];\n if (typeof part !== \"string\") {\n throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);\n }\n let decoded;\n try {\n decoded = base64UrlDecode(part);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);\n }\n try {\n return JSON.parse(decoded);\n }\n catch (e) {\n throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);\n }\n}\n","import {jwtDecode} from 'jwt-decode';\n\n// amount of seconds, that are subtracted from the exp-time of the token.\nexport const EXPIRATION_TIME_OFFSET_IN_SECONDS = 5;\n\nexport interface ITokenGenerator {\n /**\n * returns a valid JWT for authentication with the plugin\n */\n refreshToken(installationId: string): Promise;\n}\n\nexport default class TokenGenerator implements ITokenGenerator {\n private token?: string;\n constructor(private fetchToken: (installationId: string) => Promise<{jwt: string}>) {}\n\n /**\n * requests a new short-lived (60s) JWT token for the plugin installation\n */\n private async requestNewToken(installationId: string): Promise {\n const {jwt} = await this.fetchToken(installationId);\n if (!jwt) {\n throw new Error('no JWT token in response');\n }\n\n this.token = jwt;\n return jwt;\n }\n\n /**\n * returns a valid JWT token\n * will use a cached token, if it's valid the next \"EXPIRATION_TIME_OFFSET_IN_SECONDS\" seconds\n * or request a new token from the staffbase backend\n */\n async refreshToken(installationId: string): Promise {\n if (!this.token) {\n return this.requestNewToken(installationId);\n }\n\n const decodedJWT = jwtDecode(this.token);\n if (!decodedJWT) {\n throw Error('problem decoding jwt');\n }\n\n const expiry = Number(decodedJWT.exp);\n if (Date.now() / 1000 > expiry - EXPIRATION_TIME_OFFSET_IN_SECONDS) {\n return this.requestNewToken(installationId);\n }\n\n return this.token;\n }\n}\n","import axios, {AxiosError, AxiosInstance} from 'axios';\n\nimport {\n ActiveSurveyModel,\n ActiveSurveyModelResponse,\n FiltersModel,\n FiltersModelResponse,\n FilterValue,\n InstallationImmediateScheduleSettingPostRequest,\n InstallationModel,\n InstallationModelResponse,\n InstallationOneTimeScheduleSettingPostRequest,\n InstallationRecurringSettingPostRequest,\n InstallationResultsModel,\n InstallationResultsResponse,\n ParticipantsResponse,\n questionFromResponse,\n QuestionModel,\n QuestionModelResponse,\n QuestionPatchRequest,\n QuestionPostRequest,\n SurveyModel,\n SurveyModelResponse,\n SurveyResultsResponse,\n SurveySeriesModel,\n SurveySeriesResponse\n} from './models';\nimport TokenGenerator, {ITokenGenerator} from './token-generator';\n\nexport interface PluginAPIOptions {\n /**\n * baseURL of the Plugin\n */\n baseURL: string;\n /**\n * installationId of the plugin instance\n */\n installationId: string;\n /**\n * generates response containing JWT\n */\n fetchToken: (installationId: string) => Promise<{jwt: string}>;\n}\nexport class PluginAPI {\n constructor(\n private client: AxiosInstance,\n private installationId: string,\n private tokenGenerator: ITokenGenerator\n ) {\n this.client.interceptors.request.use(async (config) => {\n const token = await this.tokenGenerator.refreshToken(this.installationId);\n config.headers.Authorization = `Bearer ${token}`;\n return config;\n });\n }\n\n /**\n * finds or creates a new installation\n * - will create a new (plugin)-installation, if it doesn't exist for the particular installationId\n * - will return the existing (plugin)-installation after creation\n */\n async findOrCreateInstallation([url]: [url: string]): Promise {\n return this.client.post(url).then((r) => InstallationModel.fromResponse(r.data));\n }\n\n /**\n * sets the schedule of an installation\n * this will also set the state of the installation to READY.\n * adding questions won't be possible unless schedule is canceled\n */\n async setInstallationRecurringSchedule(\n url: string,\n {arg}: {arg: InstallationRecurringSettingPostRequest}\n ): Promise {\n return this.client.post(url, arg).then((r) => InstallationModel.fromResponse(r.data));\n }\n\n /**\n * removes any schedule information of an installation\n * this will also set the state of the installation back to DRAFT\n * IsRecurring is not affected by this route\n */\n async cancelInstallationSchedule(url: string): Promise {\n return this.client.delete(url).then((r) => InstallationModel.fromResponse(r.data));\n }\n\n /**\n * sets the one-time schedule of an installation\n * this will also set the state of the installation to READY.\n * adding questions won't be possible unless schedule is canceled\n */\n async setInstallationOneTimeSchedule(\n url: string,\n {arg}: {arg: InstallationOneTimeScheduleSettingPostRequest}\n ): Promise {\n return this.client.post(url, arg).then((r) => InstallationModel.fromResponse(r.data));\n }\n\n /**\n * sets the one-time schedule of an installation and publishes it immediately\n * this will also set the state of the installation to READY.\n * adding questions won't be possible unless schedule is canceled\n */\n async setInstallationImmediateSchedule(\n url: string,\n {arg}: {arg: InstallationImmediateScheduleSettingPostRequest}\n ): Promise {\n return this.client.post(url, arg).then((r) => InstallationModel.fromResponse(r.data));\n }\n\n /**\n * sets whether result sharing is enabled for an installation\n */\n async updateResultSharing(url: string, {arg}: {arg: {enabled: boolean}}): Promise {\n const {enabled} = arg;\n return this.client.patch(url, {enabled});\n }\n\n /**\n * creates a new question\n */\n async createQuestion(url: string, {arg}: {arg: QuestionPostRequest}) {\n return this.client.post(url, arg).then((r) => questionFromResponse(r.data));\n }\n\n /**\n * updates an existing question\n * NOTE: The request body is the same as the one sent by the `createQuestion` method, and they therefore\n * share the same type for the `content` parameter\n */\n async updateQuestion(\n url: string,\n {arg}: {arg: {questionId: string; content: QuestionPatchRequest}}\n ): Promise {\n const {content, questionId} = arg;\n return this.client\n .patch(`${url}/${questionId}`, content)\n .then((r) => questionFromResponse(r.data));\n }\n\n /**\n * updates an existing question position in a survey\n */\n async updateQuestionPosition(\n url: string,\n {arg}: {arg: {questionId: string; content: {Position: number}}}\n ): Promise {\n const {content, questionId} = arg;\n return this.client.patch(`${url}/${questionId}/position`, content);\n }\n\n /**\n * deletes an existing question\n */\n async deleteQuestion(url: string, {arg}: {arg: {questionId: string}}): Promise {\n const {questionId} = arg;\n return this.client.delete(`${url}/${questionId}`);\n }\n\n /**\n * gets question data for QuestionForm or returns undefined if none exists\n */\n async getQuestions([url]: [url: string]): Promise {\n return this.client\n .get(url)\n .then((r) => r.data.map((questionResponse) => questionFromResponse(questionResponse)));\n }\n\n async getQuestion([url]: [url: string]): Promise {\n return this.getQuestions([url]).then((questions) => (questions.length > 0 ? questions[0] : undefined));\n }\n\n /**\n * gets the active survey, returns undefined if the survey or question content doesn't exist\n */\n async getActiveSurvey([url]: [url: string]): Promise {\n return this.client\n .get(url)\n .then((r) => ActiveSurveyModel.fromResponse(r.data))\n .catch((error) => {\n if (isNotFound(error)) {\n return undefined;\n }\n\n throw error;\n });\n }\n\n async getLatestSurvey([url]: [url: string]): Promise {\n return this.client.get(url).then((r) => SurveyModel.fromResponse(r.data));\n }\n\n async updateSurveyClosedAt(url: string, {arg}: {arg: {closedAt?: Date}}): Promise {\n return this.client.patch(url, arg).then((r) => InstallationModel.fromResponse(r.data));\n }\n\n async createFeedback(url: string, {arg}: {arg: {feedback: Record}}): Promise {\n const {feedback} = arg;\n await this.client.post(url, {content: feedback});\n }\n\n /**\n * gets a list of surveys with and whether they have N or more feedback ordered by date.\n */\n async getSurveySeries([url]: [url: string]): Promise {\n return this.client\n .get(url)\n .then((r) => r.data.map((item) => SurveySeriesModel.fromResponse(item)));\n }\n\n /**\n * gets a list of questions for the given survey id\n */\n async getQuestionsBySurveyId([url]: [url: string]): Promise {\n return this.client\n .get<{questions: QuestionModelResponse[]}>(url)\n .then((r) => r.data.questions.map((item) => questionFromResponse(item)));\n }\n\n /**\n * gets results of a given survey grouped by question id\n */\n async getResultsBySurveyId([url, filters]: [\n url: string,\n filters?: Record\n ]): Promise {\n return this.client\n .get<{results: SurveyResultsResponse}>(url, {\n params: filters && convertFilterValues(filters),\n paramsSerializer: {serialize}\n })\n .then((r) => r.data.results);\n }\n\n /**\n * gets a list of available filters for given survey\n */\n async getAvailableFiltersBySurveyId([url]: [url: string]): Promise {\n return this.client\n .get(url)\n .then((r) => r.data.map((item) => FiltersModel.fromResponse(item)));\n }\n\n /**\n * gets results grouped by question id\n */\n async getInstallationResults([url, filters]: [\n url: string,\n filters?: Record\n ]): Promise {\n return this.client\n .get<{results: InstallationResultsResponse}>(url, {\n params: filters && convertFilterValues(filters),\n paramsSerializer: {serialize}\n })\n .then((r) => InstallationResultsModel.fromResponse(r.data.results));\n }\n\n /**\n * gets the total number of survey participants, returns undefined if hasReachedAnonymityLimit is false\n */\n async getTotalSurveyParticipants([url, surveyId, hasReachedAnonymityLimit, filters]: [\n url: string,\n surveyId: string,\n hasReachedAnonymityLimit: boolean,\n filters?: Record\n ]): Promise {\n // we only want to make the request if hasReachedAnonymityLimit is true\n if (!surveyId || !hasReachedAnonymityLimit) {\n return Promise.resolve(undefined);\n }\n return this.client\n .get(url, {\n params: filters && convertFilterValues(filters),\n paramsSerializer: {serialize}\n })\n .then((r) => r.data);\n }\n\n /**\n * gets installation results in CSV format\n */\n async getInstallationExport([url, locale]: [url: string, locale: string, _installationId: string]): Promise {\n return this.client.get(url, {params: {locale}, responseType: 'blob'}).then((r) => r.data as Blob);\n }\n\n /**\n * builds a PluginAPI from PluginAPIOptions\n */\n static fromOptions({baseURL, installationId, fetchToken}: PluginAPIOptions): PluginAPI {\n const client = axios.create({\n baseURL: `${baseURL}/api/v1`\n });\n const tokenGenerator = new TokenGenerator(fetchToken);\n return new PluginAPI(client, installationId, tokenGenerator);\n }\n\n public setTokenGenerator(tg: ITokenGenerator): void {\n this.tokenGenerator = tg;\n }\n}\n\nfunction isAxiosError(error: unknown): error is AxiosError {\n return (error as AxiosError).isAxiosError !== undefined && (error as AxiosError).isAxiosError;\n}\n\nfunction isNotFound(error: unknown): boolean {\n if (isAxiosError(error) && error.response?.status === 404) {\n return true;\n }\n\n return false;\n}\n\nexport const serialize = (params: Record) => {\n const urlParams = new URLSearchParams();\n\n for (const [key, values] of Object.entries(params)) {\n values.forEach((value) => urlParams.append(key, value));\n }\n\n return urlParams.toString();\n};\n\nexport const convertFilterValues = (filters: Record) => {\n return Object.entries(filters).reduce>((prev, [key, values]) => {\n if (values.length === 0) {\n return prev;\n }\n return {...prev, [key]: values.map((v) => v.value)};\n }, {});\n};\n","//#region src/ai-assist/ai-assist-resource.ts\nvar AIPagesAssistResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync sendPromptToPagesAI(pageId, payload, signal) {\n\t\tawait this.client.request(`/api/branch/pages/${pageId}/ai-generate`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.pages.ai-generation.v1+json\" },\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ai-assistant/ai-assistant-resource.ts\nvar AIAssistantResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync discover(signal) {\n\t\treturn (await this.client.request(\"/api/ai/assistant/discover\", { signal })).json();\n\t}\n\tasync createSession(payload, agentType = \"AZURE_VOICE_LIVE_WEBSOCKET\", signal) {\n\t\treturn (await this.client.request(`/api/ai/assistant/sessions?type=${agentType}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.ai-assistant.session.start.v2+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync submitConversationFeedback(conversationId, payload, signal) {\n\t\tawait this.client.request(`/api/ai/assistant/conversations/${conversationId}/feedback`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t});\n\t}\n\tasync submitItemFeedback(conversationId, itemId, payload, signal) {\n\t\tawait this.client.request(`/api/ai/assistant/conversations/${conversationId}/items/${itemId}/feedback`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.feedback.item.v1+json\" },\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ai-context-and-control/guidelines-resource.ts\nvar GuidelinesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getGuidelines(branchId, signal) {\n\t\treturn (await this.client.request(`/api/ai-context-and-control/manage/configurations?branchId=${branchId}`, { signal })).json();\n\t}\n\tasync createGuideline(branchId, payload) {\n\t\treturn (await this.client.request(\"/api/ai-context-and-control/manage/configuration\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({\n\t\t\t\tbranchId,\n\t\t\t\ttitle: payload.title,\n\t\t\t\tspaceId: payload.spaceId,\n\t\t\t\tguidelines: payload.content\n\t\t\t}),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.ai.context-and-control.configuration.create.v1+json\" }\n\t\t})).json();\n\t}\n\tasync createGuidelineFromMedia(branchId, payload) {\n\t\treturn (await this.client.request(\"/api/ai-context-and-control/manage/configuration/media\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({\n\t\t\t\tbranchId,\n\t\t\t\ttitle: payload.title,\n\t\t\t\tspaceId: payload.spaceId,\n\t\t\t\tmediaId: payload.mediaId,\n\t\t\t\tmediaUrl: payload.mediaUrl\n\t\t\t}),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.ai.context-and-control.configuration.create.v1+json\" }\n\t\t})).json();\n\t}\n\tasync updateGuidelines(branchId, payload) {\n\t\treturn (await this.client.request(\"/api/ai-context-and-control/manage/configuration\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify({\n\t\t\t\tbranchId,\n\t\t\t\t...payload\n\t\t\t}),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.ai.context-and-control.configuration.update.v1+json\" }\n\t\t})).json();\n\t}\n\tasync deleteGuideline(spaceId) {\n\t\tconst searchParams = new URLSearchParams();\n\t\tif (spaceId) searchParams.set(\"spaceId\", spaceId);\n\t\tawait this.client.request(`/api/ai-context-and-control/manage/configuration?${searchParams.toString()}`, { method: \"DELETE\" });\n\t}\n\tasync cloneGuideline(sourceSpaceId, payload) {\n\t\tconst searchParams = new URLSearchParams();\n\t\tif (sourceSpaceId) searchParams.set(\"spaceId\", sourceSpaceId);\n\t\tawait this.client.request(`/api/ai-context-and-control/manage/configuration/clone?${searchParams.toString()}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({\n\t\t\t\ttitle: payload.title,\n\t\t\t\ttargetSpaceId: payload.targetSpaceId\n\t\t\t}),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.ai.context-and-control.configuration.duplicate.v1+json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ai-podcast/episodes/draft/draft-resource.ts\nvar DraftResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Retrieves the current draft episode for the installation.\n\t* Only one draft episode can exist per installation at a time.\n\t*/\n\tasync get(installationId, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/episodes/draft`, { signal })).json();\n\t}\n\t/** Creates a new draft episode or updates an existing one. */\n\tasync update(installationId, draft, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/episodes/draft`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(draft),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/** Retrieves the current progress of the draft episode generation workflow. */\n\tasync getGenerationProgress(installationId, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/episodes/draft/generation-progress`, { signal })).json();\n\t}\n\t/** Returns recommendation counts per post for the current draft episode. */\n\tasync getPostRecommendations(installationId, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/episodes/draft/post-recommendations`, { signal })).json();\n\t}\n\t/**\n\t* Retrieves the transcript for a specific user in the current draft episode.\n\t* Generates a new personalized transcript on-the-fly if one does not yet exist.\n\t*/\n\tasync getUserTranscript(installationId, userId, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/episodes/draft/users/${userId}/transcript`, { signal })).json();\n\t}\n\t/**\n\t* Updates only the transcript text for an existing user transcript in the current draft episode.\n\t* Only allowed when the draft is in `episode_created` state.\n\t*/\n\tasync updateUserTranscript(installationId, userId, payload, signal) {\n\t\tawait this.client.request(`/api/ai-podcast/${installationId}/episodes/draft/users/${userId}/transcript`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/ai-podcast/episodes/episodes-resource.ts\nvar EpisodesResource = class {\n\tclient;\n\tdraft;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.draft = new DraftResource(client);\n\t}\n\t/** Lists episodes for an installation, ordered by creation time (newest first). */\n\tasync list(installationId, params, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/episodes`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Returns published episodes that have completed audio for the requesting user,\n\t* ordered by publish date descending with cursor-based pagination.\n\t*/\n\tasync listUser(installationId, params, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/episode-audio`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/** Fetches the raw audio stream (mp3) for a published episode. */\n\tasync getAudio(installationId, episodeId, signal) {\n\t\treturn this.client.request(`/api/ai-podcast/${installationId}/episode-audio/${episodeId}/audio.mp3`, { signal });\n\t}\n\t/** Returns the transcript for the requesting user for the specified published episode. */\n\tasync getTranscript(installationId, episodeId, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/episode-audio/${episodeId}/transcript`, { signal })).json();\n\t}\n\t/** Marks the specified episode as seen by the requesting user. */\n\tasync markSeen(installationId, episodeId, signal) {\n\t\tawait this.client.request(`/api/ai-podcast/${installationId}/episodes/${episodeId}/seen`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n\t/** Returns the posts included in a specific episode.\n\t* @deprecated This endpoint is no longer part of the public API.\n\t*/\n\tasync listPosts(installationId, episodeId, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/episodes/${episodeId}/posts`, { signal })).json();\n\t}\n\t/** Triggers generation of a new episode.\n\t* @deprecated Use the draft episode API (`draft.put`) instead.\n\t*/\n\tasync create(installationId, params, signal) {\n\t\tawait this.client.request(`/api/ai-podcast/${installationId}/episodes`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(params),\n\t\t\tsignal\n\t\t});\n\t}\n\t/**\n\t* Deletes an episode by ID. Pass `\"draft\"` as the episodeId to delete the current draft episode.\n\t* Cancels any ongoing generation, removes audio files, and deletes all related transcripts.\n\t*/\n\tasync delete(installationId, episodeId, signal) {\n\t\tawait this.client.request(`/api/ai-podcast/${installationId}/episodes/${episodeId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\t/**\n\t* Returns the latest completely generated episode from each podcast (installation) accessible by the user,\n\t* sorted by publish date descending.\n\t*/\n\tasync getUserEpisodes(signal) {\n\t\treturn (await this.client.request(\"/api/ai-podcast/user-episodes\", { signal })).json();\n\t}\n};\n//#endregion\n//#region src/ai-podcast/installation/installation-resource.ts\nvar InstallationResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Search available podcast installations.\n\t*/\n\tasync search(params, signal) {\n\t\treturn (await this.client.request(\"/api/ai-podcast/search\", {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/** Returns installation settings for the specified installation. */\n\tasync getSettings(installationId, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/settings`, { signal })).json();\n\t}\n\t/** Creates or updates installation settings for the specified installation. */\n\tasync updateSettings(installationId, settings, signal) {\n\t\treturn (await this.client.request(`/api/ai-podcast/${installationId}/settings`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(settings),\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/ai-podcast/ai-podcast-resource.ts\nvar AIPodcastResource = class {\n\tclient;\n\tepisodes;\n\tinstallation;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.episodes = new EpisodesResource(client);\n\t\tthis.installation = new InstallationResource(client);\n\t}\n\t/**\n\t* @deprecated Use {@link InstallationResource.search} via `aiPodcast.installation.search()` instead\n\t*/\n\tasync search(params, signal) {\n\t\treturn this.installation.search(params, signal);\n\t}\n\t/**\n\t* @deprecated this endpoint has been deprecated\n\t* episode title is available on `listUserEpisodes` response\n\t*/\n\tasync latest(signal) {\n\t\treturn (await this.client.request(\"/api/ai-podcast/runs/latest\", { signal })).json();\n\t}\n\t/**\n\t* @deprecated Use {@link EpisodesResource.listUser} via `aiPodcast.episodes.listUser()` instead\n\t*/\n\tasync listUserEpisodes(installationId, params, signal) {\n\t\treturn this.episodes.listUser(installationId, params, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link EpisodesResource.getAudio} via `aiPodcast.episodes.getAudio()` instead\n\t*/\n\tasync episodeAudio(installationId, episodeId, signal) {\n\t\treturn this.episodes.getAudio(installationId, episodeId, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link EpisodesResource.listPosts} via `aiPodcast.episodes.listPosts()` instead\n\t*/\n\tasync listEpisodePosts(installationId, episodeId, signal) {\n\t\treturn this.episodes.listPosts(installationId, episodeId, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link EpisodesResource.create} via `aiPodcast.episodes.create()` instead\n\t*/\n\tasync createEpisode(installationId, params, signal) {\n\t\treturn this.episodes.create(installationId, params, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link EpisodesResource.delete} via `aiPodcast.episodes.delete()` instead\n\t*/\n\tasync deleteEpisode(installationId, episodeId, signal) {\n\t\treturn this.episodes.delete(installationId, episodeId, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link InstallationResource.updateSettings} via `aiPodcast.installation.updateSettings()` instead\n\t*/\n\tasync updateSettings(installationId, settings, signal) {\n\t\treturn this.installation.updateSettings(installationId, settings, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link InstallationResource.getSettings} via `aiPodcast.installation.getSettings()` instead\n\t*/\n\tasync getSettings(installationId, signal) {\n\t\treturn this.installation.getSettings(installationId, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link DraftResource.get} via `aiPodcast.episodes.draft.get()` instead\n\t*/\n\tasync getDraftEpisode(installationId, signal) {\n\t\treturn this.episodes.draft.get(installationId, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link DraftResource.update} via `aiPodcast.episodes.draft.update()` instead\n\t*/\n\tasync putDraftEpisode(installationId, draft, signal) {\n\t\treturn this.episodes.draft.update(installationId, draft, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link DraftResource.getGenerationProgress} via `aiPodcast.episodes.draft.getGenerationProgress()` instead\n\t*/\n\tasync getDraftGenerationProgress(installationId, signal) {\n\t\treturn this.episodes.draft.getGenerationProgress(installationId, signal);\n\t}\n\t/**\n\t* @deprecated Use {@link DraftResource.getUserTranscript} via `aiPodcast.episodes.draft.getUserTranscript()` instead\n\t*/\n\tasync getDraftUserTranscript(installationId, userId, signal) {\n\t\treturn this.episodes.draft.getUserTranscript(installationId, userId, signal);\n\t}\n};\n//#endregion\n//#region src/ai-settings/ai-settings-resource.ts\nvar AiSettingsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/featureflag/?groups=ai\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(featureFlagId, payload, signal) {\n\t\tawait this.client.request(`/api/featureflag/${featureFlagId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\tAccept: \"application/json\"\n\t\t\t},\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/analytics/chat.ts\nvar AnalyticsChatResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* @deprecated use `client.branch.analytics.chats.timeseries()` instead\n\t*/\n\tasync getChatTimeseries(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/chats/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/analytics/groups.ts\nvar AnalyticsGroupsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync searchSelector(params, signal) {\n\t\treturn (await this.client.request(\"/api/analytics/groups\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/analytics/misc.ts\nvar AnalyticsMiscResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* @deprecated use `client.branch.analytics.contents.rankings()` instead\n\t*/\n\tasync getContentRankings(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/contents/rankings\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\tasync getHashtagsInteractions() {\n\t\treturn (await this.client.request(\"/api/branch/analytics/hashtags/contentsVisitsClicks\", { method: \"GET\" })).json();\n\t}\n\t/**\n\t* @deprecated use `client.branch.analytics.users.timeseries()` instead\n\t*/\n\tasync getUserTimeseries(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/v2/users/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\t/**\n\t* @deprecated use `client.branch.analytics.users.status()` instead\n\t*/\n\tasync getUserCounts(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/users/status\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\t/**\n\t* @deprecated use `client.branch.analytics.discover()` instead\n\t*/\n\tasync getAnalyticsDiscovery() {\n\t\treturn (await this.client.request(\"/api/branch/analytics/discover\", { method: \"GET\" })).json();\n\t}\n};\n//#endregion\n//#region src/analytics/post.ts\nvar AnalyticsPostResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* @deprecated use `client.branch.analytics.posts.rankings()` instead\n\t*/\n\tasync getPostRankings(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/rankings\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\t/**\n\t* @deprecated use `client.branch.analytics.posts.stats()` instead\n\t*/\n\tasync getPostStatistics(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/stats\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\t/**\n\t* @deprecated use `client.branch.analytics.posts.timeseries()` instead\n\t*/\n\tasync getPostTimeseries(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\t/**\n\t* @deprecated use `client.branch.analytics.posts.interactions()` instead\n\t*/\n\tasync getPostInteractions(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/stats/interactions\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/analytics/search.ts\nconst validSearchOrderBy = [\n\t\"trend_ASC\",\n\t\"trend_DESC\",\n\t\"search_term_ASC\",\n\t\"search_term_DESC\",\n\t\"user_count_ASC\",\n\t\"user_count_DESC\",\n\t\"total_searches_ASC\",\n\t\"total_searches_DESC\"\n];\nconst isSearchOrderBy = (orderBy) => {\n\treturn validSearchOrderBy.includes(orderBy);\n};\nvar AnalyticsSearchResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getSearchRankingDeprecated() {\n\t\treturn (await this.client.request(\"/api/branch/analytics/search/rankings\", { method: \"GET\" })).json();\n\t}\n\tasync getSearchRanking(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/search/rankings\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\theaders: { \"Accept-Version\": \"2.0\" }\n\t\t})).json();\n\t}\n\tasync getSearchRankingCSV(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/search/rankings\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tformat: \"csv\",\n\t\t\t\tlimit: -1,\n\t\t\t\toffset: 0,\n\t\t\t\t...params\n\t\t\t},\n\t\t\theaders: { \"Accept-Version\": \"2.0\" }\n\t\t})).text();\n\t}\n\tasync getSearchStats(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/search/stats\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/analytics/semantic.ts\nvar AnalyticsSemanticResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync catalog(signal) {\n\t\treturn { cubes: (await (await this.client.request(\"/api/branch/analytics/semantic/catalog\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json()).cubes.map((entry) => ({\n\t\t\tname: entry.name,\n\t\t\ttitle: entry.title,\n\t\t\tdescription: entry.description,\n\t\t\ttype: entry.type ?? \"cube\",\n\t\t\tpublic: entry.public ?? true,\n\t\t\tconnectedComponent: entry.connectedComponent,\n\t\t\tjoins: entry.joins,\n\t\t\tmeasures: entry.measures.map((m) => ({\n\t\t\t\t...m,\n\t\t\t\tshortTitle: m.shortTitle ?? m.title\n\t\t\t})),\n\t\t\tdimensions: entry.dimensions.map((m) => ({\n\t\t\t\t...m,\n\t\t\t\tshortTitle: m.shortTitle ?? m.title\n\t\t\t})),\n\t\t\tsegments: []\n\t\t})) };\n\t}\n\tasync query(payload, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/semantic/query\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({\n\t\t\t\tquery: payload,\n\t\t\t\tqueryType: \"multi\"\n\t\t\t}),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/analytics/tracking-config.ts\nconst ANALYTICS_TRACKING_CONFIG_MIME_TYPE = \"application/vnd.staffbase.analytics.tracking-config.v1+json\";\nvar AnalyticsTrackingConfigResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/analytics/tracking-config\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: ANALYTICS_TRACKING_CONFIG_MIME_TYPE },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(config, signal) {\n\t\treturn (await this.client.request(\"/api/analytics/tracking-config\", {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: {\n\t\t\t\tAccept: ANALYTICS_TRACKING_CONFIG_MIME_TYPE,\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(config),\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/approvals/types.ts\nconst ApprovalSourceTypes = {\n\tpost: \"POST\",\n\tunknown: \"UNKNOWN\"\n};\nconst ApprovalStates = {\n\tpending: \"pending\",\n\tapproved: \"approved\",\n\trejected: \"rejected\",\n\tcancelled: \"cancelled\",\n\toutdated: \"outdated\"\n};\nconst ApprovalPriorities = {\n\turgent: \"urgent\",\n\tnormal: \"normal\"\n};\n//#endregion\n//#region src/approvals/approvals-resource.ts\nvar ApprovalsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(sourceId, sourceType = ApprovalSourceTypes.post, signal) {\n\t\treturn (await this.client.request(`/api/approval/${sourceType}/${sourceId}/requests`, { signal })).json();\n\t}\n\tasync getApproversList(sourceId, params, sourceType = ApprovalSourceTypes.post, signal) {\n\t\treturn (await this.client.request(`/api/approval/${sourceType}/${sourceId}/approvers`, {\n\t\t\tsignal,\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\tasync getContent(sourceId, sourceType = ApprovalSourceTypes.post, signal) {\n\t\treturn (await this.client.request(`/api/approval/${sourceType}/${sourceId}/content`, { signal })).json();\n\t}\n\tasync getCurrent(sourceId, sourceType = ApprovalSourceTypes.post, signal) {\n\t\treturn (await this.client.request(`/api/approval/${sourceType}/${sourceId}/requests/current`, { signal })).json();\n\t}\n\tasync create(sourceId, payload, sourceType = ApprovalSourceTypes.post) {\n\t\treturn (await this.client.request(`/api/approval/${sourceType}/${sourceId}/requests`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync updateCurrent(sourceId, payload, sourceType = ApprovalSourceTypes.post) {\n\t\treturn (await this.client.request(`/api/approval/${sourceType}/${sourceId}/requests/current`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/auth/auth-legal-resource.ts\nvar AuthLegalResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/auth/legal\", { signal })).json();\n\t}\n\tasync docs(params = {}, signal) {\n\t\treturn (await this.client.request(\"/auth/legal/docs\", {\n\t\t\tsignal,\n\t\t\tquery: {\n\t\t\t\tlocale: params.locale,\n\t\t\t\tshowAll: params.showAll\n\t\t\t}\n\t\t})).json();\n\t}\n\tasync confirmation(params = {}, signal) {\n\t\treturn (await this.client.request(\"/auth/legal/confirmation\", {\n\t\t\tsignal,\n\t\t\tquery: { locale: params.locale }\n\t\t})).json();\n\t}\n\tasync documentsToAccept(params = {}, signal) {\n\t\treturn (await this.client.request(\"/auth/legal/accept\", {\n\t\t\tsignal,\n\t\t\tquery: { locale: params.locale }\n\t\t})).json();\n\t}\n\tasync accept(documents, signal) {\n\t\tawait this.client.request(\"/auth/legal/accept\", {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(documents),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/auth/auth-profile-resource.ts\nconst PROFILE_COMPLETION_V1_JSON = \"application/vnd.staffbase.profile.completion.v1+json\";\nvar AuthProfileResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/auth/profile\", {\n\t\t\tsignal,\n\t\t\theaders: { Accept: PROFILE_COMPLETION_V1_JSON }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/auth/integrations-resource.ts\nvar IntegrationsResource$2 = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(\"/auth/external/jwt\", { signal })).json();\n\t}\n\tasync get(name, signal) {\n\t\treturn (await this.client.request(`/auth/external/jwt/${name}`, { signal })).json();\n\t}\n\tasync create(data) {\n\t\treturn (await this.client.request(\"/auth/external/jwt\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data)\n\t\t})).json();\n\t}\n\tasync update(name, data) {\n\t\treturn (await this.client.request(`/auth/external/jwt/${name}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(data)\n\t\t})).json();\n\t}\n\tasync deleteAll() {\n\t\tawait this.client.request(\"/auth/external/jwt\", { method: \"DELETE\" });\n\t}\n\tasync delete(name) {\n\t\treturn (await this.client.request(`/auth/external/jwt/${name}`, { method: \"DELETE\" })).json();\n\t}\n};\n//#endregion\n//#region src/auth/password-policy-resource.ts\nvar PasswordPolicyResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(`/auth/passwordpolicy`, { signal })).json();\n\t}\n\tasync validate(data) {\n\t\tawait this.client.request(\"/auth/passwordpolicy/validation\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/auth/user-taints-resource.ts\nvar UserTaintsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/auth/taints\", {\n\t\t\tsignal,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.user.taints.v1+json\" }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/auth/auth-resource.ts\nvar AuthResource = class {\n\tclient;\n\tintegrations;\n\tlegal;\n\tpasswordPolicy;\n\tprofile;\n\ttaints;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.integrations = new IntegrationsResource$2(client);\n\t\tthis.legal = new AuthLegalResource(client);\n\t\tthis.passwordPolicy = new PasswordPolicyResource(client);\n\t\tthis.profile = new AuthProfileResource(client);\n\t\tthis.taints = new UserTaintsResource(client);\n\t}\n\tasync discover(signal) {\n\t\treturn (await this.client.request(\"/auth/discover\", { signal })).json();\n\t}\n\tasync discoverV3(signal) {\n\t\treturn (await this.client.request(\"/auth/discover\", {\n\t\t\tsignal,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.auth.discovery.v3+json\" }\n\t\t})).json();\n\t}\n\tasync email(signal) {\n\t\treturn (await this.client.request(\"/auth/email\", { signal })).json();\n\t}\n\tasync logout(reason = \"unknown\", signal) {\n\t\treturn this.client.request(\"/auth/logout\", {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\tbody: `reason=${encodeURIComponent(reason)}`,\n\t\t\theaders: { \"content-type\": \"text/plain\" }\n\t\t});\n\t}\n\tasync loginMethods(signal) {\n\t\treturn (await this.client.request(\"/api/loginviews\", { signal })).json();\n\t}\n\tasync exchangeSsoJwt(jwt, signal) {\n\t\tawait this.client.request(\"/auth/jwt/sso\", {\n\t\t\tsignal,\n\t\t\tquery: { jwt },\n\t\t\tusePublicAreaToken: false\n\t\t});\n\t}\n\tasync exchangeIntuneAccessToken(accessToken, signal) {\n\t\tawait this.client.request(\"/auth/federation/azure/intune\", {\n\t\t\tsignal,\n\t\t\tquery: { accessToken },\n\t\t\tusePublicAreaToken: false\n\t\t});\n\t}\n};\n//#endregion\n//#region src/base/error/error-types.ts\nvar HTTPError = class extends Error {\n\tresponse;\n\trequest;\n\tconstructor(response, request) {\n\t\tconst status = `${response.status || response.status === 0 ? response.status : \"\"} ${response.statusText || \"\"}`.trim();\n\t\tconst reason = status ? `status code ${status}` : \"an unknown error\";\n\t\tsuper(`Request failed with ${reason}`);\n\t\tthis.name = \"HTTPError\";\n\t\tthis.response = response;\n\t\tthis.request = request;\n\t}\n};\nvar NotLoggedInError = class extends HTTPError {};\nvar InvalidParameterError = class extends HTTPError {};\nvar InvalidRecoveryCodeError = class extends HTTPError {};\nvar InputRequiredError = class extends HTTPError {\n\tresponse;\n\trequest;\n\tlinks;\n\tcsrfToken;\n\tconstructor(response, request, links, csrfToken) {\n\t\tsuper(response, request);\n\t\tthis.response = response;\n\t\tthis.request = request;\n\t\tthis.links = links;\n\t\tthis.csrfToken = csrfToken;\n\t}\n};\n//#endregion\n//#region src/base/error/identifiers.ts\nlet ErrorIdentifier = /* @__PURE__ */ function(ErrorIdentifier) {\n\tErrorIdentifier[ErrorIdentifier[\"INVALID_PARAMETER\"] = 4003] = \"INVALID_PARAMETER\";\n\tErrorIdentifier[ErrorIdentifier[\"LOGIN_REQUIRED\"] = 40102] = \"LOGIN_REQUIRED\";\n\tErrorIdentifier[ErrorIdentifier[\"INVALID_RECOVERY_CODE\"] = 40106] = \"INVALID_RECOVERY_CODE\";\n\tErrorIdentifier[ErrorIdentifier[\"INPUT_REQUIRED\"] = 403010] = \"INPUT_REQUIRED\";\n\treturn ErrorIdentifier;\n}({});\n//#endregion\n//#region src/base/error/handler.ts\nconst determineError = async (request, response) => {\n\tconst clone = response.clone();\n\tlet body;\n\ttry {\n\t\tbody = await clone.json();\n\t} catch {\n\t\tthrow new HTTPError(response, request);\n\t}\n\tif (body && typeof body === \"object\" && \"identifier\" in body) {\n\t\tif (body.identifier === 4003) throw new InvalidParameterError(response, request);\n\t\tif (body.identifier === 40102) throw new NotLoggedInError(response, request);\n\t\tif (body.identifier === 40106) throw new InvalidRecoveryCodeError(response, request);\n\t\tif (body.identifier === 403010 && \"links\" in body) {\n\t\t\tconst csrfToken = \"csrfToken\" in body && typeof body.csrfToken === \"string\" ? body.csrfToken : void 0;\n\t\t\tthrow new InputRequiredError(response, request, body.links, csrfToken);\n\t\t}\n\t}\n\tthrow new HTTPError(response, request);\n};\n//#endregion\n//#region src/base/merge-headers.ts\nconst mergeHeaders = (source1 = {}, source2 = {}) => {\n\tconst result = new Headers(source1);\n\tconst source = new Headers(source2);\n\tfor (const [key, value] of source.entries()) if (value === void 0) result.delete(key);\n\telse result.set(key, value);\n\treturn result;\n};\n//#endregion\n//#region src/base/query-string.ts\nconst isDefined = (value) => {\n\treturn value !== void 0 && value !== null;\n};\nconst getQueryString = (params) => {\n\tconst qs = [];\n\tconst process = (key, value) => {\n\t\tif (isDefined(value)) {\n\t\t\tif (Array.isArray(value)) value.forEach((v) => {\n\t\t\t\tprocess(key, v);\n\t\t\t});\n\t\t\telse qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);\n\t\t}\n\t};\n\tObject.entries(params).forEach(([key, value]) => {\n\t\tprocess(key, value);\n\t});\n\treturn qs.join(\"&\");\n};\n//#endregion\n//#region src/base/base-client.ts\nvar BaseClient = class {\n\tbaseURL;\n\tconstructor(baseURL) {\n\t\tthis.baseURL = baseURL;\n\t}\n\tbeforeRequestHooks = [];\n\taddBeforeRequestHook(hook) {\n\t\tthis.beforeRequestHooks.push(hook);\n\t\treturn () => {\n\t\t\tthis.beforeRequestHooks.splice(this.beforeRequestHooks.indexOf(hook), 1);\n\t\t};\n\t}\n\tasync request(input, options = {}) {\n\t\tif (typeof input !== \"string\" && !(input instanceof URL || input instanceof globalThis.Request)) throw new TypeError(\"`input` must be a string, URL, or Request\");\n\t\tconst { query, ...requestOptions } = options;\n\t\tif (typeof input === \"string\") input = new URL(input, this.baseURL);\n\t\trequestOptions.credentials = requestOptions.credentials ?? (input instanceof Request ? input.credentials : void 0);\n\t\trequestOptions.headers = input instanceof Request ? mergeHeaders(input.headers, requestOptions.headers) : requestOptions.headers;\n\t\tlet request = new Request(input, requestOptions);\n\t\tif (query) {\n\t\t\tconst url = new URL(request.url);\n\t\t\turl.search = getQueryString({\n\t\t\t\t...Object.fromEntries(url.searchParams),\n\t\t\t\t...query\n\t\t\t});\n\t\t\t/**\n\t\t\t* Double constructor and request spread to adress several issues.\n\t\t\t* Request spread solves incorrect passing of `duplex` option.\n\t\t\t* Double constructor with `requestOptions` fixes passing of properties like `credentials` and `method`\n\t\t\t*/\n\t\t\trequest = new Request(new Request(url, { ...request }), requestOptions);\n\t\t}\n\t\tfor (const hook of this.beforeRequestHooks) {\n\t\t\tconst res = await hook(request, options);\n\t\t\tif (res instanceof Request) request = res;\n\t\t}\n\t\tconst response = await fetch(request);\n\t\tif (!response.ok) await determineError(request, response);\n\t\treturn response;\n\t}\n};\n//#endregion\n//#region src/base/types.ts\nlet CommentStatus = /* @__PURE__ */ function(CommentStatus) {\n\tCommentStatus[\"None\"] = \"none\";\n\tCommentStatus[\"Published\"] = \"PUBLISHED\";\n\tCommentStatus[\"Unpublished\"] = \"UNPUBLISHED\";\n\tCommentStatus[\"HiddenForModeration\"] = \"HIDDEN_FOR_MODERATION\";\n\tCommentStatus[\"Approved\"] = \"APPROVED\";\n\tCommentStatus[\"Removed\"] = \"REMOVED\";\n\tCommentStatus[\"RemovedByAuthor\"] = \"REMOVED_BY_AUTHOR\";\n\treturn CommentStatus;\n}({});\nconst EyoEntityTypes = {\n\tbranch: \"branch\",\n\tbookmark: \"bookmark\",\n\tcomment: \"comment\",\n\tconversation: \"conversation\",\n\tinstallation: \"installation\",\n\tmedium: \"medium\",\n\tmenuItem: \"menuItem\",\n\tlaunchpadApp: \"launchpadApp\",\n\tmessage: \"message\",\n\tplugin: \"plugin\",\n\tpost: \"post\",\n\tprofileField: \"profileField\",\n\tspace: \"space\",\n\ttoken: \"token\",\n\tuser: \"user\",\n\tgroup: \"group\"\n};\n//#endregion\n//#region src/base/http-status.ts\n/**\n* StatusCodes as defined in https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml\n*/\nlet HttpStatus = /* @__PURE__ */ function(HttpStatus) {\n\t/** [RFC9110, Section 15.2.1] **/\n\tHttpStatus[HttpStatus[\"CONTINUE\"] = 100] = \"CONTINUE\";\n\t/** [RFC9110, Section 15.2.2] **/\n\tHttpStatus[HttpStatus[\"SWITCHING_PROTOCOLS\"] = 101] = \"SWITCHING_PROTOCOLS\";\n\t/** [RFC2518] **/\n\tHttpStatus[HttpStatus[\"PROCESSING\"] = 102] = \"PROCESSING\";\n\t/** [RFC8297] **/\n\tHttpStatus[HttpStatus[\"EARLY_HINTS\"] = 103] = \"EARLY_HINTS\";\n\t/** [RFC9110, Section 15.3.1] **/\n\tHttpStatus[HttpStatus[\"OK\"] = 200] = \"OK\";\n\t/** [RFC9110, Section 15.3.2] **/\n\tHttpStatus[HttpStatus[\"CREATED\"] = 201] = \"CREATED\";\n\t/** [RFC9110, Section 15.3.3] **/\n\tHttpStatus[HttpStatus[\"ACCEPTED\"] = 202] = \"ACCEPTED\";\n\t/** [RFC9110, Section 15.3.4] **/\n\tHttpStatus[HttpStatus[\"NON_AUTHORATIVE_INFORMATION\"] = 203] = \"NON_AUTHORATIVE_INFORMATION\";\n\t/** [RFC9110, Section 15.3.5] **/\n\tHttpStatus[HttpStatus[\"NO_CONTENT\"] = 204] = \"NO_CONTENT\";\n\t/** [RFC9110, Section 15.3.6] **/\n\tHttpStatus[HttpStatus[\"RESET_CONTENT\"] = 205] = \"RESET_CONTENT\";\n\t/** [RFC9110, Section 15.3.7] **/\n\tHttpStatus[HttpStatus[\"PARTIAL_CONTENT\"] = 206] = \"PARTIAL_CONTENT\";\n\t/** [RFC4918] **/\n\tHttpStatus[HttpStatus[\"MULTI_STATUS\"] = 207] = \"MULTI_STATUS\";\n\t/** [RFC5842] **/\n\tHttpStatus[HttpStatus[\"ALREADY_REPORTED\"] = 208] = \"ALREADY_REPORTED\";\n\t/** [RFC3229] **/\n\tHttpStatus[HttpStatus[\"IM_USED\"] = 226] = \"IM_USED\";\n\t/** [RFC9110, Section 15.4.1] **/\n\tHttpStatus[HttpStatus[\"MULTIPLE_CHOICES\"] = 300] = \"MULTIPLE_CHOICES\";\n\t/** [RFC9110, Section 15.4.2] **/\n\tHttpStatus[HttpStatus[\"MOVED_PERMANENTLY\"] = 301] = \"MOVED_PERMANENTLY\";\n\t/** [RFC9110, Section 15.4.3] **/\n\tHttpStatus[HttpStatus[\"FOUND\"] = 302] = \"FOUND\";\n\t/** [RFC9110, Section 15.4.4] **/\n\tHttpStatus[HttpStatus[\"SEE_OTHER\"] = 303] = \"SEE_OTHER\";\n\t/** [RFC9110, Section 15.4.5] **/\n\tHttpStatus[HttpStatus[\"NOT_MODIFIED\"] = 304] = \"NOT_MODIFIED\";\n\t/** [RFC9110, Section 15.4.6] **/\n\tHttpStatus[HttpStatus[\"USE_PROXY\"] = 305] = \"USE_PROXY\";\n\t/** [RFC9110, Section 15.4.8] **/\n\tHttpStatus[HttpStatus[\"TEMPORARY_REDIRECT\"] = 307] = \"TEMPORARY_REDIRECT\";\n\t/** [RFC9110, Section 15.4.9] **/\n\tHttpStatus[HttpStatus[\"PERMANENT_REDIRECT\"] = 308] = \"PERMANENT_REDIRECT\";\n\t/** [RFC9110, Section 15.5.1] **/\n\tHttpStatus[HttpStatus[\"BAD_REQUEST\"] = 400] = \"BAD_REQUEST\";\n\t/** [RFC9110, Section 15.5.2] **/\n\tHttpStatus[HttpStatus[\"UNAUTHORIZED\"] = 401] = \"UNAUTHORIZED\";\n\t/** [RFC9110, Section 15.5.3] **/\n\tHttpStatus[HttpStatus[\"PAYMENT_REQUIRED\"] = 402] = \"PAYMENT_REQUIRED\";\n\t/** [RFC9110, Section 15.5.4] **/\n\tHttpStatus[HttpStatus[\"FORBIDDEN\"] = 403] = \"FORBIDDEN\";\n\t/** [RFC9110, Section 15.5.5] **/\n\tHttpStatus[HttpStatus[\"NOT_FOUND\"] = 404] = \"NOT_FOUND\";\n\t/** [RFC9110, Section 15.5.6] **/\n\tHttpStatus[HttpStatus[\"METHOD_NOT_ALLOWED\"] = 405] = \"METHOD_NOT_ALLOWED\";\n\t/** [RFC9110, Section 15.5.7] **/\n\tHttpStatus[HttpStatus[\"NOT_ACCEPTABLE\"] = 406] = \"NOT_ACCEPTABLE\";\n\t/** [RFC9110, Section 15.5.8] **/\n\tHttpStatus[HttpStatus[\"PROXY_AUTHENTICATION_REQUIRED\"] = 407] = \"PROXY_AUTHENTICATION_REQUIRED\";\n\t/** [RFC9110, Section 15.5.9] **/\n\tHttpStatus[HttpStatus[\"REQUEST_TIMEOUT\"] = 408] = \"REQUEST_TIMEOUT\";\n\t/** [RFC9110, Section 15.5.10] **/\n\tHttpStatus[HttpStatus[\"CONFLICT\"] = 409] = \"CONFLICT\";\n\t/** [RFC9110, Section 15.5.11] **/\n\tHttpStatus[HttpStatus[\"GONE\"] = 410] = \"GONE\";\n\t/** [RFC9110, Section 15.5.12] **/\n\tHttpStatus[HttpStatus[\"LENGTH_REQUIRED\"] = 411] = \"LENGTH_REQUIRED\";\n\t/** [RFC9110, Section 15.5.13] **/\n\tHttpStatus[HttpStatus[\"PRECONDITION_FAILED\"] = 412] = \"PRECONDITION_FAILED\";\n\t/** [RFC9110, Section 15.5.14] **/\n\tHttpStatus[HttpStatus[\"CONTENT_TOO_LARGE\"] = 413] = \"CONTENT_TOO_LARGE\";\n\t/** [RFC9110, Section 15.5.15] **/\n\tHttpStatus[HttpStatus[\"URI_TOO_LONG\"] = 414] = \"URI_TOO_LONG\";\n\t/** [RFC9110, Section 15.5.16] **/\n\tHttpStatus[HttpStatus[\"UNSUPPORTED_MEDIA_TYPE\"] = 415] = \"UNSUPPORTED_MEDIA_TYPE\";\n\t/** [RFC9110, Section 15.5.17] **/\n\tHttpStatus[HttpStatus[\"RANGE_NOT_SATISFIABLE\"] = 416] = \"RANGE_NOT_SATISFIABLE\";\n\t/** [RFC9110, Section 15.5.18] **/\n\tHttpStatus[HttpStatus[\"EXPECTATION_FAILED\"] = 417] = \"EXPECTATION_FAILED\";\n\t/** [RFC9110, Section 15.5.20] **/\n\tHttpStatus[HttpStatus[\"MISDIRECTED_REQUEST\"] = 421] = \"MISDIRECTED_REQUEST\";\n\t/** [RFC9110, Section 15.5.21] **/\n\tHttpStatus[HttpStatus[\"UNPROCESSABLE_CONTENT\"] = 422] = \"UNPROCESSABLE_CONTENT\";\n\t/** [RFC4918] **/\n\tHttpStatus[HttpStatus[\"LOCKED\"] = 423] = \"LOCKED\";\n\t/** [RFC4918] **/\n\tHttpStatus[HttpStatus[\"FAILED_DEPENDENCY\"] = 424] = \"FAILED_DEPENDENCY\";\n\t/** [RFC8470] **/\n\tHttpStatus[HttpStatus[\"TOO_EARLY\"] = 425] = \"TOO_EARLY\";\n\t/** [RFC9110, Section 15.5.22] **/\n\tHttpStatus[HttpStatus[\"UPGRADE_REQUIRED\"] = 426] = \"UPGRADE_REQUIRED\";\n\t/** [RFC6585] **/\n\tHttpStatus[HttpStatus[\"PRECONDITION_REQUIRED\"] = 428] = \"PRECONDITION_REQUIRED\";\n\t/** [RFC6585] **/\n\tHttpStatus[HttpStatus[\"TOO_MANY_REQUESTS\"] = 429] = \"TOO_MANY_REQUESTS\";\n\t/** [RFC6585] **/\n\tHttpStatus[HttpStatus[\"REQUEST_HEADER_FIELDS_TOO_LARGE\"] = 431] = \"REQUEST_HEADER_FIELDS_TOO_LARGE\";\n\t/** [RFC7725] **/\n\tHttpStatus[HttpStatus[\"UNAVAILABLE_FOR_LEGAL_REASONS\"] = 451] = \"UNAVAILABLE_FOR_LEGAL_REASONS\";\n\t/** [RFC9110, Section 15.6.1] **/\n\tHttpStatus[HttpStatus[\"INTERNAL_SERVER_ERROR\"] = 500] = \"INTERNAL_SERVER_ERROR\";\n\t/** [RFC9110, Section 15.6.2] **/\n\tHttpStatus[HttpStatus[\"NOT_IMPLEMENTED\"] = 501] = \"NOT_IMPLEMENTED\";\n\t/** [RFC9110, Section 15.6.3] **/\n\tHttpStatus[HttpStatus[\"BAD_GATEWAY\"] = 502] = \"BAD_GATEWAY\";\n\t/** [RFC9110, Section 15.6.4] **/\n\tHttpStatus[HttpStatus[\"SERVICE_UNAVAILABLE\"] = 503] = \"SERVICE_UNAVAILABLE\";\n\t/** [RFC9110, Section 15.6.5] **/\n\tHttpStatus[HttpStatus[\"GATEWAY_TIMEOUT\"] = 504] = \"GATEWAY_TIMEOUT\";\n\t/** [RFC9110, Section 15.6.6] **/\n\tHttpStatus[HttpStatus[\"HTTP_VERSION_NOT_SUPPORTED\"] = 505] = \"HTTP_VERSION_NOT_SUPPORTED\";\n\t/** [RFC2295] **/\n\tHttpStatus[HttpStatus[\"VARIANT_ALSO_NEGOTIATES\"] = 506] = \"VARIANT_ALSO_NEGOTIATES\";\n\t/** [RFC4918] **/\n\tHttpStatus[HttpStatus[\"INSUFFICIENT_STORAGE\"] = 507] = \"INSUFFICIENT_STORAGE\";\n\t/** [RFC5842] **/\n\tHttpStatus[HttpStatus[\"LOOP_DETECTED\"] = 508] = \"LOOP_DETECTED\";\n\t/** [RFC6585] **/\n\tHttpStatus[HttpStatus[\"NETWORK_AUTHENTICATION_REQUIRED\"] = 511] = \"NETWORK_AUTHENTICATION_REQUIRED\";\n\treturn HttpStatus;\n}({});\n//#endregion\n//#region src/base/rights.ts\nlet DiscoveryRight = /* @__PURE__ */ function(DiscoveryRight) {\n\t/**\n\t* Whether or not the requesting user may access the backoffice, i.e. the admin panel, at all. A,\n\t* E, PO, PE, GO, GA\n\t*/\n\tDiscoveryRight[\"ACCESS_ADMIN\"] = \"ACCESS_ADMIN\";\n\t/** Whether or not the requesting user may access the analytics section of the backoffice. A, E */\n\tDiscoveryRight[\"ACCESS_ADMIN_ANALYTICS\"] = \"ACCESS_ADMIN_ANALYTICS\";\n\t/**\n\t* Whether or not the requesting user may access the comments section of the backoffice. A, E, PO,\n\t* PE\n\t*/\n\tDiscoveryRight[\"ACCESS_ADMIN_COMMENTS\"] = \"ACCESS_ADMIN_COMMENTS\";\n\t/** Whether or not the requesting user may access the dashboard of the backoffice or not. A, E */\n\tDiscoveryRight[\"ACCESS_ADMIN_DASHBOARD\"] = \"ACCESS_ADMIN_DASHBOARD\";\n\t/** Whether or not the requesting user may access the external content of the backoffice or not. A, E */\n\tDiscoveryRight[\"ACCESS_STUDIO_EXTERNAL_CONTENTS\"] = \"ACCESS_STUDIO_EXTERNAL_CONTENTS\";\n\t/**\n\t* Whether or not the requesting user may access the groups section of the backoffice. A, GO, GA\n\t*/\n\tDiscoveryRight[\"ACCESS_ADMIN_GROUPS\"] = \"ACCESS_ADMIN_GROUPS\";\n\t/**\n\t* Whether or not the requesting user may access the branch menu section of the backoffice. A, E\n\t*/\n\tDiscoveryRight[\"ACCESS_ADMIN_MENU\"] = \"ACCESS_ADMIN_MENU\";\n\t/**\n\t* Whether or not the requesting user may access the branch settings section of the backoffice. A\n\t*/\n\tDiscoveryRight[\"ACCESS_ADMIN_SETTINGS\"] = \"ACCESS_ADMIN_SETTINGS\";\n\t/** Whether or not the requesting user may access the users section of the backoffice. A */\n\tDiscoveryRight[\"ACCESS_ADMIN_USERS\"] = \"ACCESS_ADMIN_USERS\";\n\t/** Whether or not the requesting user may access studio content. A **/\n\tDiscoveryRight[\"ACCESS_STUDIO_CONTENTS\"] = \"ACCESS_STUDIO_CONTENTS\";\n\t/** Whether or not the requesting user may access the email product within the studio. Email only users. A **/\n\tDiscoveryRight[\"ACCESS_STUDIO_EMAIL\"] = \"ACCESS_STUDIO_EMAIL\";\n\t/** Whether the requesting user may access the studio email modern tab. */\n\tDiscoveryRight[\"ACCESS_STUDIO_EMAIL_MODERN\"] = \"ACCESS_STUDIO_EMAIL_MODERN\";\n\t/** Whether or not the requesting user may create a new user group. A */\n\tDiscoveryRight[\"CREATE_GROUP\"] = \"CREATE_GROUP\";\n\t/** Whether or not the requesting user may create a new plugin installation. A */\n\tDiscoveryRight[\"CREATE_INSTALLATION\"] = \"CREATE_INSTALLATION\";\n\t/** Whether or not the requesting user may create, i.e. invite, a new user. A */\n\tDiscoveryRight[\"CREATE_USER\"] = \"CREATE_USER\";\n\t/** Whether or not a user is admin of at least one space. */\n\tDiscoveryRight[\"MANAGE_SPACE\"] = \"MANAGE_SPACE\";\n\t/** Whether the search is available or not. */\n\tDiscoveryRight[\"SEARCH\"] = \"SEARCH\";\n\treturn DiscoveryRight;\n}({});\nlet InstallationRight = /* @__PURE__ */ function(InstallationRight) {\n\tInstallationRight[\"ALTER_ICON\"] = \"ALTER_ICON\";\n\tInstallationRight[\"CONTENT\"] = \"CONTENT\";\n\t/**\n\t* Alter the content of the installation, but only in the scope of what one created oneself, i.e.\n\t* only a Post that one authored. Available for contributors.\n\t*/\n\tInstallationRight[\"CONTRIBUTE\"] = \"CONTRIBUTE\";\n\t/**\n\t* Modify the settings as well as display properties of this installation. For installation\n\t* owners.\n\t*/\n\tInstallationRight[\"MODIFY\"] = \"MODIFY\";\n\t/** Transfer the ownership of the installation. Only for installation owners. */\n\tInstallationRight[\"TRANSFER_OWNERSHIP\"] = \"TRANSFER_OWNERSHIP\";\n\t/** Delete the plugin installation. Only for installation owners. */\n\tInstallationRight[\"DELETE\"] = \"DELETE\";\n\treturn InstallationRight;\n}({});\nlet CommentRight = /* @__PURE__ */ function(CommentRight) {\n\t/**\n\t* Edit the comment's contents like the text itself or the associated image. Available for authors\n\t* or branch moderators and above.\n\t*/\n\tCommentRight[\"MODIFY\"] = \"MODIFY\";\n\t/**\n\t* Permanently delete the comment instance. Available for authors or branch moderators and above.\n\t*/\n\tCommentRight[\"DELETE\"] = \"DELETE\";\n\treturn CommentRight;\n}({});\n//#endregion\n//#region src/bookmarks/bookmarks-resource.ts\nvar BookmarksResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(params, signal) {\n\t\treturn (await this.client.request(\"/api/bookmarks\", {\n\t\t\tsignal,\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/aggregated-email-analytics-resource.ts\nvar AggregatedEmailAnalyticsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getAssetslist(signal) {\n\t\treturn (await this.client.request(\"/api/email-analytics/latest-materializations\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getGroupFilter(signal) {\n\t\treturn (await this.client.request(\"/api/email-analytics/groups\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getOverview(params, signal) {\n\t\treturn (await this.client.request(\"/api/email-analytics/overview\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getStats(params, signal) {\n\t\treturn (await this.client.request(\"/api/email-analytics/aggregated-stats\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getTimeseries(params, signal) {\n\t\treturn (await this.client.request(\"/api/email-analytics/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/analytics-assets-materializations-resource.ts\nvar AssetsMaterializationsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/assets/get_api_branch_analytics_assets_latest_materializations\n\t*/\n\tasync list() {\n\t\treturn (await this.client.request(\"/api/branch/analytics/assets/latest-materializations\", { method: \"GET\" })).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/campaign-analytics-resource.ts\nvar CampaignAnalyticsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_branch_analytics_campaigns_stats\n\t*/\n\tasync getCampaignStats(campaignId, partition, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/campaigns/stats\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tcampaignId,\n\t\t\t\tpartition\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_branch_analytics_campaigns_ranking\n\t*/\n\tasync getCampaignRanking(orderBy, limit = 100, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/campaigns/rankings\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\torderBy,\n\t\t\t\tlimit\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_branch_analytics_campaigns_engagement_timeseries\n\t*/\n\tasync getEngagementTimeseries(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/campaigns/engagement/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_branch_analytics_campaigns_visibility_timeseries\n\t*/\n\tasync getVisibilityTimeseries(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/campaigns/visibility/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/timeseries/get_api_branch_analytics_campaigns_visibility_accessors\n\t*/\n\tasync getVisibilityAccessors(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/campaigns/visibility/accessors\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_branch_analytics_campaigns_visibility_user_group_ranking\n\t*/\n\tasync getVisibilityGroupRanking(params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/campaigns/visibility/user-group-ranking`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getVisibilityContentRanking(params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/campaigns/visibility/content-ranking`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_branch_analytics_campaigns_visibility_user_group_ranking\n\t*/\n\tasync getEngagementGroupRanking(params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/campaigns/engagement/user-group-ranking`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_branch_analytics_campaigns_posts_stats\n\t*/\n\tasync getPostsStats(campaignId, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/campaigns/posts/stats`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { campaignId },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\nconst validCampaignRankingOrderBy = [\n\t\"campaign_title_ASC\",\n\t\"campaign_title_DESC\",\n\t\"campaign_goal_ASC\",\n\t\"campaign_goal_DESC\",\n\t\"visibility_ASC\",\n\t\"visibility_DESC\",\n\t\"engaged_users_ASC\",\n\t\"engaged_users_DESC\",\n\t\"posts_ASC\",\n\t\"posts_DESC\",\n\t\"engagement_rate_ASC\",\n\t\"engagement_rate_DESC\"\n];\n/**\n* @deprecated\n* use CampaignRankingOrderBy type instead of isCampaignRankingOrderBy function\n*/\nconst isCampaignRankingOrderBy = (orderBy) => {\n\treturn validCampaignRankingOrderBy.includes(orderBy);\n};\n//#endregion\n//#region src/branch/analytics/pages-analytics-resource.ts\nvar PagesAnalyticsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getStats(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/pages/stats\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getTimeSeries(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/pages/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getRanking(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/pages/ranking\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getDetailedPageStats(pageId, params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/pages/${pageId}/stats`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getDetailedPageTimeSeries(pageId, params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/pages/${pageId}/timeseries`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getDetailedPageGroupRanking(pageId, params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/pages/${pageId}/group-ranking`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getDetailedPageTrafficSources(pageId, params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/pages/${pageId}/traffic-sources`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getDetailedPageTimeOnPage(pageId, params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/pages/${pageId}/histogram`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getDetailedPageClickRanking(pageId, params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/pages/${pageId}/click-ranking`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/chats-analytics-resource.ts\nvar ChatsAnalyticsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* @see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/timeseries/get_api_chats_timeseries\n\t*/\n\tasync timeseries(params) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/chats/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/utils.ts\nconst createSCIMString = (record) => {\n\treturn Object.entries(record).map(([key, value]) => {\n\t\tif (value === void 0) return;\n\t\tif (Array.isArray(value)) {\n\t\t\tif (value.length === 0) return;\n\t\t\treturn `(${value.map((v) => `${key} eq ${JSON.stringify(v)}`).join(\" or \")})`;\n\t\t}\n\t\treturn `${key} eq ${JSON.stringify(value)}`;\n\t}).filter((v) => v !== void 0).join(\" and \");\n};\n//#endregion\n//#region src/branch/analytics/contents-analytics-resource.ts\nvar ContentsAnalyticsResouce = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* @see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_contents_rankings\n\t*/\n\tasync rankings(params = {}, signal) {\n\t\tconst { filter, groupBy, ...rest } = params;\n\t\treturn (await this.client.request(\"/api/branch/analytics/contents/rankings\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tfilter: filter ? createSCIMString({ ...filter }) : void 0,\n\t\t\t\tgroupBy: groupBy?.join(\",\"),\n\t\t\t\t...rest\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/hashtags-analytics-resource.ts\nvar HashtagsAnalyticsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync contentsVisitsClicks(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/hashtags/contentsVisitsClicks\", {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/posts-analytics-resource.ts\nvar PostsAnalyticsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* @see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_posts_rankings\n\t*/\n\tasync rankings(params = {}, signal) {\n\t\tconst { filter, groupBy, ...rest } = params;\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/rankings\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tfilter: filter ? createSCIMString({ ...filter }) : void 0,\n\t\t\t\tgroupBy: groupBy?.join(\",\"),\n\t\t\t\t...rest\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* @see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_posts_rankings_custom\n\t*/\n\tasync customRankings(aggregateBy, params = {}, signal) {\n\t\tconst { filter, ...rest } = params;\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/rankings/custom\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\taggregateBy,\n\t\t\t\tfilter: filter ? createSCIMString({ ...filter }) : void 0,\n\t\t\t\t...rest\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* @see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_posts_timeseries\n\t*/\n\tasync timeseries(params, signal) {\n\t\tconst { filter, ...rest } = params;\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tfilter: filter ? createSCIMString({ ...filter }) : void 0,\n\t\t\t\t...rest\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* @see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/interactions/get_api_branch_analytics_posts_stats_interactions\n\t*/\n\tasync interactions(params = {}, signal) {\n\t\tconst { filter, ...rest } = params;\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/stats/interactions\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tfilter: filter ? createSCIMString({ ...filter }) : void 0,\n\t\t\t\t...rest\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* @see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_posts_stats\n\t*/\n\tasync stats(params = {}, signal) {\n\t\tconst { filter, ...rest } = params;\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/stats\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tfilter: filter ? createSCIMString({ ...filter }) : void 0,\n\t\t\t\t...rest\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* @see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_branch_analytics_posts_stats_aggregated\n\t*/\n\tasync aggregatedStats(params = {}, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/posts/stats/aggregated\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync visits(postId, params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/post/${postId}/visits`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync primaryVideoViews(postId, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/post/${postId}/primaryVideoViews`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/reports-analytics-resource.ts\nvar ReportsAnalyticsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/reports\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(reportId, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/reports/${reportId}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(payload, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/reports\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(reportId, payload, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/reports/${reportId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync remove(reportId, signal) {\n\t\tawait this.client.request(`/api/branch/analytics/reports/${reportId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/branch/analytics/search-analytics-resource.ts\nvar SearchAnalyticsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync stats(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/search/stats\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync rankings(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/search/rankings\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getGroupFilter(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/search/groups\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/users-analytics-resource.ts\nvar UsersAnalyticsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* @see https://backstage.staffbase.com/catalog/default/api/analytics-api/definition#/stats/get_api_users_timeseries\n\t*/\n\tasync timeseries(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/v2/users/timeseries\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* @see https://github.com/staffbase/analytics-service\n\t*/\n\tasync countByStatus(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/users/countByStatus\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* @see https://github.com/staffbase/backend\n\t*/\n\tasync status(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/users/status\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync changelog(params, signal) {\n\t\treturn (await this.client.request(`/api/branch/analytics/user/changelog`, {\n\t\t\tsignal,\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/analytics/branch-analytics-resource.ts\nvar BranchAnalyticsResource = class {\n\tclient;\n\tassets;\n\tcampaigns;\n\tchats;\n\tcontents;\n\temail;\n\thashtags;\n\tpages;\n\tposts;\n\treports;\n\tsearch;\n\tusers;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.assets = new AssetsMaterializationsResource(client);\n\t\tthis.campaigns = new CampaignAnalyticsResource(client);\n\t\tthis.chats = new ChatsAnalyticsResource(client);\n\t\tthis.contents = new ContentsAnalyticsResouce(client);\n\t\tthis.email = new AggregatedEmailAnalyticsResource(client);\n\t\tthis.hashtags = new HashtagsAnalyticsResource(client);\n\t\tthis.pages = new PagesAnalyticsResource(client);\n\t\tthis.posts = new PostsAnalyticsResource(client);\n\t\tthis.reports = new ReportsAnalyticsResource(client);\n\t\tthis.search = new SearchAnalyticsResource(client);\n\t\tthis.users = new UsersAnalyticsResource(client);\n\t}\n\t/**\n\t* @see https://github.com/staffbase/analytics-service\n\t* @see https://github.com/staffbase/backend\n\t*/\n\tasync discover(signal) {\n\t\treturn (await this.client.request(\"/api/branch/analytics/discover\", { signal })).json();\n\t}\n};\n//#endregion\n//#region src/branch/branch-channels/branch-channel-posts/branch-channel-posts-resource.ts\nvar BranchChannelPostsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(channelId, params, signal) {\n\t\treturn (await this.client.request(`/api/branch/channels/${channelId}/posts`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/branch-channels/branch-channels-resource.ts\nvar BranchChannelsResource = class {\n\tclient;\n\tposts;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.posts = new BranchChannelPostsResource(client);\n\t}\n\tasync list(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/channels\", {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(channelId, signal) {\n\t\treturn (await this.client.request(`/api/branch/channels/${channelId}`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/branch/branch-config/branch-config-resource.ts\nvar BranchConfigResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync update(branchId, payload) {\n\t\treturn (await this.client.request(`/api/branches/${branchId}/config`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/branch-group/old-branch-group-resource.ts\nvar OldBranchGroupResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/branch/groups/${id}`, { signal })).json();\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"/api/branch/groups\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync create(data) {\n\t\treturn (await this.client.request(\"/api/branch/groups\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(data)\n\t\t})).json();\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/branch/groups/${id}`, { method: \"DELETE\" });\n\t}\n\tasync update(id, data) {\n\t\treturn (await this.client.request(`/api/branch/groups/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(data)\n\t\t})).json();\n\t}\n\tasync addUserToGroup(groupId, userId) {\n\t\tawait this.client.request(`/api/branch/groups/${groupId}/users/${userId}`, {\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"POST\"\n\t\t});\n\t}\n\tasync removeUserFromGroup(groupId, userId) {\n\t\tawait this.client.request(`/api/branch/groups/${groupId}/users/${userId}`, { method: \"DELETE\" });\n\t}\n};\n//#endregion\n//#region src/branch/branch-integrations/branch-integrations-resource.ts\nvar BranchIntegrationsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(payload) {\n\t\treturn (await this.client.request(\"/api/branch/integrations\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync update(id, payload, signal) {\n\t\treturn (await this.client.request(`/api/branch/integrations/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`/api/branch/integrations/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync features(integrationId, payload, signal) {\n\t\tawait this.client.request(`/api/branch/integrations/${integrationId}/features`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n\tasync deleteFeature(integrationId, featureId, signal) {\n\t\tawait this.client.request(`/api/branch/integrations/${integrationId}/features/${featureId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync types(signal) {\n\t\treturn (await this.client.request(\"/api/branch/integrations/types\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/branch-journeys/branch-journeys.ts\nvar BranchJourneysResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync navigatorPermission(permissionName, signal) {\n\t\treturn (await this.client.request(`/api/branch/journeys/navigator/permissions/${permissionName}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/branch-launchpad/branch-launchpad-resource.ts\nvar BranchLaunchpadResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(payload) {\n\t\treturn (await this.client.request(\"/api/branch/launchpad/apps\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(\"/api/branch/launchpad/apps\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(id, payload) {\n\t\treturn (await this.client.request(`/api/branch/launchpad/apps/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync delete(id) {\n\t\treturn this.client.request(`/api/branch/launchpad/apps/${id}`, { method: \"DELETE\" });\n\t}\n\tasync accessors(id, signal) {\n\t\treturn (await this.client.request(`/api/branch/launchpad/apps/${id}/accessors`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/branch-plugins/branch-plugins-resource.ts\nvar BranchPluginsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list({ products } = {}, signal) {\n\t\treturn (await this.client.request(\"/api/branch/plugins\", {\n\t\t\tsignal,\n\t\t\tquery: { products }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/branch/branch-sessions/branch-sessions.ts\nvar BranchSessionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync delete() {\n\t\treturn await this.client.request(`/api/branch/sessions`, { method: \"DELETE\" });\n\t}\n};\n//#endregion\n//#region src/branch/branch-resource.ts\nvar BranchesResource = class {\n\tclient;\n\tanalytics;\n\tchannels;\n\t/**\n\t* @deprecated use `BranchesResource` instead\n\t*/\n\tconfig;\n\t/**\n\t* @deprecated use new groups api (client.groups) instead\n\t*/\n\tgroups;\n\tintegrations;\n\tjourneys;\n\tplugins;\n\tsessions;\n\tlaunchpad;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.analytics = new BranchAnalyticsResource(client);\n\t\tthis.channels = new BranchChannelsResource(client);\n\t\tthis.config = new BranchConfigResource(client);\n\t\tthis.groups = new OldBranchGroupResource(client);\n\t\tthis.integrations = new BranchIntegrationsResource(client);\n\t\tthis.journeys = new BranchJourneysResource(client);\n\t\tthis.plugins = new BranchPluginsResource(client);\n\t\tthis.sessions = new BranchSessionsResource(client);\n\t\tthis.launchpad = new BranchLaunchpadResource(client);\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/branch\", { signal })).json();\n\t}\n\tasync update(payload) {\n\t\treturn (await this.client.request(`/api/branch`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/briefings/briefings-resource.ts\nvar BriefingsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"api/briefings\", {\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/briefings/${id}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(payload) {\n\t\treturn (await this.client.request(\"/api/briefings\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync delete(id, signal) {\n\t\treturn await this.client.request(`/api/briefings/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync update(id, payload) {\n\t\treturn await this.client.request(`/api/briefings/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n\tasync associateContent(id, payload) {\n\t\treturn await this.client.request(`/api/briefings/${id}/content`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/broadcast/broadcast-resource.ts\nvar BroadcastResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync message(data) {\n\t\tawait this.client.request(\"api/broadcast/messages\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n\tasync branch(signal) {\n\t\treturn (await this.client.request(\"api/broadcast/branch\", { signal })).json();\n\t}\n\tasync updateBranch(data) {\n\t\tawait this.client.request(\"api/broadcast/branch\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/campaign/campaigns-resource.ts\nvar CampaignsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(data, signal) {\n\t\treturn (await this.client.request(\"/api/campaigns\", {\n\t\t\tbody: JSON.stringify(data),\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync list(options = {}, signal) {\n\t\tconst { alignmentSurveyStatus, ...otherOptions } = options;\n\t\treturn (await this.client.request(\"/api/campaigns\", {\n\t\t\tquery: {\n\t\t\t\t...otherOptions,\n\t\t\t\t...alignmentSurveyStatus && { alignmentSurveyStatus: alignmentSurveyStatus?.join(\",\") }\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/campaigns/${id}`, { signal })).json();\n\t}\n\tasync update(id, data, signal) {\n\t\treturn (await this.client.request(`/api/campaigns/${id}`, {\n\t\t\tbody: JSON.stringify(data),\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`/api/campaigns/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync getReferences({ campaignId, sourceTypes, ...otherOptions }, pagingOpts, signal) {\n\t\treturn (await this.client.request(`/api/campaigns/${campaignId}/references`, {\n\t\t\tquery: {\n\t\t\t\tsourceTypes: sourceTypes?.join(\",\"),\n\t\t\t\t...otherOptions,\n\t\t\t\t...pagingOpts\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync upsertReference(id, { sourceType, sourceId }, signal) {\n\t\treturn (await this.client.request(`/api/campaigns/${id}/references`, {\n\t\t\tbody: JSON.stringify({\n\t\t\t\tsourceType,\n\t\t\t\tsourceId\n\t\t\t}),\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync deleteReference(id, sourceType, sourceId, signal) {\n\t\treturn await this.client.request(`/api/campaigns/${id}/references/${sourceType}/${sourceId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync getManagers(signal) {\n\t\treturn (await this.client.request(\"/api/campaigns/managers\", { signal })).json();\n\t}\n\tasync updateManagers(payload, signal) {\n\t\treturn (await this.client.request(\"/api/campaigns/managers\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.campaign-managers.extended-managers.v1+json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/channels/channel-feeds/channel-feeds-resource.ts\nvar ChannelFeedsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(channelId, signal) {\n\t\treturn (await this.client.request(`/api/channels/${channelId}/feeds`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(channelId, payload, signal) {\n\t\treturn (await this.client.request(`/api/channels/${channelId}/feeds`, {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync preview(channelId, payload, signal) {\n\t\tconst body = new URLSearchParams();\n\t\tbody.set(\"rssURL\", payload.rssURL);\n\t\treturn (await this.client.request(`/api/channels/${channelId}/feeds/preview`, {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/x-www-form-urlencoded\" },\n\t\t\tbody\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/channels/channel-posts/channel-posts-resource.ts\nvar ChannelPostsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(channelID, payload) {\n\t\treturn (await this.client.request(`/api/channels/${channelID}/posts`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\t/**\n\t* Create a post in the channel from a Content Designer document.\n\t*\n\t* The localized `content` field carries a `ContentDocument` (not stringified) and is sent with the\n\t* `application/vnd.staffbase.news.post.legacy-content-document.v1+json` content type; the backend\n\t* renders it to HTML server-side and returns the created post with `content` already as HTML.\n\t*/\n\tasync createFromContentDocument(channelID, payload) {\n\t\treturn (await this.client.request(`/api/channels/${channelID}/posts`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/vnd.staffbase.news.post.legacy-content-document.v1+json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync list(channelID, params, signal) {\n\t\treturn (await this.client.request(`/api/channels/${channelID}/posts`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync delete(channelId, sourceId, signal) {\n\t\tawait this.client.request(`/api/channels/${channelId}/posts`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tquery: { sourceId },\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/channels/channels-resource.ts\nvar ChannelsResource = class {\n\tclient;\n\tposts;\n\tfeeds;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.posts = new ChannelPostsResource(client);\n\t\tthis.feeds = new ChannelFeedsResource(client);\n\t}\n};\n//#endregion\n//#region src/client/channel/posts/channel-posts-resource.ts\nvar ClientChannelPostsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Endpoint to get a list of accessible posts from one channel.\n\t*/\n\tasync list(channelId, params, signal) {\n\t\treturn (await this.client.request(`/api/client/channels/${channelId}/posts`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/client/channel/channel-resource.ts\nvar ChannelResource = class {\n\tposts;\n\tconstructor(client) {\n\t\tthis.posts = new ClientChannelPostsResource(client);\n\t}\n};\n//#endregion\n//#region src/client/newspage/posts/newspage-posts-resource.ts\nvar NewspagePostsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Endpoint to get list of posts from one news page for feed and the news widgets (stage and feed)/news block\n\t*/\n\tasync list(newspageId, params, signal) {\n\t\treturn (await this.client.request(`/api/client/newspages/${newspageId}/posts`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/client/newspage/newspage-resource.ts\nvar NewspageResource = class {\n\tclient;\n\tposts;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.posts = new NewspagePostsResource(client);\n\t}\n\tasync listChannels(newspageId, params, signal) {\n\t\treturn (await this.client.request(`/api/client/newspages/${encodeURIComponent(newspageId)}/channels`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getRights(newspageId, signal) {\n\t\treturn (await this.client.request(`/api/client/newspages/${encodeURIComponent(newspageId)}/rights`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/client/client-resource.ts\nvar ClientResource = class {\n\tclient;\n\tnewspage;\n\tchannel;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.newspage = new NewspageResource(client);\n\t\tthis.channel = new ChannelResource(client);\n\t}\n};\n//#endregion\n//#region src/comment-moderation/comment-moderation-resource.ts\nvar CommentModerationResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getComments(options, signal) {\n\t\treturn (await this.client.request(`/api/comments/moderation/listByStatus`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getCommentCountByStatus(options, signal) {\n\t\treturn (await this.client.request(`/api/comments/moderation/countByStatus`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/comments/likes/comment-likes-resource.ts\nvar CommentLikesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(commentId, params, signal) {\n\t\treturn (await this.client.request(`/api/comments/${commentId}/likes`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/comments/comments-resource.ts\nvar CommentsResource = class {\n\tclient;\n\tlikes;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.likes = new CommentLikesResource(client);\n\t}\n\tasync getComments(options, signal) {\n\t\treturn (await this.client.request(`/api/comments`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getComment(id, signal) {\n\t\treturn (await this.client.request(`/api/comments/${id}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync fetchCountsForParent(parentId, parentType, signal) {\n\t\treturn (await this.client.request(\"/api/comments-count\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tparentId,\n\t\t\t\tparentType\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync report(commentId, signal) {\n\t\treturn (await this.client.request(`/api/comments/${commentId}/reports`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Create a reply to the given comment.\n\t*\n\t* The reply is posted to the modern `/api/comments/${commentId}/comments` route. `text` is HTML\n\t* and `image` (optional) rides on the same request.\n\t*/\n\tasync createReply(commentId, payload) {\n\t\treturn (await this.client.request(`/api/comments/${commentId}/comments`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\t/**\n\t* Create a reply to the given comment from a Content Designer document.\n\t*\n\t* `text` is sent as a `ContentDocument` object (not stringified) with the\n\t* `application/vnd.staffbase.news.comment-create.v2+json` content type; the backend renders it to\n\t* HTML server-side and returns the created reply with `text` already as HTML.\n\t*/\n\tasync createReplyFromContentDocument(commentId, payload) {\n\t\treturn (await this.client.request(`/api/comments/${commentId}/comments`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/vnd.staffbase.news.comment-create.v2+json\" }\n\t\t})).json();\n\t}\n\t/**\n\t* Update the given comment with HTML content.\n\t*\n\t* Posts to the modern `/api/comments/${commentId}` route. `text` is HTML and `image` (optional)\n\t* rides on the same request. Replaces the legacy `NewsApi.updateComment`. Pass `image: null` to\n\t* clear an existing image; omitting `image` leaves it unchanged (presence-based partial update).\n\t*/\n\tasync update(commentId, payload) {\n\t\treturn (await this.client.request(`/api/comments/${commentId}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\t/**\n\t* Update the given comment from a Content Designer document.\n\t*\n\t* `text` is sent as a `ContentDocument` object (not stringified) with the\n\t* `application/vnd.staffbase.news.comment-update.v2+json` content type; the backend renders it to\n\t* HTML server-side and returns the updated comment with `text` already as HTML. Pass `image: null`\n\t* to clear an existing image; omitting `image` leaves it unchanged (presence-based partial update).\n\t*/\n\tasync updateFromContentDocument(commentId, payload) {\n\t\treturn (await this.client.request(`/api/comments/${commentId}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/vnd.staffbase.news.comment-update.v2+json\" }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/communities/communities-resource.ts\nvar CommunitiesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/communities/${id}`, { signal })).json();\n\t}\n\tasync search(params, signal) {\n\t\treturn (await this.client.request(`/api/communities`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(payload, signal) {\n\t\treturn (await this.client.request(`/api/communities`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync update(id, payload, signal) {\n\t\treturn (await this.client.request(`/api/communities/${id}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`/api/communities/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync getMembers(id, queryParams, signal) {\n\t\treturn (await this.client.request(`/api/communities/${id}/members`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: { ...queryParams },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync addMembers(id, payload, signal) {\n\t\tawait this.client.request(`/api/communities/${id}/members`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.communities.members-add.v1+json\" },\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n\tasync removeMembers(id, payload, signal) {\n\t\tawait this.client.request(`/api/communities/${id}/members`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.communities.members-remove.v1+json\" },\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n\tasync getPost(communityId, postId, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}`, { signal })).json();\n\t}\n\tasync createPost(communityId, payload, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync updatePost(communityId, postId, payload, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync deletePost(communityId, postId, signal) {\n\t\tawait this.client.request(`/api/communities/${communityId}/posts/${postId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync getPosts(communityId, queryParams, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/vnd.staffbase.communities.posts-list.html-content.v1+json\" },\n\t\t\tquery: { ...queryParams },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync setReaction(communityId, postId, payload, signal) {\n\t\tawait this.client.request(`/api/communities/${communityId}/posts/${postId}/reactions`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync getReactions(communityId, postId, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}/reactions`, { signal })).json();\n\t}\n\tasync getReactionDetails(communityId, postId, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}/reactions/details`, { signal })).json();\n\t}\n\tasync deleteReaction(communityId, postId, signal) {\n\t\tawait this.client.request(`/api/communities/${communityId}/posts/${postId}/reactions`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync createComment(communityId, postId, payload, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}/comments`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getComments(communityId, postId, params, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}/comments`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/vnd.staffbase.communities.comments-list.v1+json\" },\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getComment(communityId, postId, commentId, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}/comments/${commentId}`, { signal })).json();\n\t}\n\tasync editComment(communityId, postId, commentId, payload, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}/comments/${commentId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync deleteComment(communityId, postId, commentId, signal) {\n\t\tawait this.client.request(`/api/communities/${communityId}/posts/${postId}/comments/${commentId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync addReactionToComment(communityId, postId, commentId, payload, signal) {\n\t\tawait this.client.request(`/api/communities/${communityId}/posts/${postId}/comments/${commentId}/reactions`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync getCommentReactions(communityId, postId, commentId, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}/comments/${commentId}/reactions`, { signal })).json();\n\t}\n\tasync getCommentReactionDetails(communityId, postId, commentId, signal) {\n\t\treturn (await this.client.request(`/api/communities/${communityId}/posts/${postId}/comments/${commentId}/reactions/details`, { signal })).json();\n\t}\n\tasync deleteReactionFromComment(communityId, postId, commentId, signal) {\n\t\tawait this.client.request(`/api/communities/${communityId}/posts/${postId}/comments/${commentId}/reactions`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/community-management/community-management-resource.ts\nvar CommunityManagementResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync listComments(options, signal) {\n\t\treturn (await this.client.request(\"/api/community-management/comments\", {\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getCommentsCountByStatus(options, signal) {\n\t\treturn (await this.client.request(\"/api/community-management/comments-count-by-status\", {\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync overrideSentiment(commentId, payload) {\n\t\tawait this.client.request(`/api/community-management/comments/${commentId}/sentiment-override`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n\tasync getSentimentTimeseries(params) {\n\t\tconst { campaignId, ...rest } = params;\n\t\treturn (await this.client.request(`api/community-management/campaigns/${campaignId}/sentiment-labels/timeseries`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...rest }\n\t\t})).json();\n\t}\n\tasync getSentimentRanking(params) {\n\t\tconst { campaignId, ...rest } = params;\n\t\treturn (await this.client.request(`api/community-management/campaigns/${campaignId}/sentiment-labels/per-post`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...rest }\n\t\t})).json();\n\t}\n\tasync getSentimentOverall({ campaignId }) {\n\t\treturn (await this.client.request(`api/community-insights/campaigns/${campaignId}/sentiment-labels/overall`)).json();\n\t}\n};\n//#endregion\n//#region src/company-events/chat-resource.ts\nvar CompanyEventChatResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync exportCsv(eventId, signal) {\n\t\treturn await this.client.request(`/api/companyevents/${encodeURIComponent(eventId)}/stream/chat/export`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"text/csv\" },\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/company-events/promotions-resource.ts\nvar CompanyEventPromotionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(eventId, signal) {\n\t\treturn await (await this.client.request(`/api/companyevents/${encodeURIComponent(eventId)}/promotions`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/company-events/recording-resource.ts\nvar CompanyEventRecordingResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(eventId, signal) {\n\t\treturn await (await this.client.request(`/api/companyevents/${encodeURIComponent(eventId)}/recording`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync process(eventId, signal) {\n\t\tawait this.client.request(`/api/companyevents/${encodeURIComponent(eventId)}/recording/process`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/company-events/events-resource.ts\nfunction sanitizePayload(data) {\n\tconst sanitized = { ...data };\n\tif (data.type === \"Online\" || data.type === \"GenericRemote\") delete sanitized.location;\n\tif (data.type === \"InPerson\" || data.type === \"GenericRemote\") delete sanitized.externalLink;\n\treturn sanitized;\n}\nvar CompanyEventsResource = class {\n\tclient;\n\tchat;\n\tpromotions;\n\trecording;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.chat = new CompanyEventChatResource(client);\n\t\tthis.promotions = new CompanyEventPromotionsResource(client);\n\t\tthis.recording = new CompanyEventRecordingResource(client);\n\t}\n\tasync list(params, signal) {\n\t\treturn await (await this.client.request(\"/api/companyevents\", {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn await (await this.client.request(`/api/companyevents/${id}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\"\n\t\t})).json();\n\t}\n\tasync create(data) {\n\t\tconst sanitized = sanitizePayload(data);\n\t\treturn await (await this.client.request(\"/api/companyevents\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(sanitized)\n\t\t})).json();\n\t}\n\tasync update(id, data) {\n\t\tconst sanitized = sanitizePayload(data);\n\t\tawait this.client.request(`/api/companyevents/${id}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(sanitized)\n\t\t});\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/companyevents/${id}`, { method: \"DELETE\" });\n\t}\n\tasync cancel(id) {\n\t\tawait this.client.request(`/api/companyevents/${id}/cancel`, { method: \"PUT\" });\n\t}\n\tasync getStreamToken(id, signal) {\n\t\treturn await (await this.client.request(`/api/companyevents/${id}/stream/token`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\"\n\t\t})).json();\n\t}\n\tasync listInvitees(id, params, signal) {\n\t\treturn await (await this.client.request(`/api/companyevents/${id}/invitees`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\tasync getInviteeSummary(id, signal) {\n\t\treturn await (await this.client.request(`/api/companyevents/${id}/invitees/summary`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\"\n\t\t})).json();\n\t}\n\t/** Streams all invitees matching [params] as CSV, in the requested sort order. Response headers include the export's filename via `Content-Disposition`. */\n\tasync exportInvitees(id, params, signal) {\n\t\treturn await this.client.request(`/api/companyevents/${id}/invitees/export`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\theaders: { Accept: \"text/csv\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/content-assistant/content-assistant-resource.ts\nvar ContentAssistantResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync chat(payload, signal) {\n\t\treturn (await this.client.request(\"/api/content-assistant/chat\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/vnd.staffbase.content-assistant.chat.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.content-assistant.chat-response.v1+json\"\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/content-migration/content-migration-resource.ts\nvar TypedContentMigrationResource = class {\n\tclient;\n\tcontentType;\n\tconstructor(client, contentType) {\n\t\tthis.client = client;\n\t\tthis.contentType = contentType;\n\t}\n\tasync migrate(contentId, signal) {\n\t\treturn this.client.request(`/api/migratecontent/${this.contentType}/${contentId}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync getPreview(contentId, device, signal) {\n\t\treturn (await this.client.request(`/api/migratecontent/${this.contentType}/${contentId}/preview`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal,\n\t\t\tquery: { device }\n\t\t})).json();\n\t}\n\tasync getStatus(contentId, signal) {\n\t\treturn (await this.client.request(`/api/migratecontent/${this.contentType}/${contentId}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getDraft(contentId, signal) {\n\t\treturn (await this.client.request(`/api/migratecontent/${this.contentType}/${contentId}/draft`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync putDraft(contentId, draft, signal) {\n\t\treturn this.client.request(`/api/migratecontent/${this.contentType}/${contentId}/draft`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(draft),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t});\n\t}\n\tasync acceptMigration(contentId, signal) {\n\t\treturn this.client.request(`/api/migratecontent/${this.contentType}/${contentId}/accept`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n};\nvar ContentMigrationResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Create a type-specific API client for content migration operations.\n\t*\n\t* @example\n\t* const pageMigrationApi = contentMigration.forType('PAGE');\n\t* await pageMigrationApi.migrate('12345');\n\t* await pageMigrationApi.getStatus('12345');\n\t*\n\t* @param contentType The type of content to migrate\n\t* @returns A type-specific content migration API\n\t*/\n\tforType(contentType) {\n\t\treturn new TypedContentMigrationResource(this.client, contentType);\n\t}\n\t/**\n\t* @deprecated Use forType(contentType).migrate(contentId) instead.\n\t*/\n\tasync migrate(contentId, contentType, signal) {\n\t\treturn this.forType(contentType).migrate(contentId, signal);\n\t}\n\t/**\n\t* @deprecated Use forType(contentType).getPreview(contentId) instead.\n\t*/\n\tasync getPreview(contentId, contentType, device, signal) {\n\t\treturn this.forType(contentType).getPreview(contentId, device, signal);\n\t}\n};\n//#endregion\n//#region src/css-migration/css-migration-resource.ts\nconst CSS_PARSE_ERROR_CONTENT_TYPE = \"application/vnd.staffbase.custom-css-migration.css-parse-error+json\";\n/**\n* Thrown instead of the generic HTTPError when `create()` fails because the primary\n* theme's legacy CustomCSS could not be parsed (422, `.css-parse-error+json`).\n*/\nvar CssParseHttpError = class extends HTTPError {\n\tcssParseError;\n\tconstructor(response, request, cssParseError) {\n\t\tsuper(response, request);\n\t\tthis.cssParseError = cssParseError;\n\t\tthis.name = \"CssParseHttpError\";\n\t}\n};\nvar CssMigrationResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/migration\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Starts a migration using the branch's primary theme and rollout-guard settings.\n\t* The service owns the source documents; no request body is sent.\n\t*/\n\tasync create(signal) {\n\t\ttry {\n\t\t\treturn await (await this.client.request(\"/api/migration\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tsignal\n\t\t\t})).json();\n\t\t} catch (e) {\n\t\t\tif (e instanceof HTTPError && e.response.status === 422 && e.response.headers.get(\"Content-Type\")?.includes(CSS_PARSE_ERROR_CONTENT_TYPE)) throw new CssParseHttpError(e.response, e.request, await e.response.json());\n\t\t\tthrow e;\n\t\t}\n\t}\n\tasync getSummary(signal) {\n\t\treturn (await this.client.request(\"/api/migration/summary\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Replaces the supplied review documents. The complete theme and/or the local\n\t* rollout-guard draft is sent as provided; omitted documents remain unchanged.\n\t*/\n\tasync update(request, signal) {\n\t\treturn (await this.client.request(\"/api/migration\", {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(request),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Publishes the reviewed theme followed by its reviewed intranet.general rollout\n\t* configuration. This can overwrite upstream changes made after creation.\n\t*/\n\tasync apply(signal) {\n\t\tawait this.client.request(\"/api/migration/apply\", {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync reset(signal) {\n\t\tawait this.client.request(\"/api/migration/reset\", {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/discovery/discovery-resource.ts\nvar DiscoveryResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/discovery\", {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\"\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/domain-management/domain-management-resource.ts\nvar DomainManagementResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(\"/api/branch/domains\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(payload) {\n\t\treturn (await this.client.request(`/api/branch/domains`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync update(domainId, payload) {\n\t\treturn (await this.client.request(`/api/branch/domains/${domainId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync delete(domainId) {\n\t\treturn await this.client.request(`/api/branch/domains/${domainId}`, { method: \"DELETE\" });\n\t}\n};\n//#endregion\n//#region src/editorial-calendar/editorial-calendar-resource.ts\nvar EditorialCalendarResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync entries(payload, signal) {\n\t\treturn (await this.client.request(\"/api/editorial-calendar/entries/search\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync entriesOverview(payload, signal) {\n\t\treturn (await this.client.request(\"/api/editorial-calendar/entries/overview\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync createEvent(payload, signal) {\n\t\treturn (await this.client.request(\"/api/editorial-calendar/events\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync updateEvent(id, data, signal) {\n\t\treturn (await this.client.request(`/api/editorial-calendar/events/${id}`, {\n\t\t\tbody: JSON.stringify(data),\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync deleteEvent(id, signal) {\n\t\tawait this.client.request(`/api/editorial-calendar/events/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/email-performance/email-performance-resource.ts\nvar EmailPerformanceResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync clicks(emailId, signal) {\n\t\treturn (await this.client.request(`/api/email-performance/${emailId}/clicks`, { signal })).json();\n\t}\n\tasync opens(emailId, signal) {\n\t\treturn (await this.client.request(`/api/email-performance/${emailId}/opens`, { signal })).json();\n\t}\n\tasync recipients(emailId, signal) {\n\t\treturn (await this.client.request(`/api/email-performance/${emailId}/recipient-count`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/email/email-resource.ts\nvar EmailResource = class {\n\tclient;\n\t_authInfo;\n\tget authInfo() {\n\t\treturn this._authInfo;\n\t}\n\tset authInfo(next) {\n\t\tthis._authInfo = next;\n\t\tif (next) this.client = new BaseClient(next.appServiceUrl);\n\t}\n\trequest(path, options) {\n\t\tif (!this.client || !this._authInfo) throw new Error(\"Email not authenticated!\");\n\t\treturn this.client.request(path, {\n\t\t\t...options,\n\t\t\theaders: {\n\t\t\t\t...options?.headers,\n\t\t\t\tAuthorization: `Bearer ${this._authInfo.token}`\n\t\t\t}\n\t\t});\n\t}\n\tasync userInfo(signal) {\n\t\treturn (await this.request(\"/user\", {\n\t\t\tsignal,\n\t\t\tquery: { firstTimeLogin: false }\n\t\t})).json();\n\t}\n\tasync emails(options, signal) {\n\t\tconst query = { resultSize: options?.resultSize };\n\t\tif (options?.sort) query.sort = JSON.stringify(options.sort);\n\t\tif (options?.filters) query.filters = JSON.stringify(options.filters);\n\t\treturn (await this.request(\"/emails\", {\n\t\t\tsignal,\n\t\t\tquery\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/features/features-resource.ts\nvar FeaturesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(type, id, signal) {\n\t\treturn (await this.client.request(`/api/features/${type}/${id}`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/feeds/feed-resource.ts\nvar FeedResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(feedId, signal) {\n\t\treturn (await this.client.request(`/api/feeds/${feedId}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync delete(feedId, signal) {\n\t\tawait this.client.request(`/api/feeds/${feedId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync update(feedId, payload, signal) {\n\t\treturn (await this.client.request(`/api/feeds/${feedId}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync trigger(feedId, signal) {\n\t\treturn (await this.client.request(`/api/feeds/${feedId}/trigger`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/footer/footer-resource.ts\nconst FOOTER_CONTENT_TYPE = \"application/vnd.staffbase.footer.v1+json\";\nvar FooterResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/footer\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(data, signal) {\n\t\treturn (await this.client.request(\"/api/footer\", {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"Content-Type\": FOOTER_CONTENT_TYPE },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/group/permissions/group-permissions-resource.ts\nconst CONTENT_TYPE_GET$3 = \"application/vnd.staffbase.accessors.groups-permissions.v1+json\";\nconst CONTENT_TYPE_ADD$3 = \"application/vnd.staffbase.accessors.groups-permissions-add.v1+json\";\nconst CONTENT_TYPE_REMOVE$3 = \"application/vnd.staffbase.accessors.groups-permissions-remove.v1+json\";\nvar GroupPermissionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/groups/permissions\", {\n\t\t\theaders: { Accept: CONTENT_TYPE_GET$3 },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync add(payload, signal) {\n\t\tawait this.client.request(\"/api/groups/permissions\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": CONTENT_TYPE_ADD$3,\n\t\t\t\tAccept: CONTENT_TYPE_ADD$3\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync remove(payload, signal) {\n\t\tawait this.client.request(\"/api/groups/permissions\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": CONTENT_TYPE_REMOVE$3,\n\t\t\t\tAccept: CONTENT_TYPE_REMOVE$3\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/group/groups-resource.ts\nvar GroupsResource$1 = class {\n\tclient;\n\tpermissions;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.permissions = new GroupPermissionsResource(client);\n\t}\n\tasync list(options, signal) {\n\t\tconst version = \"application/vnd.staffbase.accessors.groups.v2+json\";\n\t\treturn (await this.client.request(\"/api/groups\", {\n\t\t\tquery: { ...options },\n\t\t\theaders: { Accept: version },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/groups/${id}`, {\n\t\t\tsignal,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.group.v3+json\" }\n\t\t})).json();\n\t}\n\tasync create(payload) {\n\t\treturn (await this.client.request(\"/api/groups\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": \"application/vnd.staffbase.accessors.group-create.v2+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.accessors.group.v3+json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync update(id, payload) {\n\t\tawait this.client.request(`/api/groups/${id}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": \"application/vnd.staffbase.accessors.group-update.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.accessors.group.v3+json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/groups/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.group-delete.v2+json\" }\n\t\t});\n\t}\n\tasync search(params, signal) {\n\t\tconst version = \"application/vnd.staffbase.accessors.groups-search.v1+json\";\n\t\treturn (await this.client.request(\"/api/groups/search\", {\n\t\t\tsignal,\n\t\t\tquery: { ...params },\n\t\t\theaders: { Accept: version }\n\t\t})).json();\n\t}\n\tasync createMembersImport(groupId, file, replace, identifier) {\n\t\tconst body = new FormData();\n\t\tbody.append(\"file\", file);\n\t\tbody.append(\"replace\", replace.toString());\n\t\tbody.append(\"identifier\", identifier);\n\t\tawait this.client.request(`/api/groups/${groupId}/members/import`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t});\n\t}\n\tasync getMembersImportErrors(groupId, signal) {\n\t\treturn (await this.client.request(`/api/groups/${groupId}/members/import/errors`, { signal })).blob();\n\t}\n\tasync addMembers(groupId, payload, signal) {\n\t\treturn this.client.request(`/api/groups/${groupId}/members`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": \"application/vnd.staffbase.accessors.group.members-add.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.accessors.group.members-add.v1+json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync searchMembers(groupId, options, signal) {\n\t\tconst version = \"application/vnd.staffbase.accessors.group.members-search.v1+json\";\n\t\treturn (await this.client.request(`/api/groups/${groupId}/members/search`, {\n\t\t\tquery: { ...options },\n\t\t\theaders: { Accept: version },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync removeMembers(groupId, payload, signal) {\n\t\treturn this.client.request(`/api/groups/${groupId}/members`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": \"application/vnd.staffbase.accessors.group.members-remove.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.accessors.group.members-remove.v1+json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/group/groups-admins/old-groups-admins-resource.ts\nvar OldGroupsAdminResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(groupId, userIds) {\n\t\treturn this.client.request(`/api/groups/${groupId}/admins`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(userIds),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/group/old-groups-resource.ts\nvar OldGroupsResource = class {\n\tclient;\n\t/**\n\t* @deprecated use new groups api (client.groups) instead\n\t*/\n\toldAdmins;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.oldAdmins = new OldGroupsAdminResource(client);\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/groups/${id}`, {\n\t\t\tsignal,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.group.v2+json\" }\n\t\t})).json();\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"api/groups\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync create(data) {\n\t\treturn (await this.client.request(\"/api/groups\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/groups/${id}`, { method: \"DELETE\" });\n\t}\n\tasync update(id, data) {\n\t\treturn (await this.client.request(`/api/groups/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync joinGroup(groupId, userId) {\n\t\tawait this.client.request(`/api/groups/${groupId}/users/${userId}`, { method: \"POST\" });\n\t}\n\tasync leaveGroup(groupId, userId) {\n\t\tawait this.client.request(`/api/groups/${groupId}/users/${userId}`, { method: \"DELETE\" });\n\t}\n};\n//#endregion\n//#region src/i18n/custom-i18n-resource.ts\nvar CustomI18nResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(artifact, locale, signal) {\n\t\tconst response = await this.client.request(`/api/i18n/custom-i18n/${artifact}/${locale}`, { signal });\n\t\tconst contentLength = response.headers.get(\"Content-Length\");\n\t\tif (response.status === 204 || contentLength === \"0\") return {};\n\t\treturn await response.json();\n\t}\n};\n//#endregion\n//#region src/i18n/i18n-resource.ts\nvar I18nResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.custom = new CustomI18nResource(client);\n\t}\n\tcustom;\n};\n//#endregion\n//#region src/installation/installations-breadcrumbs-resource.ts\nvar InstallationsBreadcrumbsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(installationId, signal) {\n\t\treturn (await this.client.request(`/api/installations/${installationId}/breadcrumbs`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/installation/installations-menu/installations-menu-resource.ts\nvar InstallationsMenuResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync managed(installationId) {\n\t\treturn (await this.client.request(`/api/installations/${installationId}/menu/managed`)).json();\n\t}\n};\n//#endregion\n//#region src/installation/installations-permissions/installations-permissions-resource.ts\nvar InstallationsPermissionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync permission(installationId, permissionValue, signal) {\n\t\treturn (await this.client.request(`/api/installations/${installationId}/permissions/${permissionValue}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/installation/installations-resource.ts\nvar InstallationsResource = class {\n\tclient;\n\tbreadcrumbs;\n\tmenu;\n\tpermissions;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.breadcrumbs = new InstallationsBreadcrumbsResource(client);\n\t\tthis.menu = new InstallationsMenuResource(client);\n\t\tthis.permissions = new InstallationsPermissionsResource(client);\n\t}\n\tasync get(installationId, signal) {\n\t\treturn (await this.client.request(`/api/installations/${installationId}`, { signal })).json();\n\t}\n\tasync getServiceToken(installationId, signal) {\n\t\treturn (await this.client.request(`/api/installations/${installationId}/service/token`, { signal })).json();\n\t}\n\tasync update(installationId, payload, signal) {\n\t\treturn (await this.client.request(`/api/installations/${installationId}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync delete(installationId, signal) {\n\t\tawait this.client.request(`/api/installations/${installationId}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"DELETE\"\n\t\t});\n\t}\n\tasync administrated(params, signal) {\n\t\treturn (await this.client.request(\"/api/installations/administrated\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync accessors(installationId, params, signal) {\n\t\treturn (await this.client.request(`/api/installations/${installationId}/accessors`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/instrumentation/instrumentation-resource.ts\nvar InstrumentationResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync sendLog(message, level, error, payload = {}, signal) {\n\t\treturn await this.client.request(\"/api/instrumentation/logs/\", {\n\t\t\tbody: JSON.stringify({\n\t\t\t\tmsg: message,\n\t\t\t\tlevel,\n\t\t\t\terror,\n\t\t\t\t...payload\n\t\t\t}),\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/integrations/integrations-resource.ts\nvar IntegrationsResource$1 = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/integrations/${id}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal,\n\t\t\theaders: { \"Accept-Version\": \"2.0\" }\n\t\t})).json();\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(\"/api/integrations\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync deleteCredentials(id, signal) {\n\t\treturn (await this.client.request(`/api/integrations/${id}/credentials`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync checkUserAccess(integrationId, userId, signal) {\n\t\tawait this.client.request(`/api/integrations/${integrationId}/accessor/${userId}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\"\n\t\t});\n\t}\n\tasync me(integrationId, signal) {\n\t\treturn (await this.client.request(`/api/integrations/auth/${integrationId}/me`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\"\n\t\t})).json();\n\t}\n\tasync getAuthorizeUrl(integrationId, returnUrl, signal) {\n\t\treturn (await this.client.request(`/api/integrations/auth/${integrationId}/authorizeUrl`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal,\n\t\t\tquery: { returnUrl }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/ip-ranges/ip-ranges-resource.ts\nvar IpRangesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync update(data) {\n\t\treturn this.client.request(\"/api/ip-ranges\", {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/launchpad/launchpad-resource.ts\nvar LaunchpadResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(\"/api/launchpad/apps\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/logs/otlp-log-mapper.ts\n/** Map an array of LogRecord to the OTLP JSON log payload format */\nfunction mapToOtlpPayload(logs) {\n\tconst firstLog = logs[0];\n\treturn { resourceLogs: [{\n\t\tresource: { attributes: toOtlpAttributes(firstLog?.resource.attributes) },\n\t\tscopeLogs: [{\n\t\t\tscope: { name: firstLog?.instrumentationScope.name ?? \"unknown\" },\n\t\t\tlogRecords: logs.map((log) => ({\n\t\t\t\ttimeUnixNano: hrTimeToNanos(log.hrTime),\n\t\t\t\tseverityText: log.severityText,\n\t\t\t\tbody: { stringValue: stringifyBody(log.body) },\n\t\t\t\tattributes: toOtlpAttributes(log.attributes)\n\t\t\t}))\n\t\t}]\n\t}] };\n}\nfunction hrTimeToNanos(hrTime) {\n\tif (!hrTime) return String(Date.now() * 1e6);\n\treturn String(hrTime[0] * 1e9 + hrTime[1]);\n}\n/** Safely stringify a log body value, handling objects properly */\nfunction stringifyBody(body) {\n\tif (body === void 0 || body === null) return \"\";\n\tif (typeof body === \"string\") return body;\n\tif (typeof body === \"number\" || typeof body === \"boolean\") return String(body);\n\tif (typeof body === \"object\") try {\n\t\treturn JSON.stringify(body);\n\t} catch {\n\t\treturn \"[object]\";\n\t}\n\treturn \"[unknown]\";\n}\n/** Convert a record of attributes to the OTLP KeyValue array format */\nfunction toOtlpAttributes(attributes = {}) {\n\treturn Object.entries(attributes).filter(([, value]) => value !== void 0 && value !== null).map(([key, value]) => ({\n\t\tkey,\n\t\tvalue: { stringValue: String(value) }\n\t}));\n}\n//#endregion\n//#region src/logs/logs-resource.ts\nvar LogsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync sendPayload(payload) {\n\t\ttry {\n\t\t\tawait this.client.request(\"/api/otel/v1/logs\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\t\tbody: JSON.stringify(payload)\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconsole.warn(\"Failed to send logs:\", error);\n\t\t}\n\t}\n\tasync sendLogs(logs) {\n\t\tif (logs.length === 0) return;\n\t\tconst payload = mapToOtlpPayload(logs);\n\t\tawait this.sendPayload(payload);\n\t}\n};\n//#endregion\n//#region src/media/chunked-media-resource.ts\nvar TusResponse = class {\n\tresponse;\n\tbody;\n\tconstructor(response, body) {\n\t\tthis.response = response;\n\t\tthis.body = body;\n\t}\n\tgetStatus() {\n\t\treturn this.response.status;\n\t}\n\tgetHeader(header) {\n\t\treturn this.response.headers.get(header) ?? \"\";\n\t}\n\tgetBody() {\n\t\treturn this.body;\n\t}\n\tgetUnderlyingObject() {\n\t\treturn this.response;\n\t}\n};\nvar TusRequest = class {\n\tmethod;\n\turl;\n\tclient;\n\tprogressHandler;\n\tabortController = new AbortController();\n\theaders = new Headers();\n\tconstructor(method, url, client) {\n\t\tthis.method = method;\n\t\tthis.url = url;\n\t\tthis.client = client;\n\t}\n\tgetMethod() {\n\t\treturn this.method ?? \"GET\";\n\t}\n\tgetURL() {\n\t\treturn this.url;\n\t}\n\tsetHeader(header, value) {\n\t\tthis.headers.set(header, value);\n\t}\n\tgetHeader(header) {\n\t\treturn this.headers.get(header) ?? \"\";\n\t}\n\tasync send(body) {\n\t\tconst path = this.url.substring(this.url.indexOf(\"/api/media\"));\n\t\tlet response;\n\t\tlet responseBody;\n\t\ttry {\n\t\t\tresponse = await this.client.request(path, {\n\t\t\t\tbody,\n\t\t\t\theaders: this.headers,\n\t\t\t\tsignal: this.abortController.signal,\n\t\t\t\tmethod: this.method\n\t\t\t});\n\t\t\tresponseBody = await response.text();\n\t\t\tthis.progressHandler?.(body.length);\n\t\t} catch (e) {\n\t\t\tresponse = e.response;\n\t\t\tresponseBody = await response.text();\n\t\t}\n\t\treturn new TusResponse(response, responseBody);\n\t}\n\tabort() {\n\t\tthis.abortController.abort();\n\t\treturn Promise.resolve();\n\t}\n\tgetUnderlyingObject() {}\n\tsetProgressHandler(handler) {\n\t\tthis.progressHandler = handler;\n\t}\n};\nvar HttpStack = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tcreateRequest(method, url) {\n\t\treturn new TusRequest(method, url, this.client);\n\t}\n\tgetName() {\n\t\treturn \"tus-staffbase\";\n\t}\n};\nvar ChunkedMediaResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync uploadInChunks(file, onProgress) {\n\t\tconst { Upload } = await import(\"tus-js-client\");\n\t\tlet type = \"raw\";\n\t\tif (file.type.includes(\"image\")) type = \"image\";\n\t\telse if (file.type.includes(\"video\")) type = \"video\";\n\t\tconst metadata = {\n\t\t\ttype,\n\t\t\tfileName: file.name || type\n\t\t};\n\t\tconst defaultChunkSize = 52428800;\n\t\tlet chunkSize = defaultChunkSize;\n\t\tif (file.size < defaultChunkSize) chunkSize = file.size / 4;\n\t\tlet medium;\n\t\tlet lastTime = Date.now();\n\t\tlet timeoutId;\n\t\tlet finished = false;\n\t\tconst tusUpload = new Upload(file, {\n\t\t\tendpoint: \"/api/media/tus\",\n\t\t\tretryDelays: [\n\t\t\t\t1e3,\n\t\t\t\t3e3,\n\t\t\t\t5e3\n\t\t\t],\n\t\t\tmetadata,\n\t\t\tuploadSize: file.size,\n\t\t\tchunkSize,\n\t\t\thttpStack: new HttpStack(this.client),\n\t\t\tremoveFingerprintOnSuccess: true,\n\t\t\tonChunkComplete: (chunkSize, bytesAccepted, bytesTotal) => {\n\t\t\t\tconst progress = Math.round(bytesAccepted * 100 / bytesTotal);\n\t\t\t\tif (!finished) onProgress?.({\n\t\t\t\t\tprogress,\n\t\t\t\t\tprocessing: false,\n\t\t\t\t\ttotal: bytesTotal,\n\t\t\t\t\tloaded: bytesAccepted\n\t\t\t\t});\n\t\t\t\tconst time = Date.now();\n\t\t\t\tconst lastChunkUploadTime = time - lastTime;\n\t\t\t\tlastTime = time;\n\t\t\t\tconst totalChunks = Math.ceil(bytesTotal / chunkSize);\n\t\t\t\tconst chunkCount = Math.ceil(bytesAccepted / chunkSize);\n\t\t\t\tif (chunkCount === totalChunks - 1) timeoutId = window.setTimeout(() => {\n\t\t\t\t\tonProgress?.({\n\t\t\t\t\t\tprogress: 100,\n\t\t\t\t\t\tprocessing: true,\n\t\t\t\t\t\ttotal: bytesTotal,\n\t\t\t\t\t\tloaded: bytesTotal\n\t\t\t\t\t});\n\t\t\t\t\tfinished = true;\n\t\t\t\t}, lastChunkUploadTime);\n\t\t\t\tif (chunkCount === totalChunks && timeoutId) {\n\t\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\t\ttimeoutId = void 0;\n\t\t\t\t}\n\t\t\t},\n\t\t\tonAfterResponse: (req, resp) => {\n\t\t\t\tif (!this.shouldParseMediumPayload(req.getMethod(), resp.getStatus())) return;\n\t\t\t\tconst parsedBody = this.tryParseMediumPayload(resp.getBody());\n\t\t\t\tif (parsedBody) medium = parsedBody;\n\t\t\t}\n\t\t});\n\t\tlet rejectStart;\n\t\treturn {\n\t\t\tstart() {\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\trejectStart = reject;\n\t\t\t\t\tif (file.size === 0) {\n\t\t\t\t\t\treject(/* @__PURE__ */ new Error(\"Cannot upload an empty file\"));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\ttusUpload.options.onSuccess = () => {\n\t\t\t\t\t\tif (!medium) {\n\t\t\t\t\t\t\treject(/* @__PURE__ */ new Error(\"Upload completed but medium payload missing\"));\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tresolve(medium);\n\t\t\t\t\t};\n\t\t\t\t\ttusUpload.options.onError = (err) => {\n\t\t\t\t\t\tconsole.log(\"Tus upload failed due to: \" + err.message);\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t};\n\t\t\t\t\ttusUpload.start();\n\t\t\t\t});\n\t\t\t},\n\t\t\tasync hasPreviousUploads() {\n\t\t\t\treturn (await tusUpload.findPreviousUploads()).length > 0;\n\t\t\t},\n\t\t\tabort() {\n\t\t\t\trejectStart(new DOMException(\"Upload aborted\", \"AbortError\"));\n\t\t\t\treturn tusUpload.abort(true);\n\t\t\t}\n\t\t};\n\t}\n\tshouldParseMediumPayload(method, status) {\n\t\tif (method === \"POST\") return status === 200;\n\t\tif (method === \"PATCH\") return status === 200 || status === 202;\n\t\treturn false;\n\t}\n\ttryParseMediumPayload(body) {\n\t\tif (!body.trim()) return;\n\t\tlet payload;\n\t\ttry {\n\t\t\tpayload = JSON.parse(body);\n\t\t} catch {\n\t\t\treturn;\n\t\t}\n\t\treturn this.isMediumPayload(payload) ? payload : void 0;\n\t}\n\tisMediumPayload(payload) {\n\t\tif (typeof payload !== \"object\" || payload === null) return false;\n\t\tif (!(\"id\" in payload) || !(\"resourceInfo\" in payload)) return false;\n\t\treturn typeof payload.id === \"string\" && typeof payload.resourceInfo === \"object\" && payload.resourceInfo !== null;\n\t}\n};\n//#endregion\n//#region src/media/media-resource.ts\nvar MediaResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/media/${id}`, { signal })).json();\n\t}\n\tasync upload(medium, signal) {\n\t\tconst type = this.getType(medium);\n\t\tconst metadata = {\n\t\t\ttype,\n\t\t\tfileName: encodeURIComponent(medium.name || type)\n\t\t};\n\t\tconst headers = {\n\t\t\t\"Staffbase-Media-Meta\": JSON.stringify(metadata),\n\t\t\t\"Content-Type\": medium.type || \"application/octet-stream\"\n\t\t};\n\t\treturn (await this.client.request(`/api/media`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders,\n\t\t\tbody: medium,\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`/api/media/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync getMediaConfiguration(abortSignal) {\n\t\treturn (await this.client.request(\"/api/media/configuration\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal: abortSignal\n\t\t})).json();\n\t}\n\tasync getSupportedMediaTypes(abortSignal) {\n\t\treturn (await this.client.request(\"/api/media/mediatypes\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal: abortSignal\n\t\t})).json();\n\t}\n\tasync getSupportedVideoMimeTypes(abortSignal) {\n\t\treturn (await this.client.request(\"/api/media/mimetypes/video\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal: abortSignal\n\t\t})).json();\n\t}\n\tasync metadata(url, signal) {\n\t\treturn (await this.client.request(\"/api/media/metadata\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal,\n\t\t\tquery: { url }\n\t\t})).json();\n\t}\n\tasync getMediumMetadata(id, signal) {\n\t\treturn (await this.client.request(`/api/media/medium/${id}/metadata`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getChangelog(id, options) {\n\t\treturn (await this.client.request(`/api/media/${id}/changelog`, {\n\t\t\tmethod: \"GET\",\n\t\t\t...options?.query && { query: { ...options.query } },\n\t\t\tsignal: options?.signal\n\t\t})).json();\n\t}\n\tasync totalPlays(url, signal) {\n\t\treturn (await this.client.request(\"/api/media/analytics/totalplays\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal,\n\t\t\tquery: { url }\n\t\t})).json();\n\t}\n\tasync uniquePlays(url, signal) {\n\t\treturn (await this.client.request(\"/api/media/analytics/uniqueplays\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal,\n\t\t\tquery: { url }\n\t\t})).json();\n\t}\n\tasync playTime(url, signal) {\n\t\treturn (await this.client.request(\"/api/media/analytics/playtime\", {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal,\n\t\t\tquery: { url }\n\t\t})).json();\n\t}\n\tasync track(payload) {\n\t\tawait this.client.request(\"/api/media/track\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n\tasync updateMedia(id, payload) {\n\t\tconst body = new FormData();\n\t\tbody.append(\"file\", payload.file);\n\t\tbody.append(\"note\", payload.note);\n\t\tconst response = await this.client.request(`/api/media/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody\n\t\t});\n\t\tif (response.ok) return;\n\t\treturn response.json();\n\t}\n\tgetType({ type }) {\n\t\tswitch (true) {\n\t\t\tcase type.includes(\"image\"): return \"image\";\n\t\t\tcase type.includes(\"video\"): return \"video\";\n\t\t\tdefault: return \"raw\";\n\t\t}\n\t}\n\tasync getSubtitles(mediumId, signal) {\n\t\tconst response = await this.client.request(`/api/media/${mediumId}/subtitles`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t});\n\t\tif (response.status === 202) return { status: 202 };\n\t\treturn {\n\t\t\tstatus: 200,\n\t\t\t...await response.json()\n\t\t};\n\t}\n\tasync getSubtitlesLang(mediumId, lang, signal) {\n\t\treturn (await this.client.request(`/api/media/${mediumId}/subtitles/${lang}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).text();\n\t}\n\tasync createSubtitles(mediumId, lang, content, signal) {\n\t\tawait this.client.request(`/api/media/${mediumId}/subtitles/${lang}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: content,\n\t\t\theaders: { \"Content-Type\": \"text/vtt\" },\n\t\t\tsignal\n\t\t});\n\t}\n\tasync updateSubtitles(mediumId, lang, content, signal) {\n\t\tawait this.client.request(`/api/media/${mediumId}/subtitles/${lang}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: content,\n\t\t\theaders: { \"Content-Type\": \"text/vtt\" },\n\t\t\tsignal\n\t\t});\n\t}\n\tasync reviewSubtitles(mediumId, signal) {\n\t\tawait this.client.request(`/api/media/${mediumId}/subtitles/review`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/medialibrary/medialibrary-resource.ts\nvar MedialibraryResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(payload, options, signal) {\n\t\treturn (await this.client.request(\"/api/medialibrary/entries\", {\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tmethod: \"POST\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync listAll(payload, options, signal) {\n\t\treturn (await this.client.request(\"/api/medialibrary/entries/all\", {\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tmethod: \"POST\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tadd(id, signal) {\n\t\treturn this.client.request(`/api/medialibrary/entries/${id}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"PUT\"\n\t\t});\n\t}\n\tasync createCollection(payload) {\n\t\treturn (await this.client.request(\"/api/medialibrary/collections\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync getAllCollections(options, signal) {\n\t\treturn (await this.client.request(\"/api/medialibrary/collections/all\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getCollections(options, signal) {\n\t\treturn (await this.client.request(\"/api/medialibrary/collections\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getCollection(id, signal) {\n\t\treturn (await this.client.request(`/api/medialibrary/collections/${id}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getCollectionEntries(id, payload, options, signal) {\n\t\treturn (await this.client.request(`/api/medialibrary/collections/${id}/entries/search`, {\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tmethod: \"POST\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync deleteCollection(id) {\n\t\treturn await this.client.request(`/api/medialibrary/collections/${id}`, { method: \"DELETE\" });\n\t}\n\tasync updateCollection(id, payload) {\n\t\treturn (await this.client.request(`/api/medialibrary/collections/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync removeEntriesFromCollection(id, payload) {\n\t\treturn await this.client.request(`/api/medialibrary/collections/${id}/entries/delete`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n\tasync addEntriesToCollection(id, payload, signal) {\n\t\treturn (await this.client.request(`/api/medialibrary/collections/${id}/entries`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync discover(signal) {\n\t\treturn (await this.client.request(\"/api/medialibrary/discover\", { signal })).json();\n\t}\n\tasync getFileUsage(id, signal) {\n\t\treturn (await this.client.request(`/api/medialibrary/${id}/usage`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/menu/menu-breadcrumbs-resource.ts\nvar MenuBreadcrumbsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/menu/${id}/breadcrumbs`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/menu/menu-resource.ts\nvar MenuResource = class {\n\tclient;\n\tbreadcrumbs;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.breadcrumbs = new MenuBreadcrumbsResource(this.client);\n\t}\n\tasync root(platform, signal) {\n\t\tconst query = platform ? { platform } : {};\n\t\treturn (await this.client.request(\"/api/menu\", {\n\t\t\tsignal,\n\t\t\tquery\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/menu/${id}`, { signal })).json();\n\t}\n\tasync listRestricted(pluginId, signal) {\n\t\treturn (await this.client.request(`/api/menu/restrictedPluginID/${pluginId}`, { signal })).json();\n\t}\n\t/**\n\t* \"Top News\" dashboard for a news page (menu folder): its news channels, each carrying its own\n\t* limited, most-recent `articles` (see `NewsChannelDashboardParams.postLimit`).\n\t*/\n\tasync dashboard(nodeId, params, signal) {\n\t\treturn (await this.client.request(`/api/menu/${nodeId}/dashboard`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/merge-dev/accounts/merge-dev-accounts-resource.ts\nvar MergeDevAccountsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list() {\n\t\treturn (await this.client.request(\"/api/merge-dev/accounts\", { method: \"GET\" })).json();\n\t}\n\tasync discover(category) {\n\t\treturn (await this.client.request(`/api/merge-dev/accounts/discover`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { category }\n\t\t})).json();\n\t}\n\tasync delete(accountId) {\n\t\treturn await this.client.request(`/api/merge-dev/accounts/${accountId}`, { method: \"DELETE\" });\n\t}\n\tasync confirmConnection(accountId, payload) {\n\t\treturn (await this.client.request(`/api/merge-dev/accounts/${accountId}/confirm-connection`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync update(accountId, payload) {\n\t\treturn (await this.client.request(`/api/merge-dev/accounts/${accountId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync updateFieldMapping(accountId, payload) {\n\t\treturn (await this.client.request(`/api/merge-dev/accounts/${accountId}/field-mapping`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync updateFeatures(accountId, payload) {\n\t\treturn (await this.client.request(`/api/merge-dev/accounts/${accountId}/features`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync reLink(accountId) {\n\t\treturn (await this.client.request(`/api/merge-dev/accounts/${accountId}/re-link`, { method: \"GET\" })).json();\n\t}\n\tasync syncStatus(accountId) {\n\t\treturn (await this.client.request(`/api/merge-dev/accounts/${accountId}/sync-status`, { method: \"GET\" })).json();\n\t}\n\tasync resyncAccount(accountId) {\n\t\treturn (await this.client.request(`/api/merge-dev/accounts/${accountId}/resync`, { method: \"GET\" })).json();\n\t}\n};\n//#endregion\n//#region src/merge-dev/integrations/merge-dev-integrations-resource.ts\nvar MergeDevIntegrationsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list() {\n\t\treturn (await this.client.request(`/api/merge-dev/integrations`, { method: \"GET\" })).json();\n\t}\n\tasync create(integrationId, payload) {\n\t\treturn (await this.client.request(`/api/merge-dev/integrations/${integrationId}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/merge-dev/helpers/safeJSONResponseParse.ts\nasync function safeJSONResponseParse(response) {\n\tif (response.status === 204 || response.headers.get(\"Content-Length\") === \"0\") return null;\n\treturn await response.json();\n}\n//#endregion\n//#region src/merge-dev/payslips/merge-dev-payslips-resource.ts\nvar MergeDevPayslipsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(accountId, params, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/payslips`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t}));\n\t}\n\tasync get(accountId, payrollId, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/payslips/${payrollId}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t}));\n\t}\n};\n//#endregion\n//#region src/merge-dev/ticketing/collections/merge-dev-ticketing-collections-resource.ts\nvar MergeDevTicketingCollectionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(accountId, params, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/ticketing/collections`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t}));\n\t}\n};\n//#endregion\n//#region src/merge-dev/ticketing/merge-dev-ticketing-resource.ts\nvar MergeDevTicketingResource = class {\n\tclient;\n\tcollections;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.collections = new MergeDevTicketingCollectionsResource(client);\n\t}\n\tasync list(accountId, params, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/ticketing`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t}));\n\t}\n\tasync get(accountId, ticketId, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/ticketing/${ticketId}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t}));\n\t}\n\tasync metadata(accountId, ticketId, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/ticketing/${ticketId}/metadata`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t}));\n\t}\n\tasync attachments(accountId, ticketId, params, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/ticketing/${ticketId}/attachments`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t}));\n\t}\n\tasync update(accountId, ticketId, data, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/ticketing/${ticketId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(data),\n\t\t\tsignal\n\t\t}));\n\t}\n};\n//#endregion\n//#region src/merge-dev/timeoff-balance/merge-dev-timeoff-balance-resource.ts\nvar MergeDevTimeOffBalanceResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(accountId, params, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/time-off-balance`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t}));\n\t}\n};\n//#endregion\n//#region src/merge-dev/timeoff/merge-dev-timeoff-resource.ts\nvar MergeDevTimeOffResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(accountId, params, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/time-off`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t}));\n\t}\n\tasync get(accountId, timeOffId, params, signal) {\n\t\treturn await safeJSONResponseParse(await this.client.request(`/api/merge-dev/${accountId}/time-off/${timeOffId}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t}));\n\t}\n};\n//#endregion\n//#region src/merge-dev/merge-dev-resource.ts\nvar MergeDevResource = class {\n\tclient;\n\taccounts;\n\tintegrations;\n\tpayslip;\n\ttimeoff;\n\ttimeoffBalance;\n\tticketing;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.accounts = new MergeDevAccountsResource(client);\n\t\tthis.integrations = new MergeDevIntegrationsResource(client);\n\t\tthis.payslip = new MergeDevPayslipsResource(client);\n\t\tthis.timeoff = new MergeDevTimeOffResource(client);\n\t\tthis.timeoffBalance = new MergeDevTimeOffBalanceResource(client);\n\t\tthis.ticketing = new MergeDevTicketingResource(client);\n\t}\n};\n//#endregion\n//#region src/news/news-ai-generation-resource.ts\nvar NewsAiGenerationResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync generate(type, payload) {\n\t\treturn (await this.client.request(\"/api/news/ai/generation\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: { type }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/notifications/events-resource.ts\nvar EventsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\ttrack(event) {\n\t\treturn this.client.request(`/api/notifications/events`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(event),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/notifications/inbox-resource.ts\nvar InboxResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(params, signal) {\n\t\treturn (await this.client.request(`/api/notifications/inbox`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\treceipts(data) {\n\t\treturn this.client.request(`/api/notifications/inbox/receipts`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n\treceipt(id, data) {\n\t\treturn this.client.request(`/api/notifications/inbox/${id}/receipts`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/notifications/notification-settings-resource.ts\nvar NotificationSettingsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(`/api/notifications/settings`, {\n\t\t\theaders: { Accept: \"application/vnd.staffbase.notifications.usersettings.v1+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(notificationType, channel, payload, signal) {\n\t\treturn this.client.request(`/api/notifications/settings/types/${notificationType}/channels/${channel}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/notifications/notifications-resource.ts\nvar NotificationsResource = class {\n\tclient;\n\tevents;\n\tinbox;\n\tsettings;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.events = new EventsResource(client);\n\t\tthis.inbox = new InboxResource(client);\n\t\tthis.settings = new NotificationSettingsResource(client);\n\t}\n};\n//#endregion\n//#region src/oauth-clients/oauth-clients-resource.ts\nvar OAuthClientsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(`/api/branch/oauthclients`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(clientId, signal) {\n\t\treturn (await this.client.request(`/api/branch/oauthclients/${clientId}`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(payload, signal) {\n\t\treturn (await this.client.request(`/api/branch/oauthclients`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(clientId, payload, signal) {\n\t\treturn (await this.client.request(`/api/branch/oauthclients/${clientId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync delete(clientId, signal) {\n\t\tawait this.client.request(`/api/branch/oauthclients/${clientId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\theaders: { Accept: \"application/json\" },\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/pages/drafts/pages-drafts-resource.ts\nconst DRAFT_CONTENT_TYPE = \"application/vnd.staffbase.pages.draft.v1+json\";\nconst DRAFT_UPDATE_CONTENT_TYPE = \"application/vnd.staffbase.pages.draft-update.v1+json\";\nvar PagesDraftsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Reads the content-only representation of the draft. Throws an `HTTPError` with status 404 when\n\t* the page has no draft.\n\t*\n\t* Title and description are not part of this representation — read them from\n\t* `client.pages.getPageSettings` (the `localization` field).\n\t*/\n\tasync getContent(id, signal) {\n\t\treturn (await this.client.request(`/api/branch/pages/${id}/draft`, {\n\t\t\theaders: { Accept: DRAFT_CONTENT_TYPE },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Creates or updates the draft from the content-only payload.\n\t*\n\t* A locale entry without `content` (`{en_US: {}}`) keeps the locale but clears its content body.\n\t*\n\t* Title and description are not part of a draft — write them via\n\t* `client.pages.updatePageSettings` (the `localization` field).\n\t*/\n\tasync saveContent(id, payload, signal) {\n\t\tawait this.client.request(`/api/branch/pages/${id}/draft`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": DRAFT_UPDATE_CONTENT_TYPE },\n\t\t\tsignal\n\t\t});\n\t}\n\t/**\n\t* Publishes the page from its draft. The draft content becomes the published content and the\n\t* draft is deleted.\n\t*\n\t* Takes no content: call {@link PagesDraftsResource.saveContent} first if you want to publish\n\t* edits. A page without a draft is published as-is.\n\t*/\n\tasync publishContent(id, signal) {\n\t\tawait this.client.request(`/api/branch/pages/${id}/draft/publish`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/pages/issues/pages-issues-resource.ts\nvar PagesIssuesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(params, signal) {\n\t\treturn (await this.client.request(\"/api/pages\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: {\n\t\t\t\t...params,\n\t\t\t\twithIssues: true\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getSingleMetrics(params, signal) {\n\t\treturn (await this.client.request(\"/api/pages/issues/metrics\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getIssues(pageId, params, signal) {\n\t\treturn (await this.client.request(`/api/pages/${pageId}/issues`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync dismiss(pageId, signal) {\n\t\tawait this.client.request(`/api/pages/${pageId}/issues`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync getChangelog(params, signal) {\n\t\treturn (await this.client.request(\"/api/pages/issues/changelog\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: params ? { ...params } : void 0,\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getChangelogPages(params, signal) {\n\t\treturn (await this.client.request(\"/api/pages/issues/changelog/pageIds\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: params ? { ...params } : void 0,\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync translateIssue(pageId, issueId, language, signal) {\n\t\treturn (await this.client.request(`/api/pages/${pageId}/issues/${issueId}/translations/${language}`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/pages/templates/pages-templates-resource.ts\nconst PATH$1 = \"/api/pages/templates\";\nvar PagesTemplatesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(PATH$1, {\n\t\t\theaders: { Accept: \"application/vnd.staffbase.pages.templates.v1+json\" },\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(payload, signal) {\n\t\treturn (await this.client.request(PATH$1, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/vnd.staffbase.pages.template.write.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.pages.template.created.v1+json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync checkPermission(permissionId, signal) {\n\t\treturn (await this.client.request(`${PATH$1}/permissions/${permissionId}`, {\n\t\t\theaders: { Accept: \"application/vnd.staffbase.pages.permission.v1+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(templateId, signal) {\n\t\treturn (await this.client.request(`${PATH$1}/${templateId}`, {\n\t\t\theaders: { Accept: \"application/vnd.staffbase.pages.template.v1+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getRendered(templateId, signal) {\n\t\treturn (await this.client.request(`${PATH$1}/${templateId}`, {\n\t\t\theaders: { Accept: \"application/vnd.staffbase.pages.template.rendered.v1+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(templateId, payload, signal) {\n\t\tawait this.client.request(`${PATH$1}/${templateId}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.pages.template.write.v1+json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync patch(templateId, payload, signal) {\n\t\tawait this.client.request(`${PATH$1}/${templateId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.pages.template.patch.v1+json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync delete(templateId, signal) {\n\t\tawait this.client.request(`${PATH$1}/${templateId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/pages/versions/pages-versions-resource.ts\nvar PagesVersionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(version, pageId, signal) {\n\t\treturn (await this.client.request(`/api/pages/${pageId}/versions/${version}`, { signal })).json();\n\t}\n\tasync getRendered(version, pageId, device, signal) {\n\t\tconst query = device ? { device } : void 0;\n\t\treturn (await this.client.request(`/api/pages/${pageId}/versions/${version}/rendered`, {\n\t\t\tquery,\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync list(pageId, options, signal) {\n\t\treturn (await this.client.request(`/api/pages/${pageId}/versions`, {\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync restore(pageId, payload, signal) {\n\t\tawait this.client.request(`/api/pages/${pageId}/versions`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/pages/pages-resource.ts\nvar PagesResource = class {\n\tclient;\n\tdrafts;\n\tissues;\n\ttemplates;\n\tversions;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.drafts = new PagesDraftsResource(client);\n\t\tthis.issues = new PagesIssuesResource(client);\n\t\tthis.templates = new PagesTemplatesResource(client);\n\t\tthis.versions = new PagesVersionsResource(client);\n\t}\n\tasync get(id, device, signal) {\n\t\tconst query = device ? { device } : void 0;\n\t\treturn (await this.client.request(`/api/pages/${id}`, {\n\t\t\tquery,\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getPageView(id, device, signal) {\n\t\tconst query = device ? { device } : void 0;\n\t\treturn (await this.client.request(`/api/pages/${id}`, {\n\t\t\theaders: { Accept: \"application/vnd.staffbase.pages.view.v1+json\" },\n\t\t\tquery,\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getEditablePage(id, signal) {\n\t\treturn (await this.client.request(`/api/branch/pages/${id}`, { signal })).json();\n\t}\n\tasync getLayoutChunks(id, language, signal) {\n\t\treturn (await this.client.request(`/api/pages/${id}/layout-chunks`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(language ? { language } : {}),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getPageSettings(id, signal) {\n\t\treturn (await this.client.request(`/api/branch/pages/${id}/settings`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/vnd.staffbase.pages.settings.v1+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync updatePageSettings(id, settings, signal) {\n\t\treturn (await this.client.request(`/api/branch/pages/${id}/settings`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/vnd.staffbase.pages.settings-update.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.pages.settings.v1+json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(settings),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync searchPages(params, signal) {\n\t\treturn (await this.client.request(\"/api/branch/pages/search\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(`/api/pages`, { signal })).json();\n\t}\n\tasync create(payload, signal) {\n\t\treturn (await this.client.request(\"/api/branch/pages\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync duplicate(pageId, signal) {\n\t\treturn (await this.client.request(`/api/branch/pages/${pageId}/duplicate`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(id, payload, signal) {\n\t\treturn (await this.client.request(`/api/branch/pages/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`/api/pages/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync preview(id, payload, options, signal) {\n\t\treturn (await this.client.request(`/api/branch/pages/${id}/preview`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tquery: { ...options },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync translate(id, language, options, signal) {\n\t\treturn (await this.client.request(`/api/pages/${id}/translations/${language}`, {\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/passkeys/passkeys-resource.ts\nvar PasskeysResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(\"/api/passkeys\", {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\"\n\t\t})).json();\n\t}\n\tasync challenge(signal) {\n\t\treturn (await this.client.request(\"/api/passkeys/challenge\", {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\"\n\t\t})).json();\n\t}\n\tasync create(payload, signal) {\n\t\tawait this.client.request(\"/api/passkeys\", {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`/api/passkeys/${id}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"DELETE\"\n\t\t});\n\t}\n\tasync dismissPrompt(signal) {\n\t\tawait this.client.request(\"/api/passkeys/prompt-dismissal\", {\n\t\t\tsignal,\n\t\t\tmethod: \"PUT\"\n\t\t});\n\t}\n\tasync validate(payload, signal) {\n\t\tawait this.client.request(\"/api/passkeys/validate\", {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/passkeys/well-known-resource.ts\nvar WellKnownResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getCurrent(signal) {\n\t\treturn (await this.client.request(`/api/domain-association/current`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\"\n\t\t})).json();\n\t}\n\tasync update(payload, platformPath, signal) {\n\t\tawait this.client.request(`/api/domain-association/${platformPath}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/planning/planning-resource.ts\nvar PlanningResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync discover(signal) {\n\t\treturn (await this.client.request(`/api/planning/discover`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/plugins/installations/plugin-installations-resource.ts\nvar PluginInstallationsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(pluginId, signal) {\n\t\treturn (await this.client.request(`/api/plugins/${pluginId}/installations`, { signal })).json();\n\t}\n\tasync search(pluginId, params, signal) {\n\t\tconst { spaceIDs, ...restParams } = params ?? {};\n\t\tconst filter = spaceIDs?.length === 1 ? `spaceId eq \"${spaceIDs[0]}\"` : void 0;\n\t\treturn (await this.client.request(`api/plugins/${pluginId}/installations/search`, {\n\t\t\tquery: {\n\t\t\t\tpermission: restParams?.permission ?? \"manage\",\n\t\t\t\t...restParams,\n\t\t\t\tfilter\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/plugins/learning/learning-resource.ts\nvar LearningResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getAssignedCourses(installationId, language, signal) {\n\t\treturn (await this.client.request(`/api/learning/${installationId}/courses/assigned`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { language },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getRecommendedCourses(installationId, language, signal) {\n\t\treturn (await this.client.request(`/api/learning/${installationId}/courses/recommended`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { language },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getCourseDetails(installationId, courseId, language, signal) {\n\t\treturn (await this.client.request(`/api/learning/${installationId}/courses/${courseId}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { language },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync enrollCourse(installationId, courseId, signal) {\n\t\tawait this.client.request(`/api/learning/${installationId}/courses/${courseId}/enroll`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/plugins/maps/maps-markers-resource.ts\nvar MapsMarkersResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* @returns id of the created marker\n\t*/\n\tasync create(mapId, payload, signal) {\n\t\treturn (await this.client.request(`/api/plugins/maps/${mapId}/markers`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync update(mapId, payload, signal) {\n\t\treturn (await this.client.request(`/api/plugins/maps/${mapId}/markers/${payload.id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync delete(mapId, markerId, signal) {\n\t\tawait this.client.request(`/api/plugins/maps/${mapId}/markers/${markerId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/plugins/maps/maps-viewport-resource.ts\nvar MapsViewportResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync update(mapId, payload, signal) {\n\t\treturn (await this.client.request(`/api/plugins/maps/${mapId}/viewport`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tsignal,\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/plugins/maps/maps-resource.ts\nvar MapsResource = class {\n\tclient;\n\tviewport;\n\tmarkers;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.viewport = new MapsViewportResource(client);\n\t\tthis.markers = new MapsMarkersResource(client);\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/plugins/maps/${id}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/plugins/tasks/comments/task-comments-resource.ts\nvar TaskCommentsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Create a top-level comment on a task\n\t*/\n\tasync create(installationId, taskId, payload, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/task/${taskId}/comments`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/vnd.staffbase.tasks.comment-create.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.tasks.comment.html-content.v1+json\"\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* List comments for a task (top-level or replies via parentId param)\n\t*/\n\tasync list(installationId, taskId, params, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/task/${taskId}/comments`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: params,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.tasks.comment-list.html-content.v1+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Delete a comment\n\t*/\n\tasync delete(installationId, commentId, signal) {\n\t\tawait this.client.request(`/api/tasks/${installationId}/comments/${commentId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\t/**\n\t* Restore a soft-deleted comment\n\t*/\n\tasync restore(installationId, commentId, signal) {\n\t\tawait this.client.request(`/api/tasks/${installationId}/comments/${commentId}/restore`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n\t/**\n\t* Create a reply to an existing comment\n\t*/\n\tasync createReply(installationId, commentId, payload, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/comments/${commentId}/replies`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/vnd.staffbase.tasks.comment-create.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.tasks.comment.html-content.v1+json\"\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Add a reaction to a comment\n\t*/\n\tasync addReaction(installationId, commentId, payload, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/comments/${commentId}/reactions`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.tasks.comment-reaction-create.v1+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Remove the current user's reaction from a comment\n\t*/\n\tasync deleteReaction(installationId, commentId, reactionType, signal) {\n\t\tawait this.client.request(`/api/tasks/${installationId}/comments/${commentId}/reactions/${reactionType}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/plugins/tasks/lists/tasks-lists-resource.ts\nvar TaskListsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Creates a new task list for a given installation.\n\t* @param installationId - The ID of the installation to create the task list for.\n\t* @param payload - The payload containing the name and color of the task list.\n\t* @param signal - Optional AbortSignal to cancel the request.\n\t*/\n\tasync create(installationId, payload, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/lists`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Updates an existing task list for a given installation.\n\t* @param installationId - The ID of the installation to update the task list for.\n\t* @param listId - The ID of the task list to update.\n\t* @param payload - The payload containing the updated name and color of the task list.\n\t* @param signal - Optional AbortSignal to cancel the request.\n\t*/\n\tasync update(installationId, listId, payload, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/lists/${listId}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Fetches the list of task lists for a given installation.\n\t* @param installationId - The ID of the installation to fetch task lists for.\n\t*/\n\tasync list(installationId, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/lists`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Deletes a task list for a given installation.\n\t* @param installationId - The ID of the installation to delete the task list from.\n\t* @param listId - The ID of the task list to delete.\n\t* @param signal - Optional AbortSignal to cancel the request.\n\t*/\n\tasync delete(installationId, listId, signal) {\n\t\treturn await this.client.request(`/api/tasks/${installationId}/lists/${listId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/plugins/tasks/task-group/task-group-resource.ts\nvar TaskGroupResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Get installation groups\n\t* @param installationId The installation ID\n\t* @param signal The abort signal\n\t* @returns List of installation groups\n\t*/\n\tasync list(installationId, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/groups`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/plugins/tasks/task/task-resource.ts\nvar TaskResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Create a new task\n\t* @param installationId The installation ID\n\t* @param payload The task payload\n\t* @param signal The abort signal\n\t* @returns The created task\n\t*/\n\tasync create(installationId, payload, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/task`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Update an existing task\n\t* @param installationId The installation ID\n\t* @param taskId The task ID\n\t* @param payload The task payload\n\t* @param signal The abort signal\n\t* @returns The updated task\n\t*/\n\tasync update(installationId, taskId, payload, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/task/${taskId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Get a task by ID\n\t* @param installationId The installation ID\n\t* @param taskId The task ID\n\t* @param signal The abort signal\n\t* @returns The requested task\n\t*/\n\tasync get(installationId, taskId, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/task/${taskId}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Search tasks with filters\n\t* @param installationId The installation ID\n\t* @param startDateFrom The start date from\n\t* @param startDateTo The start date to\n\t* @param status The status of the task\n\t* @param limit The maximum number of tasks to return\n\t* @param cursor The cursor for pagination\n\t* @param signal The abort signal\n\t* @returns Paged response with tasks\n\t*/\n\tasync search(installationId, startDateFrom, startDateTo, updateDateFrom, updateDateTo, status, limit, cursor, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/task/search`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tstartDateFrom,\n\t\t\t\tstartDateTo,\n\t\t\t\tupdateDateFrom,\n\t\t\t\tupdateDateTo,\n\t\t\t\tstatus,\n\t\t\t\tlimit,\n\t\t\t\tcursor\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* List tasks by list ID\n\t* @param installationId The installation ID\n\t* @param listId The list ID\n\t* @param signal The abort signal\n\t* @returns The list of tasks\n\t*/\n\tasync list(installationId, listId, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/task`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { listId },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Get my tasks\n\t* @param installationId The installation ID\n\t* @param signal The abort signal\n\t* @returns The list of my tasks\n\t*/\n\tasync myTasks(installationId, signal) {\n\t\treturn (await this.client.request(`/api/tasks/${installationId}/task/my-tasks`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Archive a task\n\t* @param installationId The installation ID\n\t* @param taskId The task ID\n\t* @param signal The abort signal\n\t* @returns\n\t*/\n\tasync archive(installationId, taskId, signal) {\n\t\treturn await this.client.request(`/api/tasks/${installationId}/task/${taskId}/archive`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t});\n\t}\n\t/**\n\t* Delete a task\n\t* @param installationId The installation ID\n\t* @param taskId The task ID\n\t* @param signal The abort signal\n\t* @returns\n\t*/\n\tasync delete(installationId, taskId, signal) {\n\t\treturn await this.client.request(`/api/tasks/${installationId}/task/${taskId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\t/**\n\t* Delete task attachment\n\t* @param installationId The installation ID\n\t* @param taskId The task ID\n\t* @param attachmentId The attachment ID\n\t* @param signal The abort signal\n\t* @returns\n\t*/\n\tasync deleteAttachment(installationId, taskId, attachmentId, signal) {\n\t\treturn await this.client.request(`/api/tasks/${installationId}/task/${taskId}/attachments/${attachmentId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/plugins/tasks/tasks-resource.ts\nvar TasksResource = class {\n\tclient;\n\tcomments;\n\tlists;\n\ttask;\n\ttaskGroup;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.comments = new TaskCommentsResource(client);\n\t\tthis.lists = new TaskListsResource(client);\n\t\tthis.task = new TaskResource(client);\n\t\tthis.taskGroup = new TaskGroupResource(client);\n\t}\n};\n//#endregion\n//#region src/plugins/plugins-resource.ts\nvar PluginsResource = class {\n\tclient;\n\tmaps;\n\ttasks;\n\tinstallations;\n\tlearning;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.maps = new MapsResource(client);\n\t\tthis.tasks = new TasksResource(client);\n\t\tthis.installations = new PluginInstallationsResource(client);\n\t\tthis.learning = new LearningResource(client);\n\t}\n\tasync get(pluginId, signal) {\n\t\treturn (await this.client.request(`/api/plugins/${pluginId}`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/posts/likes/post-likes-resource.ts\nvar PostLikesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(postId, params, signal) {\n\t\treturn (await this.client.request(`/api/posts/${postId}/likes`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/posts/post-acknowledgements/post-acknowledgements-resource.ts\nvar PostAcknowledgementsResource = class {\n\tstudioApiClient;\n\tconstructor(studioApiClient) {\n\t\tthis.studioApiClient = studioApiClient;\n\t}\n\tasync list(postId, params, signal) {\n\t\treturn (await this.studioApiClient.request(`/api/posts/${postId}/acknowledgements`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/posts/posts-comments/posts-comments-resource.ts\nvar PostsCommentsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(postId, payload) {\n\t\treturn (await this.client.request(`/api/posts/${postId}/comments`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync createFromContentDocument(postId, payload) {\n\t\treturn (await this.client.request(`/api/posts/${postId}/comments`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/vnd.staffbase.news.comment-create.v2+json\" }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/posts/posts-search/posts-search-resource.ts\nconst POST_V2_MEDIA_TYPE$1 = \"application/vnd.staffbase.news.posts.v2+json\";\nvar PostsSearchResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync search(params = {}, signal) {\n\t\treturn (await this.client.request(\"/api/posts/search\", {\n\t\t\tquery: {\n\t\t\t\tquery: params.query,\n\t\t\t\tlimit: params.limit,\n\t\t\t\tcursor: params.cursor,\n\t\t\t\tsort: params.sort,\n\t\t\t\tpermission: params.permission,\n\t\t\t\tsearchFields: params.searchFields,\n\t\t\t\tfilter: params.filter\n\t\t\t},\n\t\t\theaders: { accept: POST_V2_MEDIA_TYPE$1 },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/posts/posts-resource.ts\nconst POST_V2_MEDIA_TYPE = \"application/vnd.staffbase.news.posts.v2+json\";\nvar PostsResource = class {\n\tclient;\n\tacknowledgements;\n\tcomments;\n\tlikes;\n\tsearch;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.acknowledgements = new PostAcknowledgementsResource(client);\n\t\tthis.comments = new PostsCommentsResource(client);\n\t\tthis.likes = new PostLikesResource(client);\n\t\tthis.search = new PostsSearchResource(client);\n\t}\n\tasync list({ publicationState, ...params } = {}, signal) {\n\t\treturn (await this.client.request(`/api/posts`, {\n\t\t\tquery: {\n\t\t\t\t...params,\n\t\t\t\tpublicationState: publicationState && typeof publicationState !== \"string\" ? Array.from(publicationState) : publicationState\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(postId, signal) {\n\t\treturn (await this.client.request(`/api/posts/${postId}`, { signal })).json();\n\t}\n\tasync listUnexpanded({ publicationState, ...params } = {}, signal) {\n\t\treturn (await this.client.request(\"/api/posts\", {\n\t\t\tquery: {\n\t\t\t\t...params,\n\t\t\t\tpublicationState: publicationState && typeof publicationState !== \"string\" ? Array.from(publicationState) : publicationState\n\t\t\t},\n\t\t\theaders: { accept: POST_V2_MEDIA_TYPE },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getUnexpanded(postId, signal) {\n\t\treturn (await this.client.request(`/api/posts/${postId}`, {\n\t\t\theaders: { accept: POST_V2_MEDIA_TYPE },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(postId, payload) {\n\t\treturn (await this.client.request(`/api/posts/${postId}`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync updateFromContentDocument(postId, payload) {\n\t\treturn (await this.client.request(`/api/posts/${postId}`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/vnd.staffbase.news.post-update.v2+json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync delete(postId) {\n\t\tawait this.client.request(`/api/posts/${postId}`, { method: \"DELETE\" });\n\t}\n};\n//#endregion\n//#region src/profiles/profiles-fields-resource.ts\nvar ProfilesFieldsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(`/api/profiles/fields`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(slug, data) {\n\t\tawait this.client.request(`/api/profiles/fields/${slug}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n\tasync delete(slug) {\n\t\tawait this.client.request(`/api/profiles/fields/${slug}`, { method: \"DELETE\" });\n\t}\n\tasync create(data) {\n\t\treturn (await this.client.request(`/api/profiles/fields`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).headers.get(\"Location\") ?? \"\";\n\t}\n};\nconst ProfileFieldFormats = [\n\t\"simpleString\",\n\t\"phone\",\n\t\"address\"\n];\nconst ProfileFieldsNonVisible = [\n\t\"avatar\",\n\t\"profileHeaderImage\",\n\t\"profileHeadline\",\n\t\"pronouns\",\n\t\"publicEmailAddress\",\n\t\"system_manager\"\n];\n//#endregion\n//#region src/profiles/profiles-public-resource.ts\nvar ProfilesPublicResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(userId, signal) {\n\t\treturn (await this.client.request(`/api/profiles/public/${userId}`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/profiles/profiles-resource.ts\nvar ProfilesResource = class {\n\tclient;\n\tpublic;\n\tfields;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.public = new ProfilesPublicResource(this.client);\n\t\tthis.fields = new ProfilesFieldsResource(this.client);\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/profiles/${id}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal,\n\t\t\theaders: { \"Accept-Version\": \"2.0\" }\n\t\t})).json();\n\t}\n\tasync update(id, fields) {\n\t\tawait this.client.request(`/api/profiles/${id}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(fields),\n\t\t\theaders: {\n\t\t\t\t\"content-type\": \"application/json\",\n\t\t\t\t\"Accept-Version\": \"2.0\"\n\t\t\t}\n\t\t});\n\t}\n\tasync search(request, signal) {\n\t\treturn (await this.client.request(`/api/profiles/search`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(request),\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/push-notifications/push-notifications-resource.ts\nvar PushNotificationsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync register(payload) {\n\t\treturn (await this.client.request(`/api/push/installation`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync deactivate({ token }) {\n\t\tawait this.client.request(`/api/push/installation/${token}`, { method: \"DELETE\" });\n\t}\n};\n//#endregion\n//#region src/quicklinks/quicklinks-resource.ts\nvar QuicklinksResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(params, signal) {\n\t\treturn (await this.client.request(`/api/quicklinks`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.quicklinks.quicklink-list.v2+json\" },\n\t\t\tquery: { ...params },\n\t\t\tusePublicAreaToken: false\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/reactions-count/reactions-count-resource.ts\nvar ReactionsCountResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(params, signal) {\n\t\treturn (await this.client.request(\"/api/reactions-count\", {\n\t\t\tsignal,\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/reactions/reactions-resource.ts\nvar ReactionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(payload) {\n\t\treturn this.client.request(`/api/reactions`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n\t/**\n\t* Lists reactions for a parent entity (post/comment), optionally filtered to one user's own\n\t* reaction via `userId` — matches the legacy client's `ReactionsApi.fetchUserReaction`.\n\t*/\n\tasync list(params, signal) {\n\t\treturn (await this.client.request(\"/api/reactions\", {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Deletes the current user's reaction to a parent entity — matches the legacy client's\n\t* `ReactionsApi.deleteReaction`.\n\t*/\n\tasync delete(params, signal) {\n\t\tawait this.client.request(\"/api/reactions\", {\n\t\t\tmethod: \"DELETE\",\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t});\n\t}\n\t/**\n\t* @deprecated use `reactionsCount.list()` instead\n\t*/\n\tasync fetchCountsForParent(parentId, parentType, signal) {\n\t\treturn (await this.client.request(\"/api/reactions-count\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: {\n\t\t\t\tparentId,\n\t\t\t\tparentType\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/recoveries/recoveries-resource.ts\nvar RecoveriesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(data) {\n\t\treturn (await this.client.request(\"/api/recoveries\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/rollout-guard/types.ts\nconst ROLLOUT_GUARD_API_V2_MIME_TYPES = {\n\tDETAILS: \"application/vnd.staffbase.rollout-guard.details.v2+json\",\n\tPATCH: \"application/vnd.staffbase.rollout-guard.patch.v2+json\",\n\tDISCOVER: \"application/vnd.staffbase.rollout-guard.discover.v2+json\"\n};\n//#endregion\n//#region src/rollout-guard/rollout-guard-resource.ts\nvar RolloutGuardResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getV2(signal) {\n\t\treturn (await this.client.request(\"/api/rollout-guard\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: ROLLOUT_GUARD_API_V2_MIME_TYPES.DETAILS },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync patchV2(payload, signal) {\n\t\treturn (await this.client.request(\"/api/rollout-guard\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": ROLLOUT_GUARD_API_V2_MIME_TYPES.PATCH,\n\t\t\t\tAccept: ROLLOUT_GUARD_API_V2_MIME_TYPES.DETAILS\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync discoverV2(signal) {\n\t\treturn (await this.client.request(\"/api/rollout-guard/discover\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: ROLLOUT_GUARD_API_V2_MIME_TYPES.DISCOVER },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/sanitization/sanitization-resource.ts\nvar SanitizationResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Clean a set of strings from unsupported elements and XSS attacks using the {@link https://backstage.staffbase.com/docs/default/component/satan|Satan service}.\n\t*\n\t* The returned record is guaranteed to contain the exact same keys as the input `data`.\n\t*\n\t* Satan imposes a {@link https://backstage.staffbase.com/docs/default/component/satan/usage/#request-size-limit|request size limit} depending on whether requests are authenticated.\n\t* This function does not add an authentication header to the request, this should be done with {@link BaseClient#addBeforeRequestHook|addBeforeRequestHook()}.\n\t*/\n\tasync sanitize(data, preset, customElements) {\n\t\tconst body = {\n\t\t\tdata,\n\t\t\t...preset !== void 0 && { preset },\n\t\t\t...customElements !== void 0 && { customElements }\n\t\t};\n\t\tconst result = await (await this.client.request(\"/api/sanitization/sanitize\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(body),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t})).json();\n\t\tif (!result.data) throw new Error(\"Malformed response from sanitization service\");\n\t\treturn result.data;\n\t}\n};\n//#endregion\n//#region src/screens/device-resource.ts\nvar DeviceResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Gets the data for the device using the cookie.\n\t* If the device is not registered or the cookie is missing, it will return a 404\n\t*/\n\tasync get(signal) {\n\t\treturn (await this.client.request(`/api/device`, { signal })).json();\n\t}\n\t/**\n\t* Create a registration for the device and returns a cookie with the device id\n\t* and the code to be used to confirm the device\n\t*\n\t* Needs to be confirmed by an admin / editor before the device can be used\n\t*/\n\tasync create(signal) {\n\t\treturn (await this.client.request(`/api/device`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/screens/types.ts\nlet DeviceConnectionStatus = /* @__PURE__ */ function(DeviceConnectionStatus) {\n\tDeviceConnectionStatus[\"ONLINE\"] = \"ONLINE\";\n\tDeviceConnectionStatus[\"OFFLINE\"] = \"OFFLINE\";\n\treturn DeviceConnectionStatus;\n}({});\nlet SlideshowOrientations = /* @__PURE__ */ function(SlideshowOrientations) {\n\tSlideshowOrientations[\"PORTRAIT\"] = \"PORTRAIT\";\n\tSlideshowOrientations[\"LANDSCAPE\"] = \"LANDSCAPE\";\n\treturn SlideshowOrientations;\n}({});\nlet SlideshowSettingsTabs = /* @__PURE__ */ function(SlideshowSettingsTabs) {\n\tSlideshowSettingsTabs[\"SLIDESHOW\"] = \"SLIDESHOW\";\n\tSlideshowSettingsTabs[\"MEDIA\"] = \"MEDIA\";\n\treturn SlideshowSettingsTabs;\n}({});\nlet SlideshowSourceTypes = /* @__PURE__ */ function(SlideshowSourceTypes) {\n\tSlideshowSourceTypes[\"NEWS\"] = \"NEWS\";\n\tSlideshowSourceTypes[\"CHANNEL\"] = \"CHANNEL\";\n\treturn SlideshowSourceTypes;\n}({});\nlet MediaTypes = /* @__PURE__ */ function(MediaTypes) {\n\tMediaTypes[\"IMAGE\"] = \"IMAGE\";\n\tMediaTypes[\"VIDEO\"] = \"VIDEO\";\n\treturn MediaTypes;\n}({});\nconst ScreensRights = {\n\tACCESS_SCREENS: \"ACCESS_SCREENS\",\n\tADD_DEVICE: \"ADD_DEVICE\",\n\tADD_MEDIA: \"ADD_MEDIA\",\n\tADD_SLIDESHOW: \"ADD_SLIDESHOW\",\n\tEDIT_DEVICE: \"EDIT_DEVICE\",\n\tEDIT_SLIDESHOW: \"EDIT_SLIDESHOW\",\n\tREMOVE_DEVICE: \"REMOVE_DEVICE\",\n\tREMOVE_MEDIA: \"REMOVE_MEDIA\",\n\tREMOVE_SLIDESHOW: \"REMOVE_SLIDESHOW\"\n};\n/** Vendor media types selecting the v2 Screens representations via the Accept header. */\nconst ScreensMediaTypes = {\n\tDEVICE_V2: \"application/vnd.staffbase.screens.device.v2+json\",\n\tDEVICES_V2: \"application/vnd.staffbase.screens.devices.v2+json\",\n\tNEWS_SOURCES_V1: \"application/vnd.staffbase.screens.news-sources.v1+json\",\n\tNEWS_SOURCE_POSTS_V1: \"application/vnd.staffbase.screens.news-source-posts.v1+json\",\n\tNEWS_SOURCE_PREVIEW_V1: \"application/vnd.staffbase.screens.news-source-preview.v1+json\",\n\tSLIDESHOW_V2: \"application/vnd.staffbase.screens.slideshow.v2+json\",\n\tSLIDESHOWS_V2: \"application/vnd.staffbase.screens.slideshows.v2+json\"\n};\nconst ScreenNewsSourceTypes = {\n\tCHANNEL: \"CHANNEL\",\n\tNEWS_PAGE: \"NEWS_PAGE\"\n};\n//#endregion\n//#region src/screens/device-studio-resource.ts\nvar DeviceStudioResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* List all devices from that branch\n\t*\n\t* @param options Options to search, sort and filter the list\n\t* @param signal The abort signal\n\t*\n\t* @returns List of devices\n\t*/\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"/api/branch/ds/devices\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\t/**\n\t* List all devices from that branch in the v2 representation, whose entries additionally carry\n\t* the devices' space/collection scoping (`spaceId`/`collectionId`, `null` while not assigned).\n\t*\n\t* @param options Options to search, sort and filter the list\n\t* @param signal The abort signal\n\t*\n\t* @returns List of devices with their scoping\n\t*/\n\tasync listV2(options, signal) {\n\t\treturn (await this.client.request(\"/api/branch/ds/devices\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options },\n\t\t\theaders: { accept: ScreensMediaTypes.DEVICES_V2 }\n\t\t})).json();\n\t}\n\t/**\n\t* Get a single device in the v2 representation, which additionally carries the device's\n\t* space/collection scoping (`spaceId`/`collectionId`, `null` while not assigned).\n\t*\n\t* @param deviceId The id of the device\n\t* @param signal The abort signal\n\t*\n\t* @returns The device with its scoping\n\t*/\n\tasync getV2(deviceId, signal) {\n\t\treturn (await this.client.request(`/api/branch/ds/devices/${deviceId}`, {\n\t\t\tsignal,\n\t\t\theaders: { accept: ScreensMediaTypes.DEVICE_V2 }\n\t\t})).json();\n\t}\n\t/**\n\t* Complete an open registration process, giving the code of the device\n\t*\n\t* @param code The 6 digit code\n\t* @param signal The abort signal\n\t*\n\t* @returns the registered device\n\t*/\n\tasync register(code, signal) {\n\t\treturn (await this.client.request(`/api/branch/ds/devices/${code}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Register a device into a specific collection (v2). Omit `collectionId` to use the branch\n\t* default collection. Adding a device to a collection that restricts adding devices requires\n\t* the manage tier.\n\t*\n\t* @param code The 6 digit code\n\t* @param payload The target collection\n\t* @param signal The abort signal\n\t*\n\t* @returns the registered device with its space/collection scoping\n\t*/\n\tasync registerV2(code, payload = {}, signal) {\n\t\treturn (await this.client.request(`/api/branch/ds/devices/${code}`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: {\n\t\t\t\taccept: ScreensMediaTypes.DEVICE_V2,\n\t\t\t\t\"content-type\": ScreensMediaTypes.DEVICE_V2\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Modify a device and optionally move it into another collection (v2). Omit `collectionId` to\n\t* keep its current collection.\n\t*\n\t* @param device The device data, including the optional target `collectionId`\n\t* @param signal The abort signal\n\t*\n\t* @returns the updated device with its space/collection scoping\n\t*/\n\tasync updateV2(device, signal) {\n\t\treturn (await this.client.request(`/api/branch/ds/devices/${device.id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(device),\n\t\t\theaders: {\n\t\t\t\taccept: ScreensMediaTypes.DEVICE_V2,\n\t\t\t\t\"content-type\": ScreensMediaTypes.DEVICE_V2\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Modifies an existing device\n\t*\n\t* @param device the data which should be changed for the device\n\t* @param signal The abort signal\n\t*\n\t* @returns the updated device\n\t*/\n\tasync update(device, signal) {\n\t\treturn await (await this.client.request(`api/branch/ds/devices/${device.id}`, {\n\t\t\tbody: JSON.stringify(device),\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"PUT\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Deletes an existing device\n\t*\n\t* @param deviceId the id of the device to delete\n\t* @param signal The abort signal\n\t*/\n\tasync delete(deviceId, signal) {\n\t\tawait this.client.request(`/api/branch/ds/devices/${deviceId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/screens/screen-collection-resource.ts\n/**\n* Admin API for screen collections. A collection is identified by its backing installation's id —\n* the `collectionId` the v2 device/slideshow representations carry. The endpoints only exist with\n* the `news_screens_spaces` feature enabled; without it they answer 404.\n*/\nvar ScreenCollectionResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tpath = \"/api/branch/ds/collections\";\n\t/**\n\t* Lists the collections the current user may manage, with their content counts.\n\t*\n\t* @param options Cursor paging, space narrowing, and title search\n\t* @param signal The abort signal\n\t*/\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(this.path, {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`${this.path}/${id}`, { signal })).json();\n\t}\n\t/** Lists the News sources assigned to this collection, including unavailable assignments. */\n\tasync getNewsSources(collectionId, signal) {\n\t\treturn (await this.client.request(`${this.path}/${collectionId}/news-sources`, {\n\t\t\theaders: { accept: ScreensMediaTypes.NEWS_SOURCES_V1 },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/** Gets posts from a News source assigned to this collection. */\n\tasync getNewsSourcePosts(collectionId, sourceId, options, signal) {\n\t\treturn (await this.client.request(`${this.path}/${collectionId}/news-sources/${sourceId}/posts`, {\n\t\t\theaders: { accept: ScreensMediaTypes.NEWS_SOURCE_POSTS_V1 },\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/** Gets a player-compatible preview for a News source assigned to this collection. */\n\tasync getNewsSourcePreview(collectionId, sourceId, options, signal) {\n\t\treturn (await this.client.request(`${this.path}/${collectionId}/news-sources/${sourceId}/preview`, {\n\t\t\theaders: { accept: ScreensMediaTypes.NEWS_SOURCE_PREVIEW_V1 },\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(collection, signal) {\n\t\treturn (await this.client.request(this.path, {\n\t\t\tbody: JSON.stringify(collection),\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"POST\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/** Applies the settings payload; omitted fields stay unchanged. */\n\tasync update(id, settings, signal) {\n\t\treturn (await this.client.request(`${this.path}/${id}`, {\n\t\t\tbody: JSON.stringify(settings),\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"PUT\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`${this.path}/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/screens/slideshow-resource.ts\nvar SlideshowResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/branch/ds/slideshows/${id}`, { signal })).json();\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(\"/api/branch/ds/slideshows\", { signal })).json();\n\t}\n\t/**\n\t* Get a single slideshow in the v2 representation, which additionally carries the slideshow's\n\t* space/collection scoping (`spaceId`/`collectionId`, `null` while not assigned).\n\t*/\n\tasync getV2(id, signal) {\n\t\treturn (await this.client.request(`/api/branch/ds/slideshows/${id}`, {\n\t\t\tsignal,\n\t\t\theaders: { accept: ScreensMediaTypes.SLIDESHOW_V2 }\n\t\t})).json();\n\t}\n\t/**\n\t* List the slideshows in the v2 representation, whose entries additionally carry the\n\t* slideshows' space/collection scoping (`spaceId`/`collectionId`, `null` while not assigned).\n\t*/\n\tasync listV2(options, signal) {\n\t\treturn (await this.client.request(\"/api/branch/ds/slideshows\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options },\n\t\t\theaders: { accept: ScreensMediaTypes.SLIDESHOWS_V2 }\n\t\t})).json();\n\t}\n\tasync create(slideshowData, signal) {\n\t\tconst data = {\n\t\t\t...slideshowData,\n\t\t\tupdatedAt: void 0,\n\t\t\tcreatedAt: void 0\n\t\t};\n\t\treturn (await this.client.request(`/api/branch/ds/slideshows`, {\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(id, slideshowData, signal) {\n\t\tconst data = {\n\t\t\t...slideshowData,\n\t\t\tupdatedAt: void 0,\n\t\t\tcreatedAt: void 0\n\t\t};\n\t\treturn (await this.client.request(`/api/branch/ds/slideshows/${id}`, {\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Create a slideshow in a specific collection (v2). Omit `collectionId` to use the branch\n\t* default collection.\n\t*/\n\tasync createV2(slideshowData, signal) {\n\t\tconst data = {\n\t\t\t...slideshowData,\n\t\t\tupdatedAt: void 0,\n\t\t\tcreatedAt: void 0\n\t\t};\n\t\treturn (await this.client.request(\"/api/branch/ds/slideshows\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: {\n\t\t\t\taccept: ScreensMediaTypes.SLIDESHOW_V2,\n\t\t\t\t\"content-type\": ScreensMediaTypes.SLIDESHOW_V2\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Update a slideshow and optionally move it into another collection (v2). Omit `collectionId`\n\t* to keep its current collection.\n\t*/\n\tasync updateV2(id, slideshowData, signal) {\n\t\tconst data = {\n\t\t\t...slideshowData,\n\t\t\tupdatedAt: void 0,\n\t\t\tcreatedAt: void 0\n\t\t};\n\t\treturn (await this.client.request(`/api/branch/ds/slideshows/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: {\n\t\t\t\taccept: ScreensMediaTypes.SLIDESHOW_V2,\n\t\t\t\t\"content-type\": ScreensMediaTypes.SLIDESHOW_V2\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`/api/branch/ds/slideshows/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/screens/screens-resource.ts\nvar ScreensResource = class {\n\tclient;\n\tslideshows;\n\tdevices;\n\tdevice;\n\tcollections;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.slideshows = new SlideshowResource(client);\n\t\tthis.devices = new DeviceStudioResource(client);\n\t\tthis.device = new DeviceResource(client);\n\t\tthis.collections = new ScreenCollectionResource(client);\n\t}\n\tpath = \"/api/branch/ds/screens\";\n\tasync discover(signal) {\n\t\treturn (await this.client.request(`${this.path}/discover`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/search/search-history-resource.ts\nvar SearchHistoryResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(params = {}, signal) {\n\t\treturn await (await this.client.request(\"/api/search/history\", {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(query, signal) {\n\t\treturn await (await this.client.request(\"/api/search/history\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify({ query }),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/search/history/${id}`, { method: \"DELETE\" });\n\t}\n\tasync deleteAll() {\n\t\tawait this.client.request(`/api/search/history`, { method: \"DELETE\" });\n\t}\n};\n//#endregion\n//#region src/search/search-settings-resource.ts\nvar SearchSettingsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn await (await this.client.request(\"/api/search/settings\", { signal })).json();\n\t}\n\tasync delete(signal) {\n\t\tawait this.client.request(\"/api/search/settings\", {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync updateGeneral(body, signal) {\n\t\treturn await (await this.client.request(\"/api/search/settings/general\", {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(body),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync updateInternalSection(sectionId, body, signal) {\n\t\treturn await (await this.client.request(`/api/search/settings/internal-sections/${sectionId}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(body),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync updateIntegrationSection(sectionId, body, signal) {\n\t\treturn await (await this.client.request(`/api/search/settings/integration-sections/${sectionId}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(body),\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/search/search-resource.ts\nvar SearchResource = class {\n\tclient;\n\thistory;\n\tsettings;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.history = new SearchHistoryResource(this.client);\n\t\tthis.settings = new SearchSettingsResource(this.client);\n\t}\n\tstreamUrl(query, options = {}) {\n\t\tconst { rerank, summary } = options;\n\t\treturn new URL(`/api/search/stream?${getQueryString({\n\t\t\tquery,\n\t\t\trerank,\n\t\t\tsummary\n\t\t})}`, this.client.baseURL).toString();\n\t}\n\tasync discover(signal) {\n\t\treturn await (await this.client.request(\"/api/search/discover\", { signal })).json();\n\t}\n\tasync get(options = {}, signal) {\n\t\tconst { types, sort, ...rest } = options;\n\t\tconst query = {\n\t\t\ttypes: types?.join(\",\"),\n\t\t\tsort: sort?.map((opt) => opt.asc ? opt.type : `${opt.type}_desc`).join(\",\"),\n\t\t\t...rest\n\t\t};\n\t\treturn await (await this.client.request(\"/api/search\", {\n\t\t\tquery,\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync post(request, signal) {\n\t\treturn await (await this.client.request(\"/api/search\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(request),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync hybridSearch(request, signal) {\n\t\treturn await (await this.client.request(\"/api/search/hybrid\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(request),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync submitResultsFeedback(request, signal) {\n\t\tawait this.client.request(\"/api/search/feedback/results\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(request),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync submitSummaryFeedback(request, signal) {\n\t\tawait this.client.request(\"/api/search/feedback/summary\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(request),\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/sentiment/sentiment.ts\nvar SentimentResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getSentimentTimeseries(params) {\n\t\tconst { campaignId, ...rest } = params;\n\t\treturn (await this.client.request(`api/community-insights/campaigns/${campaignId}/comments/sentiment-labels/time-series`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...rest }\n\t\t})).json();\n\t}\n\tasync getSentimentRanking(params) {\n\t\tconst { campaignId, ...rest } = params;\n\t\treturn (await this.client.request(`api/community-insights/campaigns/${campaignId}/comments/sentiment-data`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...rest }\n\t\t})).json();\n\t}\n\tasync getSentimentOverall({ campaignId }) {\n\t\treturn (await this.client.request(`api/community-insights/campaigns/${campaignId}/comments/sentiment-labels/overall`)).json();\n\t}\n};\n//#endregion\n//#region src/session/sessions-resource.ts\nvar SessionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(data) {\n\t\treturn await (await this.client.request(\"/api/sessions\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync validateOtp(payload) {\n\t\tawait this.client.request(\"/api/sessions/current/otp\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/shorts/shorts-resource.ts\nvar ShortsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tgetPath(resourceId) {\n\t\tconst id = resourceId.channelId ?? resourceId.newspageId;\n\t\tif (!id) throw new Error(\"no resource id given\");\n\t\treturn {\n\t\t\tid,\n\t\t\tpath: resourceId.channelId ? \"channels\" : \"newspages\"\n\t\t};\n\t}\n\tasync list(resourceId, params, signal) {\n\t\tconst { id, path } = this.getPath(resourceId);\n\t\treturn (await this.client.request(`/api/${path}/${id}/shorts`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getRights(resourceId, signal) {\n\t\tconst { id, path } = this.getPath(resourceId);\n\t\treturn (await this.client.request(`/api/${path}/${id}/shorts/rights`, { signal })).json();\n\t}\n\tasync listChannels(newspageId, params, signal) {\n\t\treturn (await this.client.request(`/api/newspages/${newspageId}/shorts/channels`, {\n\t\t\tquery: { ...params },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/users/utils.ts\n/**\n* Creates a filter string from a record, filtering out undefined values and handling arrays.\n* @param record - Record with search keys and values\n* @returns Filter string or undefined if no filters\n*/\nconst createFilterString = (record) => {\n\treturn Object.entries(record).map(([key, value]) => {\n\t\tif (value === void 0) return;\n\t\tif (Array.isArray(value)) {\n\t\t\tif (value.length === 0) return;\n\t\t\treturn \"(\" + value.map(function(v) {\n\t\t\t\treturn key + \" eq \" + JSON.stringify(v);\n\t\t\t}).join(\" or \") + \")\";\n\t\t}\n\t\treturn `${key} eq ${JSON.stringify(value)}`;\n\t}).filter((v) => v !== void 0).join(\" and \");\n};\nconst UserTypeSearchFilterQueries = {\n\temails: \"(emails pr and password pr)\",\n\tuserName: \"(userName pr and password pr)\",\n\tcode: \"(not (emails pr) and not (userName pr) and password pr)\"\n};\n/**\n* Transforms a UserSearchFilter into a filter string, joining multiple filters with 'and'.\n* @param f - UserSearchFilter\n* @returns Filter string or undefined if no filters\n*/\nconst transformFilters = (f) => {\n\tconst filters = Object.entries(f).flatMap(([key, value]) => {\n\t\tif (!value?.length) return [];\n\t\tif (key === \"userType\") return [\"(\" + value.map((type) => UserTypeSearchFilterQueries[type]).join(\" or \") + \")\"];\n\t\treturn createFilterString({ [key]: value });\n\t});\n\treturn filters.length ? filters.join(\" and \") : void 0;\n};\n//#endregion\n//#region src/spaces/groups/groups-resource.ts\nvar GroupsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(spaceId, params) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/groups`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.accessors.group-create.v2+json\" },\n\t\t\tbody: JSON.stringify(params)\n\t\t})).json();\n\t}\n\tasync update(spaceId, groupId, payload) {\n\t\tawait this.client.request(`/api/spaces/${spaceId}/groups/${groupId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.accessors.group-update.v1+json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n\tasync get(spaceId, groupId, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/groups/${groupId}`, {\n\t\t\tsignal,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.group.v3+json\" }\n\t\t})).json();\n\t}\n\tasync search(spaceId, params, signal) {\n\t\tconst version = \"application/vnd.staffbase.accessors.groups-search.v1+json\";\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/groups/search`, {\n\t\t\tsignal,\n\t\t\tquery: { ...params },\n\t\t\theaders: { Accept: version }\n\t\t})).json();\n\t}\n\tasync searchAll(params, signal) {\n\t\treturn (await this.client.request(`/api/spaces/groups/search`, {\n\t\t\tsignal,\n\t\t\tquery: { ...params },\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.groups-search.v1+json\" }\n\t\t})).json();\n\t}\n\tasync tags(spaceId, options, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/groups/tags`, {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync searchMembers(spaceId, groupId, params, signal) {\n\t\tconst version = \"application/vnd.staffbase.accessors.group.members-search.v1+json\";\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/groups/${groupId}/members/search`, {\n\t\t\tsignal,\n\t\t\tquery: { ...params },\n\t\t\theaders: { Accept: version }\n\t\t})).json();\n\t}\n\tasync addMembers(spaceId, groupId, payload, signal) {\n\t\treturn this.client.request(`/api/spaces/${spaceId}/groups/${groupId}/members`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/vnd.staffbase.accessors.group.members-add.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.accessors.group.members-add.v1+json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync searchUsers(spaceId, options, signal) {\n\t\tconst version = \"application/vnd.staffbase.spaces.users-search.id-list.v1+json\";\n\t\tconst { filter, ...rest } = options || {};\n\t\tconst params = {\n\t\t\tfilter: transformFilters(filter ?? {}),\n\t\t\t...rest\n\t\t};\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/users`, {\n\t\t\tsignal,\n\t\t\tquery: { ...params },\n\t\t\theaders: { Accept: version }\n\t\t})).json();\n\t}\n\tasync delete(spaceId, groupId) {\n\t\tawait this.client.request(`/api/spaces/${spaceId}/groups/${groupId}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.group-delete.v2+json\" }\n\t\t});\n\t}\n\tasync removeMembers(spaceId, groupId, payload, signal) {\n\t\treturn this.client.request(`/api/spaces/${spaceId}/groups/${groupId}/members`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": \"application/vnd.staffbase.accessors.group.members-remove.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.accessors.group.members-remove.v1+json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync createMembersImport(spaceId, groupId, file, replace, identifier) {\n\t\tconst body = new FormData();\n\t\tbody.append(\"file\", file);\n\t\tbody.append(\"replace\", replace.toString());\n\t\tbody.append(\"identifier\", identifier);\n\t\tawait this.client.request(`/api/spaces/${spaceId}/groups/${groupId}/members/import`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t});\n\t}\n\tasync getMembersImportErrors(spaceId, groupId, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/groups/${groupId}/members/import/errors`, { signal })).blob();\n\t}\n};\n//#endregion\n//#region src/spaces/menu/space-menu-resource.ts\nvar SpaceMenuResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync update(spaceID, payload) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceID}/menu`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync root(spaceID) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceID}/menu`, {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { accept: \"application/json\" }\n\t\t})).json();\n\t}\n\tasync search(spaceID, options, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceID}/menu/search`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync move(spaceId, menuNodeId, payload, signal) {\n\t\tawait this.client.request(`/api/spaces/${spaceId}/menu/${menuNodeId}/children/move`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync migrate(spaceId, folderId, payload, signal) {\n\t\tawait this.client.request(`/api/spaces/${spaceId}/menu/${folderId}/children/migrate`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync delete(menuNodeId, signal) {\n\t\treturn this.client.request(`/api/menu/${menuNodeId}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"DELETE\"\n\t\t});\n\t}\n};\n//#endregion\n//#region src/spaces/news/space-news-resource.ts\nvar SpaceNewsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(spaceId, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/news`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/spaces/spaces-installations/spaces-installations-resource.ts\nvar SpacesInstallationsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(spaceId, payload, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/installations`, {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/spaces/spaces-plugins/spaces-plugins-resource.ts\nvar SpacesPluginsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(spaceId, { products } = {}, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}/plugins`, {\n\t\t\tquery: { products },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/spaces/spaces-resource.ts\nvar SpacesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.groups = new GroupsResource(client);\n\t\tthis.installations = new SpacesInstallationsResource(client);\n\t\tthis.menu = new SpaceMenuResource(client);\n\t\tthis.news = new SpaceNewsResource(client);\n\t\tthis.plugins = new SpacesPluginsResource(client);\n\t}\n\tgroups;\n\tinstallations;\n\tmenu;\n\tnews;\n\tplugins;\n\t/**\n\t* @deprecated use getV3 instead\n\t*/\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${id}`, { signal })).json();\n\t}\n\tasync getV3(id, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${id}`, {\n\t\t\tsignal,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.spaces.space.v3+json\" }\n\t\t})).json();\n\t}\n\tasync permission({ id, permission }, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${id}/permissions/${permission}`, { signal })).json();\n\t}\n\tasync getSpacesPermission(permission, signal) {\n\t\treturn (await this.client.request(`/api/spaces/permissions/${permission}`, { signal })).json();\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"/api/spaces\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync search(options, signal) {\n\t\treturn (await this.client.request(\"/api/spaces/search\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync create(payload, signal) {\n\t\treturn (await this.client.request(`/api/spaces`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(spaceId, paylaod, signal) {\n\t\treturn (await this.client.request(`/api/spaces/${spaceId}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(paylaod),\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync move(sourceSpaceId, pageId, payload, signal) {\n\t\tawait this.client.request(`/api/spaces/${sourceSpaceId}/installations/${pageId}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync delete(spaceId, signal) {\n\t\treturn this.client.request(`/api/spaces/${spaceId}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"DELETE\"\n\t\t});\n\t}\n};\n//#endregion\n//#region src/sso/sso-configs-resource.ts\nvar SsoConfigsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(options, signal) {\n\t\treturn await (await this.client.request(\"/api/sso/configs\", {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { ...options },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn await (await this.client.request(`/api/sso/configs/${id}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync add(newId, data, signal) {\n\t\tawait this.client.request(`/api/sso/configs/${newId}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(data),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync update(id, data, signal) {\n\t\tawait this.client.request(`/api/sso/configs/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(data),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/sso/configs/${id}`, { method: \"DELETE\" });\n\t}\n\tasync clearMetadata(id) {\n\t\tawait this.client.request(`/api/sso/configs/${id}/metadata/cache`, { method: \"DELETE\" });\n\t}\n\tasync reorder(id, newIndex, signal) {\n\t\tawait this.client.request(`/api/sso/configs/${id}/order`, {\n\t\t\tmethod: \"PUT\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify({ newIndex }),\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/studio/quickactions/studio-quickactions-resource.ts\nvar StudioQuickactionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(\"api/studio/quickactions\", { signal })).json();\n\t}\n};\n//#endregion\n//#region src/studio/studio-access-resource.ts\nvar StudioAccessResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn await (await this.client.request(\"/api/studio/access\", { signal })).json();\n\t}\n};\n//#endregion\n//#region src/studio/studio-identities-resource.ts\nvar StudioIdentitiesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(data, signal) {\n\t\treturn (await this.client.request(\"/api/studio/identities\", {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/studio/identities/${id}`, { method: \"DELETE\" });\n\t}\n\tasync reinvite(id) {\n\t\tawait this.client.request(`/api/studio/identities/${id}/invitations`, { method: \"POST\" });\n\t}\n};\n//#endregion\n//#region src/studio/studio-rights-resource.ts\nvar StudioRightsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn await (await this.client.request(\"/api/studio/rights\", { signal })).json();\n\t}\n};\n//#endregion\n//#region src/studio/studio-resource.ts\nvar StudioResource = class {\n\tclient;\n\tidentities;\n\tquickactions;\n\taccess;\n\trights;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.identities = new StudioIdentitiesResource(client);\n\t\tthis.quickactions = new StudioQuickactionsResource(client);\n\t\tthis.access = new StudioAccessResource(client);\n\t\tthis.rights = new StudioRightsResource(client);\n\t}\n};\n//#endregion\n//#region src/surveys/surveys-installations/surveys-installations-questions-resource.ts\nvar SurveysInstallationsQuestionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(installationId) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/questions`, { method: \"GET\" })).json();\n\t}\n\tasync create(installationId, payload) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/questions`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync delete(installationId, questionId) {\n\t\tawait this.client.request(`/api/surveys/installations/${installationId}/questions/${questionId}`, { method: \"DELETE\" });\n\t}\n\tasync get(installationId, questionId) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/questions/${questionId}`, { method: \"GET\" })).json();\n\t}\n\tasync update(installationId, questionId, payload) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/questions/${questionId}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync position(installationId, questionId, payload) {\n\t\tawait this.client.request(`/api/surveys/installations/${installationId}/questions/${questionId}/position`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n};\n//#endregion\n//#region src/surveys/surveys-installations/surveys-installations-schedule-resource.ts\nvar SurveysInstallationsScheduleResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(installationId, payload) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/schedule`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync delete(installationId) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/schedule`, { method: \"DELETE\" })).json();\n\t}\n};\n//#endregion\n//#region src/surveys/surveys-installations/surveys-installations-surveys-resource.ts\nvar SurveysInstallationsSurveysResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(installationId) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/surveys`, { method: \"GET\" })).json();\n\t}\n\tasync active(installationId) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/surveys/active`, { method: \"GET\" })).json();\n\t}\n\tasync latest(installationId) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/surveys/latest`, { method: \"GET\" })).json();\n\t}\n\tasync updateClosedAt(installationId, payload) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/surveys/closed-at`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync filters(installationId, surveyId) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/surveys/${surveyId}/filters`, { method: \"GET\" })).json();\n\t}\n\tasync participants(installationId, surveyId, query) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/surveys/${surveyId}/participants`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery\n\t\t})).json();\n\t}\n\tasync questions(installationId, surveyId) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/surveys/${surveyId}/questions`, { method: \"GET\" })).json();\n\t}\n\tasync results(installationId, surveyId, query) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/surveys/${surveyId}/results`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/surveys/surveys-installations/surveys-installations-resource.ts\nvar SurveysInstallationsResource = class {\n\tclient;\n\tschedule;\n\tquestions;\n\tsurveys;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.schedule = new SurveysInstallationsScheduleResource(client);\n\t\tthis.questions = new SurveysInstallationsQuestionsResource(client);\n\t\tthis.surveys = new SurveysInstallationsSurveysResource(client);\n\t}\n\tasync create(installationId) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}`, { method: \"POST\" })).json();\n\t}\n\tasync publish(installationId, payload) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/publish`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync feedback(installationId, payload) {\n\t\tawait this.client.request(`/api/surveys/installations/${installationId}/feedback`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n\tasync setOneTimeSchedule(installationId, payload) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/one-time-schedule`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync setResultSharing(installationId, payload) {\n\t\tawait this.client.request(`/api/surveys/installations/${installationId}/result-sharing`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n\tasync export(installationId, locale) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/export`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery: { locale }\n\t\t})).text();\n\t}\n\tasync results(installationId, query) {\n\t\treturn (await this.client.request(`/api/surveys/installations/${installationId}/results`, {\n\t\t\tmethod: \"GET\",\n\t\t\tquery\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/surveys/surveys-resource.ts\nvar SurveysResource = class {\n\tclient;\n\tinstallations;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.installations = new SurveysInstallationsResource(client);\n\t}\n};\n//#endregion\n//#region src/tags/tags-resource.ts\nvar TagsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"api/tags\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/teams-notifications/teams-notifications-resource.ts\nvar TeamsNotificationsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getSettings(signal) {\n\t\treturn (await this.client.request(`/api/msteams/settings`, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/templates/templates-resource.ts\nconst PATH = \"/api/templates\";\nvar TemplatesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(payload, signal) {\n\t\treturn (await this.client.request(PATH, {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"content-type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t})).json();\n\t}\n\tasync get(templateId, signal) {\n\t\treturn (await this.client.request(`${PATH}/${templateId}`, { signal })).json();\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(PATH, { signal })).json();\n\t}\n};\n//#endregion\n//#region src/theming/fonts/font-resource.ts\nvar FontResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(data, signal) {\n\t\treturn (await this.client.request(\"/api/theming/fonts\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.theming.fonts.create+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/theming/fonts/${id}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync retrieveMetadata(url, signal) {\n\t\treturn (await this.client.request(\"/api/theming/fonts/metadata\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({ url }),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.theming.fonts.fonturl+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync upload(file, signal) {\n\t\tconst body = new FormData();\n\t\tbody.append(\"fontFile\", file);\n\t\treturn (await this.client.request(\"/api/theming/fonts/upload\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody,\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(`/api/theming/fonts`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(id, data, signal) {\n\t\tawait this.client.request(`/api/theming/fonts/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.theming.fonts.update+json\" },\n\t\t\tsignal\n\t\t});\n\t}\n\tasync delete(id, optionsOrSignal, signal) {\n\t\tconst isSignal = optionsOrSignal instanceof AbortSignal;\n\t\tawait this.client.request(`/api/theming/fonts/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tquery: isSignal ? void 0 : { ...optionsOrSignal },\n\t\t\tsignal: isSignal ? optionsOrSignal : signal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/theming/theming-resource.ts\nconst themeDiscoverHeaderMap = {\n\tEMAIL: \"application/vnd.staffbase.theming.theme.email+json\",\n\tDESKTOP: \"application/vnd.staffbase.theming.theme.desktop+json\",\n\tMOBILE: \"application/vnd.staffbase.theming.theme.mobile+json\"\n};\nvar ThemingResource = class {\n\tclient;\n\tfonts;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.fonts = new FontResource(client);\n\t}\n\tasync discover(channel, signal) {\n\t\tconst acceptHeader = themeDiscoverHeaderMap[channel];\n\t\treturn await (await this.client.request(\"/api/theming/discover\", {\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: acceptHeader },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync create(data, signal) {\n\t\tawait this.client.request(\"/api/theming/themes\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.theming.themes.theme+json\" },\n\t\t\tsignal\n\t\t});\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/theming/themes/${id}`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync primary(signal) {\n\t\treturn (await this.client.request(`/api/theming/themes/primary`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync list(signal) {\n\t\treturn (await this.client.request(`/api/theming/themes`, {\n\t\t\tmethod: \"GET\",\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync update(id, data, signal) {\n\t\tawait this.client.request(`/api/theming/themes/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.theming.themes.theme+json\" },\n\t\t\tsignal\n\t\t});\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`/api/theming/themes/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\tsignal\n\t\t});\n\t}\n\tasync preview(data, signal) {\n\t\treturn (await this.client.request(`/api/theming/themes/preview`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.theming.themes.theme+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/tokens/tokens-resource.ts\nvar TokensResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync create(data) {\n\t\treturn (await this.client.request(\"/api/tokens\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/tokens/${id}`, { signal })).json();\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/tokens/${id}`, { method: \"DELETE\" });\n\t}\n\tasync update(id, data) {\n\t\treturn (await this.client.request(`/api/tokens/${id}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"/api/tokens\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync rotate(id) {\n\t\treturn (await this.client.request(`/api/tokens/${id}/rotate`, { method: \"POST\" })).json();\n\t}\n};\n//#endregion\n//#region src/tracking/events/tracking-events-resource.ts\n/**\n* Resource for tracking events via the tracking-server.\n* Sends CloudEvents to the tracking-server which publishes them to NATS JetStream.\n*\n* @see https://github.com/Staffbase/tracking-server/blob/main/docs/API.md\n*/\nvar TrackingEventsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Submit a single analytics event to the tracking server.\n\t*\n\t* @param payload - The event payload containing source, type, and data\n\t* @param signal - Optional AbortSignal for cancellation\n\t* @returns Response with event_id and nats_subject\n\t*/\n\tasync createEvent(payload, signal) {\n\t\treturn (await this.client.request(\"/api/events\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\tAccept: \"application/json\",\n\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/tracking/view/tracking-view-resource.ts\nvar TrackingViewResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* Track the user viewing a menu folder node.\n\t*\n\t* @param menuNodeId - The ObjectId of the menu folder.\n\t* @param payload - Optional index and UTM tracking parameters.\n\t*/\n\tasync menu(menuNodeId, payload = {}) {\n\t\tawait this.client.request(`/api/tracking/view/menu/${menuNodeId}`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n\t/**\n\t* Track the user viewing a plugin installation.\n\t*\n\t* @param installationId - The ObjectId of the installation.\n\t* @param payload - Optional index and UTM tracking parameters.\n\t*/\n\tasync installation(installationId, payload = {}) {\n\t\tawait this.client.request(`/api/tracking/view/installation/${installationId}`, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(payload)\n\t\t});\n\t}\n};\n//#endregion\n//#region src/tracking/tracking-resource.ts\nvar TrackingResource = class {\n\tclient;\n\tview;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.view = new TrackingViewResource(client);\n\t}\n\tasync event(event) {\n\t\tawait this.client.request(\"/tracking/event\", {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tbody: JSON.stringify(event)\n\t\t});\n\t}\n};\n//#endregion\n//#region src/translations/translations-resource.ts\nvar TranslationsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\t/**\n\t* @deprecated Use translateHtml instead\n\t*/\n\tasync translate(payload, signal) {\n\t\treturn this.translateHtml(payload, signal);\n\t}\n\t/**\n\t* Translates plain text and HTML content from a source language to a target language.\n\t* Requires the content_translation feature flag to be enabled for the branch.\n\t*\n\t* @param payload - HTML translation request with source/target languages and content map\n\t* @param signal - Optional abort signal\n\t* @returns Translated HTML content\n\t*/\n\tasync translateHtml(payload, signal) {\n\t\treturn (await this.client.request(\"/api/translations\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.translations.html.v1+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\t/**\n\t* Translates content documents from a source language to a target language.\n\t* Requires the content_translation feature flag to be enabled for the branch.\n\t*\n\t* @param payload - Content document translation request with source/target languages and document\n\t* @param signal - Optional abort signal\n\t* @returns Translated content document\n\t*/\n\tasync translateContentDocument(payload, signal) {\n\t\treturn (await this.client.request(\"/api/translations\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.translations.content_document.v1+json\" },\n\t\t\tsignal\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/trash/trash-resource.ts\nvar TrashResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync list(params, signal) {\n\t\treturn (await this.client.request(\"/api/trash\", {\n\t\t\tsignal,\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\tasync restore(id, signal) {\n\t\treturn this.client.request(`/api/trash/${id}/restore`, {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\"\n\t\t});\n\t}\n\tasync delete(id, signal) {\n\t\treturn this.client.request(`/api/trash/${id}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"DELETE\"\n\t\t});\n\t}\n};\n//#endregion\n//#region src/users/old-users-resource.ts\nvar OldUsersResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/users/${id}`, {\n\t\t\tsignal,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.user.v2+json\" }\n\t\t})).json();\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"api/users\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync create(data) {\n\t\treturn (await this.client.request(\"/api/users\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync delete(id, signal) {\n\t\tawait this.client.request(`/api/users/${id}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"DELETE\"\n\t\t});\n\t}\n\tasync update(id, data) {\n\t\treturn (await this.client.request(`/api/users/${id}`, {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync updateConfig(id, data) {\n\t\tawait this.client.request(`/api/users/${id}/config`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(data),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n\tasync getGroupsFor(id, signal) {\n\t\treturn (await this.client.request(`/api/users/${id}/groups`, { signal })).json();\n\t}\n\tasync trackedcount(signal) {\n\t\treturn (await this.client.request(\"api/users/trackedcount\", { signal })).json();\n\t}\n};\n//#endregion\n//#region src/users/imports/permissions/imports-permissions-resource.ts\nconst CONTENT_TYPE_GET$2 = \"application/vnd.staffbase.csv-import-permissions.v1+json\";\nconst CONTENT_TYPE_ADD$2 = \"application/vnd.staffbase.csv-import-permissions-add.v1+json\";\nconst CONTENT_TYPE_REMOVE$2 = \"application/vnd.staffbase.csv-import-permissions-remove.v1+json\";\nconst CONTENT_TYPE_DISCOVER$1 = \"application/vnd.staffbase.csv-import-permissions-discover.v1+json\";\nvar ImportsPermissionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/users/imports/permissions\", {\n\t\t\theaders: { Accept: CONTENT_TYPE_GET$2 },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync discover(signal) {\n\t\treturn (await this.client.request(\"/api/users/imports/permissions/discover\", {\n\t\t\theaders: { Accept: CONTENT_TYPE_DISCOVER$1 },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync add(payload, signal) {\n\t\tawait this.client.request(\"/api/users/imports/permissions\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": CONTENT_TYPE_ADD$2,\n\t\t\t\tAccept: CONTENT_TYPE_ADD$2\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync remove(payload, signal) {\n\t\tawait this.client.request(\"/api/users/imports/permissions\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": CONTENT_TYPE_REMOVE$2,\n\t\t\t\tAccept: CONTENT_TYPE_REMOVE$2\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/users/imports/imports-resource.ts\nvar ImportsResource = class {\n\tclient;\n\tpermissions;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.permissions = new ImportsPermissionsResource(client);\n\t}\n\tasync getConfig(id, signal) {\n\t\treturn (await this.client.request(`/api/users/imports/${id}/config`, { signal })).json();\n\t}\n\tasync getDetail(id, signal) {\n\t\treturn (await this.client.request(`/api/users/imports/${id}`, { signal })).json();\n\t}\n\tasync getHead(id, params, signal) {\n\t\treturn (await this.client.request(`/api/users/imports/${id}/head`, {\n\t\t\tsignal,\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\tasync getStatus(id, signal) {\n\t\treturn (await this.client.request(`/api/users/imports/${id}/status`, { signal })).json();\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"/api/users/imports\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/users/imports/${id}`, { method: \"DELETE\" });\n\t}\n\tasync start(id, state) {\n\t\tawait this.client.request(`/api/users/imports/${id}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify({ state }),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n\tasync updateConfig(id, settings) {\n\t\tawait this.client.request(`/api/users/imports/${id}/config`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(settings),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n\tasync upload(file) {\n\t\tconst body = new FormData();\n\t\tbody.append(\"file\", file);\n\t\tawait this.client.request(\"/api/users/imports\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody\n\t\t});\n\t}\n};\n//#endregion\n//#region src/users/integrations/permissions/integrations-permissions-resource.ts\nconst CONTENT_TYPE_GET$1 = \"application/vnd.staffbase.user-integration-permissions.v1+json\";\nconst CONTENT_TYPE_ADD$1 = \"application/vnd.staffbase.user-integration-permissions-add.v1+json\";\nconst CONTENT_TYPE_REMOVE$1 = \"application/vnd.staffbase.user-integration-permissions-remove.v1+json\";\nconst CONTENT_TYPE_DISCOVER = \"application/vnd.staffbase.user-integration-permissions-discover.v1+json\";\nvar IntegrationsPermissionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/users/integrations/permissions\", {\n\t\t\theaders: { Accept: CONTENT_TYPE_GET$1 },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync discover(signal) {\n\t\treturn (await this.client.request(\"/api/users/integrations/permissions/discover\", {\n\t\t\theaders: { Accept: CONTENT_TYPE_DISCOVER },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync add(payload, signal) {\n\t\tawait this.client.request(\"/api/users/integrations/permissions\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": CONTENT_TYPE_ADD$1,\n\t\t\t\tAccept: CONTENT_TYPE_ADD$1\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync remove(payload, signal) {\n\t\tawait this.client.request(\"/api/users/integrations/permissions\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": CONTENT_TYPE_REMOVE$1,\n\t\t\t\tAccept: CONTENT_TYPE_REMOVE$1\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/users/integrations/integrations-resource.ts\nvar IntegrationsResource = class {\n\tclient;\n\tpermissions;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.permissions = new IntegrationsPermissionsResource(client);\n\t}\n\tasync create(payload) {\n\t\treturn (await this.client.request(`/api/users/integrations`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t})).json();\n\t}\n\tasync list(options, signal) {\n\t\treturn (await this.client.request(\"/api/users/integrations\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options }\n\t\t})).json();\n\t}\n\tasync getConfig(id, signal) {\n\t\treturn (await this.client.request(`/api/users/integrations/${id}/config`, { signal })).json();\n\t}\n\tasync updateConfig(id, payload) {\n\t\tawait this.client.request(`/api/users/integrations/${id}/config`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n\tasync getHead(id, signal) {\n\t\treturn (await this.client.request(`/api/users/integrations/${id}/head`, { signal })).json();\n\t}\n\tasync getGroups(id, params, signal) {\n\t\treturn (await this.client.request(`/api/users/integrations/${id}/groups`, {\n\t\t\tsignal,\n\t\t\tquery: { ...params }\n\t\t})).json();\n\t}\n\tasync getStatus(id, signal) {\n\t\treturn (await this.client.request(`/api/users/integrations/${id}/status`, { signal })).json();\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/users/integrations/${id}`, { method: \"DELETE\" });\n\t}\n\tasync update(id, payload) {\n\t\tawait this.client.request(`/api/users/integrations/${id}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"content-type\": \"application/json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/users/permissions/users-permissions-resource.ts\nconst CONTENT_TYPE_GET = \"application/vnd.staffbase.accessors.users-permissions.v1+json\";\nconst CONTENT_TYPE_ADD = \"application/vnd.staffbase.accessors.users-permissions-add.v1+json\";\nconst CONTENT_TYPE_REMOVE = \"application/vnd.staffbase.accessors.users-permissions-remove.v1+json\";\nvar UsersPermissionsResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/users/permissions\", {\n\t\t\theaders: { Accept: CONTENT_TYPE_GET },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync add(payload, signal) {\n\t\tawait this.client.request(\"/api/users/permissions\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": CONTENT_TYPE_ADD,\n\t\t\t\tAccept: CONTENT_TYPE_ADD\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n\tasync remove(payload, signal) {\n\t\tawait this.client.request(\"/api/users/permissions\", {\n\t\t\tmethod: \"PATCH\",\n\t\t\theaders: {\n\t\t\t\t\"content-type\": CONTENT_TYPE_REMOVE,\n\t\t\t\tAccept: CONTENT_TYPE_REMOVE\n\t\t\t},\n\t\t\tbody: JSON.stringify(payload),\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/users/user-export/user-export-resource.ts\nvar UserExportResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync start(payload) {\n\t\tawait this.client.request(\"/api/users/exports\", {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: { \"Content-Type\": \"application/vnd.staffbase.csv-export.export-create.v1+json\" }\n\t\t});\n\t}\n\tasync delete() {\n\t\tawait this.client.request(\"/api/users/exports\", {\n\t\t\tmethod: \"DELETE\",\n\t\t\theaders: { Accept: \"application/vnd.staffbase.csv-export.export-delete.v1+json\" }\n\t\t});\n\t}\n};\n//#endregion\n//#region src/users/users-resource.ts\nvar UsersResource = class {\n\tclient;\n\texport;\n\tintegrations;\n\timports;\n\tpermissions;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t\tthis.export = new UserExportResource(this.client);\n\t\tthis.integrations = new IntegrationsResource(client);\n\t\tthis.imports = new ImportsResource(client);\n\t\tthis.permissions = new UsersPermissionsResource(client);\n\t}\n\tasync list(options, signal) {\n\t\tconst version = \"application/vnd.staffbase.accessors.users.v2+json\";\n\t\treturn (await this.client.request(\"/api/users\", {\n\t\t\tsignal,\n\t\t\tquery: { ...options },\n\t\t\theaders: { Accept: version }\n\t\t})).json();\n\t}\n\tasync invite(payload, signal) {\n\t\treturn (await this.client.request(\"/api/users\", {\n\t\t\tsignal,\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: {\n\t\t\t\t\"content-type\": \"application/vnd.staffbase.accessors.user-invite.v2+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.accessors.user.v3+json\"\n\t\t\t}\n\t\t})).json();\n\t}\n\tasync get(id, signal) {\n\t\treturn (await this.client.request(`/api/users/${id}`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.user.v3+json\" }\n\t\t})).json();\n\t}\n\tasync update(id, payload) {\n\t\treturn (await this.client.request(`/api/users/${id}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: {\n\t\t\t\t\"content-type\": \"application/vnd.staffbase.accessors.user-update.v1+json\",\n\t\t\t\tAccept: \"application/vnd.staffbase.accessors.user.v3+json\"\n\t\t\t}\n\t\t})).json();\n\t}\n\tasync delete(id) {\n\t\tawait this.client.request(`/api/users/${id}`, {\n\t\t\tmethod: \"DELETE\",\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.user-delete.v2+json\" }\n\t\t});\n\t}\n\tasync search(options, signal) {\n\t\tconst version = \"application/vnd.staffbase.accessors.users-search.v1+json\";\n\t\tconst { filter, ...rest } = options || {};\n\t\tconst params = {\n\t\t\tfilter: transformFilters(filter ?? {}),\n\t\t\t...rest\n\t\t};\n\t\treturn (await this.client.request(\"/api/users/search\", {\n\t\t\tsignal,\n\t\t\tquery: { ...params },\n\t\t\theaders: { Accept: version }\n\t\t})).json();\n\t}\n\tasync groupIds(id, signal) {\n\t\treturn (await this.client.request(`/api/users/${id}/groups`, {\n\t\t\tsignal,\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.user.groups.v1+json\" }\n\t\t})).json();\n\t}\n\tasync groups(id, options, signal) {\n\t\tconst version = \"application/vnd.staffbase.accessors.user.groups-search.v1+json\";\n\t\treturn (await this.client.request(`/api/users/${id}/groups/search`, {\n\t\t\tsignal,\n\t\t\tquery: { ...options },\n\t\t\theaders: { Accept: version }\n\t\t})).json();\n\t}\n\tasync logout(id) {\n\t\tawait this.client.request(`/api/users/${id}/sessions`, { method: \"DELETE\" });\n\t}\n\tasync recoveryCode(id, signal) {\n\t\treturn (await this.client.request(`/api/users/${id}/recovery-code`, {\n\t\t\tsignal,\n\t\t\tmethod: \"GET\",\n\t\t\theaders: { Accept: \"application/vnd.staffbase.accessors.user.recovery-code.v1+json\" }\n\t\t})).json();\n\t}\n};\n//#endregion\n//#region src/version/version-resource.ts\nvar VersionResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync get(signal) {\n\t\treturn (await this.client.request(\"/api/version\", { signal })).json();\n\t}\n};\n//#endregion\n//#region src/welcome-pages/welcome-pages-resource.ts\nconst WELCOME_PAGE_SETTINGS_V1_JSON = \"application/vnd.staffbase.welcome-page.settings.v1+json\";\nconst WELCOME_PAGE_VIEW_V1_JSON = \"application/vnd.staffbase.welcome-page.view.v1+json\";\nvar WelcomePagesResource = class {\n\tclient;\n\tconstructor(client) {\n\t\tthis.client = client;\n\t}\n\tasync getSettings(signal) {\n\t\treturn (await this.client.request(\"/api/welcome-page\", {\n\t\t\theaders: { Accept: WELCOME_PAGE_SETTINGS_V1_JSON },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync putSettings(payload, signal) {\n\t\treturn (await this.client.request(\"/api/welcome-page\", {\n\t\t\tmethod: \"PUT\",\n\t\t\tbody: JSON.stringify(payload),\n\t\t\theaders: {\n\t\t\t\t\"Content-Type\": WELCOME_PAGE_SETTINGS_V1_JSON,\n\t\t\t\tAccept: WELCOME_PAGE_SETTINGS_V1_JSON\n\t\t\t},\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync getView(device, signal) {\n\t\treturn (await this.client.request(\"/api/welcome-page\", {\n\t\t\theaders: { Accept: WELCOME_PAGE_VIEW_V1_JSON },\n\t\t\tquery: { device },\n\t\t\tsignal\n\t\t})).json();\n\t}\n\tasync confirm(signal) {\n\t\tawait this.client.request(\"/api/welcome-page/confirmation\", {\n\t\t\tmethod: \"PUT\",\n\t\t\tsignal\n\t\t});\n\t}\n};\n//#endregion\n//#region src/broadcast/types.ts\nlet BroadcastNotificationChannel = /* @__PURE__ */ function(BroadcastNotificationChannel) {\n\tBroadcastNotificationChannel[\"email\"] = \"email\";\n\tBroadcastNotificationChannel[\"push\"] = \"push\";\n\tBroadcastNotificationChannel[\"notificationCenter\"] = \"notificationCenter\";\n\tBroadcastNotificationChannel[\"sms\"] = \"sms\";\n\treturn BroadcastNotificationChannel;\n}({});\n//#endregion\n//#region src/comments/types.ts\nlet CommentParentType = /* @__PURE__ */ function(CommentParentType) {\n\tCommentParentType[\"Comment\"] = \"comment\";\n\tCommentParentType[\"Post\"] = \"post\";\n\treturn CommentParentType;\n}({});\n//#endregion\n//#region src/communities/types.ts\nlet CommunityTypes = /* @__PURE__ */ function(CommunityTypes) {\n\tCommunityTypes[\"Open\"] = \"open\";\n\tCommunityTypes[\"OpenReadOnly\"] = \"openReadOnly\";\n\tCommunityTypes[\"Closed\"] = \"closed\";\n\tCommunityTypes[\"Secret\"] = \"secret\";\n\treturn CommunityTypes;\n}({});\nlet CommunityCommentStatus = /* @__PURE__ */ function(CommunityCommentStatus) {\n\tCommunityCommentStatus[\"Published\"] = \"published\";\n\tCommunityCommentStatus[\"Deleted\"] = \"deleted\";\n\treturn CommunityCommentStatus;\n}({});\nlet CommentReactionType = /* @__PURE__ */ function(CommentReactionType) {\n\tCommentReactionType[\"Like\"] = \"like\";\n\tCommentReactionType[\"Celebrate\"] = \"celebrate\";\n\tCommentReactionType[\"Support\"] = \"support\";\n\tCommentReactionType[\"Insightful\"] = \"insightful\";\n\tCommentReactionType[\"Thanks\"] = \"thanks\";\n\treturn CommentReactionType;\n}({});\n//#endregion\n//#region src/editorial-calendar/types.ts\nlet CalendarEventType = /* @__PURE__ */ function(CalendarEventType) {\n\tCalendarEventType[\"Event\"] = \"EVENT\";\n\treturn CalendarEventType;\n}({});\n//#endregion\n//#region src/installation/types.ts\nconst InstallationAccessRights = {\n\tALTER_ICON: \"ALTER_ICON\",\n\t/** Alter the content of the installation. For installation admins. */\n\tCONTENT: \"CONTENT\",\n\t/**\n\t* Alter the content of the installation, but only in the scope of what one created oneself\n\t*/\n\tCONTRIBUTE: \"CONTRIBUTE\",\n\t/**\n\t* Modify the settings as well as display properties of this installation. For installation\n\t* owners.\n\t*/\n\tMODIFY: \"MODIFY\",\n\t/** Transfer the ownership of the installation. Only for installation owners. */\n\tTRANSFER_OWNERSHIP: \"TRANSFER_OWNERSHIP\",\n\t/** Delete the plugin installation. Only for installation owners. */\n\tDELETE: \"DELETE\",\n\t/**\n\t* User is allowed to modify the settings of the installation (only contributors don't have this\n\t* right)\n\t*/\n\tMODIFY_SETTINGS: \"MODIFY_SETTINGS\"\n};\n//#endregion\n//#region src/medialibrary/types.ts\nconst MediaLibraryDiscoveryRights = { ACCESS_FILE_MANAGER: \"ACCESS_FILE_MANAGER\" };\n//#endregion\n//#region src/menu/types.ts\nconst MenuNodeTypes = {\n\tfolder: \"folder\",\n\tinstallation: \"installation\"\n};\n/**\n* The feed type(s) a news page (menu folder restricted to the `news` plugin) offers: `dashboard`\n* (\"Top News\" — channels grouped, each with a few most-recent posts) and/or `posts` (\"Recent News\"\n* — a flat, newest-first stream across all of the page's channels). Only present on news pages.\n*/\nconst NewsFeedTypes = {\n\tdashboard: \"dashboard\",\n\tposts: \"posts\"\n};\n//#endregion\n//#region src/news/types.ts\nconst ContentTypes = {\n\tarticles: \"articles\",\n\tupdates: \"updates\",\n\tpictures: \"pictures\"\n};\nconst NewspageRights = { contribute: \"CONTRIBUTE\" };\nconst NewsNotificationChannels = {\n\temail: \"email\",\n\tpush: \"push\"\n};\nconst PrimaryMediaTypes = {\n\tBIG_FIRST: \"big-first\",\n\tBIG: \"big\",\n\tSMALL: \"small\"\n};\nconst WeArticleSources = {\n\tapp: \"app\",\n\tdemo: \"demo\",\n\tfeed: \"feed\",\n\texternal: \"external\"\n};\nconst WeArticleStates = {\n\tpublished: \"published\",\n\tunpublished: \"unpublished\",\n\tscheduled: \"scheduled\"\n};\nconst NewsAiGenerationTypes = {\n\ttitle: \"title\",\n\tteaser: \"teaser\",\n\ttextShorter: \"text_shorter\",\n\ttextLonger: \"text_longer\",\n\ttextBulletList: \"text_bullet_list\",\n\ttextSummarize: \"text_summarize\",\n\ttextToneCasual: \"text_tone_casual\",\n\ttextToneConfident: \"text_tone_confident\",\n\ttextToneEmpathetic: \"text_tone_empathetic\",\n\ttextToneFriendly: \"text_tone_friendly\",\n\ttextToneProfessional: \"text_tone_professional\",\n\tcustom: \"custom\"\n};\n//#endregion\n//#region src/plugins/tasks/comments/types.ts\nlet TaskCommentStatus = /* @__PURE__ */ function(TaskCommentStatus) {\n\tTaskCommentStatus[\"Published\"] = \"PUBLISHED\";\n\tTaskCommentStatus[\"Deleted\"] = \"DELETED\";\n\tTaskCommentStatus[\"PermanentlyDeleted\"] = \"PERMANENTLY_DELETED\";\n\treturn TaskCommentStatus;\n}({});\nlet TaskCommentReactionType = /* @__PURE__ */ function(TaskCommentReactionType) {\n\tTaskCommentReactionType[\"Like\"] = \"like\";\n\tTaskCommentReactionType[\"Celebrate\"] = \"celebrate\";\n\tTaskCommentReactionType[\"Insightful\"] = \"insightful\";\n\tTaskCommentReactionType[\"Support\"] = \"support\";\n\tTaskCommentReactionType[\"Thanks\"] = \"thanks\";\n\treturn TaskCommentReactionType;\n}({});\n//#endregion\n//#region src/reactions/types.ts\nconst ReactionParentType = {\n\tcomment: \"comment\",\n\tpost: \"post\",\n\tmessage: \"message\"\n};\n//#endregion\n//#region src/shorts/types.ts\nlet ShortsRight = /* @__PURE__ */ function(ShortsRight) {\n\tShortsRight[\"contribute\"] = \"CONTRIBUTE\";\n\treturn ShortsRight;\n}({});\n//#endregion\n//#region src/teams-notifications/types.ts\nconst MsTeamsAppTypes = [\"staffbase\", \"custom\"];\n//#endregion\n//#region src/tinymce/types.ts\nconst TINYMCE_MESSAGE_TYPES = {\n\tREADY: \"tinymce-ready\",\n\tCHANGE: \"tinymce-change\",\n\tERROR: \"tinymce-error\",\n\tHEIGHT_CHANGE: \"tinymce-height-change\",\n\tMODAL_OPEN: \"tinymce-modal-open\",\n\tMODAL_CLOSE: \"tinymce-modal-close\",\n\tSET_CONTENT: \"tinymce-set-content\"\n};\n//#endregion\n//#region src/users/types.ts\nconst UserRoles = [\n\t{\n\t\tid: \"WeBranchRestrictedReaderRole\",\n\t\tname: \"restricted\"\n\t},\n\t{\n\t\tid: \"WeBranchReaderRole\",\n\t\tname: \"reader\"\n\t},\n\t{\n\t\tid: \"WeBranchModeratorRole\",\n\t\tname: \"moderator\"\n\t},\n\t{\n\t\tid: \"WeBranchManagingEditorRole\",\n\t\tname: \"editor\"\n\t},\n\t{\n\t\tid: \"WeBranchAdminRole\",\n\t\tname: \"admin\"\n\t}\n];\n//#endregion\n//#region src/client.ts\nvar FrontendApiClient = class extends BaseClient {\n\taiAssist = new AIPagesAssistResource(this);\n\taiAssistant = new AIAssistantResource(this);\n\taiPodcast = new AIPodcastResource(this);\n\taiSettings = new AiSettingsResource(this);\n\taiContextAndControl = { guidelines: new GuidelinesResource(this) };\n\tcontentAssistant = new ContentAssistantResource(this);\n\tnewsAiGeneration = new NewsAiGenerationResource(this);\n\tauth = new AuthResource(this);\n\tanalytics = {\n\t\tassets: new AssetsMaterializationsResource(this),\n\t\tcampaign: new CampaignAnalyticsResource(this),\n\t\tchat: new AnalyticsChatResource(this),\n\t\temail: new AggregatedEmailAnalyticsResource(this),\n\t\tgroups: new AnalyticsGroupsResource(this),\n\t\tmisc: new AnalyticsMiscResource(this),\n\t\tpages: new PagesAnalyticsResource(this),\n\t\tpost: new AnalyticsPostResource(this),\n\t\tsearch: new AnalyticsSearchResource(this),\n\t\tsemantic: new AnalyticsSemanticResource(this),\n\t\ttrackingConfig: new AnalyticsTrackingConfigResource(this)\n\t};\n\tapprovals = new ApprovalsResource(this);\n\tbookmarks = new BookmarksResource(this);\n\tbranch = new BranchesResource(this);\n\tbroadcast = new BroadcastResource(this);\n\tbriefings = new BriefingsResource(this);\n\t/**\n\t* endpoints for accessing (not managing) news\n\t*/\n\tclient = new ClientResource(this);\n\tinstrumentation = new InstrumentationResource(this);\n\tdiscovery = new DiscoveryResource(this);\n\teditorialCalendar = new EditorialCalendarResource(this);\n\tcampaigns = new CampaignsResource(this);\n\tchannels = new ChannelsResource(this);\n\tshorts = new ShortsResource(this);\n\trolloutGuard = new RolloutGuardResource(this);\n\tcommmentModeration = new CommentModerationResource(this);\n\tcommunityManagement = new CommunityManagementResource(this);\n\tcommunities = new CommunitiesResource(this);\n\tcomments = new CommentsResource(this);\n\tcontentMigration = new ContentMigrationResource(this);\n\tcssMigration = new CssMigrationResource(this);\n\tdomainManagement = new DomainManagementResource(this);\n\t/**\n\t* Email is a special case that creates its own base client.\n\t* The URL and headers are derived from the public `authInfo` setter.\n\t*\n\t* To use email, first authenticate using the `auth.email()` function then apply\n\t* the returned object to `email.authInfo`.\n\t*/\n\temail = new EmailResource();\n\temailPerformance = new EmailPerformanceResource(this);\n\tfeatures = new FeaturesResource(this);\n\tfooter = new FooterResource(this);\n\t/**\n\t* @deprecated use new groups api (client.groups) instead\n\t*/\n\toldGroups = new OldGroupsResource(this);\n\tgroups = new GroupsResource$1(this);\n\tinstallations = new InstallationsResource(this);\n\ti18n = new I18nResource(this);\n\tlaunchpad = new LaunchpadResource(this);\n\tlogs = new LogsResource(this);\n\tmedia = new MediaResource(this);\n\tmedialibrary = new MedialibraryResource(this);\n\tmenu = new MenuResource(this);\n\tnotifications = new NotificationsResource(this);\n\toauthClients = new OAuthClientsResource(this);\n\tpages = new PagesResource(this);\n\tpasskeys = new PasskeysResource(this);\n\tplugins = new PluginsResource(this);\n\tposts = new PostsResource(this);\n\tpushNotifications = new PushNotificationsResource(this);\n\treactionsCount = new ReactionsCountResource(this);\n\tsanitization = new SanitizationResource(this);\n\tsearch = new SearchResource(this);\n\tscreens = new ScreensResource(this);\n\tsentiment = new SentimentResource(this);\n\tsessions = new SessionsResource(this);\n\tspaces = new SpacesResource(this);\n\t/**\n\t* @deprecated use new users api (client.users) instead\n\t*/\n\toldUsers = new OldUsersResource(this);\n\tusers = new UsersResource(this);\n\tversion = new VersionResource(this);\n\twelcomePages = new WelcomePagesResource(this);\n\tprofiles = new ProfilesResource(this);\n\tstudio = new StudioResource(this);\n\tsurveys = new SurveysResource(this);\n\ttags = new TagsResource(this);\n\ttheming = new ThemingResource(this);\n\ttokens = new TokensResource(this);\n\ttranslations = new TranslationsResource(this);\n\tintegrations = new IntegrationsResource$1(this);\n\tchunkedMedia = new ChunkedMediaResource(this);\n\ttrash = new TrashResource(this);\n\trecoveries = new RecoveriesResource(this);\n\tmergeDev = new MergeDevResource(this);\n\tplanning = new PlanningResource(this);\n\tteamsNotifications = new TeamsNotificationsResource(this);\n\ttemplates = new TemplatesResource(this);\n\ttracking = new TrackingResource(this);\n\t/**\n\t* New tracking events resource for the tracking-server.\n\t* Sends CloudEvents to the tracking-server which publishes them to NATS JetStream.\n\t* @see https://github.com/Staffbase/tracking-server/blob/main/docs/API.md\n\t*/\n\ttrackingEvents = new TrackingEventsResource(this);\n\tquicklinks = new QuicklinksResource(this);\n\treactions = new ReactionsResource(this);\n\twellknown = new WellKnownResource(this);\n\tipRanges = new IpRangesResource(this);\n\tevents = new CompanyEventsResource(this);\n\tssoConfigs = new SsoConfigsResource(this);\n\tfeeds = new FeedResource(this);\n};\n//#endregion\nexport { ANALYTICS_TRACKING_CONFIG_MIME_TYPE, ApprovalPriorities, ApprovalSourceTypes, ApprovalStates, BaseClient, BranchAnalyticsResource, BroadcastNotificationChannel, CalendarEventType, CommentParentType, CommentReactionType, CommentRight, CommentStatus, CommunityCommentStatus, CommunityTypes, ContentTypes, CssParseHttpError, DeviceConnectionStatus, DiscoveryRight, ErrorIdentifier, EyoEntityTypes, FrontendApiClient, HTTPError, HttpStatus, InputRequiredError, InstallationAccessRights, InstallationRight, InvalidParameterError, InvalidRecoveryCodeError, MediaLibraryDiscoveryRights, MediaTypes, MenuNodeTypes, MsTeamsAppTypes, NewsAiGenerationTypes, NewsFeedTypes, NewsNotificationChannels, NewspageRights, NotLoggedInError, PrimaryMediaTypes, ProfileFieldFormats, ProfileFieldsNonVisible, ProfilesResource, ReactionParentType, ScreenNewsSourceTypes, ScreensMediaTypes, ScreensRights, ShortsRight, SlideshowOrientations, SlideshowSettingsTabs, SlideshowSourceTypes, TINYMCE_MESSAGE_TYPES, TaskCommentReactionType, TaskCommentStatus, UserRoles, WeArticleSources, WeArticleStates, createFilterString as createUserFilterString, determineError, getQueryString as encodeQuery, getQueryString, isCampaignRankingOrderBy, isSearchOrderBy, transformFilters as transformUserFilters };\n","import {BaseClient} from '@staffbase/api';\n\nimport {\n ActiveSurveyModel,\n ActiveSurveyModelResponse,\n InstallationResultsModel,\n InstallationResultsResponse,\n ParticipantsResponse,\n SurveyResultsResponse\n} from './models';\n\nclass ApiClient extends BaseClient {\n constructor(baseURL?: string) {\n super(baseURL);\n }\n\n public async getActiveSurvey([url]: [string]) {\n const response = (\n await this.request(url, {\n method: 'GET'\n })\n ).json() as Promise;\n\n return ActiveSurveyModel.fromResponse(await response);\n }\n\n public async createFeedback(url: string, {arg}: {arg: {feedback: Record}}): Promise {\n return void (await this.request(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({content: arg.feedback})\n }));\n }\n\n public async getResultsBySurveyId([url]: [url: string]) {\n const response = (\n await this.request(url, {\n method: 'GET'\n })\n ).json() as Promise<{results: SurveyResultsResponse}>;\n\n const {results} = await response;\n return results;\n }\n\n public async getInstallationResults([url]: [url: string]) {\n const response = (\n await this.request(url, {\n method: 'GET'\n })\n ).json() as Promise<{results: InstallationResultsResponse}>;\n\n const {results} = await response;\n return InstallationResultsModel.fromResponse(results);\n }\n\n public async getTotalSurveyParticipants([url]: [url: string]) {\n const response = (\n await this.request(url, {\n method: 'GET'\n })\n ).json() as Promise;\n\n return await response;\n }\n}\n\nexport default ApiClient;\n","import ApiClient from './client';\n\nexport interface EmployeeApiConfig {\n baseURL: string;\n branchSlug: string;\n distributionType: string;\n isNative?: boolean;\n platform: string;\n version: string;\n}\n\nconst DISCOVER_V3_MEDIA_TYPE = 'application/vnd.staffbase.auth.discovery.v3+json';\nconst SAFE_METHODS = new Set(['GET', 'HEAD', 'OPTIONS']);\n\n/**\n * Hosts embed the employee view without handing over the session's CSRF token, but the backend rejects\n * state-changing cookie-authenticated requests that lack it, so the token is read from the session discovery.\n * The call fails soft: without a token the request is sent as before and the backend decides.\n */\nconst fetchCsrfToken = async (client: ApiClient): Promise => {\n try {\n const response = await client.request('auth/discover', {headers: {Accept: DISCOVER_V3_MEDIA_TYPE}});\n const {accessor} = (await response.json()) as {accessor?: {csrfToken?: unknown}};\n return typeof accessor?.csrfToken === 'string' && accessor.csrfToken ? accessor.csrfToken : undefined;\n } catch {\n return undefined;\n }\n};\n\nexport const createEmployeeApiClient = ({\n baseURL,\n branchSlug,\n distributionType,\n isNative,\n platform,\n version\n}: EmployeeApiConfig) => {\n const client = new ApiClient(baseURL);\n client.addBeforeRequestHook(async (req) => {\n req.headers.set(\n 'Staffbase-App',\n `${branchSlug}; platform=${platform}; component=employee-survey; native=${isNative}; distMode=${distributionType}; version=${version}`\n );\n\n if (!SAFE_METHODS.has(req.method)) {\n const csrfToken = await fetchCsrfToken(client);\n if (csrfToken) {\n req.headers.set('X-CSRF-Token', csrfToken);\n }\n }\n\n return new Request(req, {credentials: 'include', mode: 'cors'});\n });\n\n return client;\n};\n","import {useApiContext, useStaffbaseApi} from 'hooks';\nimport {useSWRConfig} from 'swr';\nimport useSWR from 'swr/immutable';\nimport useSWRMutation from 'swr/mutation';\n\nimport {PluginAPI} from '../api';\nimport {createEmployeeApiClient} from '../employeeClient';\n\ninterface useAPIOptions {\n baseURL: string;\n installationId: string;\n /**\n * generates authenticated path\n */\n fetchToken: (installationId: string) => Promise<{jwt: string}>;\n}\n\nexport const useApi = (apiOptions: useAPIOptions) => {\n const context = useApiContext();\n const {baseURL, branchSlug, distributionType, isNative, platform, version} = context.apiConfig ?? {};\n\n if (baseURL && branchSlug && distributionType && platform && version) {\n return {\n client: createEmployeeApiClient({baseURL, branchSlug, distributionType, isNative, platform, version}),\n version: 'v2'\n } as const;\n }\n\n return {client: PluginAPI.fromOptions(apiOptions), version: 'v1'} as const;\n};\n\nexport const useFindOrCreateInstallation = ({installationId}: {installationId: string}) => {\n const {baseURL} = useApiContext();\n const {fetchToken} = useStaffbaseApi();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useFindOrCreateInstallation should not be called from employee view');\n }\n\n return useSWR(['/installation', installationId], client.findOrCreateInstallation.bind(client), {\n keepPreviousData: true\n });\n};\n\nexport const useQuestions = ({installationId}: {installationId: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useQuestions should not be called from employee view');\n }\n\n return useSWR(['/question', installationId], client.getQuestions.bind(client), {keepPreviousData: true});\n};\n\nexport const useQuestion = ({installationId}: {installationId: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useQuestion should not be called from employee view');\n }\n\n return useSWR(['/question', installationId], client.getQuestion.bind(client), {keepPreviousData: true});\n};\n\nexport const useActiveSurvey = ({installationId}: {installationId: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n const endpoint = version === 'v2' ? `api/surveys/installations/${installationId}/surveys/active` : '/survey/active';\n\n // TODO: Might remove explicit types when this is fixed: https://github.com/vercel/swr/issues/4179\n return useSWR>, unknown>(\n [endpoint, installationId],\n client.getActiveSurvey.bind(client),\n {keepPreviousData: true}\n );\n};\n\nexport const useLatestSurvey = ({installationId}: {installationId: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useLatestSurvey should not be called from employee view');\n }\n\n return useSWR(['/survey/latest', installationId], client.getLatestSurvey.bind(client), {\n keepPreviousData: true,\n shouldRetryOnError: false\n });\n};\n\nexport const useCreateQuestion = ({installationId}: {installationId: string}) => {\n const {mutate} = useSWRConfig();\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useCreateQuestion should not be called from employee view');\n }\n\n return useSWRMutation('/question', client.createQuestion.bind(client), {\n onSuccess: () => void mutate(['/question', installationId])\n });\n};\n\nexport const useUpdateQuestion = ({installationId}: {installationId: string}) => {\n const {mutate} = useSWRConfig();\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useUpdateQuestion should not be called from employee view');\n }\n\n return useSWRMutation('/question', client.updateQuestion.bind(client), {\n onSuccess: () => void mutate(['/question', installationId])\n });\n};\n\nexport const useUpdateQuestionPosition = ({installationId}: {installationId: string}) => {\n const {mutate} = useSWRConfig();\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useUpdateQuestionPosition should not be called from employee view');\n }\n\n return useSWRMutation('/question', client.updateQuestionPosition.bind(client), {\n onSuccess: () => void mutate(['/question', installationId])\n });\n};\n\nexport const useDeleteQuestion = ({installationId}: {installationId: string}) => {\n const {mutate} = useSWRConfig();\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useDeleteQuestion should not be called from employee view');\n }\n\n return useSWRMutation('/question', client.deleteQuestion.bind(client), {\n onSuccess: () => void mutate(['/question', installationId])\n });\n};\n\nexport const useScheduleOneTimeSurvey = ({installationId}: {installationId: string}) => {\n const {mutate} = useSWRConfig();\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useScheduleOneTimeSurvey should not be called from employee view');\n }\n\n return useSWRMutation('/installation/one-time-schedule', client.setInstallationOneTimeSchedule.bind(client), {\n onSuccess: () => void mutate(['/installation', installationId])\n });\n};\n\nexport const usePublishSurveyImmediately = ({installationId}: {installationId: string}) => {\n const {mutate} = useSWRConfig();\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('usePublishSurveyImmediately should not be called from employee view');\n }\n\n return useSWRMutation('/installation/publish', client.setInstallationImmediateSchedule.bind(client), {\n onSuccess: () => void mutate(['/installation', installationId])\n });\n};\n\nexport const useScheduleRecurringSurvey = ({installationId}: {installationId: string}) => {\n const {mutate} = useSWRConfig();\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useScheduleRecurringSurvey should not be called from employee view');\n }\n\n return useSWRMutation('/installation/schedule', client.setInstallationRecurringSchedule.bind(client), {\n onSuccess: () => void mutate(['/installation', installationId])\n });\n};\n\nexport const useUpdateSurveyClosedAt = ({installationId}: {installationId: string}) => {\n const {mutate} = useSWRConfig();\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useUpdateSurveyClosedAt should not be called from employee view');\n }\n\n return useSWRMutation('/survey/closed-at', client.updateSurveyClosedAt.bind(client), {\n onSuccess: () => void mutate(['/installation', installationId])\n });\n};\n\nexport const useUpdateResultSharing = ({installationId}: {installationId: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useUpdateResultSharing should not be called from employee view');\n }\n\n return useSWRMutation('/installation/result-sharing', client.updateResultSharing.bind(client));\n};\n\nexport const useInstallationSurveys = ({installationId}: {installationId: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useInstallationSurveys should not be called from employee view');\n }\n\n // TODO: Might remove explicit types when this is fixed: https://github.com/vercel/swr/issues/4179\n return useSWR>, unknown>(\n ['/installation/survey', installationId],\n client.getSurveySeries.bind(client),\n {keepPreviousData: true}\n );\n};\n\nexport const useRemoveSurveySchedule = ({installationId}: {installationId: string}) => {\n const {mutate} = useSWRConfig();\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useRemoveSurveySchedule should not be called from employee view');\n }\n\n return useSWRMutation('/installation/schedule', client.cancelInstallationSchedule.bind(client), {\n onSuccess: () => void mutate(['/installation', installationId])\n });\n};\n\nexport const useSurveyQuestions = ({installationId, surveyId}: {installationId: string; surveyId: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useSurveyQuestions should not be called from employee view');\n }\n\n return useSWR([`/survey/${surveyId}/question`, installationId], client.getQuestionsBySurveyId.bind(client), {\n keepPreviousData: true\n });\n};\n\nexport const useCreateFeedback = ({installationId}: {installationId: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n const endpoint = version === 'v2' ? `api/surveys/installations/${installationId}/feedback` : '/feedback';\n\n // TODO: Might remove explicit types when this is fixed: https://github.com/vercel/swr/issues/4179\n type CreateFeedbackArgs = Parameters[1];\n return useSWRMutation(endpoint, client.createFeedback.bind(client));\n};\n\nexport const useSurveyResults = ({\n filters,\n id,\n installationId\n}: {\n filters?: Record;\n id: string;\n installationId: string;\n}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n const endpoint =\n version === 'v2' ? `api/surveys/installations/${installationId}/surveys/${id}/results` : `/survey/${id}/results`;\n\n return useSWR([endpoint, filters, installationId], client.getResultsBySurveyId.bind(client), {\n keepPreviousData: true\n });\n};\n\nexport const useSurveyFilters = ({id, installationId}: {id: string; installationId: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useSurveyFilters should not be called from employee view');\n }\n\n return useSWR([`/survey/${id}/filters`, installationId], client.getAvailableFiltersBySurveyId.bind(client), {\n keepPreviousData: true\n });\n};\n\nexport const useInstallationResults = ({\n filters,\n installationId\n}: {\n filters?: Record;\n installationId: string;\n}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n const endpoint = version === 'v2' ? `api/surveys/installations/${installationId}/results` : '/installation/result';\n\n return useSWR([endpoint, filters, installationId], client.getInstallationResults.bind(client), {\n keepPreviousData: true\n });\n};\n\nexport const useSurveyParticipants = ({\n filters,\n hasReachedAnonymityLimit,\n installationId,\n surveyId\n}: {\n filters?: Record;\n hasReachedAnonymityLimit: boolean;\n installationId: string;\n surveyId: string;\n}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n const endpoint =\n version === 'v2'\n ? `api/surveys/installations/${installationId}/surveys/${surveyId}/participants`\n : `/survey/${surveyId}/participants`;\n\n return useSWR(\n [endpoint, surveyId, hasReachedAnonymityLimit, filters, installationId],\n client.getTotalSurveyParticipants.bind(client),\n {keepPreviousData: true}\n );\n};\n\nexport const useInstallationExport = ({installationId, locale}: {installationId: string; locale: string}) => {\n const {fetchToken} = useStaffbaseApi();\n const {baseURL} = useApiContext();\n const {client, version} = useApi({installationId, baseURL, fetchToken});\n\n if (version === 'v2') {\n throw new Error('useInstallationExport should not be called from employee view');\n }\n\n return useSWRMutation(['/installation/export', locale, installationId], client.getInstallationExport.bind(client));\n};\n","import styled from '@emotion/styled';\n\nimport {Button, IconName} from '@staffbase/ui';\n\nexport const ButtonWrapper = styled.div`\n display: flex;\n justify-content: flex-end;\n padding: 12px 28px;\n`;\n\nexport const InputLabel = styled.label`\n color: #333;\n display: block;\n font-size: 14px;\n font-weight: 600;\n margin-bottom: 15px;\n\n &:not(:first-of-type) {\n margin-top: 24px;\n }\n`;\n\nexport const QuestionSummary = styled.div`\n display: flex;\n flex: 1;\n flex-direction: column;\n\n hgroup {\n &:not(:first-of-type) {\n margin-top: 24px;\n }\n }\n\n h3 {\n font-size: 14px;\n margin-bottom: 15px;\n }\n`;\n\nexport const WidgetBody = styled.div`\n display: flex;\n flex-direction: column;\n min-height: 284px;\n padding: 48px 32px;\n`;\nexport const WidgetButton = styled.button`\n margin: 0;\n min-width: 80px;\n width: auto;\n`;\n\nexport const ExpandableElementButton = styled(Button)<{char: string}>`\n align-items: center;\n border: none;\n background-color: #ffffff !important;\n display: flex;\n width: auto;\n margin: ${({char}) => (char === IconName.cancel.valueOf() ? '0 0 0 8px' : '20px 0 0 0')};\n\n .we-icon {\n color: #878d92;\n font-size: 16px;\n }\n\n > span {\n color: #878d92;\n }\n\n &:hover {\n opacity: 0.8;\n }\n`;\n\nexport const Wrapper = styled.div`\n overflow: auto;\n`;\n","import {QuestionModel} from 'api';\n\nimport {WidgetButton} from '../../QuestionForm/index.styles';\n\nimport React, {ReactNode} from 'react';\n\nimport {RenderPreview} from '..';\n\ninterface QuestionPreviewProps {\n children: ReactNode;\n questions: QuestionModel[];\n resultSharingEnabled: boolean;\n step?: number;\n}\n\nconst Button = ({children, resultSharingEnabled, questions, step}: QuestionPreviewProps) => {\n return (\n (\n {\n show(step);\n }}\n >\n {children}\n \n )}\n />\n );\n};\n\nexport default Button;\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t {\n dividerPosition?: 'horizontal' | 'vertical';\n fullWidth?: boolean;\n /**\n * The padding of the divider in pixels\n * @default '24'\n */\n padding?: number;\n}\n\nfunction getDividerStyles(props: DividerProps): React.CSSProperties {\n const {padding = 24, fullWidth, dividerPosition = 'horizontal'} = props;\n if (dividerPosition == 'vertical') {\n return {\n width: 2 * padding + 1,\n padding: fullWidth ? `0 ${padding}px` : `${padding}px`\n };\n }\n return {\n height: 2 * padding + 1,\n padding: fullWidth ? `${padding}px 0` : `${padding}px`\n };\n}\n\nexport default function Divider(props: DividerProps): ReactElement {\n const {dividerPosition = 'horizontal', className = '', fullWidth = false, ...otherProps} = props;\n return (\n \n );\n}\n\nDivider.displayName = 'Divider';\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst CaretUpIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-caret-up', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n );\n});\n\nCaretUpIcon.displayName = 'CaretUpIcon';\n\nexport default React.memo(CaretUpIcon);\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst CaretDownIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-caret-down', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n );\n});\n\nCaretDownIcon.displayName = 'CaretDownIcon';\n\nexport default React.memo(CaretDownIcon);\n","import {useI18n} from '@staffbase/ui';\n\nimport {useIsClient} from '..';\n\nconst useLocalizedContent = (content: Record, acceptedLanguages: string[]): T => {\n const {contentLocale, locale} = useI18n();\n const {isClient} = useIsClient();\n\n /*\n * This is to handle the scenario where an embedded survey is previewed inside of news content,\n * as the previewed language is passed as an attribute to the iframe element and cannot be determined\n * from the current `contentLocale`.\n *\n * The passed attribute has the shape \"/content/news/article/random-content-id?language=en_US#__simulate_android_phone\"\n */\n const urlParams = new URLSearchParams(window?.frameElement?.getAttribute('src')?.split(/[?#]/)[1] ?? '');\n const urlLanguage = urlParams.get('language');\n\n const availableContentLanguages = Object.keys(content);\n\n if (isClient && urlLanguage && content[urlLanguage]) {\n return content[urlLanguage];\n }\n\n if (isClient && content[contentLocale]) {\n return content[contentLocale];\n }\n\n if (content[locale]) {\n return content[locale];\n }\n\n if (content['en_US']) {\n return content['en_US'];\n }\n\n for (const availableLanguage of availableContentLanguages) {\n if (acceptedLanguages.includes(availableLanguage)) {\n return content[availableLanguage];\n }\n }\n\n // if we get here, the content doens't include any language accepted by the client\n return content[availableContentLanguages[0]];\n};\n\nexport default useLocalizedContent;\n","import {QuestionModel} from 'api';\nimport {useLanguage, useLocalizedContent} from 'hooks';\nimport React from 'react';\n\nconst QuestionOverview = ({question}: {question: QuestionModel}) => {\n const {availableLanguageValues} = useLanguage();\n const {title, description} = useLocalizedContent(question.content, availableLanguageValues);\n\n return (\n <>\n

{title}

\n {description &&

{description}

}\n \n );\n};\n\nexport default QuestionOverview;\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { debounce } from \"../utils/debounce.js\";\nconst defaultIgnoreDimensions = [];\nconst defaultInitialSize = {\n width: 0,\n height: 0,\n top: 0,\n left: 0\n};\nexport default function useParentSize() {\n let {\n initialSize = defaultInitialSize,\n debounceTime = 300,\n ignoreDimensions = defaultIgnoreDimensions,\n enableDebounceLeadingCall = true,\n resizeObserverPolyfill,\n externalRef\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const [node, setNode] = useState(null);\n const parentRef = useCallback(el => {\n setNode(el);\n if (typeof externalRef === 'function') {\n externalRef(el);\n } else if (externalRef != null) {\n // eslint-disable-next-line no-param-reassign -- standard ref-merging pattern\n externalRef.current = el;\n }\n }, [externalRef]);\n const animationFrameID = useRef(0);\n const [state, setState] = useState({\n ...defaultInitialSize,\n ...initialSize\n });\n const resize = useMemo(() => {\n const normalized = Array.isArray(ignoreDimensions) ? ignoreDimensions : [ignoreDimensions];\n return debounce(incoming => {\n setState(existing => {\n const stateKeys = Object.keys(existing);\n const keysWithChanges = stateKeys.filter(key => existing[key] !== incoming[key]);\n const shouldBail = keysWithChanges.every(key => normalized.includes(key));\n return shouldBail ? existing : incoming;\n });\n }, debounceTime, {\n leading: enableDebounceLeadingCall\n });\n }, [debounceTime, enableDebounceLeadingCall, ignoreDimensions]);\n useEffect(() => {\n if (!node) {\n resize.cancel();\n return;\n }\n const LocalResizeObserver = resizeObserverPolyfill || window.ResizeObserver;\n const observer = new LocalResizeObserver(entries => {\n entries.forEach(entry => {\n const {\n left,\n top,\n width,\n height\n } = entry?.contentRect ?? {};\n animationFrameID.current = window.requestAnimationFrame(() => {\n resize({\n width,\n height,\n top,\n left\n });\n });\n });\n });\n observer.observe(node);\n return () => {\n window.cancelAnimationFrame(animationFrameID.current);\n observer.disconnect();\n resize.cancel();\n };\n }, [node, resize, resizeObserverPolyfill]);\n return {\n parentRef,\n node,\n resize,\n ...state\n };\n}","/**\n * Creates a debounced function that delays invoking `func` until after `wait` milliseconds\n * have elapsed since the last invocation.\n *\n * When `leading` is true, the function fires immediately on the first call (leading edge),\n * and also fires on the trailing edge if there were subsequent calls during the wait period\n * (matching lodash behavior with leading:true, trailing:true).\n */\nexport function debounce(func, wait) {\n let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n const {\n leading = false\n } = options;\n let timeoutId;\n // Track args for the trailing call; null means no subsequent calls after leading\n let pendingArgs = null;\n let pendingContext;\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n if (leading && timeoutId === undefined) {\n // Fire immediately on the leading edge, no pending trailing needed yet\n func.apply(this, args);\n pendingArgs = null;\n } else {\n // Record these args for the trailing call\n pendingArgs = args;\n pendingContext = this;\n }\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => {\n timeoutId = undefined;\n if (pendingArgs !== null) {\n func.apply(pendingContext, pendingArgs);\n pendingArgs = null;\n pendingContext = undefined;\n }\n }, wait);\n }\n debounced.cancel = function cancel() {\n clearTimeout(timeoutId);\n timeoutId = undefined;\n pendingArgs = null;\n pendingContext = undefined;\n };\n return debounced;\n}","import useParentSize from \"../hooks/useParentSize.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultOuterStyles = {\n width: '100%',\n height: '100%',\n position: 'relative'\n};\nconst measurementStyles = {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n overflow: 'hidden'\n};\nexport default function ParentSize(_ref) {\n let {\n className,\n children,\n debounceTime,\n ignoreDimensions,\n initialSize,\n parentSizeStyles,\n enableDebounceLeadingCall = true,\n resizeObserverPolyfill,\n style,\n ...restProps\n } = _ref;\n const {\n parentRef,\n node,\n resize,\n ...dimensions\n } = useParentSize({\n initialSize,\n debounceTime,\n ignoreDimensions,\n enableDebounceLeadingCall,\n resizeObserverPolyfill\n });\n const outerStyle = parentSizeStyles ? {\n position: 'relative',\n ...parentSizeStyles,\n ...style\n } : {\n ...defaultOuterStyles,\n ...style\n };\n return /*#__PURE__*/_jsx(\"div\", {\n style: outerStyle,\n className: className,\n ...restProps,\n children: /*#__PURE__*/_jsx(\"div\", {\n style: measurementStyles,\n ref: parentRef,\n children: children({\n ...dimensions,\n ref: node,\n resize\n })\n })\n });\n}","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst StarAltIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-star-alt', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n );\n});\n\nStarAltIcon.displayName = 'StarAltIcon';\n\nexport default React.memo(StarAltIcon);\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst SliderQuestionIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-slider-question', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n \n \n );\n});\n\nSliderQuestionIcon.displayName = 'SliderQuestionIcon';\n\nexport default React.memo(SliderQuestionIcon);\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst NpsQuestionIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-nps-question', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n \n );\n});\n\nNpsQuestionIcon.displayName = 'NpsQuestionIcon';\n\nexport default React.memo(NpsQuestionIcon);\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst MultipleChoiceQuestionIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-multiple-choice-question', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n \n \n \n \n );\n});\n\nMultipleChoiceQuestionIcon.displayName = 'MultipleChoiceQuestionIcon';\n\nexport default React.memo(MultipleChoiceQuestionIcon);\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst TextQuestionIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-text-question', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n \n );\n});\n\nTextQuestionIcon.displayName = 'TextQuestionIcon';\n\nexport default React.memo(TextQuestionIcon);\n","import {ReactElement, cloneElement} from 'react';\n\nimport clsx from 'clsx';\n\nexport type IconSize = '40px' | '96px';\n\nexport interface EmptyStateProps {\n /**\n * Defines the title of the component\n */\n title: string;\n /**\n * The icon of the component\n */\n icon?: ReactElement;\n /**\n * The two icon sizes\n * @default 40px\n */\n iconSize?: IconSize;\n /**\n * The body text which appears below the \"title\" of the component\n */\n body?: string;\n /**\n * Optional classname prop for styling\n */\n className?: string;\n}\n\nconst getValidIconSize = (iconSize?: IconSize): IconSize =>\n iconSize === '40px' || iconSize === '96px' ? iconSize : '40px';\n\nexport function EmptyState(props: EmptyStateProps): ReactElement {\n const {title, icon, iconSize, body, className = ''} = props;\n const validIconSize = getValidIconSize(iconSize);\n\n return (\n
\n {icon &&\n cloneElement(icon, {\n style: {\n marginBottom: '24px',\n width: validIconSize,\n height: validIconSize\n },\n className: 'text-neutral-icon-weak'\n })}\n

{title}

\n {body ?

{body}

: null}\n
\n );\n}\n\nEmptyState.displayName = 'EmptyState';\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst ViewAltIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-view-alt', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n );\n});\n\nViewAltIcon.displayName = 'ViewAltIcon';\n\nexport default React.memo(ViewAltIcon);\n","import cx from 'classnames';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function Group(_ref) {\n let {\n top = 0,\n left = 0,\n transform,\n className,\n children,\n innerRef,\n ...restProps\n } = _ref;\n return /*#__PURE__*/_jsx(\"g\", {\n ref: innerRef,\n className: cx('visx-group', className),\n transform: transform || `translate(${left}, ${top})`,\n ...restProps,\n children: children\n });\n}","export function initRange(domain, range) {\n switch (arguments.length) {\n case 0: break;\n case 1: this.range(domain); break;\n default: this.range(range).domain(domain); break;\n }\n return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n switch (arguments.length) {\n case 0: break;\n case 1: {\n if (typeof domain === \"function\") this.interpolator(domain);\n else this.range(domain);\n break;\n }\n default: {\n this.domain(domain);\n if (typeof interpolator === \"function\") this.interpolator(interpolator);\n else this.range(interpolator);\n break;\n }\n }\n return this;\n}\n","export class InternMap extends Map {\n constructor(entries, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (entries != null) for (const [key, value] of entries) this.set(key, value);\n }\n get(key) {\n return super.get(intern_get(this, key));\n }\n has(key) {\n return super.has(intern_get(this, key));\n }\n set(key, value) {\n return super.set(intern_set(this, key), value);\n }\n delete(key) {\n return super.delete(intern_delete(this, key));\n }\n}\n\nexport class InternSet extends Set {\n constructor(values, key = keyof) {\n super();\n Object.defineProperties(this, {_intern: {value: new Map()}, _key: {value: key}});\n if (values != null) for (const value of values) this.add(value);\n }\n has(value) {\n return super.has(intern_get(this, value));\n }\n add(value) {\n return super.add(intern_set(this, value));\n }\n delete(value) {\n return super.delete(intern_delete(this, value));\n }\n}\n\nfunction intern_get({_intern, _key}, value) {\n const key = _key(value);\n return _intern.has(key) ? _intern.get(key) : value;\n}\n\nfunction intern_set({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) return _intern.get(key);\n _intern.set(key, value);\n return value;\n}\n\nfunction intern_delete({_intern, _key}, value) {\n const key = _key(value);\n if (_intern.has(key)) {\n value = _intern.get(key);\n _intern.delete(key);\n }\n return value;\n}\n\nfunction keyof(value) {\n return value !== null && typeof value === \"object\" ? value.valueOf() : value;\n}\n","import {InternMap} from \"d3-array\";\nimport {initRange} from \"./init.js\";\n\nexport const implicit = Symbol(\"implicit\");\n\nexport default function ordinal() {\n var index = new InternMap(),\n domain = [],\n range = [],\n unknown = implicit;\n\n function scale(d) {\n let i = index.get(d);\n if (i === undefined) {\n if (unknown !== implicit) return unknown;\n index.set(d, i = domain.push(d) - 1);\n }\n return range[i % range.length];\n }\n\n scale.domain = function(_) {\n if (!arguments.length) return domain.slice();\n domain = [], index = new InternMap();\n for (const value of _) {\n if (index.has(value)) continue;\n index.set(value, domain.push(value) - 1);\n }\n return scale;\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), scale) : range.slice();\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n scale.copy = function() {\n return ordinal(domain, range).unknown(unknown);\n };\n\n initRange.apply(scale, arguments);\n\n return scale;\n}\n","import {range as sequence} from \"d3-array\";\nimport {initRange} from \"./init.js\";\nimport ordinal from \"./ordinal.js\";\n\nexport default function band() {\n var scale = ordinal().unknown(undefined),\n domain = scale.domain,\n ordinalRange = scale.range,\n r0 = 0,\n r1 = 1,\n step,\n bandwidth,\n round = false,\n paddingInner = 0,\n paddingOuter = 0,\n align = 0.5;\n\n delete scale.unknown;\n\n function rescale() {\n var n = domain().length,\n reverse = r1 < r0,\n start = reverse ? r1 : r0,\n stop = reverse ? r0 : r1;\n step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);\n if (round) step = Math.floor(step);\n start += (stop - start - step * (n - paddingInner)) * align;\n bandwidth = step * (1 - paddingInner);\n if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);\n var values = sequence(n).map(function(i) { return start + step * i; });\n return ordinalRange(reverse ? values.reverse() : values);\n }\n\n scale.domain = function(_) {\n return arguments.length ? (domain(_), rescale()) : domain();\n };\n\n scale.range = function(_) {\n return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];\n };\n\n scale.rangeRound = function(_) {\n return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();\n };\n\n scale.bandwidth = function() {\n return bandwidth;\n };\n\n scale.step = function() {\n return step;\n };\n\n scale.round = function(_) {\n return arguments.length ? (round = !!_, rescale()) : round;\n };\n\n scale.padding = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;\n };\n\n scale.paddingInner = function(_) {\n return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;\n };\n\n scale.paddingOuter = function(_) {\n return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;\n };\n\n scale.align = function(_) {\n return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;\n };\n\n scale.copy = function() {\n return band(domain(), [r0, r1])\n .round(round)\n .paddingInner(paddingInner)\n .paddingOuter(paddingOuter)\n .align(align);\n };\n\n return initRange.apply(rescale(), arguments);\n}\n\nfunction pointish(scale) {\n var copy = scale.copy;\n\n scale.padding = scale.paddingOuter;\n delete scale.paddingInner;\n delete scale.paddingOuter;\n\n scale.copy = function() {\n return pointish(copy());\n };\n\n return scale;\n}\n\nexport function point() {\n return pointish(band.apply(null, arguments).paddingInner(1));\n}\n","export default function range(start, stop, step) {\n start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;\n\n var i = -1,\n n = Math.max(0, Math.ceil((stop - start) / step)) | 0,\n range = new Array(n);\n\n while (++i < n) {\n range[i] = start + i * step;\n }\n\n return range;\n}\n","export default function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n","import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n copy(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHex8: color_formatHex8,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb() {\n return this;\n },\n clamp() {\n return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n },\n displayable() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatHex8: rgb_formatHex8,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n value = clampi(value);\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n clamp() {\n return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n },\n displayable() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl() {\n const a = clampa(this.opacity);\n return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n }\n}));\n\nfunction clamph(value) {\n value = (value || 0) % 360;\n return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n","export const radians = Math.PI / 180;\nexport const degrees = 180 / Math.PI;\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nconst K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nexport function gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nexport default function lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nexport function Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\ndefine(Lab, lab, extend(Color, {\n brighter(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new Rgb(\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * degrees;\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nexport function lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nexport function Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * radians;\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\ndefine(Hcl, hcl, extend(Color, {\n brighter(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb() {\n return hcl2lab(this).rgb();\n }\n}));\n","export default x => () => x;\n","import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nexport function hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n };\n}\n\nexport default function nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n","import {hcl as colorHcl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),\n c = color(start.c, end.c),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hcl(hue);\nexport var hclLong = hcl(color);\n","import {hsl as colorHsl} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\nexport default hsl(hue);\nexport var hslLong = hsl(color);\n","import define, {extend} from \"./define.js\";\nimport {Color, rgbConvert, Rgb, darker, brighter} from \"./color.js\";\nimport {degrees, radians} from \"./math.js\";\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Rgb)) o = rgbConvert(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * degrees - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nexport default function cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nexport function Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\ndefine(Cubehelix, cubehelix, extend(Color, {\n brighter(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * radians,\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new Rgb(\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n","import {cubehelix as colorCubehelix} from \"d3-color\";\nimport color, {hue} from \"./color.js\";\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),\n s = color(start.s, end.s),\n l = color(start.l, end.l),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\nexport default cubehelix(hue);\nexport var cubehelixLong = cubehelix(color);\n","import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n var color = gamma(y);\n\n function rgb(start, end) {\n var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = nogamma(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = colorRgb(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n","import { interpolateRgb, interpolateLab, interpolateHcl, interpolateHclLong, interpolateHsl, interpolateHslLong, interpolateCubehelix, interpolateCubehelixLong } from '@visx/vendor/d3-interpolate';\nconst interpolatorMap = {\n lab: interpolateLab,\n hcl: interpolateHcl,\n 'hcl-long': interpolateHclLong,\n hsl: interpolateHsl,\n 'hsl-long': interpolateHslLong,\n cubehelix: interpolateCubehelix,\n 'cubehelix-long': interpolateCubehelixLong,\n rgb: interpolateRgb\n};\nexport default function createColorInterpolator(interpolate) {\n switch (interpolate) {\n case 'lab':\n case 'hcl':\n case 'hcl-long':\n case 'hsl':\n case 'hsl-long':\n case 'cubehelix':\n case 'cubehelix-long':\n case 'rgb':\n return interpolatorMap[interpolate];\n default:\n }\n const {\n type,\n gamma\n } = interpolate;\n const interpolator = interpolatorMap[type];\n return typeof gamma === 'undefined' ? interpolator : interpolator.gamma(gamma);\n}","import {lab as colorLab} from \"d3-color\";\nimport color from \"./color.js\";\n\nexport default function lab(start, end) {\n var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),\n a = color(start.a, end.a),\n b = color(start.b, end.b),\n opacity = color(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n","const t0 = new Date, t1 = new Date;\n\nexport function timeInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = (date) => {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = (date) => {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = (date) => {\n const d0 = interval(date), d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = (date, step) => {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = (start, stop, step) => {\n const range = [];\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n let previous;\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = (test) => {\n return timeInterval((date) => {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, (date, step) => {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = (start, end) => {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = (step) => {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? (d) => field(d) % step === 0\n : (d) => interval.count(0, d) % step === 0);\n };\n }\n\n return interval;\n}\n","export const durationSecond = 1000;\nexport const durationMinute = durationSecond * 60;\nexport const durationHour = durationMinute * 60;\nexport const durationDay = durationHour * 24;\nexport const durationWeek = durationDay * 7;\nexport const durationMonth = durationDay * 30;\nexport const durationYear = durationDay * 365;\n","import {timeInterval} from \"./interval.js\";\nimport {durationDay, durationMinute} from \"./duration.js\";\n\nexport const timeDay = timeInterval(\n date => date.setHours(0, 0, 0, 0),\n (date, step) => date.setDate(date.getDate() + step),\n (start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,\n date => date.getDate() - 1\n);\n\nexport const timeDays = timeDay.range;\n\nexport const utcDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return date.getUTCDate() - 1;\n});\n\nexport const utcDays = utcDay.range;\n\nexport const unixDay = timeInterval((date) => {\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step);\n}, (start, end) => {\n return (end - start) / durationDay;\n}, (date) => {\n return Math.floor(date / durationDay);\n});\n\nexport const unixDays = unixDay.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationHour, durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeHour = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getHours();\n});\n\nexport const timeHours = timeHour.range;\n\nexport const utcHour = timeInterval((date) => {\n date.setUTCMinutes(0, 0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationHour);\n}, (start, end) => {\n return (end - start) / durationHour;\n}, (date) => {\n return date.getUTCHours();\n});\n\nexport const utcHours = utcHour.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationSecond} from \"./duration.js\";\n\nexport const timeMinute = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getMinutes();\n});\n\nexport const timeMinutes = timeMinute.range;\n\nexport const utcMinute = timeInterval((date) => {\n date.setUTCSeconds(0, 0);\n}, (date, step) => {\n date.setTime(+date + step * durationMinute);\n}, (start, end) => {\n return (end - start) / durationMinute;\n}, (date) => {\n return date.getUTCMinutes();\n});\n\nexport const utcMinutes = utcMinute.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeMonth = timeInterval((date) => {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setMonth(date.getMonth() + step);\n}, (start, end) => {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, (date) => {\n return date.getMonth();\n});\n\nexport const timeMonths = timeMonth.range;\n\nexport const utcMonth = timeInterval((date) => {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, (start, end) => {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, (date) => {\n return date.getUTCMonth();\n});\n\nexport const utcMonths = utcMonth.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationSecond} from \"./duration.js\";\n\nexport const second = timeInterval((date) => {\n date.setTime(date - date.getMilliseconds());\n}, (date, step) => {\n date.setTime(+date + step * durationSecond);\n}, (start, end) => {\n return (end - start) / durationSecond;\n}, (date) => {\n return date.getUTCSeconds();\n});\n\nexport const seconds = second.range;\n","import {timeInterval} from \"./interval.js\";\nimport {durationMinute, durationWeek} from \"./duration.js\";\n\nfunction timeWeekday(i) {\n return timeInterval((date) => {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setDate(date.getDate() + step * 7);\n }, (start, end) => {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nexport const timeSunday = timeWeekday(0);\nexport const timeMonday = timeWeekday(1);\nexport const timeTuesday = timeWeekday(2);\nexport const timeWednesday = timeWeekday(3);\nexport const timeThursday = timeWeekday(4);\nexport const timeFriday = timeWeekday(5);\nexport const timeSaturday = timeWeekday(6);\n\nexport const timeSundays = timeSunday.range;\nexport const timeMondays = timeMonday.range;\nexport const timeTuesdays = timeTuesday.range;\nexport const timeWednesdays = timeWednesday.range;\nexport const timeThursdays = timeThursday.range;\nexport const timeFridays = timeFriday.range;\nexport const timeSaturdays = timeSaturday.range;\n\nfunction utcWeekday(i) {\n return timeInterval((date) => {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, (start, end) => {\n return (end - start) / durationWeek;\n });\n}\n\nexport const utcSunday = utcWeekday(0);\nexport const utcMonday = utcWeekday(1);\nexport const utcTuesday = utcWeekday(2);\nexport const utcWednesday = utcWeekday(3);\nexport const utcThursday = utcWeekday(4);\nexport const utcFriday = utcWeekday(5);\nexport const utcSaturday = utcWeekday(6);\n\nexport const utcSundays = utcSunday.range;\nexport const utcMondays = utcMonday.range;\nexport const utcTuesdays = utcTuesday.range;\nexport const utcWednesdays = utcWednesday.range;\nexport const utcThursdays = utcThursday.range;\nexport const utcFridays = utcFriday.range;\nexport const utcSaturdays = utcSaturday.range;\n","import {timeInterval} from \"./interval.js\";\n\nexport const timeYear = timeInterval((date) => {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setFullYear(date.getFullYear() + step);\n}, (start, end) => {\n return end.getFullYear() - start.getFullYear();\n}, (date) => {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\ntimeYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\nexport const timeYears = timeYear.range;\n\nexport const utcYear = timeInterval((date) => {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, (start, end) => {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, (date) => {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = (k) => {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, (date, step) => {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\nexport const utcYears = utcYear.range;\n","const TEST_TIME = new Date(Date.UTC(2020, 1, 2, 3, 4, 5));\nconst TEST_FORMAT = '%Y-%m-%d %H:%M';\n\n/**\n * Check if the scale is UTC or Time scale\n * When local time is equal to UTC, always return true\n * @param scale time or utc scale\n */\nexport default function isUtcScale(scale) {\n // The only difference between time and utc scale is\n // whether the tick format function is utcFormat or timeFormat\n const output = scale.tickFormat(1, TEST_FORMAT)(TEST_TIME);\n return output === '2020-02-02 03:04';\n}","import { timeSecond, timeMinute, timeHour, timeDay, timeYear, timeMonth, timeWeek, utcSecond, utcMinute, utcHour, utcDay, utcWeek, utcMonth, utcYear } from '@visx/vendor/d3-time';\nimport isUtcScale from \"../utils/isUtcScale.js\";\nconst localTimeIntervals = {\n day: timeDay,\n hour: timeHour,\n minute: timeMinute,\n month: timeMonth,\n second: timeSecond,\n week: timeWeek,\n year: timeYear\n};\nconst utcIntervals = {\n day: utcDay,\n hour: utcHour,\n minute: utcMinute,\n month: utcMonth,\n second: utcSecond,\n week: utcWeek,\n year: utcYear\n};\nexport default function applyNice(scale, config) {\n if ('nice' in config && typeof config.nice !== 'undefined' && 'nice' in scale) {\n const {\n nice\n } = config;\n if (typeof nice === 'boolean') {\n if (nice) {\n scale.nice();\n }\n } else if (typeof nice === 'number') {\n scale.nice(nice);\n } else {\n const timeScale = scale;\n const isUtc = isUtcScale(timeScale);\n if (typeof nice === 'string') {\n timeScale.nice(isUtc ? utcIntervals[nice] : localTimeIntervals[nice]);\n } else {\n const {\n interval,\n step\n } = nice;\n const parsedInterval = (isUtc ? utcIntervals[interval] : localTimeIntervals[interval]).every(step);\n if (parsedInterval != null) {\n timeScale.nice(parsedInterval);\n }\n }\n }\n }\n}","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","import domain from \"./domain.js\";\nimport range from \"./range.js\";\nimport align from \"./align.js\";\nimport base from \"./base.js\";\nimport clamp from \"./clamp.js\";\nimport constant from \"./constant.js\";\nimport exponent from \"./exponent.js\";\nimport interpolate from \"./interpolate.js\";\nimport nice from \"./nice.js\";\nimport padding from \"./padding.js\";\nimport reverse from \"./reverse.js\";\nimport round from \"./round.js\";\nimport unknown from \"./unknown.js\";\nimport zero from \"./zero.js\";\n/**\n * List of all operators, in order of execution\n */\nexport const ALL_OPERATORS = [\n// domain => nice => zero\n'domain', 'nice', 'zero',\n// interpolate before round\n'interpolate', 'round',\n// set range then reverse\n'range', 'reverse',\n// Order does not matter for these operators\n'align', 'base', 'clamp', 'constant', 'exponent', 'padding', 'unknown'];\n// Use Record to enforce that all keys in OperatorType must exist.\nconst operators = {\n domain,\n nice,\n zero,\n interpolate,\n round,\n align,\n base,\n clamp,\n constant,\n exponent,\n padding,\n range,\n reverse,\n unknown\n};\nexport default function scaleOperator() {\n for (var _len = arguments.length, ops = new Array(_len), _key = 0; _key < _len; _key++) {\n ops[_key] = arguments[_key];\n }\n const selection = new Set(ops);\n const selectedOps = ALL_OPERATORS.filter(o => selection.has(o));\n return function applyOperators(scale, config) {\n if (typeof config !== 'undefined') {\n selectedOps.forEach(op => {\n operators[op](scale, config);\n });\n }\n return scale;\n };\n}","export default function applyDomain(scale, config) {\n if (config.domain) {\n if ('nice' in scale || 'quantiles' in scale) {\n // continuous input scales\n scale.domain(config.domain);\n } else if ('padding' in scale) {\n // point and band scales\n scale.domain(config.domain);\n } else {\n // ordinal and threshold scale\n scale.domain(config.domain);\n }\n }\n}","export default function applyZero(scale, config) {\n if ('zero' in config && config.zero === true) {\n const domain = scale.domain();\n const [a, b] = domain;\n const isDescending = b < a;\n const [min, max] = isDescending ? [b, a] : [a, b];\n const domainWithZero = [Math.min(0, min), Math.max(0, max)];\n scale.domain(isDescending ? domainWithZero.reverse() : domainWithZero);\n }\n}","import createColorInterpolator from \"../utils/createColorInterpolator.js\";\nexport default function applyInterpolate(scale, config) {\n if ('interpolate' in config && 'interpolate' in scale && typeof config.interpolate !== 'undefined') {\n const interpolator = createColorInterpolator(config.interpolate);\n scale.interpolate(interpolator);\n }\n}","import { interpolateRound } from '@visx/vendor/d3-interpolate';\nexport default function applyRound(scale, config) {\n if ('round' in config && typeof config.round !== 'undefined') {\n if (config.round && 'interpolate' in config && typeof config.interpolate !== 'undefined') {\n console.warn(`[visx/scale/applyRound] ignoring round: scale config contains round and interpolate. only applying interpolate. config:`, config);\n } else if ('round' in scale) {\n // for point and band scales\n scale.round(config.round);\n } else if ('interpolate' in scale && config.round) {\n // for continuous output scales\n // setting config.round = true\n // is actually setting interpolator to interpolateRound\n // as these scales do not have scale.round() function\n scale.interpolate(interpolateRound);\n }\n }\n}","export default function applyAlign(scale, config) {\n if ('align' in scale && 'align' in config && typeof config.align !== 'undefined') {\n scale.align(config.align);\n }\n}","export default function applyBase(scale, config) {\n if ('base' in scale && 'base' in config && typeof config.base !== 'undefined') {\n scale.base(config.base);\n }\n}","export default function applyClamp(scale, config) {\n if ('clamp' in scale && 'clamp' in config && typeof config.clamp !== 'undefined') {\n scale.clamp(config.clamp);\n }\n}","export default function applyConstant(scale, config) {\n if ('constant' in scale && 'constant' in config && typeof config.constant !== 'undefined') {\n scale.constant(config.constant);\n }\n}","export default function applyExponent(scale, config) {\n if ('exponent' in scale && 'exponent' in config && typeof config.exponent !== 'undefined') {\n scale.exponent(config.exponent);\n }\n}","export default function applyPadding(scale, config) {\n if ('padding' in scale && 'padding' in config && typeof config.padding !== 'undefined') {\n scale.padding(config.padding);\n }\n if ('paddingInner' in scale && 'paddingInner' in config && typeof config.paddingInner !== 'undefined') {\n scale.paddingInner(config.paddingInner);\n }\n if ('paddingOuter' in scale && 'paddingOuter' in config && typeof config.paddingOuter !== 'undefined') {\n scale.paddingOuter(config.paddingOuter);\n }\n}","export default function applyRange(scale, config) {\n if (config.range) {\n if ('padding' in scale) {\n // point and band scales\n scale.range(config.range);\n } else {\n // the rest\n scale.range(config.range);\n }\n }\n}","export default function applyReverse(scale, config) {\n if (config.reverse) {\n const reversedRange = scale.range().slice().reverse();\n if ('padding' in scale) {\n // point and band scales\n scale.range(reversedRange);\n } else {\n // the rest\n scale.range(reversedRange);\n }\n }\n}","export default function applyUnknown(scale, config) {\n if ('unknown' in scale && 'unknown' in config && typeof config.unknown !== 'undefined') {\n scale.unknown(config.unknown);\n }\n}","import { scaleBand } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateBandScale = scaleOperator('domain', 'range', 'reverse', 'align', 'padding', 'round');\nexport default function createBandScale(config) {\n return updateBandScale(scaleBand(), config);\n}","import { scalePoint } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updatePointScale = scaleOperator('domain', 'range', 'reverse', 'align', 'padding', 'round');\nexport default function createPointScale(config) {\n return updatePointScale(scalePoint(), config);\n}","const e10 = Math.sqrt(50),\n e5 = Math.sqrt(10),\n e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n const step = (stop - start) / Math.max(0, count),\n power = Math.floor(Math.log10(step)),\n error = step / Math.pow(10, power),\n factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n let i1, i2, inc;\n if (power < 0) {\n inc = Math.pow(10, -power) / factor;\n i1 = Math.round(start * inc);\n i2 = Math.round(stop * inc);\n if (i1 / inc < start) ++i1;\n if (i2 / inc > stop) --i2;\n inc = -inc;\n } else {\n inc = Math.pow(10, power) * factor;\n i1 = Math.round(start / inc);\n i2 = Math.round(stop / inc);\n if (i1 * inc < start) ++i1;\n if (i2 * inc > stop) --i2;\n }\n if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n if (!(count > 0)) return [];\n if (start === stop) return [start];\n const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n if (!(i2 >= i1)) return [];\n const n = i2 - i1 + 1, ticks = new Array(n);\n if (reverse) {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n } else {\n if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n }\n return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n stop = +stop, start = +start, count = +count;\n const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n","export default function ascending(a, b) {\n return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n","export default function descending(a, b) {\n return a == null || b == null ? NaN\n : b < a ? -1\n : b > a ? 1\n : b >= a ? 0\n : NaN;\n}\n","import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n let compare1, compare2, delta;\n\n // If an accessor is specified, promote it to a comparator. In this case we\n // can test whether the search value is (self-) comparable. We can’t do this\n // for a comparator (except for specific, known comparators) because we can’t\n // tell if the comparator is symmetric, and an asymmetric comparator can’t be\n // used to test whether a single value is comparable.\n if (f.length !== 2) {\n compare1 = ascending;\n compare2 = (d, x) => ascending(f(d), x);\n delta = (d, x) => f(d) - x;\n } else {\n compare1 = f === ascending || f === descending ? f : zero;\n compare2 = f;\n delta = f;\n }\n\n function left(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) < 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function right(a, x, lo = 0, hi = a.length) {\n if (lo < hi) {\n if (compare1(x, x) !== 0) return hi;\n do {\n const mid = (lo + hi) >>> 1;\n if (compare2(a[mid], x) <= 0) lo = mid + 1;\n else hi = mid;\n } while (lo < hi);\n }\n return lo;\n }\n\n function center(a, x, lo = 0, hi = a.length) {\n const i = left(a, x, lo, hi - 1);\n return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n }\n\n return {left, center, right};\n}\n\nfunction zero() {\n return 0;\n}\n","import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","export default function number(x) {\n return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n if (valueof === undefined) {\n for (let value of values) {\n if (value != null && (value = +value) >= value) {\n yield value;\n }\n }\n } else {\n let index = -1;\n for (let value of values) {\n if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n yield value;\n }\n }\n }\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","export default function number(x) {\n return +x;\n}\n","import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n return x;\n}\n\nfunction normalize(a, b) {\n return (b -= (a = +a))\n ? function(x) { return (x - a) / b; }\n : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n var t;\n if (a > b) t = a, a = b, b = t;\n return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n var j = Math.min(domain.length, range.length) - 1,\n d = new Array(j),\n r = new Array(j),\n i = -1;\n\n // Reverse descending domains.\n if (domain[j] < domain[0]) {\n domain = domain.slice().reverse();\n range = range.slice().reverse();\n }\n\n while (++i < j) {\n d[i] = normalize(domain[i], domain[i + 1]);\n r[i] = interpolate(range[i], range[i + 1]);\n }\n\n return function(x) {\n var i = bisect(domain, x, 1, j) - 1;\n return r[i](d[i](x));\n };\n}\n\nexport function copy(source, target) {\n return target\n .domain(source.domain())\n .range(source.range())\n .interpolate(source.interpolate())\n .clamp(source.clamp())\n .unknown(source.unknown());\n}\n\nexport function transformer() {\n var domain = unit,\n range = unit,\n interpolate = interpolateValue,\n transform,\n untransform,\n unknown,\n clamp = identity,\n piecewise,\n output,\n input;\n\n function rescale() {\n var n = Math.min(domain.length, range.length);\n if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n piecewise = n > 2 ? polymap : bimap;\n output = input = null;\n return scale;\n }\n\n function scale(x) {\n return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n }\n\n scale.invert = function(y) {\n return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n };\n\n scale.domain = function(_) {\n return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n };\n\n scale.range = function(_) {\n return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n };\n\n scale.rangeRound = function(_) {\n return range = Array.from(_), interpolate = interpolateRound, rescale();\n };\n\n scale.clamp = function(_) {\n return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n };\n\n scale.interpolate = function(_) {\n return arguments.length ? (interpolate = _, rescale()) : interpolate;\n };\n\n scale.unknown = function(_) {\n return arguments.length ? (unknown = _, scale) : unknown;\n };\n\n return function(t, u) {\n transform = t, untransform = u;\n return rescale();\n };\n}\n\nexport default function continuous() {\n return transformer()(identity, identity);\n}\n","export default function constants(x) {\n return function() {\n return x;\n };\n}\n","// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n","export default function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n","import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n","import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n \"%\": (x, p) => (x * 100).toFixed(p),\n \"b\": (x) => Math.round(x).toString(2),\n \"c\": (x) => x + \"\",\n \"d\": formatDecimal,\n \"e\": (x, p) => x.toExponential(p),\n \"f\": (x, p) => x.toFixed(p),\n \"g\": (x, p) => x.toPrecision(p),\n \"o\": (x) => Math.round(x).toString(8),\n \"p\": (x, p) => formatRounded(x * 100, p),\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n \"x\": (x) => Math.round(x).toString(16)\n};\n","export default function(x) {\n return x;\n}\n","import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"−\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n}\n","export default function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n}\n","export default function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n}\n","// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n","import { scaleLinear } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateLinearScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round', 'zero');\nexport default function createLinearScale(config) {\n return updateLinearScale(scaleLinear(), config);\n}","import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n var domain = scale.domain;\n\n scale.ticks = function(count) {\n var d = domain();\n return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n };\n\n scale.tickFormat = function(count, specifier) {\n var d = domain();\n return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n };\n\n scale.nice = function(count) {\n if (count == null) count = 10;\n\n var d = domain();\n var i0 = 0;\n var i1 = d.length - 1;\n var start = d[i0];\n var stop = d[i1];\n var prestep;\n var step;\n var maxIter = 10;\n\n if (stop < start) {\n step = start, start = stop, stop = step;\n step = i0, i0 = i1, i1 = step;\n }\n \n while (maxIter-- > 0) {\n step = tickIncrement(start, stop, count);\n if (step === prestep) {\n d[i0] = start\n d[i1] = stop\n return domain(d);\n } else if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n } else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n } else {\n break;\n }\n prestep = step;\n }\n\n return scale;\n };\n\n return scale;\n}\n\nexport default function linear() {\n var scale = continuous();\n\n scale.copy = function() {\n return copy(scale, linear());\n };\n\n initRange.apply(scale, arguments);\n\n return linearish(scale);\n}\n","import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? constant(b)\n : (t === \"number\" ? number\n : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n : b instanceof color ? rgb\n : b instanceof Date ? date\n : isNumberArray(b) ? numberArray\n : Array.isArray(b) ? genericArray\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n : number)(a, b);\n}\n","export default function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n}\n\nexport function isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n","export default function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n}\n","import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n","import value from \"./value.js\";\n\nexport default function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = value(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n}\n","import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n var step = tickStep(start, stop, count),\n precision;\n specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n switch (specifier.type) {\n case \"s\": {\n var value = Math.max(Math.abs(start), Math.abs(stop));\n if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n return formatPrefix(specifier, value);\n }\n case \"\":\n case \"e\":\n case \"g\":\n case \"p\":\n case \"r\": {\n if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n break;\n }\n case \"f\":\n case \"%\": {\n if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n break;\n }\n }\n return format(specifier);\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n","import exponent from \"./exponent.js\";\n\nexport default function(step) {\n return Math.max(0, -exponent(Math.abs(step)));\n}\n","export default function coerceNumber(val) {\n if ((typeof val === 'function' || typeof val === 'object' && !!val) && 'valueOf' in val) {\n const num = val.valueOf();\n if (typeof num === 'number') return num;\n }\n return val;\n}","export default function getTicks(scale, numTicks) {\n // Because `Scale` is generic type which maybe a subset of AnyD3Scale\n // that may not have `ticks` field,\n // TypeScript will not let us do the `'ticks' in scale` check directly.\n // Have to manually cast and expand type first.\n const s = scale;\n if ('ticks' in s) {\n return s.ticks(numTicks);\n }\n return s.domain().filter((_, index, arr) => numTicks == null || arr.length <= numTicks || index % Math.round((arr.length - 1) / numTicks) === 0);\n}","export default function toString(x) {\n return x?.toString();\n}","export default function(x) {\n return function constant() {\n return x;\n };\n}\n","function Linear(context) {\n this._context = context;\n}\n\nLinear.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: this._context.lineTo(x, y); break;\n }\n }\n};\n\nexport default function(context) {\n return new Linear(context);\n}\n","import { scaleRadial } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateRadialScale = scaleOperator('domain', 'range', 'clamp', 'nice', 'round', 'unknown');\nexport default function createRadialScale(config) {\n return updateRadialScale(scaleRadial(), config);\n}","import { scaleTime } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateTimeScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round');\nexport default function createTimeScale(config) {\n return updateTimeScale(scaleTime(), config);\n}","import { scaleUtc } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateUtcScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round');\nexport default function createUtcScale(config) {\n return updateUtcScale(scaleUtc(), config);\n}","import { scaleLog } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateLogScale = scaleOperator('domain', 'range', 'reverse', 'base', 'clamp', 'interpolate', 'nice', 'round');\nexport default function createLogScale(config) {\n return updateLogScale(scaleLog(), config);\n}","import { scalePow } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updatePowScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'exponent', 'interpolate', 'nice', 'round', 'zero');\nexport default function createPowScale(config) {\n return updatePowScale(scalePow(), config);\n}","import { scaleOrdinal } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateOrdinalScale = scaleOperator('domain', 'range', 'reverse', 'unknown');\nexport default function createOrdinalScale(config) {\n return updateOrdinalScale(scaleOrdinal(), config);\n}","import { scaleQuantize } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateQuantizeScale = scaleOperator('domain', 'range', 'reverse', 'nice', 'zero');\nexport default function createQuantizeScale(config) {\n return updateQuantizeScale(scaleQuantize(), config);\n}","import { scaleQuantile } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateQuantileScale = scaleOperator('domain', 'range', 'reverse');\nexport default function createQuantileScale(config) {\n return updateQuantileScale(scaleQuantile(), config);\n}","import { scaleSymlog } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateSymlogScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'constant', 'nice', 'zero', 'round');\nexport default function createSymlogScale(config) {\n return updateSymlogScale(scaleSymlog(), config);\n}","import { scaleThreshold } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateThresholdScale = scaleOperator('domain', 'range', 'reverse');\nexport default function createThresholdScale(config) {\n return updateThresholdScale(scaleThreshold(), config);\n}","import { scaleSqrt } from '@visx/vendor/d3-scale';\nimport scaleOperator from \"../operators/scaleOperator.js\";\nexport const updateSqrtScale = scaleOperator('domain', 'range', 'reverse', 'clamp', 'interpolate', 'nice', 'round', 'zero');\nexport default function createSqrtScale(config) {\n return updateSqrtScale(scaleSqrt(), config);\n}","/* eslint-disable no-redeclare */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport scaleOperator, { ALL_OPERATORS } from \"./operators/scaleOperator.js\";\nconst applyAllOperators = scaleOperator(...ALL_OPERATORS);\n\n// Overload function signature for more strict typing, e.g.,\n// If the scale is a ScaleLinear, the config is a linear config.\n\n// Actual implementation\n\nfunction updateScale(scale, config) {\n return applyAllOperators(scale.copy(), config);\n}\nexport default updateScale;","export var slice = Array.prototype.slice;\n\nexport default function(x) {\n return typeof x === \"object\" && \"length\" in x\n ? x // Array, TypedArray, NodeList, array-like\n : Array.from(x); // Map, Set, iterable, string, or anything else\n}\n","const pi = Math.PI,\n tau = 2 * pi,\n epsilon = 1e-6,\n tauEpsilon = tau - epsilon;\n\nfunction append(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += arguments[i] + strings[i];\n }\n}\n\nfunction appendRound(digits) {\n let d = Math.floor(digits);\n if (!(d >= 0)) throw new Error(`invalid digits: ${digits}`);\n if (d > 15) return append;\n const k = 10 ** d;\n return function(strings) {\n this._ += strings[0];\n for (let i = 1, n = strings.length; i < n; ++i) {\n this._ += Math.round(arguments[i] * k) / k + strings[i];\n }\n };\n}\n\nexport class Path {\n constructor(digits) {\n this._x0 = this._y0 = // start of current subpath\n this._x1 = this._y1 = null; // end of current subpath\n this._ = \"\";\n this._append = digits == null ? append : appendRound(digits);\n }\n moveTo(x, y) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}`;\n }\n closePath() {\n if (this._x1 !== null) {\n this._x1 = this._x0, this._y1 = this._y0;\n this._append`Z`;\n }\n }\n lineTo(x, y) {\n this._append`L${this._x1 = +x},${this._y1 = +y}`;\n }\n quadraticCurveTo(x1, y1, x, y) {\n this._append`Q${+x1},${+y1},${this._x1 = +x},${this._y1 = +y}`;\n }\n bezierCurveTo(x1, y1, x2, y2, x, y) {\n this._append`C${+x1},${+y1},${+x2},${+y2},${this._x1 = +x},${this._y1 = +y}`;\n }\n arcTo(x1, y1, x2, y2, r) {\n x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let x0 = this._x1,\n y0 = this._y1,\n x21 = x2 - x1,\n y21 = y2 - y1,\n x01 = x0 - x1,\n y01 = y0 - y1,\n l01_2 = x01 * x01 + y01 * y01;\n\n // Is this path empty? Move to (x1,y1).\n if (this._x1 === null) {\n this._append`M${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.\n else if (!(l01_2 > epsilon));\n\n // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?\n // Equivalently, is (x1,y1) coincident with (x2,y2)?\n // Or, is the radius zero? Line to (x1,y1).\n else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {\n this._append`L${this._x1 = x1},${this._y1 = y1}`;\n }\n\n // Otherwise, draw an arc!\n else {\n let x20 = x2 - x0,\n y20 = y2 - y0,\n l21_2 = x21 * x21 + y21 * y21,\n l20_2 = x20 * x20 + y20 * y20,\n l21 = Math.sqrt(l21_2),\n l01 = Math.sqrt(l01_2),\n l = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),\n t01 = l / l01,\n t21 = l / l21;\n\n // If the start tangent is not coincident with (x0,y0), line to.\n if (Math.abs(t01 - 1) > epsilon) {\n this._append`L${x1 + t01 * x01},${y1 + t01 * y01}`;\n }\n\n this._append`A${r},${r},0,0,${+(y01 * x20 > x01 * y20)},${this._x1 = x1 + t21 * x21},${this._y1 = y1 + t21 * y21}`;\n }\n }\n arc(x, y, r, a0, a1, ccw) {\n x = +x, y = +y, r = +r, ccw = !!ccw;\n\n // Is the radius negative? Error.\n if (r < 0) throw new Error(`negative radius: ${r}`);\n\n let dx = r * Math.cos(a0),\n dy = r * Math.sin(a0),\n x0 = x + dx,\n y0 = y + dy,\n cw = 1 ^ ccw,\n da = ccw ? a0 - a1 : a1 - a0;\n\n // Is this path empty? Move to (x0,y0).\n if (this._x1 === null) {\n this._append`M${x0},${y0}`;\n }\n\n // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).\n else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {\n this._append`L${x0},${y0}`;\n }\n\n // Is this arc empty? We’re done.\n if (!r) return;\n\n // Does the angle go the wrong way? Flip the direction.\n if (da < 0) da = da % tau + tau;\n\n // Is this a complete circle? Draw two arcs to complete the circle.\n if (da > tauEpsilon) {\n this._append`A${r},${r},0,1,${cw},${x - dx},${y - dy}A${r},${r},0,1,${cw},${this._x1 = x0},${this._y1 = y0}`;\n }\n\n // Is this arc non-empty? Draw an arc!\n else if (da > epsilon) {\n this._append`A${r},${r},0,${+(da >= pi)},${cw},${this._x1 = x + r * Math.cos(a1)},${this._y1 = y + r * Math.sin(a1)}`;\n }\n }\n rect(x, y, w, h) {\n this._append`M${this._x0 = this._x1 = +x},${this._y0 = this._y1 = +y}h${w = +w}v${+h}h${-w}Z`;\n }\n toString() {\n return this._;\n }\n}\n\nexport function path() {\n return new Path;\n}\n\n// Allow instanceof d3.path\npath.prototype = Path.prototype;\n\nexport function pathRound(digits = 3) {\n return new Path(+digits);\n}\n","export function x(p) {\n return p[0];\n}\n\nexport function y(p) {\n return p[1];\n}\n","import cx from 'classnames';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function Line(_ref) {\n let {\n from = {\n x: 0,\n y: 0\n },\n to = {\n x: 1,\n y: 1\n },\n fill = 'transparent',\n className,\n innerRef,\n ...restProps\n } = _ref;\n const isRectilinear = from.x === to.x || from.y === to.y;\n return /*#__PURE__*/_jsx(\"line\", {\n ref: innerRef,\n className: cx('visx-line', className),\n x1: from.x,\n y1: from.y,\n x2: to.x,\n y2: to.y,\n fill: fill,\n shapeRendering: isRectilinear ? 'crispEdges' : 'auto',\n ...restProps\n });\n}","import cx from 'classnames';\nimport { line } from \"../util/D3ShapeFactories.js\";\nimport { Fragment as _Fragment, jsx as _jsx } from \"react/jsx-runtime\";\nexport default function LinePath(_ref) {\n let {\n children,\n data = [],\n x,\n y,\n fill = 'transparent',\n className,\n curve,\n innerRef,\n defined = () => true,\n ...restProps\n } = _ref;\n const path = line({\n x,\n y,\n defined,\n curve\n });\n if (children) return /*#__PURE__*/_jsx(_Fragment, {\n children: children({\n path\n })\n });\n return /*#__PURE__*/_jsx(\"path\", {\n ref: innerRef,\n className: cx('visx-linepath', className),\n d: path(data) || '',\n fill: fill\n // without this a datum surrounded by nulls will not be visible\n // https://github.com/d3/d3-shape#line_defined\n ,\n strokeLinecap: \"round\",\n ...restProps\n });\n}","import { arc as d3Arc, area as d3Area, line as d3Line, pie as d3Pie, radialLine as d3RadialLine, stack as d3Stack } from '@visx/vendor/d3-shape';\nimport setNumberOrNumberAccessor from \"./setNumberOrNumberAccessor.js\";\nimport stackOrder from \"./stackOrder.js\";\nimport stackOffset from \"./stackOffset.js\";\nexport function arc() {\n let {\n innerRadius,\n outerRadius,\n cornerRadius,\n startAngle,\n endAngle,\n padAngle,\n padRadius\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const path = d3Arc();\n if (innerRadius != null) setNumberOrNumberAccessor(path.innerRadius, innerRadius);\n if (outerRadius != null) setNumberOrNumberAccessor(path.outerRadius, outerRadius);\n if (cornerRadius != null) setNumberOrNumberAccessor(path.cornerRadius, cornerRadius);\n if (startAngle != null) setNumberOrNumberAccessor(path.startAngle, startAngle);\n if (endAngle != null) setNumberOrNumberAccessor(path.endAngle, endAngle);\n if (padAngle != null) setNumberOrNumberAccessor(path.padAngle, padAngle);\n if (padRadius != null) setNumberOrNumberAccessor(path.padRadius, padRadius);\n return path;\n}\nexport function area() {\n let {\n x,\n x0,\n x1,\n y,\n y0,\n y1,\n defined,\n curve\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const path = d3Area();\n if (x) setNumberOrNumberAccessor(path.x, x);\n if (x0) setNumberOrNumberAccessor(path.x0, x0);\n if (x1) setNumberOrNumberAccessor(path.x1, x1);\n if (y) setNumberOrNumberAccessor(path.y, y);\n if (y0) setNumberOrNumberAccessor(path.y0, y0);\n if (y1) setNumberOrNumberAccessor(path.y1, y1);\n if (defined) path.defined(defined);\n if (curve) path.curve(curve);\n return path;\n}\nexport function line() {\n let {\n x,\n y,\n defined,\n curve\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const path = d3Line();\n if (x) setNumberOrNumberAccessor(path.x, x);\n if (y) setNumberOrNumberAccessor(path.y, y);\n if (defined) path.defined(defined);\n if (curve) path.curve(curve);\n return path;\n}\nexport function pie() {\n let {\n startAngle,\n endAngle,\n padAngle,\n value,\n sort,\n sortValues\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const path = d3Pie();\n\n // In d3-shape v3+, sortValues defaults to descending sort.\n // To maintain visx's behavior of preserving input order by default,\n // we explicitly set sortValues to null when neither sort nor sortValues is provided.\n // Note: d3's pie generator clears sortValues when sort is set, and vice versa.\n if (sortValues !== undefined) {\n path.sortValues(sortValues);\n } else if (sort === undefined) {\n // Neither provided - disable sorting to preserve input order\n path.sortValues(null);\n } else if (sort === null) {\n // explicit null: clear comparator\n path.sort(null);\n } else {\n // here sort is narrowed to a comparator function\n path.sort(sort);\n }\n if (value != null) path.value(value);\n if (padAngle != null) setNumberOrNumberAccessor(path.padAngle, padAngle);\n if (startAngle != null) setNumberOrNumberAccessor(path.startAngle, startAngle);\n if (endAngle != null) setNumberOrNumberAccessor(path.endAngle, endAngle);\n return path;\n}\nexport function radialLine() {\n let {\n angle,\n radius,\n defined,\n curve\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const path = d3RadialLine();\n if (angle) setNumberOrNumberAccessor(path.angle, angle);\n if (radius) setNumberOrNumberAccessor(path.radius, radius);\n if (defined) path.defined(defined);\n if (curve) path.curve(curve);\n return path;\n}\nexport function stack(_ref) {\n let {\n keys,\n value,\n order,\n offset\n } = _ref;\n const path = d3Stack();\n if (keys) path.keys(keys);\n if (value) setNumberOrNumberAccessor(path.value, value);\n if (order) path.order(stackOrder(order));\n if (offset) path.offset(stackOffset(offset));\n return path;\n}","/**\n * This is a workaround for TypeScript not inferring the correct\n * method overload/signature for some d3 shape methods.\n */\nexport default function setNumberOrNumberAccessor(func, value) {\n if (typeof value === 'number') func(value);else func(value);\n}","import array from \"./array.js\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport {withPath} from \"./path.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function(x, y) {\n var defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null,\n path = withPath(line);\n\n x = typeof x === \"function\" ? x : (x === undefined) ? pointX : constant(x);\n y = typeof y === \"function\" ? y : (y === undefined) ? pointY : constant(y);\n\n function line(data) {\n var i,\n n = (data = array(data)).length,\n d,\n defined0 = false,\n buffer;\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) output.lineStart();\n else output.lineEnd();\n }\n if (defined0) output.point(+x(d, i, data), +y(d, i, data));\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n line.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : constant(+_), line) : x;\n };\n\n line.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : constant(+_), line) : y;\n };\n\n line.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), line) : defined;\n };\n\n line.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;\n };\n\n line.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;\n };\n\n return line;\n}\n","import {Path} from \"d3-path\";\n\nexport function withPath(shape) {\n let digits = 3;\n\n shape.digits = function(_) {\n if (!arguments.length) return digits;\n if (_ == null) {\n digits = null;\n } else {\n const d = Math.floor(_);\n if (!(d >= 0)) throw new RangeError(`invalid digits: ${_}`);\n digits = d;\n }\n return shape;\n };\n\n return () => new Path(digits);\n}\n","import cx from 'classnames';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function Bar(_ref) {\n let {\n className,\n innerRef,\n ...restProps\n } = _ref;\n return /*#__PURE__*/_jsx(\"rect\", {\n ref: innerRef,\n className: cx('visx-bar', className),\n ...restProps\n });\n}","import cx from 'classnames';\nimport { Fragment as _Fragment, jsx as _jsx } from \"react/jsx-runtime\";\n/** Hook that returns a BarRounded path. */\nexport function useBarRoundedPath(_ref) {\n let {\n all,\n bottom,\n bottomLeft,\n bottomRight,\n height,\n left,\n radius,\n right,\n top,\n topLeft,\n topRight,\n width,\n x,\n y\n } = _ref;\n topRight = all || top || right || topRight;\n bottomRight = all || bottom || right || bottomRight;\n bottomLeft = all || bottom || left || bottomLeft;\n topLeft = all || top || left || topLeft;\n\n // clamp radius to center of shortest side of the rect\n radius = Math.max(1, Math.min(radius, Math.min(width, height) / 2));\n const diameter = 2 * radius;\n const path = `M${x + radius},${y} h${width - diameter}\n ${topRight ? `a${radius},${radius} 0 0 1 ${radius},${radius}` : `h${radius}v${radius}`}\n v${height - diameter}\n ${bottomRight ? `a${radius},${radius} 0 0 1 ${-radius},${radius}` : `v${radius}h${-radius}`}\n h${diameter - width}\n ${bottomLeft ? `a${radius},${radius} 0 0 1 ${-radius},${-radius}` : `h${-radius}v${-radius}`}\n v${diameter - height}\n ${topLeft ? `a${radius},${radius} 0 0 1 ${radius},${-radius}` : `v${-radius}h${radius}`}\nz`.split('\\n').join('');\n return path;\n}\nexport default function BarRounded(_ref2) {\n let {\n children,\n className,\n innerRef,\n x,\n y,\n width,\n height,\n radius,\n all = false,\n top = false,\n bottom = false,\n left = false,\n right = false,\n topLeft = false,\n topRight = false,\n bottomLeft = false,\n bottomRight = false,\n ...restProps\n } = _ref2;\n const path = useBarRoundedPath({\n x,\n y,\n width,\n height,\n radius,\n all,\n top,\n bottom,\n left,\n right,\n topLeft,\n topRight,\n bottomLeft,\n bottomRight\n });\n if (children) return /*#__PURE__*/_jsx(_Fragment, {\n children: children({\n path\n })\n });\n return /*#__PURE__*/_jsx(\"path\", {\n ref: innerRef,\n className: cx('visx-bar-rounded', className),\n d: path,\n ...restProps\n });\n}","import memoize from \"./memoize.js\";\nconst MEASUREMENT_ELEMENT_ID = '__react_svg_text_measurement_id';\nfunction getStringWidth(str, style) {\n if (typeof document === 'undefined') return null;\n try {\n // Calculate length of each word to be used to determine number of words per line\n let textEl = document.getElementById(MEASUREMENT_ELEMENT_ID);\n if (!textEl) {\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('aria-hidden', 'true');\n svg.style.width = '0';\n svg.style.height = '0';\n svg.style.position = 'absolute';\n svg.style.top = '-100%';\n svg.style.left = '-100%';\n textEl = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n textEl.setAttribute('id', MEASUREMENT_ELEMENT_ID);\n svg.appendChild(textEl);\n document.body.appendChild(svg);\n }\n Object.assign(textEl.style, style);\n textEl.textContent = str;\n return textEl.getComputedTextLength();\n } catch {\n return null;\n }\n}\nexport default memoize(getStringWidth, (str, style) => `${str}_${JSON.stringify(style)}`);","import { useMemo } from 'react';\nimport reduceCSSCalc from 'reduce-css-calc';\nimport getStringWidth from \"../util/getStringWidth.js\";\nfunction isNumber(val) {\n return typeof val === 'number';\n}\nfunction isXOrYInValid(xOrY) {\n return (\n // number that is not NaN or Infinity\n typeof xOrY === 'number' && Number.isFinite(xOrY) ||\n // for percentage\n typeof xOrY === 'string'\n );\n}\nexport default function useText(props) {\n const {\n verticalAnchor = 'end',\n scaleToFit = false,\n angle,\n width,\n lineHeight = '1em',\n capHeight = '0.71em',\n // Magic number from d3\n children,\n style,\n ...textProps\n } = props;\n const {\n x = 0,\n y = 0\n } = textProps;\n const isXOrYNotValid = !isXOrYInValid(x) || !isXOrYInValid(y);\n const {\n wordsWithWidth,\n spaceWidth\n } = useMemo(() => {\n const words = children == null ? [] : children.toString().split(/(?:(?!\\u00A0+)\\s+)/);\n return {\n wordsWithWidth: words.map(word => ({\n word,\n wordWidth: getStringWidth(word, style) || 0\n })),\n spaceWidth: getStringWidth('\\u00A0', style) || 0\n };\n }, [children, style]);\n const wordsByLines = useMemo(() => {\n if (isXOrYNotValid) {\n return [];\n }\n\n // Only perform calculations if using features that require them (multiline, scaleToFit)\n if (width || scaleToFit) {\n return wordsWithWidth.reduce((result, _ref) => {\n let {\n word,\n wordWidth\n } = _ref;\n const currentLine = result[result.length - 1];\n if (currentLine && (width == null || scaleToFit || (currentLine.width || 0) + wordWidth + spaceWidth < width)) {\n // Word can be added to an existing line\n currentLine.words.push(word);\n currentLine.width = currentLine.width || 0;\n currentLine.width += wordWidth + spaceWidth;\n } else {\n // Add first word to line or word is too long to scaleToFit on existing line\n const newLine = {\n words: [word],\n width: wordWidth\n };\n result.push(newLine);\n }\n return result;\n }, []);\n }\n return [{\n words: children == null ? [] : children.toString().split(/(?:(?!\\u00A0+)\\s+)/)\n }];\n }, [isXOrYNotValid, width, scaleToFit, children, wordsWithWidth, spaceWidth]);\n const startDy = useMemo(() => {\n const startDyStr = isXOrYNotValid ? '' : verticalAnchor === 'start' ? reduceCSSCalc(`calc(${capHeight})`) : verticalAnchor === 'middle' ? reduceCSSCalc(`calc(${(wordsByLines.length - 1) / 2} * -${lineHeight} + (${capHeight} / 2))`) : reduceCSSCalc(`calc(${wordsByLines.length - 1} * -${lineHeight})`);\n return startDyStr;\n }, [isXOrYNotValid, verticalAnchor, capHeight, wordsByLines.length, lineHeight]);\n const transform = useMemo(() => {\n const transforms = [];\n if (isXOrYNotValid) {\n return '';\n }\n if (isNumber(x) && isNumber(y) && isNumber(width) && scaleToFit && wordsByLines.length > 0) {\n const lineWidth = wordsByLines[0].width || 1;\n const sx = scaleToFit === 'shrink-only' ? Math.min(width / lineWidth, 1) : width / lineWidth;\n const sy = sx;\n const originX = x - sx * x;\n const originY = y - sy * y;\n transforms.push(`matrix(${sx}, 0, 0, ${sy}, ${originX}, ${originY})`);\n }\n if (angle) {\n transforms.push(`rotate(${angle}, ${x}, ${y})`);\n }\n return transforms.length > 0 ? transforms.join(' ') : '';\n }, [isXOrYNotValid, x, y, width, scaleToFit, wordsByLines, angle]);\n return {\n wordsByLines,\n startDy,\n transform\n };\n}","import useText from \"./hooks/useText.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst SVG_STYLE = {\n overflow: 'visible'\n};\nexport default function Text(props) {\n const {\n dx = 0,\n dy = 0,\n textAnchor = 'start',\n innerRef,\n innerTextRef,\n verticalAnchor,\n angle,\n lineHeight = '1em',\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n scaleToFit = false,\n capHeight,\n width,\n ...textProps\n } = props;\n const {\n x = 0,\n fontSize\n } = textProps;\n const {\n wordsByLines,\n startDy,\n transform\n } = useText(props);\n return /*#__PURE__*/_jsx(\"svg\", {\n ref: innerRef,\n x: dx,\n y: dy,\n fontSize: fontSize,\n style: SVG_STYLE,\n children: wordsByLines.length > 0 ? /*#__PURE__*/_jsx(\"text\", {\n ref: innerTextRef,\n transform: transform,\n ...textProps,\n textAnchor: textAnchor,\n children: wordsByLines.map((line, index) => /*#__PURE__*/_jsx(\"tspan\", {\n x: x,\n dy: index === 0 ? startDy : lineHeight,\n children: line.words.join(' ')\n }, index))\n }) : null\n });\n}","const Orientation = {\n top: 'top',\n left: 'left',\n right: 'right',\n bottom: 'bottom'\n};\nexport default Orientation;","import cx from 'classnames';\nimport { Line } from '@visx/shape';\nimport { Group } from '@visx/group';\nimport { Text } from '@visx/text';\nimport Orientation from \"../constants/orientation.js\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nexport default function Ticks(_ref) {\n let {\n hideTicks,\n horizontal,\n orientation,\n tickClassName,\n tickComponent,\n tickLabelProps: allTickLabelProps,\n tickStroke = '#222',\n tickTransform,\n ticks,\n strokeWidth,\n tickLineProps\n } = _ref;\n return ticks.map(_ref2 => {\n let {\n value,\n index,\n from,\n to,\n formattedValue\n } = _ref2;\n const tickLabelProps = allTickLabelProps[index] ?? {};\n const tickLabelFontSize = Math.max(10, typeof tickLabelProps.fontSize === 'number' && tickLabelProps.fontSize || 0);\n const tickYCoord = to.y + (horizontal && orientation !== Orientation.top ? tickLabelFontSize : 0);\n return /*#__PURE__*/_jsxs(Group, {\n className: cx('visx-axis-tick', tickClassName),\n transform: tickTransform,\n children: [!hideTicks && /*#__PURE__*/_jsx(Line, {\n from: from,\n to: to,\n stroke: tickStroke,\n strokeWidth: strokeWidth,\n strokeLinecap: \"square\",\n ...tickLineProps\n }), tickComponent ? tickComponent({\n ...tickLabelProps,\n x: to.x,\n y: tickYCoord,\n formattedValue\n }) : /*#__PURE__*/_jsx(Text, {\n x: to.x,\n y: tickYCoord,\n ...tickLabelProps,\n children: formattedValue\n })]\n }, `visx-tick-${value}-${index}`);\n });\n}","import cx from 'classnames';\nimport { Line } from '@visx/shape';\nimport { Text } from '@visx/text';\nimport getLabelTransform from \"../utils/getLabelTransform.js\";\nimport Orientation from \"../constants/orientation.js\";\nimport Ticks from \"./Ticks.js\";\nimport { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst defaultTextProps = {\n textAnchor: 'middle',\n fontFamily: 'Arial',\n fontSize: 10,\n fill: '#222'\n};\nexport default function AxisRenderer(_ref) {\n let {\n axisFromPoint,\n axisLineClassName,\n axisToPoint,\n hideAxisLine,\n hideTicks,\n horizontal,\n label = '',\n labelClassName,\n labelOffset = 14,\n labelProps,\n orientation = Orientation.bottom,\n scale,\n stroke = '#222',\n strokeDasharray,\n strokeWidth = 1,\n tickClassName,\n tickComponent,\n tickLineProps,\n tickLabelProps,\n tickLength = 8,\n tickStroke = '#222',\n tickTransform,\n ticks,\n ticksComponent = Ticks\n } = _ref;\n const combinedLabelProps = {\n ...defaultTextProps,\n ...labelProps\n };\n const tickLabelPropsDefault = {\n ...defaultTextProps,\n ...(typeof tickLabelProps === 'object' ? tickLabelProps : null)\n };\n // compute the max tick label size to compute label offset\n const allTickLabelProps = ticks.map(_ref2 => {\n let {\n value,\n index\n } = _ref2;\n return typeof tickLabelProps === 'function' ? tickLabelProps(value, index, ticks) : tickLabelPropsDefault;\n });\n const maxTickLabelFontSize = Math.max(10, ...allTickLabelProps.map(props => typeof props.fontSize === 'number' ? props.fontSize : 0));\n return /*#__PURE__*/_jsxs(_Fragment, {\n children: [ticksComponent({\n hideTicks,\n horizontal,\n orientation,\n scale,\n tickClassName,\n tickComponent,\n tickLabelProps: allTickLabelProps,\n tickStroke,\n tickTransform,\n ticks,\n strokeWidth,\n tickLineProps\n }), !hideAxisLine && /*#__PURE__*/_jsx(Line, {\n className: cx('visx-axis-line', axisLineClassName),\n from: axisFromPoint,\n to: axisToPoint,\n stroke: stroke,\n strokeWidth: strokeWidth,\n strokeDasharray: strokeDasharray\n }), label && /*#__PURE__*/_jsx(Text, {\n className: cx('visx-axis-label', labelClassName),\n ...getLabelTransform({\n labelOffset,\n labelProps: combinedLabelProps,\n orientation,\n range: scale.range(),\n tickLabelFontSize: maxTickLabelFontSize,\n tickLength\n }),\n ...combinedLabelProps,\n children: label\n })]\n });\n}","import Orientation from \"../constants/orientation.js\";\nexport default function getLabelTransform(_ref) {\n let {\n labelOffset,\n labelProps,\n orientation,\n range,\n tickLabelFontSize,\n tickLength\n } = _ref;\n const sign = orientation === Orientation.left || orientation === Orientation.top ? -1 : 1;\n let x;\n let y;\n let transform;\n if (orientation === Orientation.top || orientation === Orientation.bottom) {\n const yBottomOffset = orientation === Orientation.bottom && typeof labelProps.fontSize === 'number' ? labelProps.fontSize : 0;\n x = (Number(range[0]) + Number(range[range.length - 1])) / 2;\n y = sign * (tickLength + labelOffset + tickLabelFontSize + yBottomOffset);\n } else {\n x = sign * ((Number(range[0]) + Number(range[range.length - 1])) / 2);\n y = -(tickLength + labelOffset);\n transform = `rotate(${sign * 90})`;\n }\n return {\n x,\n y,\n transform\n };\n}","export default class Point {\n x = 0;\n y = 0;\n constructor(_ref) {\n let {\n x = 0,\n y = 0\n } = _ref;\n this.x = x;\n this.y = y;\n }\n value() {\n return {\n x: this.x,\n y: this.y\n };\n }\n toArray() {\n return [this.x, this.y];\n }\n}","import { Point } from '@visx/point';\nexport default function createPoint(_ref, horizontal) {\n let {\n x,\n y\n } = _ref;\n return new Point(horizontal ? {\n x,\n y\n } : {\n x: y,\n y: x\n });\n}","import cx from 'classnames';\nimport { Group } from '@visx/group';\nimport { getTicks, coerceNumber } from '@visx/scale';\nimport AxisRenderer from \"./AxisRenderer.js\";\nimport getTickPosition from \"../utils/getTickPosition.js\";\nimport getTickFormatter from \"../utils/getTickFormatter.js\";\nimport createPoint from \"../utils/createPoint.js\";\nimport Orientation from \"../constants/orientation.js\";\nimport getAxisRangePaddingConfig from \"../utils/getAxisRangePaddingConfig.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function Axis(_ref) {\n let {\n children = AxisRenderer,\n axisClassName,\n hideAxisLine = false,\n hideTicks = false,\n hideZero = false,\n innerRef,\n left = 0,\n numTicks = 10,\n orientation = Orientation.bottom,\n rangePadding = 0,\n scale,\n tickFormat,\n tickLength = 8,\n tickValues,\n top = 0,\n ...restProps\n } = _ref;\n const format = tickFormat ?? getTickFormatter(scale);\n const isLeft = orientation === Orientation.left;\n const isTop = orientation === Orientation.top;\n const horizontal = isTop || orientation === Orientation.bottom;\n const tickPosition = getTickPosition(scale);\n const tickSign = isLeft || isTop ? -1 : 1;\n const range = scale.range();\n const rangePaddingConfig = getAxisRangePaddingConfig(rangePadding);\n const axisFromPoint = createPoint({\n x: Number(range[0]) + 0.5 - rangePaddingConfig.start,\n y: 0\n }, horizontal);\n const axisToPoint = createPoint({\n x: Number(range[range.length - 1]) + 0.5 + rangePaddingConfig.end,\n y: 0\n }, horizontal);\n const filteredTickValues = (tickValues ?? getTicks(scale, numTicks)).filter(value => !hideZero || value !== 0 && value !== '0').map((value, index) => ({\n value,\n index\n }));\n const ticks = filteredTickValues.map(_ref2 => {\n let {\n value,\n index\n } = _ref2;\n const scaledValue = coerceNumber(tickPosition(value));\n return {\n value,\n index,\n from: createPoint({\n x: scaledValue,\n y: 0\n }, horizontal),\n to: createPoint({\n x: scaledValue,\n y: tickLength * tickSign\n }, horizontal),\n formattedValue: format(value, index, filteredTickValues)\n };\n });\n return /*#__PURE__*/_jsx(Group, {\n className: cx('visx-axis', axisClassName),\n innerRef: innerRef,\n top: top,\n left: left,\n children: children({\n ...restProps,\n axisFromPoint,\n axisToPoint,\n hideAxisLine,\n hideTicks,\n hideZero,\n horizontal,\n numTicks,\n orientation,\n rangePadding,\n scale,\n tickFormat: format,\n tickLength,\n tickPosition,\n tickSign,\n ticks\n })\n });\n}","import { toString } from '@visx/scale';\n/**\n * Returns a tick position for the given tick value\n */\nexport default function getTickFormatter(scale) {\n // Broaden type before using 'xxx' in s as typeguard.\n const s = scale;\n\n // For point or band scales,\n // have to add offset to make the tick centered.\n if ('tickFormat' in s) {\n return s.tickFormat();\n }\n return toString;\n}","/**\n * Create a function that returns a tick position for the given tick value\n */\nexport default function getTickPosition(scale) {\n let align = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'center';\n // Broaden type before using 'xxx' in s as typeguard.\n const s = scale;\n\n // For point or band scales,\n // have to add offset to make the tick at center or end.\n if (align !== 'start' && 'bandwidth' in s) {\n let offset = s.bandwidth();\n if (align === 'center') offset /= 2;\n if (s.round()) offset = Math.round(offset);\n return d => {\n const scaledValue = s(d);\n return typeof scaledValue === 'number' ? scaledValue + offset : scaledValue;\n };\n }\n return scale;\n}","export const defaultAxisRangePadding = 0;\nexport default function getAxisRangePaddingConfig() {\n let originalRangePadding = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultAxisRangePadding;\n return typeof originalRangePadding === 'number' ? {\n start: originalRangePadding,\n end: originalRangePadding\n } : {\n start: defaultAxisRangePadding,\n end: defaultAxisRangePadding,\n ...originalRangePadding\n };\n}","import cx from 'classnames';\nimport Axis from \"./Axis.js\";\nimport Orientation from \"../constants/orientation.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const leftTickLabelProps = {\n dx: '-0.25em',\n dy: '0.25em',\n fill: '#222',\n fontFamily: 'Arial',\n fontSize: 10,\n textAnchor: 'end'\n};\nexport default function AxisLeft(_ref) {\n let {\n axisClassName,\n labelOffset = 36,\n tickLength = 8,\n tickLabelProps,\n ...restProps\n } = _ref;\n const tickLabelPropsFinal = typeof tickLabelProps === 'function' ? tickLabelProps : {\n ...leftTickLabelProps,\n ...tickLabelProps\n };\n return /*#__PURE__*/_jsx(Axis, {\n axisClassName: cx('visx-axis-left', axisClassName),\n labelOffset: labelOffset,\n orientation: Orientation.left,\n tickLabelProps: tickLabelPropsFinal,\n tickLength: tickLength,\n ...restProps\n });\n}","import cx from 'classnames';\nimport Axis from \"./Axis.js\";\nimport Orientation from \"../constants/orientation.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const rightTickLabelProps = {\n dx: '0.25em',\n dy: '0.25em',\n fill: '#222',\n fontFamily: 'Arial',\n fontSize: 10,\n textAnchor: 'start'\n};\nexport default function AxisRight(_ref) {\n let {\n axisClassName,\n labelOffset = 36,\n tickLength = 8,\n tickLabelProps,\n ...restProps\n } = _ref;\n const tickLabelPropsFinal = typeof tickLabelProps === 'function' ? tickLabelProps : {\n ...rightTickLabelProps,\n ...tickLabelProps\n };\n return /*#__PURE__*/_jsx(Axis, {\n axisClassName: cx('visx-axis-right', axisClassName),\n labelOffset: labelOffset,\n orientation: Orientation.right,\n tickLabelProps: tickLabelPropsFinal,\n tickLength: tickLength,\n ...restProps\n });\n}","import cx from 'classnames';\nimport Axis from \"./Axis.js\";\nimport Orientation from \"../constants/orientation.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const bottomTickLabelProps = {\n dy: '0.25em',\n fill: '#222',\n fontFamily: 'Arial',\n fontSize: 10,\n textAnchor: 'middle'\n};\nexport default function AxisBottom(_ref) {\n let {\n axisClassName,\n labelOffset = 8,\n tickLength = 8,\n tickLabelProps,\n ...restProps\n } = _ref;\n const tickLabelPropsFinal = typeof tickLabelProps === 'function' ? tickLabelProps : {\n ...bottomTickLabelProps,\n ...tickLabelProps\n };\n return /*#__PURE__*/_jsx(Axis, {\n axisClassName: cx('visx-axis-bottom', axisClassName),\n labelOffset: labelOffset,\n orientation: Orientation.bottom,\n tickLabelProps: tickLabelPropsFinal,\n tickLength: tickLength,\n ...restProps\n });\n}","export const roundToTwoDecimalPlaces = (num: number): string => {\n return (Math.round(num * 100) / 100).toFixed(2);\n};\n","import styled from '@emotion/styled';\n\nexport const LabelText = styled.text`\n fill: #666666;\n font-size: 12px;\n font-weight: 400;\n line-height: 18px;\n text-anchor: end;\n\n tspan {\n font-size: 14px;\n font-weight: 600;\n line-height: 20px;\n }\n`;\n","import {AxisLeft, AxisRight, TickRendererProps} from '@visx/axis';\nimport {Group} from '@visx/group';\nimport {scaleBand, scaleLinear} from '@visx/scale';\nimport {Bar, BarRounded} from '@visx/shape';\nimport {TextProps} from '@visx/text';\nimport {NumericalResultBucket} from 'api';\nimport {useIsClient, useIsRTL} from 'hooks';\nimport React, {ReactChild} from 'react';\n\nimport {useTheme} from '@staffbase/ui';\n\nimport {roundToTwoDecimalPlaces} from '../../utils';\nimport {LabelText} from './index.style';\n\nconst BACKING_BAR_FILL = '#F5F5F5';\nconst BACKING_WIDTH = 1;\nconst BAR_RADIUS = 5;\nconst CHART_LINE_FILL = '#eeeeee';\nconst LABEL_Y_OFFSET = 5;\nconst STAFFBASE_BLUE = '#007ABC';\nconst ltrMargin = {top: 0, right: 70, bottom: 0, left: 50};\nconst rtlMargin = {top: 0, right: 50, bottom: 0, left: 70};\n\ntype Props = {\n barColors?: string[];\n data?: Partial>;\n height: number;\n maxNumericValue: number;\n minNumericValue: number;\n width: number;\n};\n\ntype BucketContent = {\n label: NumericalResultBucket;\n value: number;\n};\n\nconst CustomScaleLabel = ({children, x, y, value}: {children: ReactChild; x: number; y: number; value: string}) => (\n \n {value}\n {children}\n \n);\n\nconst BarChart = (props: Props): React.ReactElement => {\n const theme = useTheme();\n const {isRTL} = useIsRTL();\n const {isClient} = useIsClient();\n const {barColors, data, width, height, maxNumericValue, minNumericValue} = props;\n\n const margin = isRTL ? rtlMargin : ltrMargin;\n\n const buckets = new Map();\n\n for (let index: NumericalResultBucket = minNumericValue; index <= maxNumericValue; index++) {\n buckets.set(index, (data && data[index]) || 0);\n }\n\n const bucketData = Array.from(buckets.entries())\n .sort((a, b) => (a[0] < b[0] ? 1 : -1))\n .map(([key, count]) => ({label: key, value: count}));\n\n const feedbackTotal = Array.from(buckets.entries()).reduce((acc: number, [_, count]) => acc + count, 0);\n\n const convertStringToStarsBucket = (d: NumericalResultBucket) => Number(d);\n\n const getLeftTickFormat = (d: NumericalResultBucket) => `${d}`;\n const getRightTickFormat = (d: NumericalResultBucket) => {\n if (!feedbackTotal) {\n return '';\n }\n const bucket = convertStringToStarsBucket(d);\n\n return `${roundToTwoDecimalPlaces(((buckets.get(bucket || 0) || 0) / feedbackTotal) * 100)}%`;\n };\n\n // bounds\n const xMax = width - margin.left - margin.right;\n\n const y = (d: BucketContent) => d.label;\n const x = (d: BucketContent) => d.value;\n\n // scales\n const yScale = scaleBand({\n range: [0, height],\n domain: bucketData.map(y),\n padding: 0.6\n });\n const xScale = scaleLinear({\n range: [0, xMax],\n domain: [feedbackTotal, 0]\n });\n\n const rightTickProps = (): Partial => ({\n fontSize: 14,\n fontWeight: 600,\n fill: '#212121',\n textAnchor: 'end'\n });\n\n const keyAxisProps = {\n hideTicks: true,\n scale: yScale,\n numTicks: bucketData.length,\n stroke: CHART_LINE_FILL,\n tickFormat: getLeftTickFormat,\n tickComponent: (t: TickRendererProps) => {\n const {x, y, formattedValue} = t;\n const maxValueLabel = `/${maxNumericValue}`;\n return (\n \n {maxValueLabel}\n \n );\n }\n };\n\n const dataAxisProps = {\n hideTicks: true,\n hideAxisLine: true,\n scale: yScale,\n numTicks: bucketData.length,\n tickLabelProps: rightTickProps,\n tickFormat: getRightTickFormat,\n top: LABEL_Y_OFFSET\n };\n\n if (barColors && barColors.length < bucketData.length) {\n console.warn('Fewer barColors than data buckets provided, make sure you are passing enough colours for your data');\n }\n\n return (\n
\n \n \n {bucketData.map((d, i) => {\n const label = y(d);\n const barWidth = xMax - xScale(x(d));\n const barHeight = yScale.bandwidth();\n const barY = yScale(label);\n const barX = isRTL ? xMax - barWidth : 0;\n\n const barFill = barColors && barColors[i] ? barColors[i] : STAFFBASE_BLUE;\n\n return (\n barY && (\n \n \n {data && (\n \n )}\n \n )\n );\n })}\n\n \n {!isRTL && (\n <>\n {/* key axis */}\n \n {/* data axis */}\n {data && }\n \n )}\n\n {isRTL && (\n <>\n {/* key axis */}\n \n {/* data axis */}\n {data && }\n \n )}\n \n\n {/* These are a little arbitrary in the design, and hard to attach to meaningful values */}\n \n \n \n \n
\n );\n};\n\nexport default BarChart;\n","import styled from '@emotion/styled';\n\nexport const Wrapper = styled.div`\n margin-top: 8px;\n\n > svg {\n display: block;\n }\n`;\n","import {Group} from '@visx/group';\nimport {scaleLinear} from '@visx/scale';\nimport {Bar, BarRounded} from '@visx/shape';\nimport {Text, useText} from '@visx/text';\nimport {useIsRTL} from 'hooks';\nimport React from 'react';\n\nimport {useTheme} from '@staffbase/ui';\n\nimport {roundToTwoDecimalPlaces} from '../../utils';\nimport {Wrapper} from './index.styled';\n\nconst CHART_LINE_FILL = '#eeeeee';\nconst FONT_COLOR = '#666666';\nconst FONT_SIZE = 14;\nconst ltrMargin = {top: 20, right: 70, bottom: 30, left: 28};\nconst rtlMargin = {top: 20, right: 28, bottom: 30, left: 70};\n\nconst BACKING_BAR_FILL = '#F5F5F5';\nconst BACKING_WIDTH = 1;\nconst BAR_RADIUS = 5;\nconst BAR_HEIGHT = 16;\nconst FONT_WEIGHT = 600;\nconst LINE_HEIGHT = 16;\nconst LABEL_OFFSET = 12;\nconst PATH_HEIGHT = 8;\n\nconst OPTION_BASE_HEIGHT = 36;\nconst OPTION_TEXT_Y_OFFSET = 8;\nconst OPTION_TEXT_X_OFFSET = 4;\nconst INDEX_TEXT_X_OFFSET = -10;\n\nconst PERCENTAGE_X_OFFSET = 58;\nconst PERCENTAGE_Y_OFFSET = 14;\n\nconst X_MAX_OFFSET = 4;\n\ntype Props = {\n xData: number[][];\n yData: string[];\n width: number;\n};\n\ninterface OptionProps {\n barWidth: number;\n index: number;\n text: string;\n xMax: number;\n width: number;\n margin: {\n top: number;\n left: number;\n right: number;\n bottom: number;\n };\n percentage?: string;\n}\n\nconst Option = (props: OptionProps) => {\n const {barWidth, index, margin, text, width, percentage, xMax} = props;\n const theme = useTheme();\n const {isRTL, directionSign} = useIsRTL();\n const {wordsByLines} = useText({children: text, width: xMax});\n const lineNumbers = wordsByLines.length;\n\n const optionHeight = lineNumbers * LINE_HEIGHT + OPTION_BASE_HEIGHT;\n\n return (\n \n \n \n \n\n \n {/* Option Text */}\n \n {text}\n \n\n {/* Index Labels */}\n \n {index + 1}\n \n\n \n \n \n \n\n {/* Percentage Labels */}\n \n {percentage}\n \n \n \n );\n};\n\nconst OptionChart = (props: Props) => {\n const {isRTL} = useIsRTL();\n const {width, yData, xData} = props;\n const margin = isRTL ? rtlMargin : ltrMargin;\n\n const xMax = width - margin.left - margin.right;\n const total = xData.map((item) => item[0]).reduce((acc, curr) => acc + curr, 0);\n\n const xScale = scaleLinear({\n range: [0, xMax],\n domain: [total, 0]\n });\n\n return (\n \n {/* Chart Top Bar */}\n \n \n \n\n {yData.map((text, i) => {\n const [value, index] = xData[i];\n const barWidth = total && xMax - xScale(value);\n\n const percentage = value ? `${roundToTwoDecimalPlaces((value / total) * 100)}%` : '0.00%';\n\n return (\n \n );\n })}\n\n {/* Chart Bottom Bar */}\n \n \n \n \n \n \n \n );\n};\n\nexport default OptionChart;\n","import {ParentSize, useParentSize} from '@visx/responsive';\nimport {MultipleChoiceQuestionModel, NumericalResultBucket, QuestionModel, QuestionType} from 'api';\nimport {useLanguage, useLocalizedContent, useTranslation} from 'hooks';\nimport React, {Fragment, PropsWithChildren} from 'react';\n\nimport {\n Divider,\n EmptyState,\n MultipleChoiceQuestionIcon,\n NpsQuestionIcon,\n SliderQuestionIcon,\n StarAltIcon,\n TextQuestionIcon,\n ViewAltIcon\n} from '@staffbase/design';\n\nimport BarChart from '../charts/BarChart';\nimport OptionChart from '../charts/OptionChart';\n\ntype NumericalResultsProps = {\n buckets: Partial>;\n maxNumericValue: number;\n minNumericValue: number;\n participantCount?: number;\n};\n\nconst NumericalResults = (props: PropsWithChildren) => {\n const {children, buckets, maxNumericValue, minNumericValue, participantCount} = props;\n const {t} = useTranslation();\n\n return (\n <>\n
\n {children}\n\n {Number.isInteger(participantCount) ? (\n

\n {participantCount} {t('plugin.surveys.employee.results.participants')}\n

\n ) : null}\n
\n
\n \n {({height, width}) =>\n /*\n * Don't render BarChart until parent component\n * has had time to calculate necessary height\n */\n height && (\n \n )\n }\n \n
\n \n );\n};\n\ntype StarResultsProps = {\n buckets: Partial>;\n participantCount?: number;\n};\n\nconst StarResults = ({buckets, participantCount}: StarResultsProps) => {\n const {t} = useTranslation();\n\n return (\n \n

\n \n {t('plugin.surveys.employee.results.question.type.star')}\n

\n
\n );\n};\n\ntype ScaleResultsProps = {\n buckets: Partial>;\n maxNumericValue: number;\n participantCount?: number;\n};\n\nconst ScaleResults = ({buckets, maxNumericValue, participantCount}: ScaleResultsProps) => {\n const {t} = useTranslation();\n\n return (\n \n

\n \n {t('plugin.surveys.employee.results.question.type.scale')}\n

\n \n );\n};\n\ntype NPSResultsProps = {\n buckets: Partial>;\n participantCount?: number;\n};\n\nconst NPSResults = ({buckets, participantCount}: NPSResultsProps) => {\n const {t} = useTranslation();\n\n return (\n \n

\n \n {t('plugin.surveys.employee.results.question.type.nps')}\n

\n
\n );\n};\n\ntype MultipleChoiceResultsProps = {\n multipleChoiceBuckets: Partial>;\n question: MultipleChoiceQuestionModel;\n};\n\nconst MultipleChoiceResults = (props: MultipleChoiceResultsProps) => {\n const {multipleChoiceBuckets, question} = props;\n const {availableLanguageValues} = useLanguage();\n const {options} = useLocalizedContent(question.content, availableLanguageValues);\n const {t} = useTranslation();\n const {parentRef, width} = useParentSize();\n\n const data = options.map(({id, text}) => {\n const count = multipleChoiceBuckets[id] ?? 0;\n return {count, id, text};\n });\n\n const yData = data.map(({text}) => text);\n const xData = data.map(({count}, index) => [count, index]);\n\n return (\n <>\n
\n

\n \n {t('plugin.surveys.employee.results.question.type.multiple-choice')}\n

\n
\n {/*\n * Not ParentSize: since @visx/responsive v4 it renders children inside a\n * position:absolute overflow:hidden box, so the chart can't grow this\n * container and gets clipped to zero height (OptionChart's height varies\n * with the option count, so a fixed height like NumericalResults'\n * h-[276px] is no option). Measure only the width and let the chart\n * size the container in normal flow instead.\n */}\n
{width > 0 ? : null}
\n \n );\n};\n\ntype TextResultsProps = {textResponses: string[]};\n\nconst TextResults = ({textResponses}: TextResultsProps) => {\n const {t} = useTranslation();\n\n return (\n <>\n
\n

\n \n {t('plugin.surveys.employee.results.question.type.text')}\n

\n
\n
    \n {textResponses.map((response, index) => (\n \n \n
  • {response}
  • \n
    \n ))}\n
\n \n );\n};\n\ntype Props = {\n buckets?: Partial>;\n hasMetAnonymityThreshold: boolean;\n multipleChoiceBuckets?: Partial>;\n participantCount?: number;\n question: QuestionModel;\n textResponses?: string[];\n};\n\nconst ResultsController = (props: Props) => {\n const {buckets, hasMetAnonymityThreshold, multipleChoiceBuckets, participantCount, question, textResponses} = props;\n const {t} = useTranslation();\n const {questionType} = question;\n\n if (!hasMetAnonymityThreshold) {\n return (\n
\n }\n title={t('plugin.surveys.employee.results.not-enough-feedback')}\n />\n
\n );\n }\n\n switch (questionType) {\n case QuestionType.STAR:\n return ;\n case QuestionType.SCALE:\n return (\n \n );\n case QuestionType.NPS:\n return ;\n case QuestionType.MULTIPLE_CHOICE:\n return ;\n case QuestionType.TEXT:\n return ;\n default:\n return null;\n }\n};\n\nexport default ResultsController;\n","import {QuestionModel, QuestionType} from 'api';\nimport {useTranslation} from 'hooks';\nimport React, {PropsWithChildren} from 'react';\n\nimport {roundToTwoDecimalPlaces} from '../utils';\n\nconst ANONYMITY_LIMIT = 5;\n\nconst ResultSummary = ({children}: PropsWithChildren) => {\n return (\n
\n

{children}

\n
\n );\n};\n\nconst NoResultSummary = () => {\n const {t} = useTranslation();\n\n return (\n \n {t('plugin.surveys.employee.results.no-results')}\n \n );\n};\n\nconst NumericalResultSummary = ({average, maxNumericValue}: {average: number; maxNumericValue: number}) => {\n const {t} = useTranslation();\n\n return (\n \n \n {t('plugin.surveys.employee.results.average-score')} \n \n \n {roundToTwoDecimalPlaces(average)}\n /{maxNumericValue}\n \n \n );\n};\n\nconst GenericResultSummary = ({participantCount}: {participantCount: number}) => {\n const {t} = useTranslation();\n\n return (\n \n \n {t('plugin.surveys.employee.results.number-of-responses')} \n \n {participantCount}\n \n );\n};\n\nconst ResultSummaryController = (props: {average: number; participantCount: number; question: QuestionModel}) => {\n const {average, participantCount, question} = props;\n const {questionType} = question;\n\n if (participantCount < ANONYMITY_LIMIT) {\n return ;\n }\n\n switch (questionType) {\n case QuestionType.STAR:\n case QuestionType.SCALE:\n case QuestionType.NPS:\n return ;\n default:\n return ;\n }\n};\n\nexport default ResultSummaryController;\n","import {InstallationResults, ParticipantsResponse, QuestionModel, SurveyResultsResponse} from 'api';\nimport {useTranslation} from 'hooks';\nimport React, {Fragment, PropsWithChildren, ReactNode, useState} from 'react';\n\nimport {CaretDownIcon, CaretUpIcon, Divider} from '@staffbase/design';\n\nimport QuestionOverview from './QuestionOverview';\nimport Results from './Results';\nimport ResultSummary from './ResultSummary';\n\nconst ANONYMITY_THRESHOLD = 5;\n\ntype QuestionListProps = {\n questions: QuestionModel[];\n surveyId: string;\n surveyResults: SurveyResultsResponse;\n timeSeriesResults: InstallationResults;\n};\n\nconst QuestionList = ({questions, surveyResults}: QuestionListProps) => {\n if (questions.length === 1) {\n const question = questions[0];\n const {average, buckets, multipleChoiceBuckets, multipleChoiceParticipants, textResponses} = surveyResults[\n question.id\n ] || {\n average: undefined,\n buckets: undefined,\n multipleChoiceBuckets: undefined,\n multipleChoiceParticipants: undefined,\n textResponses: undefined\n };\n\n const numericFeedbackCount = Object.values(buckets || {}).reduce((acc, curr) => (acc += curr), 0);\n const participantCount = numericFeedbackCount || textResponses?.length || multipleChoiceParticipants || 0;\n\n return (\n }\n resultSummary={}\n >\n = ANONYMITY_THRESHOLD}\n multipleChoiceBuckets={multipleChoiceBuckets}\n question={question}\n textResponses={textResponses}\n />\n \n );\n }\n\n return (\n
\n {questions.map((question, index) => {\n const {average, buckets, multipleChoiceBuckets, multipleChoiceParticipants, textResponses} = surveyResults[\n question.id\n ] || {\n average: undefined,\n buckets: undefined,\n multipleChoiceBuckets: undefined,\n multipleChoiceParticipants: undefined,\n textResponses: undefined\n };\n\n const numericFeedbackCount = Object.values(buckets || {}).reduce((acc, curr) => (acc += curr), 0);\n const participantCount = numericFeedbackCount || textResponses?.length || multipleChoiceParticipants || 0;\n\n return (\n \n }\n resultSummary={\n \n }\n >\n = ANONYMITY_THRESHOLD}\n participantCount={participantCount}\n question={question}\n textResponses={textResponses}\n />\n \n {index === questions.length - 1 ? null : }\n \n );\n })}\n
\n );\n};\n\ntype QuestionLayouProps = {resultSummary: ReactNode; questionOverview: ReactNode};\n\nconst MultipleQuestionLayout = (props: PropsWithChildren) => {\n const {children, questionOverview, resultSummary} = props;\n const [isOpen, setIsOpen] = useState(false);\n\n return (\n {\n setIsOpen(currentTarget.open);\n }}\n className=\"flex flex-1 flex-col p-16\"\n >\n \n
{questionOverview}
\n
\n {resultSummary}\n
\n {isOpen ? (\n \n ) : (\n \n )}\n
\n
\n
\n
\n
\n {children}\n
\n
\n \n );\n};\n\nconst SingleQuestionLayout = (props: PropsWithChildren) => {\n const {children, questionOverview, resultSummary} = props;\n\n return (\n
\n
\n
{questionOverview}
\n {resultSummary}\n
\n
\n {children}\n
\n
\n );\n};\n\ninterface Props {\n questions: QuestionModel[];\n participants: ParticipantsResponse | undefined;\n surveyId: string;\n surveyResults: SurveyResultsResponse;\n timeSeriesResults: InstallationResults;\n}\n\nconst ShareableResults = (props: Props) => {\n const {questions, participants, surveyId, surveyResults, timeSeriesResults} = props;\n const {t} = useTranslation();\n\n return (\n
\n
\n

{t('plugin.surveys.employee.results.survey-results')}

\n
\n

\n {participants?.totalParticipants || '-'} \n {t('plugin.surveys.employee.results.participants')}\n

\n
\n
\n \n
\n \n
\n
\n );\n};\n\nexport default ShareableResults;\n","import {QuestionModel, useInstallationResults, useSurveyParticipants, useSurveyResults} from 'api';\nimport React from 'react';\n\nimport {ShareableResults} from 'components';\n\ninterface Props {\n installationId: string;\n questions: QuestionModel[];\n surveyId: string;\n}\n\nconst Entrypoint = (props: Props) => {\n const {installationId, questions, surveyId} = props;\n const participantsQuery = useSurveyParticipants({surveyId, hasReachedAnonymityLimit: true, installationId});\n const resultsQuery = useSurveyResults({id: surveyId, installationId});\n const timeSeriesQuery = useInstallationResults({installationId});\n\n if (participantsQuery.isLoading || resultsQuery.isLoading || timeSeriesQuery.isLoading) {\n return null;\n }\n\n if (resultsQuery.data === undefined || timeSeriesQuery.data === undefined) {\n return null;\n }\n\n return (\n \n );\n};\n\nexport default Entrypoint;\n","import {forwardRef, ReactElement, SVGAttributes, ButtonHTMLAttributes} from 'react';\nimport clsx from 'clsx';\n\nexport type ButtonVariant = 'primary' | 'secondary' | 'critical';\nexport type ButtonIconPosition = 'leading' | 'trailing';\n\nexport interface BaseButtonProps extends ButtonHTMLAttributes {\n /**\n * The colors of the component\n */\n variant?: ButtonVariant;\n /**\n * \"leading\" refers to the start position, whereas \"trailing\" refers to the end position of the icon\n */\n iconPosition?: ButtonIconPosition;\n}\n\nexport interface ButtonProps extends BaseButtonProps {\n /**\n * Refers to the child element of the button\n */\n children?: string;\n /**\n * Disabled state of the button\n */\n disabled?: boolean;\n /**\n * The icon of the button\n */\n icon?: ReactElement>;\n}\n\nexport const Button = forwardRef(function Button(props, ref): ReactElement {\n const {\n children,\n className = '',\n variant = 'primary',\n icon = null,\n disabled,\n iconPosition = 'leading',\n ...rest\n } = props;\n return (\n \n );\n});\n\nexport interface IconButtonProps extends Omit {\n icon: ReactElement>;\n title: string;\n}\n\nexport const IconButton = forwardRef(function IconButton(props, ref): ReactElement {\n const {icon, className = '', variant = 'primary', ...rest} = props;\n return (\n \n {icon}\n \n );\n});\n\nButton.displayName = 'Button';\n\nIconButton.displayName = 'IconButton';\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst DoubleCheckIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-double-check', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n \n \n );\n});\n\nDoubleCheckIcon.displayName = 'DoubleCheckIcon';\n\nexport default React.memo(DoubleCheckIcon);\n","import React from 'react';\nimport {PropsWithChildren} from 'react';\n\nconst SurveyCard = ({children}: PropsWithChildren) => {\n return (\n
\n {children}\n
\n );\n};\n\nexport default SurveyCard;\n","import {useTranslation} from 'hooks';\nimport React, {PropsWithChildren} from 'react';\nimport {useLocation} from 'wouter';\n\nimport {Button, DoubleCheckIcon} from '@staffbase/design';\n\nimport SurveyCard from '../SurveyCard';\n\nconst SurveyThanks = () => {\n const {t} = useTranslation();\n\n return (\n \n

\n {t('plugin.surveys.employee.finish.thanks')}\n

\n
\n );\n};\n\nexport const SurveyThanksWithResults = () => {\n const {t} = useTranslation();\n const [_, navigate] = useLocation();\n\n return (\n \n
\n

\n {t('plugin.surveys.employee.finish.thanks')}\n

\n

{t('plugin.surveys.employee.finish.results.description')}

\n
\n {\n navigate('/results');\n }}\n className=\"w-auto m-0\"\n >\n {t('plugin.surveys.employee.finish.results.button')}\n \n
\n );\n};\n\nconst Layout = ({children}: PropsWithChildren) => {\n return (\n \n
\n {/* TODO icon primary token seems to be missing in this verion of DS */}\n \n {children}\n
\n
\n );\n};\n\nexport default SurveyThanks;\n","var isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tObject.keys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tObject.keys(source).forEach(function(key) {\n\t\tif (!options.isMergeableObject(source[key]) || !target[key]) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = deepmerge(target[key], source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nexport default deepmerge_1;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nexport default freeGlobal;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nexport default root;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nexport default Symbol;\n","import Symbol from './_Symbol.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nexport default getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nexport default objectToString;\n","import Symbol from './_Symbol.js';\nimport getRawTag from './_getRawTag.js';\nimport objectToString from './_objectToString.js';\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nexport default baseGetTag;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nexport default overArg;\n","import overArg from './_overArg.js';\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nexport default getPrototype;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nexport default isObjectLike;\n","import baseGetTag from './_baseGetTag.js';\nimport getPrototype from './_getPrototype.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nexport default isPlainObject;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","var isProduction = process.env.NODE_ENV === 'production';\nfunction warning(condition, message) {\n if (!isProduction) {\n if (condition) {\n return;\n }\n\n var text = \"Warning: \" + message;\n\n if (typeof console !== 'undefined') {\n console.warn(text);\n }\n\n try {\n throw Error(text);\n } catch (x) {}\n }\n}\n\nexport default warning;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import arrayMap from './_arrayMap.js';\nimport copyArray from './_copyArray.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\nimport stringToPath from './_stringToPath.js';\nimport toKey from './_toKey.js';\nimport toString from './toString.js';\n\n/**\n * Converts `value` to a property path array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {*} value The value to convert.\n * @returns {Array} Returns the new property path array.\n * @example\n *\n * _.toPath('a.b.c');\n * // => ['a', 'b', 'c']\n *\n * _.toPath('a[0].b.c');\n * // => ['a', '0', 'b', 'c']\n */\nfunction toPath(value) {\n if (isArray(value)) {\n return arrayMap(value, toKey);\n }\n return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n}\n\nexport default toPath;\n","import deepmerge from 'deepmerge';\nimport isPlainObject from 'lodash-es/isPlainObject';\nimport cloneDeep from 'lodash-es/cloneDeep';\nimport { createContext, useContext, Children, useRef, useEffect, useState, useCallback, useMemo, useImperativeHandle, createElement, useLayoutEffect, forwardRef, Component } from 'react';\nimport isEqual from 'react-fast-compare';\nimport invariant from 'tiny-warning';\nimport clone from 'lodash-es/clone';\nimport toPath from 'lodash-es/toPath';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nvar FormikContext = /*#__PURE__*/createContext(undefined);\nFormikContext.displayName = 'FormikContext';\nvar FormikProvider = FormikContext.Provider;\nvar FormikConsumer = FormikContext.Consumer;\nfunction useFormikContext() {\n var formik = useContext(FormikContext);\n !!!formik ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Formik context is undefined, please verify you are calling useFormikContext() as child of a component.\") : invariant(false) : void 0;\n return formik;\n}\n\n/** @private is the value an empty array? */\n\nvar isEmptyArray = function isEmptyArray(value) {\n return Array.isArray(value) && value.length === 0;\n};\n/** @private is the given object a Function? */\n\nvar isFunction = function isFunction(obj) {\n return typeof obj === 'function';\n};\n/** @private is the given object an Object? */\n\nvar isObject = function isObject(obj) {\n return obj !== null && typeof obj === 'object';\n};\n/** @private is the given object an integer? */\n\nvar isInteger = function isInteger(obj) {\n return String(Math.floor(Number(obj))) === obj;\n};\n/** @private is the given object a string? */\n\nvar isString = function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n};\n/** @private is the given object a NaN? */\n// eslint-disable-next-line no-self-compare\n\nvar isNaN$1 = function isNaN(obj) {\n return obj !== obj;\n};\n/** @private Does a React component have exactly 0 children? */\n\nvar isEmptyChildren = function isEmptyChildren(children) {\n return Children.count(children) === 0;\n};\n/** @private is the given object/value a promise? */\n\nvar isPromise = function isPromise(value) {\n return isObject(value) && isFunction(value.then);\n};\n/** @private is the given object/value a type of synthetic event? */\n\nvar isInputEvent = function isInputEvent(value) {\n return value && isObject(value) && isObject(value.target);\n};\n/**\r\n * Same as document.activeElement but wraps in a try-catch block. In IE it is\r\n * not safe to call document.activeElement if there is nothing focused.\r\n *\r\n * The activeElement will be null only if the document or document body is not\r\n * yet defined.\r\n *\r\n * @param {?Document} doc Defaults to current document.\r\n * @return {Element | null}\r\n * @see https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/dom/getActiveElement.js\r\n */\n\nfunction getActiveElement(doc) {\n doc = doc || (typeof document !== 'undefined' ? document : undefined);\n\n if (typeof doc === 'undefined') {\n return null;\n }\n\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\n/**\r\n * Deeply get a value from an object via its path.\r\n */\n\nfunction getIn(obj, key, def, p) {\n if (p === void 0) {\n p = 0;\n }\n\n var path = toPath(key);\n\n while (obj && p < path.length) {\n obj = obj[path[p++]];\n } // check if path is not in the end\n\n\n if (p !== path.length && !obj) {\n return def;\n }\n\n return obj === undefined ? def : obj;\n}\n/**\r\n * Deeply set a value from in object via it's path. If the value at `path`\r\n * has changed, return a shallow copy of obj with `value` set at `path`.\r\n * If `value` has not changed, return the original `obj`.\r\n *\r\n * Existing objects / arrays along `path` are also shallow copied. Sibling\r\n * objects along path retain the same internal js reference. Since new\r\n * objects / arrays are only created along `path`, we can test if anything\r\n * changed in a nested structure by comparing the object's reference in\r\n * the old and new object, similar to how russian doll cache invalidation\r\n * works.\r\n *\r\n * In earlier versions of this function, which used cloneDeep, there were\r\n * issues whereby settings a nested value would mutate the parent\r\n * instead of creating a new object. `clone` avoids that bug making a\r\n * shallow copy of the objects along the update path\r\n * so no object is mutated in place.\r\n *\r\n * Before changing this function, please read through the following\r\n * discussions.\r\n *\r\n * @see https://github.com/developit/linkstate\r\n * @see https://github.com/jaredpalmer/formik/pull/123\r\n */\n\nfunction setIn(obj, path, value) {\n var res = clone(obj); // this keeps inheritance when obj is a class\n\n var resVal = res;\n var i = 0;\n var pathArray = toPath(path);\n\n for (; i < pathArray.length - 1; i++) {\n var currentPath = pathArray[i];\n var currentObj = getIn(obj, pathArray.slice(0, i + 1));\n\n if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {\n resVal = resVal[currentPath] = clone(currentObj);\n } else {\n var nextPath = pathArray[i + 1];\n resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};\n }\n } // Return original object if new value is the same as current\n\n\n if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {\n return obj;\n }\n\n if (value === undefined) {\n delete resVal[pathArray[i]];\n } else {\n resVal[pathArray[i]] = value;\n } // If the path array has a single element, the loop did not run.\n // Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\n\n\n if (i === 0 && value === undefined) {\n delete res[pathArray[i]];\n }\n\n return res;\n}\n/**\r\n * Recursively a set the same value for all keys and arrays nested object, cloning\r\n * @param object\r\n * @param value\r\n * @param visited\r\n * @param response\r\n */\n\nfunction setNestedObjectValues(object, value, visited, response) {\n if (visited === void 0) {\n visited = new WeakMap();\n }\n\n if (response === void 0) {\n response = {};\n }\n\n for (var _i = 0, _Object$keys = Object.keys(object); _i < _Object$keys.length; _i++) {\n var k = _Object$keys[_i];\n var val = object[k];\n\n if (isObject(val)) {\n if (!visited.get(val)) {\n visited.set(val, true); // In order to keep array values consistent for both dot path and\n // bracket syntax, we need to check if this is an array so that\n // this will output { friends: [true] } and not { friends: { \"0\": true } }\n\n response[k] = Array.isArray(val) ? [] : {};\n setNestedObjectValues(val, value, visited, response[k]);\n }\n } else {\n response[k] = value;\n }\n }\n\n return response;\n}\n\nfunction formikReducer(state, msg) {\n switch (msg.type) {\n case 'SET_VALUES':\n return _extends({}, state, {\n values: msg.payload\n });\n\n case 'SET_TOUCHED':\n return _extends({}, state, {\n touched: msg.payload\n });\n\n case 'SET_ERRORS':\n if (isEqual(state.errors, msg.payload)) {\n return state;\n }\n\n return _extends({}, state, {\n errors: msg.payload\n });\n\n case 'SET_STATUS':\n return _extends({}, state, {\n status: msg.payload\n });\n\n case 'SET_ISSUBMITTING':\n return _extends({}, state, {\n isSubmitting: msg.payload\n });\n\n case 'SET_ISVALIDATING':\n return _extends({}, state, {\n isValidating: msg.payload\n });\n\n case 'SET_FIELD_VALUE':\n return _extends({}, state, {\n values: setIn(state.values, msg.payload.field, msg.payload.value)\n });\n\n case 'SET_FIELD_TOUCHED':\n return _extends({}, state, {\n touched: setIn(state.touched, msg.payload.field, msg.payload.value)\n });\n\n case 'SET_FIELD_ERROR':\n return _extends({}, state, {\n errors: setIn(state.errors, msg.payload.field, msg.payload.value)\n });\n\n case 'RESET_FORM':\n return _extends({}, state, msg.payload);\n\n case 'SET_FORMIK_STATE':\n return msg.payload(state);\n\n case 'SUBMIT_ATTEMPT':\n return _extends({}, state, {\n touched: setNestedObjectValues(state.values, true),\n isSubmitting: true,\n submitCount: state.submitCount + 1\n });\n\n case 'SUBMIT_FAILURE':\n return _extends({}, state, {\n isSubmitting: false\n });\n\n case 'SUBMIT_SUCCESS':\n return _extends({}, state, {\n isSubmitting: false\n });\n\n default:\n return state;\n }\n} // Initial empty states // objects\n\n\nvar emptyErrors = {};\nvar emptyTouched = {};\nfunction useFormik(_ref) {\n var _ref$validateOnChange = _ref.validateOnChange,\n validateOnChange = _ref$validateOnChange === void 0 ? true : _ref$validateOnChange,\n _ref$validateOnBlur = _ref.validateOnBlur,\n validateOnBlur = _ref$validateOnBlur === void 0 ? true : _ref$validateOnBlur,\n _ref$validateOnMount = _ref.validateOnMount,\n validateOnMount = _ref$validateOnMount === void 0 ? false : _ref$validateOnMount,\n isInitialValid = _ref.isInitialValid,\n _ref$enableReinitiali = _ref.enableReinitialize,\n enableReinitialize = _ref$enableReinitiali === void 0 ? false : _ref$enableReinitiali,\n onSubmit = _ref.onSubmit,\n rest = _objectWithoutPropertiesLoose(_ref, [\"validateOnChange\", \"validateOnBlur\", \"validateOnMount\", \"isInitialValid\", \"enableReinitialize\", \"onSubmit\"]);\n\n var props = _extends({\n validateOnChange: validateOnChange,\n validateOnBlur: validateOnBlur,\n validateOnMount: validateOnMount,\n onSubmit: onSubmit\n }, rest);\n\n var initialValues = useRef(props.initialValues);\n var initialErrors = useRef(props.initialErrors || emptyErrors);\n var initialTouched = useRef(props.initialTouched || emptyTouched);\n var initialStatus = useRef(props.initialStatus);\n var isMounted = useRef(false);\n var fieldRegistry = useRef({});\n\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(function () {\n !(typeof isInitialValid === 'undefined') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead.') : invariant(false) : void 0; // eslint-disable-next-line\n }, []);\n }\n\n useEffect(function () {\n isMounted.current = true;\n return function () {\n isMounted.current = false;\n };\n }, []);\n\n var _React$useState = useState(0),\n setIteration = _React$useState[1];\n\n var stateRef = useRef({\n values: cloneDeep(props.initialValues),\n errors: cloneDeep(props.initialErrors) || emptyErrors,\n touched: cloneDeep(props.initialTouched) || emptyTouched,\n status: cloneDeep(props.initialStatus),\n isSubmitting: false,\n isValidating: false,\n submitCount: 0\n });\n var state = stateRef.current;\n var dispatch = useCallback(function (action) {\n var prev = stateRef.current;\n stateRef.current = formikReducer(prev, action); // force rerender\n\n if (prev !== stateRef.current) setIteration(function (x) {\n return x + 1;\n });\n }, []);\n var runValidateHandler = useCallback(function (values, field) {\n return new Promise(function (resolve, reject) {\n var maybePromisedErrors = props.validate(values, field);\n\n if (maybePromisedErrors == null) {\n // use loose null check here on purpose\n resolve(emptyErrors);\n } else if (isPromise(maybePromisedErrors)) {\n maybePromisedErrors.then(function (errors) {\n resolve(errors || emptyErrors);\n }, function (actualException) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Warning: An unhandled error was caught during validation in \", actualException);\n }\n\n reject(actualException);\n });\n } else {\n resolve(maybePromisedErrors);\n }\n });\n }, [props.validate]);\n /**\r\n * Run validation against a Yup schema and optionally run a function if successful\r\n */\n\n var runValidationSchema = useCallback(function (values, field) {\n var validationSchema = props.validationSchema;\n var schema = isFunction(validationSchema) ? validationSchema(field) : validationSchema;\n var promise = field && schema.validateAt ? schema.validateAt(field, values) : validateYupSchema(values, schema);\n return new Promise(function (resolve, reject) {\n promise.then(function () {\n resolve(emptyErrors);\n }, function (err) {\n // Yup will throw a validation error if validation fails. We catch those and\n // resolve them into Formik errors. We can sniff if something is a Yup error\n // by checking error.name.\n // @see https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n if (err.name === 'ValidationError') {\n resolve(yupToFormErrors(err));\n } else {\n // We throw any other errors\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Warning: An unhandled error was caught during validation in \", err);\n }\n\n reject(err);\n }\n });\n });\n }, [props.validationSchema]);\n var runSingleFieldLevelValidation = useCallback(function (field, value) {\n return new Promise(function (resolve) {\n return resolve(fieldRegistry.current[field].validate(value));\n });\n }, []);\n var runFieldLevelValidations = useCallback(function (values) {\n var fieldKeysWithValidation = Object.keys(fieldRegistry.current).filter(function (f) {\n return isFunction(fieldRegistry.current[f].validate);\n }); // Construct an array with all of the field validation functions\n\n var fieldValidations = fieldKeysWithValidation.length > 0 ? fieldKeysWithValidation.map(function (f) {\n return runSingleFieldLevelValidation(f, getIn(values, f));\n }) : [Promise.resolve('DO_NOT_DELETE_YOU_WILL_BE_FIRED')]; // use special case ;)\n\n return Promise.all(fieldValidations).then(function (fieldErrorsList) {\n return fieldErrorsList.reduce(function (prev, curr, index) {\n if (curr === 'DO_NOT_DELETE_YOU_WILL_BE_FIRED') {\n return prev;\n }\n\n if (curr) {\n prev = setIn(prev, fieldKeysWithValidation[index], curr);\n }\n\n return prev;\n }, {});\n });\n }, [runSingleFieldLevelValidation]); // Run all validations and return the result\n\n var runAllValidations = useCallback(function (values) {\n return Promise.all([runFieldLevelValidations(values), props.validationSchema ? runValidationSchema(values) : {}, props.validate ? runValidateHandler(values) : {}]).then(function (_ref2) {\n var fieldErrors = _ref2[0],\n schemaErrors = _ref2[1],\n validateErrors = _ref2[2];\n var combinedErrors = deepmerge.all([fieldErrors, schemaErrors, validateErrors], {\n arrayMerge: arrayMerge\n });\n return combinedErrors;\n });\n }, [props.validate, props.validationSchema, runFieldLevelValidations, runValidateHandler, runValidationSchema]); // Run all validations methods and update state accordingly\n\n var validateFormWithHighPriority = useEventCallback(function (values) {\n if (values === void 0) {\n values = state.values;\n }\n\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: true\n });\n return runAllValidations(values).then(function (combinedErrors) {\n if (!!isMounted.current) {\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: false\n });\n dispatch({\n type: 'SET_ERRORS',\n payload: combinedErrors\n });\n }\n\n return combinedErrors;\n });\n });\n useEffect(function () {\n if (validateOnMount && isMounted.current === true && isEqual(initialValues.current, props.initialValues)) {\n validateFormWithHighPriority(initialValues.current);\n }\n }, [validateOnMount, validateFormWithHighPriority]);\n var resetForm = useCallback(function (nextState) {\n var values = nextState && nextState.values ? nextState.values : initialValues.current;\n var errors = nextState && nextState.errors ? nextState.errors : initialErrors.current ? initialErrors.current : props.initialErrors || {};\n var touched = nextState && nextState.touched ? nextState.touched : initialTouched.current ? initialTouched.current : props.initialTouched || {};\n var status = nextState && nextState.status ? nextState.status : initialStatus.current ? initialStatus.current : props.initialStatus;\n initialValues.current = values;\n initialErrors.current = errors;\n initialTouched.current = touched;\n initialStatus.current = status;\n\n var dispatchFn = function dispatchFn() {\n dispatch({\n type: 'RESET_FORM',\n payload: {\n isSubmitting: !!nextState && !!nextState.isSubmitting,\n errors: errors,\n touched: touched,\n status: status,\n values: values,\n isValidating: !!nextState && !!nextState.isValidating,\n submitCount: !!nextState && !!nextState.submitCount && typeof nextState.submitCount === 'number' ? nextState.submitCount : 0\n }\n });\n };\n\n if (props.onReset) {\n var maybePromisedOnReset = props.onReset(state.values, imperativeMethods);\n\n if (isPromise(maybePromisedOnReset)) {\n maybePromisedOnReset.then(dispatchFn);\n } else {\n dispatchFn();\n }\n } else {\n dispatchFn();\n }\n }, [props.initialErrors, props.initialStatus, props.initialTouched, props.onReset]);\n useEffect(function () {\n if (isMounted.current === true && !isEqual(initialValues.current, props.initialValues)) {\n if (enableReinitialize) {\n initialValues.current = props.initialValues;\n resetForm();\n\n if (validateOnMount) {\n validateFormWithHighPriority(initialValues.current);\n }\n }\n }\n }, [enableReinitialize, props.initialValues, resetForm, validateOnMount, validateFormWithHighPriority]);\n useEffect(function () {\n if (enableReinitialize && isMounted.current === true && !isEqual(initialErrors.current, props.initialErrors)) {\n initialErrors.current = props.initialErrors || emptyErrors;\n dispatch({\n type: 'SET_ERRORS',\n payload: props.initialErrors || emptyErrors\n });\n }\n }, [enableReinitialize, props.initialErrors]);\n useEffect(function () {\n if (enableReinitialize && isMounted.current === true && !isEqual(initialTouched.current, props.initialTouched)) {\n initialTouched.current = props.initialTouched || emptyTouched;\n dispatch({\n type: 'SET_TOUCHED',\n payload: props.initialTouched || emptyTouched\n });\n }\n }, [enableReinitialize, props.initialTouched]);\n useEffect(function () {\n if (enableReinitialize && isMounted.current === true && !isEqual(initialStatus.current, props.initialStatus)) {\n initialStatus.current = props.initialStatus;\n dispatch({\n type: 'SET_STATUS',\n payload: props.initialStatus\n });\n }\n }, [enableReinitialize, props.initialStatus, props.initialTouched]);\n var validateField = useEventCallback(function (name) {\n // This will efficiently validate a single field by avoiding state\n // changes if the validation function is synchronous. It's different from\n // what is called when using validateForm.\n if (fieldRegistry.current[name] && isFunction(fieldRegistry.current[name].validate)) {\n var value = getIn(state.values, name);\n var maybePromise = fieldRegistry.current[name].validate(value);\n\n if (isPromise(maybePromise)) {\n // Only flip isValidating if the function is async.\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: true\n });\n return maybePromise.then(function (x) {\n return x;\n }).then(function (error) {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: {\n field: name,\n value: error\n }\n });\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: false\n });\n });\n } else {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: {\n field: name,\n value: maybePromise\n }\n });\n return Promise.resolve(maybePromise);\n }\n } else if (props.validationSchema) {\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: true\n });\n return runValidationSchema(state.values, name).then(function (x) {\n return x;\n }).then(function (error) {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: {\n field: name,\n value: getIn(error, name)\n }\n });\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: false\n });\n });\n }\n\n return Promise.resolve();\n });\n var registerField = useCallback(function (name, _ref3) {\n var validate = _ref3.validate;\n fieldRegistry.current[name] = {\n validate: validate\n };\n }, []);\n var unregisterField = useCallback(function (name) {\n delete fieldRegistry.current[name];\n }, []);\n var setTouched = useEventCallback(function (touched, shouldValidate) {\n dispatch({\n type: 'SET_TOUCHED',\n payload: touched\n });\n var willValidate = shouldValidate === undefined ? validateOnBlur : shouldValidate;\n return willValidate ? validateFormWithHighPriority(state.values) : Promise.resolve();\n });\n var setErrors = useCallback(function (errors) {\n dispatch({\n type: 'SET_ERRORS',\n payload: errors\n });\n }, []);\n var setValues = useEventCallback(function (values, shouldValidate) {\n var resolvedValues = isFunction(values) ? values(state.values) : values;\n dispatch({\n type: 'SET_VALUES',\n payload: resolvedValues\n });\n var willValidate = shouldValidate === undefined ? validateOnChange : shouldValidate;\n return willValidate ? validateFormWithHighPriority(resolvedValues) : Promise.resolve();\n });\n var setFieldError = useCallback(function (field, value) {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: {\n field: field,\n value: value\n }\n });\n }, []);\n var setFieldValue = useEventCallback(function (field, value, shouldValidate) {\n var resolvedValue = isFunction(value) ? value(getIn(state.values, field)) : value;\n dispatch({\n type: 'SET_FIELD_VALUE',\n payload: {\n field: field,\n value: resolvedValue\n }\n });\n var willValidate = shouldValidate === undefined ? validateOnChange : shouldValidate;\n return willValidate ? validateFormWithHighPriority(setIn(state.values, field, resolvedValue)) : Promise.resolve();\n });\n var executeChange = useCallback(function (eventOrTextValue, maybePath) {\n // By default, assume that the first argument is a string. This allows us to use\n // handleChange with React Native and React Native Web's onChangeText prop which\n // provides just the value of the input.\n var field = maybePath;\n var val = eventOrTextValue;\n var parsed; // If the first argument is not a string though, it has to be a synthetic React Event (or a fake one),\n // so we handle like we would a normal HTML change event.\n\n if (!isString(eventOrTextValue)) {\n // If we can, persist the event\n // @see https://reactjs.org/docs/events.html#event-pooling\n if (eventOrTextValue.persist) {\n eventOrTextValue.persist();\n }\n\n var target = eventOrTextValue.target ? eventOrTextValue.target : eventOrTextValue.currentTarget;\n var type = target.type,\n name = target.name,\n id = target.id,\n value = target.value,\n checked = target.checked,\n outerHTML = target.outerHTML,\n options = target.options,\n multiple = target.multiple;\n field = maybePath ? maybePath : name ? name : id;\n\n if (!field && process.env.NODE_ENV !== \"production\") {\n warnAboutMissingIdentifier({\n htmlContent: outerHTML,\n documentationAnchorLink: 'handlechange-e-reactchangeeventany--void',\n handlerName: 'handleChange'\n });\n }\n\n val = /number|range/.test(type) ? (parsed = parseFloat(value), isNaN(parsed) ? '' : parsed) : /checkbox/.test(type) // checkboxes\n ? getValueForCheckbox(getIn(state.values, field), checked, value) : options && multiple // setFieldValue(name, option)} />\n {option}\n \n ))}\n
\n \n {\n e.stopPropagation();\n onTouch();\n }}\n onChange={onChange}\n onKeyDown={(e) => {\n const keyValue = Number(e.key);\n const isValidValue =\n Number.isInteger(keyValue) && keyValue >= MINIMUM_NUMERIC_VALUE && keyValue <= maxNumericValue;\n\n if (isValidValue) {\n setFieldValue(name, keyValue);\n }\n }}\n step={hasSelectedScale ? 1 : 0.5}\n value={`${value ?? ''}`}\n style={{'--fill': `${value ? Number(value - 1) * (100 / Number(maxNumericValue - 1)) : 0}%`} as CSSProperties}\n />\n \n \n );\n};\n\ntype LayoutProps = {\n maxNumericValue: MaxScale;\n minScaleLabel: string;\n maxScaleLabel: string;\n questionId: string;\n};\n\nconst Layout = (props: PropsWithChildren) => {\n const {children, maxNumericValue, maxScaleLabel, minScaleLabel, questionId} = props;\n return (\n <>\n \n {MINIMUM_NUMERIC_VALUE}: \n {minScaleLabel}\n \n {children}\n \n {maxNumericValue}: \n {maxScaleLabel}\n \n \n );\n};\n\nconst ScaleQuestionField = ({name, question}: {name: string; question: ScaleQuestionModel}) => {\n return (\n \n {(props: FieldProps) => {\n const {field} = props;\n return ;\n }}\n \n );\n};\n\nexport default ScaleQuestionField;\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst StarIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-star', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n );\n});\n\nStarIcon.displayName = 'StarIcon';\n\nexport default React.memo(StarIcon);\n","import {FeedbackStar} from 'api';\nimport {useFormikContext} from 'formik';\nimport {useTranslation} from 'hooks';\nimport React, {ReactElement} from 'react';\n\ntype Props = {\n checked?: boolean;\n onBlur: () => void;\n onFocus: (value: FeedbackStar) => void;\n name: string;\n value: FeedbackStar;\n renderStar: () => ReactElement;\n};\n\nexport const RatingStar = (props: Props) => {\n const {checked, onBlur, onFocus, name, renderStar, value} = props;\n const {t} = useTranslation();\n const {setFieldValue, setFieldTouched} = useFormikContext();\n\n // TODO[rhe]: update formik to 3.0.0, see parse function\n // https://github.com/formium/formik/pull/2255\n const handleChange = (e: React.ChangeEvent) => {\n setFieldValue(props.name, Number(e.target.value));\n\n // without this Android doesn't correctly redraw the SVG input when using Talkback\n setTimeout(() => setFieldTouched(props.name, true));\n };\n\n return (\n {\n onFocus(value);\n }}\n onMouseLeave={onBlur}\n onBlur={onBlur}\n onFocus={() => {\n onFocus(value);\n }}\n >\n \n {renderStar()}\n \n );\n};\n\nexport default RatingStar;\n","import {FeedbackStar, StarQuestionModel} from 'api';\nimport {Field, FieldProps} from 'formik';\nimport React, {useState} from 'react';\n\nimport {StarAltIcon, StarIcon} from '@staffbase/design';\n\nimport {RatingStar} from './RatingStar';\n\nconst RATING_STARS = [FeedbackStar.ONE, FeedbackStar.TWO, FeedbackStar.THREE, FeedbackStar.FOUR, FeedbackStar.FIVE];\n\ntype Props = {name: string; question: StarQuestionModel; value: FeedbackStar};\n\nconst RatingStarList = ({question, name, value}: Props) => {\n const [hoveredStar, setHoveredStar] = useState(null);\n\n return (\n \n {RATING_STARS.map((star) => {\n const isFilled = star <= Number(value) || star <= Number(hoveredStar);\n const isChecked = star === Number(value);\n\n return (\n {\n setHoveredStar(null);\n }}\n onFocus={(value) => {\n setHoveredStar(value);\n }}\n key={`star-${star}`}\n name={name}\n value={star}\n renderStar={() => {\n if (isFilled) {\n return (\n \n );\n }\n return (\n \n );\n }}\n />\n );\n })}\n \n );\n};\n\nconst RatingStarField = ({name, question}: {name: string; question: StarQuestionModel}) => (\n
\n \n {({field}: FieldProps) => }\n \n
\n);\nexport default RatingStarField;\n","import {ChangeEvent, forwardRef, ReactElement, useId} from 'react';\nimport clsx from 'clsx';\n\nexport interface RadioProps {\n /**\n * The radio is checked\n */\n checked?: boolean;\n /**\n * The optional description text\n */\n description?: string;\n /**\n * The optional disabled text\n */\n disabled?: boolean;\n /**\n * The required label of the radio\n */\n label: string;\n /**\n * The onChange event occurs when selecting the radio value/option\n */\n onChange?: (e: ChangeEvent) => void;\n /**\n * The required name of the radio to reference the data\n */\n name: string;\n /**\n * The required value of the radio\n */\n value: string;\n /**\n * Error state of the radio\n */\n hasError?: boolean;\n /**\n * Optional classname prop for styling\n */\n className?: string;\n}\n\nexport const Radio = forwardRef(function Radio(props, ref): ReactElement {\n const {checked, description, disabled, label, name, onChange, value, hasError, className = ''} = props;\n const id = useId();\n const descriptionId = `radio-${id}-descr`;\n\n return (\n
\n \n {description && (\n \n {description}\n

\n )}\n
\n );\n});\n\nRadio.displayName = 'Radio';\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst CheckIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-check', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n );\n});\n\nCheckIcon.displayName = 'CheckIcon';\n\nexport default React.memo(CheckIcon);\n","import {forwardRef, InputHTMLAttributes, useId} from 'react';\n\nimport {AlertIcon, CheckIcon} from '../../icons';\n\nimport clsx from 'clsx';\n\nexport interface CheckboxProps\n extends Pick<\n InputHTMLAttributes,\n 'checked' | 'disabled' | 'onChange' | 'defaultChecked' | 'id' | 'name' | 'tabIndex' | 'readOnly' | 'className'\n > {\n label: string;\n description?: string;\n errorMessage?: string;\n hasError?: boolean;\n errorAriaLive?: 'off' | 'assertive' | 'polite';\n requiredLabel?: string;\n}\n\nconst Checkbox = forwardRef((props, ref) => {\n const {\n description,\n errorAriaLive,\n errorMessage,\n hasError,\n requiredLabel,\n label,\n className = '',\n ...inputProps\n } = props;\n\n const id = useId();\n const descriptionId = `checkbox-${id}-descr`;\n const inputId = `checkbox-${id}-label`;\n const errorId = `checkbox-${id}-error`;\n\n return (\n \n
\n \n \n \n \n {label && (\n \n {label}\n {requiredLabel && (\n \n {requiredLabel}\n \n )}\n \n )}\n
\n \n {hasError && errorMessage && (\n <>\n \n {errorMessage}\n \n )}\n \n {description && (\n \n {description}\n \n )}\n \n );\n});\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n","import {FeedbackMultipleChoice, MaxNumOptions, MultipleChoiceQuestionModel} from 'api';\nimport {useFormikContext} from 'formik';\nimport {useLanguage, useLocalizedContent, useTranslation} from 'hooks';\nimport React from 'react';\n\nimport {Checkbox, Radio} from '@staffbase/design';\n\nconst MaxOptions = ({maxNumOptions}: {maxNumOptions?: MaxNumOptions}) => {\n const {t} = useTranslation();\n\n if (!maxNumOptions) {\n return (\n \n );\n }\n if (maxNumOptions === MaxNumOptions.ONE) {\n return (\n \n );\n }\n return (\n \n );\n};\n\ninterface Props {\n name: string;\n question: MultipleChoiceQuestionModel;\n}\n\nconst MultipleChoiceField = ({name, question}: Props) => {\n const {availableLanguageValues} = useLanguage();\n const {values, setFieldValue} = useFormikContext>();\n const {options} = useLocalizedContent(question.content, availableLanguageValues);\n\n const {maxNumOptions} = question;\n const selectionCount = values[name]?.length;\n const maxNumOptionsReached = selectionCount === maxNumOptions;\n\n return (\n \n {}\n {options?.map(({id, text}) => {\n /*\n * We need to make sure not to disable the option the user has selected,\n * in case they want to change their mind and deselect the option\n */\n const isNotSelected = !values[name]?.includes(id);\n const disabled = maxNumOptions && isNotSelected && maxNumOptionsReached;\n\n const handleChange = () => {\n if (!values[name]) {\n setFieldValue(name, [id]);\n return;\n }\n\n if (isNotSelected) {\n setFieldValue(name, [...values[name], id]);\n return;\n }\n\n setFieldValue(\n name,\n values[name].filter((value) => value !== id)\n );\n };\n\n if (maxNumOptions === MaxNumOptions.ONE) {\n return (\n {\n setFieldValue(name, [id]);\n }}\n value={id}\n />\n );\n }\n\n return (\n \n );\n })}\n \n );\n};\n\nexport default MultipleChoiceField;\n","import {FeedbackNPS, MaxScale, NPSQuestionModel} from 'api';\nimport {Field, FieldInputProps, FieldProps, useFormikContext} from 'formik';\nimport {useLanguage, useLocalizedContent} from 'hooks';\nimport React, {ChangeEvent, CSSProperties, PropsWithChildren} from 'react';\n\nconst MINIMUM_NUMERIC_VALUE = 0;\n\nconst getSliderStyles = ({isTouched}: {isTouched: boolean}) => {\n if (!isTouched) {\n return `slider slider--untouched`;\n }\n\n return `slider slider--touched slider_gradient`;\n};\n\nconst NPSQuestionInput = ({question, value, name}: FieldInputProps & {question: NPSQuestionModel}) => {\n const {maxNumericValue} = question;\n const {availableLanguageValues} = useLanguage();\n const {minScaleLabel, maxScaleLabel} = useLocalizedContent(question.content, availableLanguageValues);\n const {setFieldValue} = useFormikContext();\n const hasSelectedScale = Number.isInteger(value);\n\n const sliderStyles = getSliderStyles({isTouched: hasSelectedScale});\n\n const onTouch = () => {\n if (hasSelectedScale) {\n return;\n }\n\n setFieldValue(name, Math.ceil(maxNumericValue / 2));\n };\n\n const onChange = (e: ChangeEvent) => {\n const value = Number(e.target.value);\n if (!value && value !== MINIMUM_NUMERIC_VALUE) {\n return;\n }\n\n setFieldValue(name, Math.floor(value));\n };\n\n return (\n
\n
\n {Array.from({length: maxNumericValue + 1}, (_, i) => i).map((option) => (\n \n setFieldValue(name, option)} />\n {option}\n \n ))}\n
\n \n {\n e.stopPropagation();\n onTouch();\n }}\n onChange={onChange}\n onKeyDown={(e) => {\n const keyValue = Number(e.key);\n const isValidValue =\n Number.isInteger(keyValue) && keyValue >= MINIMUM_NUMERIC_VALUE && keyValue <= maxNumericValue;\n\n if (isValidValue) {\n setFieldValue(name, keyValue);\n }\n }}\n step={hasSelectedScale ? 1 : 0.5}\n value={`${value ?? ''}`}\n style={{'--fill': `${value * maxNumericValue}%`} as CSSProperties}\n />\n \n
\n );\n};\n\ntype LayoutProps = {\n maxNumericValue: MaxScale;\n minScaleLabel: string;\n maxScaleLabel: string;\n questionId: string;\n};\n\nconst Layout = (props: PropsWithChildren) => {\n const {children, maxNumericValue, maxScaleLabel, minScaleLabel, questionId} = props;\n return (\n <>\n \n {MINIMUM_NUMERIC_VALUE}: \n {minScaleLabel}\n \n {children}\n \n {maxNumericValue}: \n {maxScaleLabel}\n \n \n );\n};\n\nconst NPSQuestionField = ({name, question}: {name: string; question: NPSQuestionModel}) => {\n return (\n \n {(props: FieldProps) => {\n const {field} = props;\n return ;\n }}\n \n );\n};\n\nexport default NPSQuestionField;\n","import {QuestionModel, QuestionType} from 'api';\nimport React from 'react';\n\nimport {\n MultipleChoiceField,\n NPSQuestionField,\n RatingStarField,\n ScaleQuestionField,\n TextQuestionField\n} from '../../../SurveyInputs';\n\nconst Field = (props: {question: QuestionModel}) => {\n const {question} = props;\n switch (question.questionType) {\n case QuestionType.TEXT:\n return ;\n case QuestionType.SCALE:\n return ;\n case QuestionType.STAR:\n return ;\n case QuestionType.MULTIPLE_CHOICE:\n return ;\n case QuestionType.NPS:\n return ;\n }\n};\n\nexport default Field;\n","import {ButtonHTMLAttributes, forwardRef, ReactElement, SVGAttributes} from 'react';\nimport clsx from 'clsx';\n\nexport interface GhostButtonProps extends BaseGhostButtonProps {\n /**\n * Refers to the child element of the ghost button\n */\n children?: string;\n /**\n * Disabled state of the ghost button\n */\n disabled?: boolean;\n /**\n * The icon of the button\n */\n icon?: ReactElement>;\n}\n\nexport type GhostButtonVariant = 'primary' | 'secondary' | 'critical';\nexport type GhostButtonIconPosition = 'leading' | 'trailing';\n\nexport interface BaseGhostButtonProps extends ButtonHTMLAttributes {\n /**\n * The colors of the component\n */\n variant?: GhostButtonVariant;\n /**\n * \"leading\" refers to the start position, whereas \"trailing\" refers to the end position of the icon\n */\n iconPosition?: GhostButtonIconPosition;\n}\n\nexport const GhostButton = forwardRef(\n function GhostButton(props, ref): ReactElement {\n const {\n children,\n className = '',\n variant = 'primary',\n icon = null,\n disabled,\n iconPosition = 'leading',\n ...rest\n } = props;\n return (\n \n {iconPosition === 'leading' ? icon : null}\n \n {children}\n \n {iconPosition === 'trailing' ? icon : null}\n \n );\n }\n);\n\nexport interface IconGhostButtonProps extends Omit {\n icon: ReactElement>;\n title: string;\n}\n\nexport const IconGhostButton = forwardRef(\n function IconGhostButton(props, ref): ReactElement {\n const {icon, className = '', variant = 'primary', ...rest} = props;\n\n return (\n \n {icon}\n \n );\n }\n);\n\nGhostButton.displayName = 'GhostButton';\nIconGhostButton.displayName = 'IconGhostButton';\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst ArrowRightIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-arrow-right', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n );\n});\n\nArrowRightIcon.displayName = 'ArrowRightIcon';\n\nexport default React.memo(ArrowRightIcon);\n","/**\n * THIS IS A GENERATED FILE. PLEASE SEE `scripts/iconGenerator`.\n */\n\nimport React, {SVGAttributes} from 'react';\n\nconst ArrowLeftIcon = React.forwardRef>((props, ref) => {\n const {className, ...rest} = props;\n const finalClassName = ['ds-icon ds-icon-arrow-left', className].filter(Boolean).join(' ');\n\n return (\n \n \n \n );\n});\n\nArrowLeftIcon.displayName = 'ArrowLeftIcon';\n\nexport default React.memo(ArrowLeftIcon);\n","import {QuestionModel} from 'api';\nimport {useFormikContext} from 'formik';\nimport {useIsRTL, useTranslation} from 'hooks';\nimport React, {PropsWithChildren} from 'react';\n\nimport {ArrowLeftIcon, ArrowRightIcon, Button, GhostButton, LockIcon} from '@staffbase/design';\n\nimport {countValidFeedback} from '../helpers';\nimport {Values} from '../reducer';\n\nconst ICON_DIMENSION = 12;\n\ntype Props = {\n isLastStep: boolean;\n isSkip: boolean;\n backButtonDisabled: boolean;\n onNavBack: () => void;\n questions: QuestionModel[];\n isSubmitting: boolean;\n};\n\nconst Footer = (props: PropsWithChildren) => {\n const {children, isLastStep, isSkip, backButtonDisabled, onNavBack, questions, isSubmitting} = props;\n const {t} = useTranslation();\n const {values} = useFormikContext();\n const {isRTL} = useIsRTL();\n\n const submitDisabled = !countValidFeedback(questions, values) || isSubmitting;\n\n if (isLastStep && submitDisabled) {\n return (\n
\n {children}\n\n
\n : }\n >\n {t('plugin.surveys.employee.confirmation.back')}\n \n
\n
\n );\n }\n\n if (isLastStep) {\n return (\n
\n {children}\n\n
\n : }\n >\n {t('plugin.surveys.employee.confirmation.back')}\n \n \n
\n
\n );\n }\n\n return (\n \n {backButtonDisabled ? null : (\n \n )}\n \n \n );\n};\n\nconst Layout = ({children}: PropsWithChildren) => {\n const {t} = useTranslation();\n\n return (\n
\n
\n \n

\n {t('plugin.surveys.employee.multiple-questions.confidential.label')}\n

\n
\n\n
{children}
\n
\n );\n};\n\nexport default Footer;\n","import {Reducer as ReducerType} from 'react';\n\nexport type Values = Record;\n\ninterface State {\n stepNumber: number;\n totalSteps: number;\n values: Values;\n}\n\ninterface ActionNext {\n type: 'next';\n values: Values;\n}\n\ninterface ActionPrevious {\n type: 'prev';\n values: Values;\n}\n\ntype Action = ActionNext | ActionPrevious;\n\nconst Reducer: ReducerType = (state, action) => {\n switch (action.type) {\n case 'next':\n return {...state, values: action.values, stepNumber: Math.min(state.stepNumber + 1, state.totalSteps - 1)};\n case 'prev':\n return {...state, values: action.values, stepNumber: Math.max(state.stepNumber - 1, 0)};\n default:\n return state;\n }\n};\n\nexport default Reducer;\n","import {QuestionModel} from 'api';\nimport {Form, Formik, FormikHelpers} from 'formik';\nimport {useTranslation} from 'hooks';\nimport React, {useReducer} from 'react';\n\nimport {AlertIcon} from '@staffbase/design';\n\nimport ProgressBar from '../../ProgressBar';\nimport QuestionContents from '../../QuestionContents';\nimport SurveyCard from '../../SurveyCard';\nimport SubmissionStep from '../SubmissionStep';\nimport Field from './Field';\nimport Footer from './Footer';\nimport {mapToObject, checkFeedback, sanitizeFeedback} from './helpers';\nimport Reducer, {Values} from './reducer';\n\ntype Props = {\n initialStep?: number;\n hasError: boolean;\n onSubmit: (values: Values) => void;\n questions: QuestionModel[];\n resultSharingEnabled?: boolean;\n};\nconst Wizard = (props: Props) => {\n const {hasError, questions, initialStep, onSubmit, resultSharingEnabled} = props;\n const {t} = useTranslation();\n const fieldNames = questions.map(({id}) => id);\n const initialValues = mapToObject(questions);\n const [state, dispatch] = useReducer(Reducer, {\n stepNumber: initialStep ?? 0,\n totalSteps: questions.length + 1,\n values: initialValues\n });\n\n const step = questions[state.stepNumber];\n const isLastStep = state.stepNumber === state.totalSteps - 1;\n const currentFieldName = fieldNames[state.stepNumber];\n\n const handleSubmit = async (values: Values, helpers: FormikHelpers) => {\n if (isLastStep) {\n onSubmit(sanitizeFeedback(questions, values));\n return;\n }\n helpers.setTouched({});\n dispatch({type: 'next', values});\n return false;\n };\n\n return (\n \n {(formik) => (\n
\n \n \n {isLastStep ? (\n \n ) : (\n <>\n \n \n \n )}\n {\n dispatch({type: 'prev', values: formik.values});\n\n formik.setSubmitting(true);\n setTimeout(() => {\n formik.setSubmitting(false);\n });\n }}\n backButtonDisabled={state.stepNumber === 0}\n isSkip={!isLastStep && !checkFeedback(step.questionType, formik.values[currentFieldName])}\n isLastStep={isLastStep}\n isSubmitting={formik.isSubmitting}\n questions={questions}\n >\n {hasError ? (\n
\n \n

{t('plugin.surveys.employee.errors.feedback.submit')}

\n
\n ) : null}\n \n
\n \n )}\n
\n );\n};\n\nexport default Wizard;\n","import clsx from 'clsx';\nimport {ReactElement} from 'react';\n\ntype SpinnerSize = '64px' | '40px' | '24px' | '12px';\n\nexport interface LoadingSpinnerProps {\n /**\n * Sizing variants of the loading spinner\n */\n sizing?: SpinnerSize;\n /** Describes the purpose/context of the loading spinner **/\n a11yDescription: string;\n /**\n * optional className prop for styling\n */\n className?: string;\n}\n\nexport default function LoadingSpinner(props: Readonly): ReactElement {\n const {sizing = '40px', a11yDescription, className = ''} = props;\n\n return (\n
\n \n {a11yDescription}\n
\n \n );\n}\n\nLoadingSpinner.displayName = 'LoadingSpinner';\n","import {QuestionModel, QuestionType} from 'api';\nimport {Formik} from 'formik';\nimport {useTranslation} from 'hooks';\nimport React from 'react';\n\nimport {AlertIcon, Button, LoadingSpinner, LockIcon} from '@staffbase/design';\n\nimport QuestionContents from '../QuestionContents';\nimport {\n MultipleChoiceField,\n NPSQuestionField,\n RatingStarField,\n ScaleQuestionField,\n TextQuestionField\n} from '../SurveyInputs';\n\nimport SurveyCard from 'components/src/SurveyCard';\n\nexport interface SurveyForm {\n answerValue: string;\n}\n\nconst InvalidSubmissionMessage = () => {\n const {t} = useTranslation();\n\n return (\n
\n \n

\n {t('plugin.surveys.employee.invalid-submission')} {t('plugin.surveys.employee.confidential.label')}\n

\n
\n );\n};\n\nconst AnonymityLabel = () => {\n const {t} = useTranslation();\n\n return (\n
\n \n

{t('plugin.surveys.employee.confidential.label')}

\n
\n );\n};\n\ntype Props = {\n handleSubmitFeedback: ({answerValue}: {[questionId: string]: unknown}) => void;\n hasError: boolean;\n question: QuestionModel;\n};\n\nconst SingleQuestionForm = (props: Props) => {\n const {handleSubmitFeedback, hasError, question} = props;\n const {t} = useTranslation();\n\n return (\n \n initialValues={{answerValue: ''}}\n onSubmit={({answerValue}, {setErrors, setSubmitting}) => {\n // this is awkward, will revisit validation when replacing Formik\n if (!answerValue || (typeof answerValue === 'string' && answerValue.trim() === '')) {\n setErrors({[question.id]: 'invalid submission'});\n setSubmitting(false);\n return;\n }\n handleSubmitFeedback({[question.id]: answerValue});\n }}\n >\n {({handleSubmit, isSubmitting, errors}) => {\n const hasInvalidSubmission = Object.keys(errors).length > 0;\n\n return (\n
\n \n \n \n
\n {hasInvalidSubmission ? : }\n : undefined}\n >\n {t('plugin.surveys.employee.button.submit-answer')}\n \n
\n {hasError ? (\n
\n \n

\n {t('plugin.surveys.employee.errors.feedback.submit')}\n

\n
\n ) : null}\n
\n
\n );\n }}\n \n );\n};\n\nconst Field = ({question}: {question: QuestionModel}) => {\n switch (question.questionType) {\n case QuestionType.TEXT:\n return ;\n case QuestionType.SCALE:\n return ;\n case QuestionType.STAR:\n return ;\n case QuestionType.MULTIPLE_CHOICE:\n return ;\n case QuestionType.NPS:\n return ;\n }\n};\n\nexport default SingleQuestionForm;\n","import {QuestionModel, useLatestSurvey} from 'api';\nimport {FeatureFlag, useFeatureFlags} from 'hooks';\nimport React from 'react';\nimport {Redirect, Route, Router, Switch, useLocation, useParams} from 'wouter';\nimport {memoryLocation} from 'wouter/memory-location';\n\nimport Results from '../QuestionPreview/Results';\n\nimport {\n SingleQuestionForm,\n MultipleQuestionForm,\n SurveyThanks,\n SurveyThanksWithResults,\n ShareableResults\n} from 'components';\n\ninterface Props {\n questions: QuestionModel[];\n resultSharingEnabled: boolean;\n step?: number;\n}\n\nconst PreviewSurvey = ({questions, resultSharingEnabled, step}: Props) => {\n const flags = useFeatureFlags();\n const {installationId} = useParams<{installationId: string}>();\n const {data} = useLatestSurvey({installationId});\n const {hook} = memoryLocation({path: '/survey'});\n\n return (\n \n \n \n \n \n \n {flags.has(FeatureFlag.PREMIUM) && resultSharingEnabled ? : }\n \n \n {data?.id ? (\n \n ) : (\n \n )}\n \n \n \n \n \n \n );\n};\n\ninterface SurveyProps {\n questions: QuestionModel[];\n resultSharingEnabled: boolean;\n step?: number;\n}\n\nconst Survey = ({questions, resultSharingEnabled, step}: SurveyProps) => {\n const [_, navigate] = useLocation();\n\n const handleSubmitFeedback = (_: Record) => {\n navigate('/thanks');\n };\n\n if (questions.length > 1) {\n return (\n \n );\n } else {\n const question = questions[0];\n\n return ;\n }\n};\n\nexport default PreviewSurvey;\n","import { useSyncExternalStore } from \"./react-deps.js\";\n\n/**\n * In-memory location that supports navigation\n */\n\nexport const memoryLocation = ({\n path = \"/\",\n searchPath = \"\",\n state: initialState = null,\n static: staticLocation,\n record,\n} = {}) => {\n let initialPath = path;\n if (searchPath) {\n // join with & if path contains search query, and ? otherwise\n initialPath += path.split(\"?\")[1] ? \"&\" : \"?\";\n initialPath += searchPath;\n }\n\n let [currentPath, currentSearch = \"\"] = initialPath.split(\"?\");\n let currentState = initialState;\n const history = [initialPath];\n let listeners = [];\n\n const navigateImplementation = (path, { replace = false, state } = {}) => {\n if (record)\n history[replace && history.length ? history.length - 1 : history.length] =\n path;\n\n [currentPath, currentSearch = \"\"] = path.split(\"?\");\n if (state !== undefined) currentState = state;\n listeners.forEach((cb) => cb());\n };\n\n const navigate = !staticLocation ? navigateImplementation : () => null;\n\n // Copy on subscription changes instead of copying on every navigation.\n const subscribe = (cb) => {\n listeners = [...listeners, cb];\n return () => {\n listeners = listeners.filter((i) => i !== cb);\n };\n };\n\n // Fresh getters keep React 18's store cache current after render-phase updates.\n // https://github.com/facebook/react/pull/25578\n const useMemoryLocation = () => [\n useSyncExternalStore(subscribe, () => currentPath),\n navigate,\n ];\n\n const useMemoryQuery = () =>\n useSyncExternalStore(subscribe, () => currentSearch);\n\n // Attach searchHook to the location hook for auto-inheritance in Router\n useMemoryLocation.searchHook = useMemoryQuery;\n\n function reset() {\n // clean history array with mutation to preserve link\n history.length = 0;\n navigateImplementation(initialPath, { state: initialState });\n }\n\n return Object.defineProperty(\n {\n hook: useMemoryLocation,\n searchHook: useMemoryQuery,\n navigate,\n history: record ? history : undefined,\n reset: record ? reset : undefined,\n },\n \"state\",\n { enumerable: true, get: () => currentState }\n );\n};\n","import styled from '@emotion/styled';\n\nimport {WithTheme, withTheme} from '@staffbase/ui';\n\nexport const DialogWrapper = styled.div`\n align-items: stretch;\n display: flex;\n flex-direction: column;\n`;\n\nexport const Dialog = withTheme(styled.div`\n align-items: stretch;\n width: 990px;\n padding: 40px;\n border-radius: 5px 5px 0px 0px;\n text-align: left;\n display: flex;\n flex: auto;\n max-height: 668px;\n overflow: auto;\n background-color: #fafafa;\n\n @media only screen and (max-width: 480px) {\n text-align: center;\n width: 100%;\n margin: 0 24px;\n padding: 24px 12px;\n }\n\n > form {\n width: 100%;\n }\n`);\n\nexport const CloseDialogButtonWrapper = styled.div`\n padding: 18px 40px;\n display: flex;\n background-color: #eeeeee;\n border-radius: 0px 0px 5px 5px;\n justify-content: flex-end;\n`;\n","import {QuestionModel} from 'api';\nimport {useTranslation} from 'hooks';\nimport React, {CSSProperties, ReactNode, useState} from 'react';\n\nimport {DesktopModal} from '@staffbase/ui';\n\nimport PreviewSurvey from '../../PreviewSurvey';\nimport {WidgetButton} from '../../QuestionForm/index.styles';\nimport {CloseDialogButtonWrapper, Dialog, DialogWrapper} from './index.styles';\n\ninterface RenderPreviewProps {\n questions: QuestionModel[];\n resultSharingEnabled: boolean;\n render(props: {show: (step?: number) => void}): ReactNode;\n}\n/**\n * Renders the preview for given questions\n * starts the survey at the step given in the show function\n *\n * ignores calls to \"show\" with invalid values for \"step\"\n */\n// eslint-disable-next-line @typescript-eslint/unbound-method\nexport const Preview = ({render, resultSharingEnabled, questions}: RenderPreviewProps) => {\n const [isShown, setIsShown] = useState(false);\n const [step, setStep] = useState(0);\n const {t} = useTranslation();\n const show = (from = 0) => {\n if (questions.length === 0) {\n return;\n }\n if (from > questions.length) {\n return;\n }\n if (from < 0) {\n return;\n }\n if (!Number.isInteger(from)) {\n return;\n }\n\n setIsShown(true);\n setStep(from);\n };\n\n return (\n <>\n {render({show})}\n {\n setIsShown(false);\n }}\n content={(onClose) => (\n \n \n
\n \n
\n
\n \n \n {t('plugin.surveys.admin.planner.question.preview.close')}\n \n \n
\n )}\n />\n \n );\n};\n\nexport default Preview;\n","import {useGrowl, GrowlType} from '@staffbase/ui';\n\nexport interface GrowlInterface {\n showError: (message: string) => void;\n showSuccess: (message: string) => void;\n showPromiseError: (_: string) => (_: unknown) => void;\n showPromiseSuccess: (_: string) => (_: unknown) => void;\n}\n\nconst useGrowlNotification = (): GrowlInterface => {\n const growl = useGrowl();\n\n const showError = (message: string) => {\n growl.show(message, {\n type: GrowlType.Error\n });\n };\n\n const showSuccess = (message: string) => {\n growl.show(message, {\n type: GrowlType.Success\n });\n };\n\n const showPromiseError = (message: string) => {\n return (error: unknown) => {\n console.error(error)\n showError(message);\n };\n };\n\n const showPromiseSuccess = (message: string) => {\n return (_: unknown) => {\n showSuccess(message);\n };\n };\n\n return {showError, showSuccess, showPromiseError, showPromiseSuccess};\n};\n\nexport default useGrowlNotification;\n","import {\n getDefaultQuestionContent,\n MaxNumOptions,\n MaxScale,\n QuestionModel,\n QuestionPostContent,\n QuestionType\n} from 'api';\nimport {produce} from 'immer';\nimport {Reducer} from 'react';\n\ninterface ActionInitialize {\n type: 'initialize';\n value: QuestionModel;\n}\n\ninterface ActionAdd {\n type: 'add';\n localeKey: string;\n localeToCopy: string | undefined;\n}\n\ninterface ActionRemove {\n type: 'remove';\n localeKey: string;\n}\n\ninterface ActionEdit {\n type: 'edit';\n localeKey: string;\n prop: keyof QuestionPostContent;\n value: unknown;\n}\n\ninterface ChangeQuestionType {\n type: 'changeQuestionType';\n to: QuestionType;\n}\n\ninterface ChangeMaxScale {\n type: 'changeMaxScale';\n to: MaxScale;\n}\n\ninterface AddOption {\n type: 'addOption';\n}\n\ninterface RemoveOption {\n type: 'removeOption';\n index: number;\n}\n\ninterface EditOption {\n type: 'editOption';\n index: number;\n localeKey: string;\n value: string;\n}\n\ninterface MoveOption {\n type: 'moveOption';\n prevIndex: number;\n newIndex: number;\n}\n\ninterface ChangeMaxOptions {\n type: 'changeMaxOptions';\n value: number | undefined;\n}\n\ninterface ActionToggleDescription {\n type: 'toggleDescription';\n value: boolean;\n}\n\nexport type QuestionAction =\n | ActionInitialize\n | ActionAdd\n | ActionRemove\n | ActionEdit\n | ActionToggleDescription\n | ChangeQuestionType\n | ChangeMaxScale\n | ChangeMaxOptions\n | AddOption\n | RemoveOption\n | EditOption\n | MoveOption;\n\nexport interface QuestionReducerInterface {\n translations: Record;\n hasDescription: boolean;\n questionType: QuestionType;\n maxNumOptions?: MaxNumOptions;\n scaleQuestionRange?: MaxScale;\n}\n\nexport const QuestionReducer: Reducer = produce((draft, action) => {\n const firstTranslationKey = Object.keys(draft.translations)[0];\n\n switch (action.type) {\n case 'initialize': {\n const hasDescription = Object.values(action.value.content).some((translation) => translation.description);\n const scaleQuestionRange =\n action.value.questionType === QuestionType.SCALE ? action.value.maxScale : MaxScale.FIVE;\n const maxNumOptions =\n action.value.questionType === QuestionType.MULTIPLE_CHOICE ? action.value.maxNumOptions : undefined;\n\n return {\n translations: action.value.content,\n hasDescription,\n questionType: action.value.questionType,\n maxNumOptions,\n scaleQuestionRange\n };\n }\n case 'add':\n // prevents user adding multiple of the same language\n if (draft.translations[action.localeKey]) {\n break;\n }\n\n if (action.localeToCopy) {\n draft.translations[action.localeKey] = draft.translations[action.localeToCopy];\n break;\n }\n\n draft.translations[action.localeKey] = getDefaultQuestionContent();\n\n if (draft.questionType === QuestionType.MULTIPLE_CHOICE) {\n const optionCount = draft.translations[firstTranslationKey].options?.length || 1;\n draft.translations[action.localeKey].options = Array.from({length: optionCount}, (_) => ({text: ''}));\n break;\n }\n\n break;\n case 'remove':\n delete draft.translations[action.localeKey];\n break;\n case 'edit':\n draft.translations[action.localeKey] = {...draft.translations[action.localeKey], [action.prop]: action.value};\n break;\n case 'changeQuestionType':\n if (action.to === draft.questionType) {\n break;\n }\n\n if (action.to === QuestionType.MULTIPLE_CHOICE) {\n for (const locale of Object.keys(draft.translations)) {\n draft.translations[locale].options = [{text: ''}];\n }\n } else {\n draft.maxNumOptions = undefined;\n }\n\n draft.questionType = action.to;\n break;\n case 'changeMaxScale':\n draft.scaleQuestionRange = action.to;\n break;\n case 'addOption':\n for (const locale of Object.keys(draft.translations)) {\n draft.translations[locale].options = [...(draft.translations[locale].options || [{text: ''}]), {text: ''}];\n }\n break;\n case 'removeOption': {\n for (const locale of Object.keys(draft.translations)) {\n draft.translations[locale]?.options?.splice(action.index, 1);\n }\n\n const currentOptionCount = draft.translations[firstTranslationKey].options?.length || 1;\n /*\n * If the max number of options that an employee may select is currently less or equal to\n * actual number of options available, we reset it to undefined\n */\n if (draft.maxNumOptions && currentOptionCount <= draft.maxNumOptions.valueOf()) {\n draft.maxNumOptions = undefined;\n }\n\n break;\n }\n case 'editOption': {\n const optionsToEdit = draft.translations[action.localeKey].options || [{text: ''}];\n optionsToEdit[action.index] = {text: action.value};\n\n draft.translations[action.localeKey].options = optionsToEdit;\n break;\n }\n case 'changeMaxOptions':\n draft.maxNumOptions = action.value;\n break;\n case 'moveOption':\n for (const locale of Object.keys(draft.translations)) {\n const optionToMove = draft.translations[locale]?.options?.splice(action.prevIndex, 1)[0];\n\n if (optionToMove === undefined) {\n break;\n }\n\n draft.translations[locale].options?.splice(action.newIndex, 0, optionToMove);\n }\n break;\n case 'toggleDescription':\n draft.hasDescription = action.value;\n break;\n }\n\n return draft;\n});\n","import styled from '@emotion/styled';\nimport React from 'react';\n\nimport Icon, {IconName, IconStyled} from '../Icon/Icon';\n\nexport interface IconButtonProps extends React.HTMLProps {\n /**\n * The char of an icon that should be displayed.\n */\n char: string | IconName;\n\n /**\n * A label that describes the icon - important for a11y!\n */\n label: string;\n}\n\nexport const IconButtonStyled = styled(IconStyled.withComponent('button'))`\n display: inline-block;\n width: 40px;\n height: 40px;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 22px;\n color: inherit;\n padding: 0;\n margin: 0;\n\n &:hover {\n opacity: 0.6;\n border: none;\n background: none !important;\n }\n`;\n\nconst IconButtonContainer = Icon.withComponent(IconButtonStyled);\n\n/**\n * A button that only consists of an icon (no border, no background, no text).\n */\nexport default function IconButton(props: IconButtonProps): JSX.Element {\n return ;\n}\n","import styled from '@emotion/styled';\n\nimport IconButton from '../../atoms/IconButton/IconButton';\nimport {ColorScheme} from '../../theme';\n\nexport const Wrapper = styled.div`\n width: 100%;\n display: flex;\n align-items: center;\n background-color: ${ColorScheme.backgroundField};\n border-bottom: 1px solid ${ColorScheme.borderSolid};\n`;\n\ninterface TranslationTabProps {\n readonly isSelected?: boolean;\n}\nexport const TranslationTab = styled.div`\n display: flex;\n align-items: center;\n`;\n\nexport const CountryFlag = styled.span`\n margin-right: 10px;\n flex: 0 0 auto;\n`;\n\nexport const TranslationName = styled.span`\n flex-basis: 100%;\n white-space: nowrap;\n font-size: 14px;\n flex: 1 0 auto;\n`;\n\nexport const DeleteTranslationButton = styled(IconButton)`\n color: ${ColorScheme.textPlaceholder};\n font-size: 10px;\n font-weight: 600;\n width: auto;\n height: auto;\n margin-left: 10px;\n flex: 0 0 auto;\n\n opacity: 0.4;\n &:hover {\n opacity: 1;\n }\n`;\n\nexport const AddTranslationButton = styled(IconButton)`\n font-size: 18px;\n color: #ccc;\n\n &:hover {\n opacity: 1;\n color: #888;\n }\n`;\n","import React from 'react';\n\nimport {useTranslations} from '../../adapters/I18nAdapter';\nimport TabbedList from '../../atoms/TabbedList/TabbedList';\nimport {getAccessibleButtonProps} from '../../helpers/a11y';\nimport {\n DeleteTranslationButton as RemoveTranslationButton,\n AddTranslationButton,\n Wrapper,\n TranslationTab,\n CountryFlag,\n TranslationName\n} from './TranslationsBar.style';\n\nconst renderTranslationTabContent = (\n locale: Locale,\n showRemoveButton: boolean,\n handleLocaleRemove: (localeKey: string) => void,\n deleteTranslationLabel: string\n // eslint-disable-next-line react/display-name\n) => (isSelected: boolean) => (\n \n \n {locale.name}\n {showRemoveButton && (\n {\n event.stopPropagation();\n handleLocaleRemove(locale.localeKey);\n })}\n label={deleteTranslationLabel}\n char=\"c\"\n />\n )}\n \n);\n\ninterface Locale {\n readonly localeKey: string;\n readonly name: string;\n}\ninterface TranslationsBarProps {\n readonly locales: Locale[];\n readonly onSelect?: (locale: string) => void;\n readonly onRemove?: (localeKey: string) => void;\n readonly onAdd?: () => void;\n readonly hideRemoveButton?: boolean;\n readonly hideAddButton?: boolean;\n readonly selectedLocaleKey?: string;\n}\n\nexport default function TranslationsBar({\n locales,\n onSelect,\n onRemove,\n onAdd,\n selectedLocaleKey,\n hideRemoveButton,\n hideAddButton\n}: TranslationsBarProps): JSX.Element {\n const t = useTranslations();\n const shouldShowRemoveButton = !hideRemoveButton && locales.length > 1;\n const handleTabSelect = (_: number, data: string) => {\n onSelect?.(data);\n };\n const handleLocaleDelete = (localeKey: string) => {\n onRemove?.(localeKey);\n };\n const removeTranslationButtonLabel = t('TranslationSwitcher.remove.headline');\n const tabs = locales.map((locale) => ({\n data: locale.localeKey,\n renderTabContent: renderTranslationTabContent(\n locale,\n shouldShowRemoveButton,\n handleLocaleDelete,\n removeTranslationButtonLabel\n )\n }));\n\n return (\n \n \n tabs={tabs}\n onTabSelect={handleTabSelect}\n selectedIndex={locales.findIndex((locale) => locale.localeKey === selectedLocaleKey)}\n />\n {!hideAddButton && (\n \n )}\n \n );\n}\n","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","export default function getUAString() {\n var uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) {\n return uaData.brands.map(function (item) {\n return item.brand + \"/\" + item.version;\n }).join(' ');\n }\n\n return navigator.userAgent;\n}","import getUAString from \"../utils/userAgent.js\";\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}","import { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nimport getWindow from \"./getWindow.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getBoundingClientRect(element, includeScale, isFixedStrategy) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n var clientRect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n var _ref = isElement(element) ? getWindow(element) : window,\n visualViewport = _ref.visualViewport;\n\n var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;\n var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;\n var width = clientRect.width / scaleX;\n var height = clientRect.height / scaleY;\n return {\n width: width,\n height: height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x: x,\n y: y\n };\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getUAString from \"../utils/userAgent.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = /firefox/i.test(getUAString());\n var isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref, win) {\n var x = _ref.x,\n y = _ref.y;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }, getWindow(popper)) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element, strategy) {\n var rect = getBoundingClientRect(element, false, strategy === 'fixed');\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent, strategy) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary, strategy) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport isLayoutViewport from \"./isLayoutViewport.js\";\nexport default function getViewportRect(element, strategy) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n var layoutViewport = isLayoutViewport();\n\n if (layoutViewport || !layoutViewport && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$strategy = _options.strategy,\n strategy = _options$strategy === void 0 ? state.strategy : _options$strategy,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","/**!\n* tippy.js v6.3.7\n* (c) 2017-2021 atomiks\n* MIT License\n*/\nimport { createPopper, applyStyles } from '@popperjs/core';\n\nvar ROUND_ARROW = '';\nvar BOX_CLASS = \"tippy-box\";\nvar CONTENT_CLASS = \"tippy-content\";\nvar BACKDROP_CLASS = \"tippy-backdrop\";\nvar ARROW_CLASS = \"tippy-arrow\";\nvar SVG_ARROW_CLASS = \"tippy-svg-arrow\";\nvar TOUCH_OPTIONS = {\n passive: true,\n capture: true\n};\nvar TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {\n return document.body;\n};\n\nfunction hasOwnProperty(obj, key) {\n return {}.hasOwnProperty.call(obj, key);\n}\nfunction getValueAtIndexOrReturn(value, index, defaultValue) {\n if (Array.isArray(value)) {\n var v = value[index];\n return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;\n }\n\n return value;\n}\nfunction isType(value, type) {\n var str = {}.toString.call(value);\n return str.indexOf('[object') === 0 && str.indexOf(type + \"]\") > -1;\n}\nfunction invokeWithArgsOrReturn(value, args) {\n return typeof value === 'function' ? value.apply(void 0, args) : value;\n}\nfunction debounce(fn, ms) {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n\n var timeout;\n return function (arg) {\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n fn(arg);\n }, ms);\n };\n}\nfunction removeProperties(obj, keys) {\n var clone = Object.assign({}, obj);\n keys.forEach(function (key) {\n delete clone[key];\n });\n return clone;\n}\nfunction splitBySpaces(value) {\n return value.split(/\\s+/).filter(Boolean);\n}\nfunction normalizeToArray(value) {\n return [].concat(value);\n}\nfunction pushIfUnique(arr, value) {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n }\n}\nfunction unique(arr) {\n return arr.filter(function (item, index) {\n return arr.indexOf(item) === index;\n });\n}\nfunction getBasePlacement(placement) {\n return placement.split('-')[0];\n}\nfunction arrayFrom(value) {\n return [].slice.call(value);\n}\nfunction removeUndefinedProps(obj) {\n return Object.keys(obj).reduce(function (acc, key) {\n if (obj[key] !== undefined) {\n acc[key] = obj[key];\n }\n\n return acc;\n }, {});\n}\n\nfunction div() {\n return document.createElement('div');\n}\nfunction isElement(value) {\n return ['Element', 'Fragment'].some(function (type) {\n return isType(value, type);\n });\n}\nfunction isNodeList(value) {\n return isType(value, 'NodeList');\n}\nfunction isMouseEvent(value) {\n return isType(value, 'MouseEvent');\n}\nfunction isReferenceElement(value) {\n return !!(value && value._tippy && value._tippy.reference === value);\n}\nfunction getArrayOfElements(value) {\n if (isElement(value)) {\n return [value];\n }\n\n if (isNodeList(value)) {\n return arrayFrom(value);\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n return arrayFrom(document.querySelectorAll(value));\n}\nfunction setTransitionDuration(els, value) {\n els.forEach(function (el) {\n if (el) {\n el.style.transitionDuration = value + \"ms\";\n }\n });\n}\nfunction setVisibilityState(els, state) {\n els.forEach(function (el) {\n if (el) {\n el.setAttribute('data-state', state);\n }\n });\n}\nfunction getOwnerDocument(elementOrElements) {\n var _element$ownerDocumen;\n\n var _normalizeToArray = normalizeToArray(elementOrElements),\n element = _normalizeToArray[0]; // Elements created via a